Return-Path: tawileh@usc.edu Delivery-Date: Thu Apr 22 20:10:55 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3N3AtqB006778 for ; Thu, 22 Apr 2004 20:10:55 -0700 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id UAA16228 for ; Thu, 22 Apr 2004 20:11:03 -0700 (PDT) Received: from smtp.vzavenue.net(66.171.59.140) by mcphilmy.usc.edu via csmap id ef3a5cfa_94d3_11d8_8a7f_0002b3c81b7b_21385; Thu, 22 Apr 2004 20:11:38 -0700 (PDT) Received: from usc.edu (69.85.171.66.subscriber.vzavenue.net [66.171.85.69]) by smtp.vzavenue.net (MOS 3.4.3-CR) with ESMTP id AMV54359; Thu, 22 Apr 2004 23:07:16 -0400 (EDT) Message-ID: <40888864.2000708@usc.edu> Date: Thu, 22 Apr 2004 20:07:16 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: regarding -reset option References: <6aa45cd01718.40881291@usc.edu> In-Reply-To: <6aa45cd01718.40881291@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > Hey nadim > > I was trying unlink() to delete the files when -reset is specified.. but this command will have to be called on all the files and this is not the best way to do it. > > Another option can be popen(" rm *.* "); > but i tried running this on command line... it prompts user for input... > Can u tell me what;s the efficient way to do this...bcz i need to delete the mini file system ( including files dircetory) .. > rm is aliased in all accounts to 'rm -i' which prompts the user for confirmation. if you want to use rm to delete your filesystem, you should do '/bin/rm -f *.*'. Be very careful what directory you do that in. You dont want to accidentally wipe out your source code. Return-Path: tawileh@usc.edu Delivery-Date: Thu Apr 22 18:16:32 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3N1GWqB004689 for ; Thu, 22 Apr 2004 18:16:32 -0700 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id SAA01339 for ; Thu, 22 Apr 2004 18:16:49 -0700 (PDT) Received: from smtp.vzavenue.net(66.171.59.140) by mcphilmy.usc.edu via csmap id fa16f652_94c3_11d8_92a7_0002b3c81b7b_27940; Thu, 22 Apr 2004 18:17:24 -0700 (PDT) Received: from usc.edu (69.85.171.66.subscriber.vzavenue.net [66.171.85.69]) by smtp.vzavenue.net (MOS 3.4.3-CR) with ESMTP id AMV45883; Thu, 22 Apr 2004 21:13:00 -0400 (EDT) Message-ID: <40886D9C.3040709@usc.edu> Date: Thu, 22 Apr 2004 18:13:00 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: regarding GET message References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > hi nadim... > > i am a bit confused with file-ids..? when exactly do i generate these fild ids?? > > at present i m generating them when i send a search response.... but i have a feeling that i m not doing the right thing.. > you should have a fileid for every file in your storage. this means that whenever you add a file into your filesystem, with store or get, you should generate a fileid associated with it. > so ....is it when i get a store message , if i decide to store this file, I have to generate a new file id for this file and store it somewhere (for future searches) ...... is this correct??? > > heres how i am generating the file ids. where fname is the string with complete path of the filename?? something like /home/scf-27/slalani/551/finalproject/2.meta > > GetUOID(node_inst_id, fname, buf, sizeof(buf)); > > is it right or can i do better?? > fileid can be any random 20 byte value. you dont need to have the path to the filename, but it's not wrong the way it is. > > and i have to assume that before every GET message.. user must do a search request?? am i correct?? right > > i had not implemented the -reset option i part I ? do i need to implement it for part II??? you should at least do the part of it which is related to this submission (to delete all files in the filesystem) Return-Path: tawileh@usc.edu Delivery-Date: Thu Apr 22 13:23:10 2004 Received: from postal.usc.edu (postal.usc.edu [128.125.253.6]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3MKNAqB031798 for ; Thu, 22 Apr 2004 13:23:10 -0700 Received: from usc.edu (roguex.usc.edu [128.125.163.26]) by postal.usc.edu (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTPS id <0HWL00EGD9Z37900@postal.usc.edu> for cs551@merlot.usc.edu; Thu, 22 Apr 2004 13:23:28 -0700 (PDT) Date: Thu, 22 Apr 2004 13:22:44 -0700 From: nadim tawileh Subject: Re: Why my program run okay in forground while segmentation fault in backgournd? In-reply-to: <444b40d5b0e.4087ba76@usc.edu> To: cs551@merlot.usc.edu Message-id: <40882994.3070203@usc.edu> Organization: USC MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en References: <444b40d5b0e.4087ba76@usc.edu> User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) > Dear Nadim > > Why my program run okay in forground while segmentation fault in backgournd? > _____________________________________________________ > bash-2.05b$ sv_node start.ini < null & > [1] 15712 > bash-2.05b$ > [1]+ Segmentation Fault sv_node start.ini bash-2.05b$ > _____________________________________________________ > > Thanks > > is it the background thing or the fact that you are feeding a null into the program? try "sv_node start.ini < null" to find out. If it crashes, look into the functions in your user interface that get the input from the user. make sure you take appropriate measures if the user inputs blanks or null or EOF...etc Return-Path: tawileh@usc.edu Delivery-Date: Thu Apr 22 11:37:31 2004 Received: from postal.usc.edu (postal.usc.edu [128.125.253.6]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3MIbVqB029857 for ; Thu, 22 Apr 2004 11:37:31 -0700 Received: from usc.edu (roguex.usc.edu [128.125.163.26]) by postal.usc.edu (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTPS id <0HWL0070A530QZ00@postal.usc.edu> for cs551@merlot.usc.edu; Thu, 22 Apr 2004 11:37:48 -0700 (PDT) Date: Thu, 22 Apr 2004 11:37:04 -0700 From: nadim tawileh Subject: Re: Regenerate Index In-reply-to: <20040422111256.GA27512@divinity.we1.client2.attbi.com> To: cs551@merlot.usc.edu Message-id: <408810D0.3070104@usc.edu> Organization: USC MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en References: <20040422111256.GA27512@divinity.we1.client2.attbi.com> User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) > Hi Nadim, > > I was wondering if we regenerate index files from the metadata if no > index files have been found when the node starts up. This is when the > index files are deleted. This is a design decision, because if there are > no index files and there are some files in the files/ directoy, the node > will think that there are no files and will start storing files numbered > 1,2,3.. which might over-write existing files in the files/ directory. > like you said, this is a design decision. nothing is required by the spec when it comes to that. > However, this can occur only if the indexes have been deleted > purposefully. Will this be graded? I'm asking this because this > situation is rare since when we pass "-reset" to the command argument, > we delete all files - indexes and the actual files. > the grader will not delete things manually and mess around with your filesystem. Return-Path: tawileh@usc.edu Delivery-Date: Wed Apr 21 22:10:09 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3M5A9qB013523 for ; Wed, 21 Apr 2004 22:10:09 -0700 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id WAA21049 for ; Wed, 21 Apr 2004 22:10:25 -0700 (PDT) Received: from smtp.vzavenue.net(66.171.59.140) by mcphilmy.usc.edu via csmap id 6ed4fa1a_941b_11d8_8613_0002b3c81b7b_18403; Wed, 21 Apr 2004 22:10:55 -0700 (PDT) Received: from usc.edu (69.85.171.66.subscriber.vzavenue.net [66.171.85.69]) by smtp.vzavenue.net (MOS 3.4.3-CR) with ESMTP id AMS21024; Thu, 22 Apr 2004 01:06:38 -0400 (EDT) Message-ID: <408752DD.9060200@usc.edu> Date: Wed, 21 Apr 2004 22:06:37 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: Copying into a string References: <200404220316.UAA11929@usc.edu> In-Reply-To: <200404220316.UAA11929@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > Hi, I'm having a problem. On my search response message, I've found that > the root of my problems is that the message buffer is not being copied into, > even though gdb shows that the positions that should be filled are. Here is > what I'm doing. > > char *msgbuf = new char[1024]; > strncpy(msgbuf, rcv_msg_UOID, 20); > ptr=20; > This is the only string that gets copied in correctly. After the following > loop, msgbuf still says the only thing in the buf is rcv_msg_UOID. > > For loop to go through all matching filenames in BST { > Calucate nextlength, put in htons format > memcpy(&msgbuf[ptr], &nextlength, 4); > ptr+=4; > strncpy(&msgbuf[ptr], fileUoidIdx[(*iter)].filename, ...) > ... > Fill in rest of buffer > } > > If I print out an individual spot while filling in the loop, say > Print msgbuf[65] it shows the correct value as if it has been filled > properly. However, if I just do a print msgbuf all that shows up is the > UOID. Also, in the middle of filling in the rest of the buffer, I did a > strlen(msgbuf) and it was only 20, meaning that the other values actually > hadn't been filled in. Yet right after that command I checked a value of > msgbuf via print in gdb and it acted like it was filled in. How can this > happen? What might be causing it? > > your msgbuf is not a character string. you cannot use string functions like strlen on it. strlen will stop on the first occurance of a null character or 0x00. if printing specific chars like msgbuf[65] displays correct values, then your buffer is being filled out correctly. Return-Path: tawileh@usc.edu Delivery-Date: Wed Apr 21 10:15:07 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3LHF7qB028994 for ; Wed, 21 Apr 2004 10:15:07 -0700 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id KAA12276 for ; Wed, 21 Apr 2004 10:15:22 -0700 (PDT) Received: from smtp.vzavenue.net(66.171.59.140) by mcphilmy.usc.edu via csmap id 8929d930_93b7_11d8_98ef_0002b3c81b7b_25846; Wed, 21 Apr 2004 10:15:49 -0700 (PDT) Received: from usc.edu (69.85.171.66.subscriber.vzavenue.net [66.171.85.69]) by smtp.vzavenue.net (MOS 3.4.3-CR) with ESMTP id AMQ04587; Wed, 21 Apr 2004 13:11:32 -0400 (EDT) Message-ID: <4086AB44.6080406@usc.edu> Date: Wed, 21 Apr 2004 10:11:32 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: keywords match References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > so if i give the keywords as "rock jazz" would it be a match with a file with keywords "rock pop" ? > No. I'm copying this from the project spec commandline section: To search for a file with keywords key1, key2, *and* key3, the user should enter: search keywords="key1 key2 key3" Return-Path: tawileh@usc.edu Delivery-Date: Tue Apr 20 11:37:59 2004 Received: from postal.usc.edu (postal.usc.edu [128.125.253.6]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3KIbxqB003804 for ; Tue, 20 Apr 2004 11:37:59 -0700 Received: from usc.edu (localhost.usc.edu [127.0.0.1]) by postal.usc.edu (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0HWH004QJFRNS300@postal.usc.edu> for cs551@merlot.usc.edu; Tue, 20 Apr 2004 11:38:11 -0700 (PDT) Received: from [128.125.3.83] by postal.usc.edu (mshttpd); Tue, 20 Apr 2004 11:38:11 -0700 Date: Tue, 20 Apr 2004 11:38:11 -0700 From: nadim tawileh Subject: Re: multiple search To: cs551@merlot.usc.edu Message-id: MIME-version: 1.0 X-Mailer: Sun ONE Messenger Express 6.0 HotFix 1.01 (built Mar 15 2004) Content-type: text/plain; charset=us-ascii Content-language: en Content-transfer-encoding: 7BIT Content-disposition: inline X-Accept-Language: en Priority: normal > hi nadim, > > if a node issues a search, and displays all the responses. then some time > later, issues another search. now the node operator types get 5....(lets > say there were atleast 5 search results in both cases). then which 5 would > be considered? the latest? > Yes. Return-Path: tawileh@usc.edu Delivery-Date: Mon Apr 19 20:34:01 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3K3Y1qB019520 for ; Mon, 19 Apr 2004 20:34:01 -0700 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id UAA14076 for ; Mon, 19 Apr 2004 20:34:12 -0700 (PDT) Received: from smtp.vzavenue.net(66.171.59.140) by mcphilmy.usc.edu via csmap id a2c58d4a_927b_11d8_9e0b_0002b3c81b7b_23741; Mon, 19 Apr 2004 20:34:31 -0700 (PDT) Received: from usc.edu (69.85.171.66.subscriber.vzavenue.net [66.171.85.69]) by smtp.vzavenue.net (MOS 3.4.3-CR) with ESMTP id AMG52961; Mon, 19 Apr 2004 23:30:24 -0400 (EDT) Message-ID: <40849950.2040706@usc.edu> Date: Mon, 19 Apr 2004 20:30:24 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: regarding cache files and permanent files in get/store message References: <20e3f53a6aa1.408429d9@usc.edu> In-Reply-To: <20e3f53a6aa1.408429d9@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > ok.. i got that.. > > but i am not having any separate directories for perm and cache storage.. keeping the same.. can i just make changes to storage memories.. and keep the files as it is..!! and if the requested file is not in cache then i get the file from another node and just keep the file in perm .. > > or should i make different directories for cache and perm...?? ( i dont think this is mentioned in the spec ) and change the total available memory for cache and perm.. storage..!! > you should *not* do seperate directories for cache and perm. you should read the message i sent you before again. same filesystem for both. in the index structure, you should have a bit or flag for each file to mark it as cached or not. > by the way.. a question regarding fileid.. i m using the pathname(this will be unique) of the file to generate it on a node.. is that correct?? coz everytime if i have to generate fileid for that particular file stored at that particular location .. it will be the same.. or should i just pass the filename?? > fileid is a 20 byte randomly generated number. do not use the path of the file as fileid. Return-Path: tawileh@usc.edu Delivery-Date: Mon Apr 19 18:01:36 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3K11aqB016666 for ; Mon, 19 Apr 2004 18:01:36 -0700 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id SAA15370 for ; Mon, 19 Apr 2004 18:01:47 -0700 (PDT) Received: from smtp.vzavenue.net(66.171.59.140) by mcphilmy.usc.edu via csmap id 57be0134_9266_11d8_9a20_0002b3c81b7b_21701; Mon, 19 Apr 2004 18:02:06 -0700 (PDT) Received: from usc.edu (69.85.171.66.subscriber.vzavenue.net [66.171.85.69]) by smtp.vzavenue.net (MOS 3.4.3-CR) with ESMTP id AMG42585; Mon, 19 Apr 2004 21:00:29 -0400 (EDT) Message-ID: <4084762A.3020009@usc.edu> Date: Mon, 19 Apr 2004 18:00:26 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: regarding cache files and permanent files in get/store message References: <933f216a2f65.40840e2b@usc.edu> In-Reply-To: <933f216a2f65.40840e2b@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > hey nadim.. > > how do i differentiate between cached files and permanent files...?? > > like suppose during a store transaction i already have a file with the name blondie.mp3.. and now my node issues a get on that.. by i already have that in my cache storage.. so what do i do then?? > move it to perm storage. (if you have enough space of course) > do i have to give some different kind of names to the cached files and different names to permanent files?? how can i say that a file is cached or in permanent storage..?? > > i think Prof. Cheng mentioned that somewhere. You only need to keep a bit or flag or something in your file information structures to tag a file as cached or perm. Other than that, cached and perm files look the same in your filesystem. Return-Path: tawileh@usc.edu Delivery-Date: Mon Apr 19 17:58:38 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3K0wcqB016608 for ; Mon, 19 Apr 2004 17:58:38 -0700 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id RAA10005 for ; Mon, 19 Apr 2004 17:58:49 -0700 (PDT) Received: from smtp.vzavenue.net(66.171.59.140) by mcphilmy.usc.edu via csmap id ed8dc3bc_9265_11d8_9dfc_0002b3c81b7b_20854; Mon, 19 Apr 2004 17:59:08 -0700 (PDT) Received: from usc.edu (69.85.171.66.subscriber.vzavenue.net [66.171.85.69]) by smtp.vzavenue.net (MOS 3.4.3-CR) with ESMTP id AMG41400; Mon, 19 Apr 2004 20:54:13 -0400 (EDT) Message-ID: <408474B6.4080508@usc.edu> Date: Mon, 19 Apr 2004 17:54:14 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: A normal node References: <20040420002243.GA26865@divinity.we1.client2.attbi.com> In-Reply-To: <20040420002243.GA26865@divinity.we1.client2.attbi.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > Hi Nadim, > > We have the "Retry" key under the "beacons" section to see how long to > wait before trying to reconnect to a beacon again for a beacon node. > What happens in a non-beacon node, when we're making a new > init_neighbour_list, and it cannot connect to any beacon? Does the node > inform the user about this and die, or does it use the "Retry" key and > wait and retry? > If a join procedure fails with all beacons, inform the user and die. Note that this is not related to this submission and will probably not be graded. Return-Path: tawileh@usc.edu Delivery-Date: Mon Apr 19 01:27:50 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3J8RoqB030176 for ; Mon, 19 Apr 2004 01:27:50 -0700 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id BAA02109 for ; Mon, 19 Apr 2004 01:27:41 -0700 (PDT) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id 7bc7c096_91db_11d8_9fad_0002b3c946b2_16571; Mon, 19 Apr 2004 01:28:07 -0700 (PDT) Received: from usc.edu (69.85.171.66.subscriber.vzavenue.net [66.171.85.69]) by smtp.vzavenue.net (MOS 3.4.3-CR) with ESMTP id AME33673; Mon, 19 Apr 2004 04:23:49 -0400 (EDT) Message-ID: <40838C93.40007@usc.edu> Date: Mon, 19 Apr 2004 01:23:47 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: Node Getting same file again References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > ok...sounds good. now what about the store probabilities? > i'm flipping the coin by calling > double my_store_prob = (double)drand48() > > now i have to store the file if my_store_prob is lesser than the value read from the file or greater? i'm currently storing the file when the my_store_prob is greater... > for success (or to store), my_store_prob has to be less than or equal to the config file parameter. think of the case when the conf file param is 1 (always store) and 0 (never store). Return-Path: tawileh@usc.edu Delivery-Date: Sun Apr 18 22:37:16 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3J5bGqB027084 for ; Sun, 18 Apr 2004 22:37:16 -0700 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id WAA17577 for ; Sun, 18 Apr 2004 22:37:26 -0700 (PDT) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id b28538d8_91c3_11d8_9b5a_0002b3c946b2_12518; Sun, 18 Apr 2004 22:37:50 -0700 (PDT) Received: from usc.edu (69.85.171.66.subscriber.vzavenue.net [66.171.85.69]) by smtp.vzavenue.net (MOS 3.4.3-CR) with ESMTP id AME04258; Mon, 19 Apr 2004 01:33:38 -0400 (EDT) Message-ID: <408364B1.7080307@usc.edu> Date: Sun, 18 Apr 2004 22:33:37 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: Node Getting same file again References: <1b32b3ec441f.4082fcbd@usc.edu> In-Reply-To: <1b32b3ec441f.4082fcbd@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > What happens if a node gets the same file in a new store message? > you dont store it again. by same file, we are talking about matching SHA1's and Nonce's (and filenames). If it is the same file (filename+sha1) but different Nonce, it is considered a different file. Return-Path: tawileh@usc.edu Delivery-Date: Thu Apr 15 17:13:41 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3G0DfqB027837 for ; Thu, 15 Apr 2004 17:13:41 -0700 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id RAA23924 for ; Thu, 15 Apr 2004 17:17:28 -0700 (PDT) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id 7954f6dc_8f3b_11d8_89ab_0002b3c946b2_4580; Thu, 15 Apr 2004 17:17:41 -0700 (PDT) Received: from usc.edu (44.84.171.66.subscriber.vzavenue.net [66.171.84.44]) by smtp.vzavenue.net (MOS 3.4.3-CR) with ESMTP id AMA27877; Thu, 15 Apr 2004 20:13:39 -0400 (EDT) Message-ID: <407F2534.7040700@usc.edu> Date: Thu, 15 Apr 2004 17:13:40 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: more questions on store request.. References: <6691598766c5.407eafaa@usc.edu> In-Reply-To: <6691598766c5.407eafaa@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > hi nadim.. > > u said that.." store is like copying a file into your kazaa shared folder" > > so what do u mean.. but then what is the point in forwarding the store > message to the entire network??? and that too.. we are sending the actual file > contents..through out the network..? why is htat? > the point of forwarding is to have cached copies of the file in the network. > one more thing .. i am having some trouble writing the hex form of SHA1..? can > u tell me how can i copy SHA1 into hex form into another string..!!can u give > me some hints..?? > how did you print the MD5 sum in warmup1? Use the same thing. Remember that everything you can output using printf(), you can print to a string using sprintf(). You could also have a function which takes the SHA1, and for every byte prints the corrsponding hex chars in ascii into a string. Return-Path: tawileh@usc.edu Delivery-Date: Thu Apr 15 17:02:49 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3G02nqB027630 for ; Thu, 15 Apr 2004 17:02:49 -0700 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id RAA28578 for ; Thu, 15 Apr 2004 17:06:38 -0700 (PDT) Received: from smtp.vzavenue.net(66.171.59.140) by mcphilmy.usc.edu via csmap id ecd12308_8f39_11d8_9aca_0002b3c81b7b_24872; Thu, 15 Apr 2004 17:06:35 -0700 (PDT) Received: from usc.edu (44.84.171.66.subscriber.vzavenue.net [66.171.84.44]) by smtp.vzavenue.net (MOS 3.4.3-CR) with ESMTP id AMA26835; Thu, 15 Apr 2004 20:02:47 -0400 (EDT) Message-ID: <407F22A8.9050302@usc.edu> Date: Thu, 15 Apr 2004 17:02:48 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: questions on store message.. References: <5f3945cc35ba.407eae8e@usc.edu> In-Reply-To: <5f3945cc35ba.407eae8e@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > hi nadim.. > > to send the SHA1 and NONCE values in the store message.. i m using the > following commands.. am i correct? > GetUOID(node_inst_id, "file", buf, sizeof(buf)); > GetUOID(node_inst_id, "Nonce", buf, sizeof(buf)); > SHA1 is not some random number like Nonce or message UOID. SHA1 is the sha1 hash of the file. You have to compute it, like you computed the MD5 checksum for files in warmup 1. > > also.. what if i issue a store message with the same file ..then what should i > do..? i mean.. what should the other nodes do?? > the file will have the same filename, same sha1 but different nonce. as far as the servant network is concerned, it is a different file and treated accordingly. Return-Path: tawileh@usc.edu Delivery-Date: Thu Apr 15 00:48:58 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3F7mwqB009178 for ; Thu, 15 Apr 2004 00:48:58 -0700 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id AAA00525 for ; Thu, 15 Apr 2004 00:52:45 -0700 (PDT) Received: from h000.c000.snv.cp.net(209.228.32.64) by mcphail.usc.edu via csmap id e7a96fe4_8eb1_11d8_8b68_0002b3c946b2_25059; Thu, 15 Apr 2004 00:52:55 -0700 (PDT) Received: (cpmta 717 invoked from network); 15 Apr 2004 00:49:45 -0700 Received: from 66.171.84.44 (HELO usc.edu) by smtp.tawileh.com (209.228.32.64) with SMTP; 15 Apr 2004 00:49:45 -0700 X-Sent: 15 Apr 2004 07:49:45 GMT Message-ID: <407E3E98.6050107@usc.edu> Date: Thu, 15 Apr 2004 00:49:44 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: regarding store command.. References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > hi nadim.. > > i m confused but why do have two different commands like store and get?? > whats teh difference between them?? > get is used by a node to obtain a file from another servant node. store is used by a node to add a file from its local disk onto its servant storage. in short, store is like copying a file into your kazaa shared folder. get is the way you download files from kazaa (which are in other ppl's shared folders) there are issues and details like caching for each of these messages. make sure you read the spec carefully. > can u explain it to me briefly..?? > > and the node that has issued a store command on a particular file.. can only > delete that file??? > yes > > one more thing.. how do i identify the files for delete command.? is it thru > SHA1??? once i receive a file.. should i calculate SHA1 for that file.. right?? > for delete, you identify the file using sha1, nonce and filename. refer to the delete msg format. when you receive a file, you will also receive its sha1 in the file metadata and you should also calculate the sha1 and verify that they are the same. note that you do not need to have a file in storage to be able to delete it. if you know the sha1, filename and nonce, you can flood a delete cmd to the network. > once more clarification once a node issues a delete command.. naturally i > will flood the delete command.. compare the SHA1 for files.. and cerfitificate > of the file.. and delete the file if the SHA1 and the certificate matches..?? > > am i correct ??? > see what i wrote above. you're not only comparing sha1's. also, you are not 'matching' certificates. you are using the stored certificate to verify a signed message. Return-Path: tawileh@usc.edu Delivery-Date: Tue Apr 13 15:37:41 2004 Received: from postal.usc.edu (postal.usc.edu [128.125.253.6]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3DMbfqB004251 for ; Tue, 13 Apr 2004 15:37:41 -0700 Received: from usc.edu (roguex.usc.edu [128.125.163.26]) by postal.usc.edu (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTPS id <0HW4004Q9SD12D00@postal.usc.edu> for cs551@merlot.usc.edu; Tue, 13 Apr 2004 15:41:25 -0700 (PDT) Date: Tue, 13 Apr 2004 15:40:52 -0700 From: nadim tawileh Subject: Re: regarding certificates.. In-reply-to: To: cs551@merlot.usc.edu Message-id: <407C6C74.1060409@usc.edu> Organization: USC MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en References: User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) > hi nadim.. > > i am confused with what to send in the store message?? > > like suppose uer issues a "store blonide.mp3 ......" then.. in store > message. the length of certificate .. is the length of the file cert.pem > which is generated by this command > > /bin/echo \ > "US\nCA\nLA\nUSC\nServant-`date +%d%b%Y`-rootca \ > `hostname`\nYOURNAME@YOURDOMAIN\n\n\n" | \ > openssl req -new -nodes -newkey rsa:1024 -x509 \ > -keyout private.pem -out cert.pem > > yes > or is it.. that i sign this file with cert.pem and then send this file in teh > message.. > > openssl smime -sign -in foo -out bar \ > -nocerts -signer cert.pem -inkey private.pem > > and do i have send the entire certificate file??? and the original file also? > right?? > there is nothing to sign in the store message. signing/verifying is used for delete. you send the cert file and the original file. Return-Path: tawileh@usc.edu Delivery-Date: Tue Apr 13 11:41:27 2004 Received: from postal.usc.edu (postal.usc.edu [128.125.253.6]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3DIfRqB032408 for ; Tue, 13 Apr 2004 11:41:27 -0700 Received: from usc.edu (localhost.usc.edu [127.0.0.1]) by postal.usc.edu (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0HW400DC3HF8A910@postal.usc.edu> for cs551@merlot.usc.edu; Tue, 13 Apr 2004 11:45:08 -0700 (PDT) Received: from [128.125.3.83] by postal.usc.edu (mshttpd); Tue, 13 Apr 2004 11:45:08 -0700 Date: Tue, 13 Apr 2004 11:45:08 -0700 From: nadim tawileh Subject: Re: regarding bitvectors To: cs551@merlot.usc.edu Message-id: MIME-version: 1.0 X-Mailer: Sun ONE Messenger Express 6.0 HotFix 1.01 (built Mar 15 2004) Content-type: text/plain; charset=us-ascii Content-language: en Content-transfer-encoding: 7BIT Content-disposition: inline X-Accept-Language: en Priority: normal > Could we assume that the path /usr/usc/openssl/default/bin/ is set > in the testing environment? Thanks. > Yes. Return-Path: tawileh@usc.edu Delivery-Date: Mon Apr 12 23:09:01 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3D691qB018194 for ; Mon, 12 Apr 2004 23:09:01 -0700 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id XAA07681 for ; Mon, 12 Apr 2004 23:12:43 -0700 (PDT) Received: from h002.c000.snv.cp.net(209.228.32.66) by mcphail.usc.edu via csmap id 94329a12_8d11_11d8_99f4_0002b3c946b2_12066; Mon, 12 Apr 2004 23:12:44 -0700 (PDT) Received: (cpmta 11551 invoked from network); 12 Apr 2004 23:09:42 -0700 Received: from 66.171.84.44 (HELO usc.edu) by smtp.tawileh.com (209.228.32.66) with SMTP; 12 Apr 2004 23:09:42 -0700 X-Sent: 13 Apr 2004 06:09:42 GMT Message-ID: <407B8426.9010603@usc.edu> Date: Mon, 12 Apr 2004 23:09:42 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: regarding bitvectors References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > hey nadim.. > > hi .. i have some problems with turning on the correct bit. can you give me > some hints on how should i turn on the right bit..?? and i have declared > something like this for the bitvector : > > char bitvector[256]; > i hope that is ok? > this will give you a 2048 bit vector. char [128] will give you 1024 bit vector. you locate the byte in which you want to set the bit, then use a bitwise OR on the byte to set the right bit. for example, to set the least significant bit, you 'OR' the byte with '1'. to set the most significant bit, you 'OR' the byte with 2^7 or 128...etc > also when i try to use openssl in the certificates.. it says.. openssl > command not found?? > can you help me? > openssl is in /usr/usc/openssl/default/bin/. Either add that directory in your environment path or use /usr/usc/openssl/default/bin/openssl as the command. Return-Path: tawileh@usc.edu Delivery-Date: Mon Apr 12 17:58:27 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3D0wRqB011979 for ; Mon, 12 Apr 2004 17:58:27 -0700 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id SAA18113 for ; Mon, 12 Apr 2004 18:02:09 -0700 (PDT) Received: from h001.c000.snv.cp.net(209.228.32.65) by mcphilmy.usc.edu via csmap id 25b79644_8ce6_11d8_9cf3_0002b3c81b7b_4957; Mon, 12 Apr 2004 18:01:51 -0700 (PDT) Received: (cpmta 15270 invoked from network); 12 Apr 2004 17:59:08 -0700 Received: from 66.171.84.44 (HELO usc.edu) by smtp.tawileh.com (209.228.32.65) with SMTP; 12 Apr 2004 17:59:08 -0700 X-Sent: 13 Apr 2004 00:59:08 GMT Message-ID: <407B3B5C.7070506@usc.edu> Date: Mon, 12 Apr 2004 17:59:08 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: Question on get Response References: <407B33BC.1030201@usc.edu> In-Reply-To: <407B33BC.1030201@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > Hi, > > Suppose I've 3 node > > A - B - C > > connect as above. > > There is store file bar on Node A and it propagate to Node B and C and > cache there. > > Now if there is a search request from A for bar, it will get > > [1] bar <= from A > .. > [2] bar <= from B > .. > [3] bar <= from C > > If the user then type > > get 3 > > bar will travel to B and then to A. > If B decide to cache whenever it pass B using cacheProb. B will have 2 > bar file of same > nonce but different FileID. > > Similar A will have 2 bar file with same nonce but different FileID. > > Is that what you expect for Node B and A result ? > This creates unnecessary duplicates of the same file. If the file is the same, you don't need to store it more than once. If two files have the same SHA1's, then their contents are identical. If they also have the same Nonce, then they are copies of the same instance of that file. If two files have those two fields identical, it's safe to say that they are the same and therefore only one of them needs to be in storage. Return-Path: tawileh@usc.edu Delivery-Date: Sun Apr 11 21:13:50 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3C4DoqB020803 for ; Sun, 11 Apr 2004 21:13:50 -0700 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id VAA10695 for ; Sun, 11 Apr 2004 21:17:31 -0700 (PDT) Received: from h002.c000.snv.cp.net(209.228.32.66) by mcphail.usc.edu via csmap id 4f16543e_8c38_11d8_8728_0002b3c946b2_22000; Sun, 11 Apr 2004 21:17:28 -0700 (PDT) Received: (cpmta 26768 invoked from network); 11 Apr 2004 21:14:29 -0700 Received: from 66.171.84.44 (HELO usc.edu) by smtp.tawileh.com (209.228.32.66) with SMTP; 11 Apr 2004 21:14:29 -0700 X-Sent: 12 Apr 2004 04:14:29 GMT Message-ID: <407A17A3.2090304@usc.edu> Date: Sun, 11 Apr 2004 21:14:27 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: Check Response References: <59f2c359f262.59f26259f2c3@usc.edu> In-Reply-To: <59f2c359f262.59f26259f2c3@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > Hey Nadim, > > How long does a node wait for a check response? > something a little higher than msglifetime is a good choice. like 1.1xmsglifetime. for your tests, use a short timeout value so you dont have to wait a lot of time and since everything is happening on nunki, messages should go around pretty fast. when you submit however, use a reasonable value like the one i gave above. Return-Path: tawileh@usc.edu Delivery-Date: Sun Apr 11 20:19:57 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3C3JvqB019773 for ; Sun, 11 Apr 2004 20:19:57 -0700 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id UAA20964 for ; Sun, 11 Apr 2004 20:23:37 -0700 (PDT) Received: from h000.c000.snv.cp.net(209.228.32.64) by mcphail.usc.edu via csmap id c7b51bf8_8c30_11d8_89c3_0002b3c946b2_10291; Sun, 11 Apr 2004 20:23:34 -0700 (PDT) Received: (cpmta 26881 invoked from network); 11 Apr 2004 20:20:36 -0700 Received: from 66.171.84.44 (HELO usc.edu) by smtp.tawileh.com (209.228.32.64) with SMTP; 11 Apr 2004 20:20:36 -0700 X-Sent: 12 Apr 2004 03:20:36 GMT Message-ID: <407A0B03.30609@usc.edu> Date: Sun, 11 Apr 2004 20:20:35 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: reuse socket References: <200404120303.UAA22165@usc.edu> In-Reply-To: <200404120303.UAA22165@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > What was the name of that command you were talking about that lets you reuse > a socket before the time out expires? I'm getting really sick of having to > wait a couple minutes. > setsockopt. The syntax is something like: setsockopt(yourMasterSocket, SOL_SOCKET, SO_REUSEADDR, (char*) &yes, sizeof(yes)) yes should contain anything greater than 0 (or true). You should verify the syntax in the man page. Return-Path: tawileh@usc.edu Delivery-Date: Sun Apr 11 20:16:41 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i3C3GfqB019726 for ; Sun, 11 Apr 2004 20:16:41 -0700 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id UAA16348 for ; Sun, 11 Apr 2004 20:20:22 -0700 (PDT) Received: from h000.c000.snv.cp.net(209.228.32.64) by mcphilmy.usc.edu via csmap id 47260182_8c30_11d8_8fe5_0002b3c81b7b_10632; Sun, 11 Apr 2004 20:19:58 -0700 (PDT) Received: (cpmta 24952 invoked from network); 11 Apr 2004 20:17:20 -0700 Received: from 66.171.84.44 (HELO usc.edu) by smtp.tawileh.com (209.228.32.64) with SMTP; 11 Apr 2004 20:17:20 -0700 X-Sent: 12 Apr 2004 03:17:20 GMT Message-ID: <407A0A3D.5000801@usc.edu> Date: Sun, 11 Apr 2004 20:17:17 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: Question on LRU cache References: <4079BBD6.4040406@usc.edu> In-Reply-To: <4079BBD6.4040406@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > Hi, > > Suppose I've 3 file in cache in order of age > > A (100) > B (50) > C (40) > > The max. cache size is 200. > > If I got a file D of size 110 need to cache, I'll search for the oldest > C first, > remove it, and then B, remove it (still not enough space), then A and > remove it after that I got only file D in cache. > > Do we need to be 'smart' that only file A is remove but not B and C ? So > it end up B, C, D in cache that can fit the max. cache size. > Both methods are variations of LRU replacement method. Since the spec only requires you to do LRU and doesn't give further details, you can do whichever one you want. Return-Path: tawileh@usc.edu Delivery-Date: Fri Apr 9 16:16:54 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i39NGsqB016720 for ; Fri, 9 Apr 2004 16:16:54 -0700 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id QAA14255 for ; Fri, 9 Apr 2004 16:20:29 -0700 (PDT) Received: from h002.c000.snv.cp.net(209.228.32.66) by mcphilmy.usc.edu via csmap id 68fa7316_8a7c_11d8_8567_0002b3c81b7b_30849; Fri, 09 Apr 2004 16:19:54 -0700 (PDT) Received: (cpmta 2371 invoked from network); 9 Apr 2004 16:17:28 -0700 Received: from 66.171.89.34 (HELO usc.edu) by smtp.tawileh.com (209.228.32.66) with SMTP; 9 Apr 2004 16:17:28 -0700 X-Sent: 9 Apr 2004 23:17:28 GMT Message-ID: <40772F08.6030304@usc.edu> Date: Fri, 09 Apr 2004 16:17:28 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: Store cmd / StoreProb References: <21fdb8225a5d.225a5d21fdb8@usc.edu> In-Reply-To: <21fdb8225a5d.225a5d21fdb8@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > hey nadim.. one quick question.. > > in store command.. suppose the user gives in store blondie.mp3 on a > particular node.. then should i forward this file to all the open socket > descriptors taht i am connected to ...alongwith the keywords? > > and what is the meaning of "probabilistically flooded" in the spec? is that > i should not forward the file to all the nodes.??? i cannot understand the > exact meaning of "StoreProb -" in the ini file. > For every interface you are connected to, you flip a coin with a probability of success being NeighborStoreProb. On success, you send the store msg to that neighbor. When the neighbor gets that msg, it flips a coin again with the probability of success being StoreProb. On success, it caches the file being sent in the msg. The section 'Servant Node Startup' has details on each config parameter. I changed the Subject of this email, but in the future, pls try to use a meaningful subject rather than just replying to my last email. It makes it easier for everyone to later find a msg in the web archive and even in their own mailboxes. Thanks Return-Path: tawileh@usc.edu Delivery-Date: Fri Apr 9 11:34:12 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i39IYCqB011620 for ; Fri, 9 Apr 2004 11:34:12 -0700 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id LAA22382 for ; Fri, 9 Apr 2004 11:05:26 -0700 (PDT) Received: from h031.c000.snv.cp.net(209.228.34.189) by mcphilmy.usc.edu via csmap id be993b58_8a50_11d8_8c1c_0002b3c81b7b_17255; Fri, 09 Apr 2004 11:07:20 -0700 (PDT) Received: (cpmta 20969 invoked from network); 9 Apr 2004 11:02:23 -0700 Received: from 66.171.89.34 (HELO usc.edu) by smtp.tawileh.com (209.228.34.189) with SMTP; 9 Apr 2004 11:02:23 -0700 X-Sent: 9 Apr 2004 18:02:23 GMT Message-ID: <4076E52D.7010801@usc.edu> Date: Fri, 09 Apr 2004 11:02:21 -0700 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: plz help me References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > how are u? i really need your help.. because i m still playing around with > the first part of my project only..! > > i am almost done with forwarding but its really weird that sometimes my code > forwards the packet well and sometimes it doesnt.. dont know whats wrong with > my code??? > > i really need ur help with simultaneous connections.. yes i am still having > problems with that. i m really confused in that.. consider this example.. > suppose A and B are both beacon nodes then i m able to close the socket from > one side only.. but 1 of the sockets stil remain open whcih causes some > problems with the forwarding and might cause some problems in future with the > program also.. can u give me a better solution.. because i m able to close the > connected fd but how can i close the socket fd that initiated connection?? > in both nodes you should have a list of neighbors where you keep track of open connections: node id's, socket descriptors and any other relevant data. i'm not sure exactly where your problem is but this should be very straightforward. you should be able to close a connection to any node at any time. > another thing is how can I bring that prompt because i m printing messages on > the screen..so how can i issue commands simultaneously.. yaa i know this was > first part but i m still working on it.. > the prompt is still there waiting for your input even if you print messages. it just wont look nice. say you have: printf("servant> "); scanf or fgets or any command that waits for input on stdin then in another thread you do more printf's, the function waiting on input in the UI thread is still waiting on input. Ideally, when you finish your project, you should get rid of most of the messages you print to the console and use the log file. the output of your program will look a lot nicer. Return-Path: tawileh@usc.edu Delivery-Date: Thu Apr 8 11:33:07 2004 Received: from postal.usc.edu (postal.usc.edu [128.125.253.6]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i38IX7qB017157 for ; Thu, 8 Apr 2004 11:33:07 -0700 Received: from usc.edu (roguex.usc.edu [128.125.163.26]) by postal.usc.edu (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) with ESMTPS id <0HVV00BBG7P2YQ@postal.usc.edu> for cs551@merlot.usc.edu; Thu, 08 Apr 2004 11:36:38 -0700 (PDT) Date: Thu, 08 Apr 2004 11:36:11 -0700 From: nadim tawileh Subject: Re: socket problem In-reply-to: To: cs551@merlot.usc.edu Message-id: <40759B9B.4000603@usc.edu> Organization: USC MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) References: > hey nadim > > i have one questions to ask you.. > > sometimes when I close the socket, the corresponding socket on the other > side, goes into an infite loop continuously keeps on reading the same message > which was last written by the other socket.. do you have a clue why is it so? > and the main thing is that.. this happens..only sometimes in my program..so > I cant figure out a reason for that > > can you help me? > It cannot be reading the same message. It is probably reading nothing and the buffer in your program still contains the old message bytes. The same data will not be handed to you more than once by the tcp stack. If you do not close the socket when read() returns -1, subsequent calls to read on that same socket will always return 0, and you might end up with a loop. Actually, I shouldn't say 'always', but this problem does happen frequently. After every call to a network read(), you should check the return value and take action if that value is -1 and also if that value is 0. I would check if the read() in my loop returns 0 four or five consecutive times (using a blocking socket), assume something is wrong and close this connection. Return-Path: tawileh@usc.edu Delivery-Date: Fri Apr 2 04:06:47 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i32C6lqB000912 for ; Fri, 2 Apr 2004 04:06:47 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id EAA02682 for ; Fri, 2 Apr 2004 04:10:04 -0800 (PST) Received: from h000.c000.snv.cp.net(209.228.32.64) by mcphail.usc.edu via csmap id 892bc50e_8482_11d8_8659_0002b3c946b2_2015; Fri, 02 Apr 2004 00:48:38 -0800 (PST) Received: (cpmta 7378 invoked from network); 2 Apr 2004 00:40:52 -0800 Received: from 66.171.137.19 (HELO usc.edu) by smtp.tawileh.com (209.228.32.64) with SMTP; 2 Apr 2004 00:40:52 -0800 X-Sent: 2 Apr 2004 08:40:52 GMT Message-ID: <406D2714.70200@usc.edu> Date: Fri, 02 Apr 2004 00:40:52 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Final project part 2 notes Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Here's a couple of notes on the final project, based on some of the most common questions I got this week. Do not go out of your way to complete whatever you did not do for part 1. You will not be graded for the same thing twice. for example, if JOIN had some bugs when you submitted part 1, you will not be penalized again if it has the same bugs in part 2. Same thing applies for incomplete or even parts that are not implemented. That being said, focus on part 2 requirements for this submission. Obviously, there has to be a minimum of working part 1 for part 2 to work, but part 1 doesn't have to be perfect. To find file SHA1's you have to use the openssl C/C++ API functions (as in warmup1). However, to sign/verify (used in delete), you may call the openssl unix command from within your program using popen() or system() or any similar function. As far as file sharing is concerned, beacons function exactly like non-beacons. You can work on your project on any one of the Sun stations in the public ISD labs. it is a bit of a hassle to go through those ini files and change the hostnames, but if you're planning to sit down for 2 or 3 hours of work, it's nice to know that you're working on a system where the resources (cpu, memory, network ports...etc) are exclusively yours. --nt Return-Path: tawileh@usc.edu Delivery-Date: Fri Apr 2 02:45:59 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i32AjxqB031492 for ; Fri, 2 Apr 2004 02:45:59 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id CAA05461 for ; Fri, 2 Apr 2004 02:49:16 -0800 (PST) Received: from h000.c000.snv.cp.net(209.228.32.64) by mcphail.usc.edu via csmap id 6024b5f6_8493_11d8_8118_0002b3c946b2_17060; Fri, 02 Apr 2004 02:49:11 -0800 (PST) Received: (cpmta 7378 invoked from network); 2 Apr 2004 00:40:52 -0800 Received: from 66.171.137.19 (HELO usc.edu) by smtp.tawileh.com (209.228.32.64) with SMTP; 2 Apr 2004 00:40:52 -0800 X-Sent: 2 Apr 2004 08:40:52 GMT Message-ID: <406D2714.70200@usc.edu> Date: Fri, 02 Apr 2004 00:40:52 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Final project part 2 notes Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Here's a couple of notes on the final project, based on some of the most common questions I got this week. Do not go out of your way to complete whatever you did not do for part 1. You will not be graded for the same thing twice. for example, if JOIN had some bugs when you submitted part 1, you will not be penalized again if it has the same bugs in part 2. Same thing applies for incomplete or even parts that are not implemented. That being said, focus on part 2 requirements for this submission. Obviously, there has to be a minimum of working part 1 for part 2 to work, but part 1 doesn't have to be perfect. To find file SHA1's you have to use the openssl C/C++ API functions (as in warmup1). However, to sign/verify (used in delete), you may call the openssl unix command from within your program using popen() or system() or any similar function. As far as file sharing is concerned, beacons function exactly like non-beacons. You can work on your project on any one of the Sun stations in the public ISD labs. it is a bit of a hassle to go through those ini files and change the hostnames, but if you're planning to sit down for 2 or 3 hours of work, it's nice to know that you're working on a system where the resources (cpu, memory, network ports...etc) are exclusively yours. --nt Return-Path: tawileh@usc.edu Delivery-Date: Fri Apr 2 00:52:51 2004 Received: from scf-fs.usc.edu (scf-fs.usc.edu [128.125.7.183]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i328qpqB029441 for ; Fri, 2 Apr 2004 00:52:51 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by scf-fs.usc.edu (8.10.1/8.10.1/usc) with SMTP id i328mt826549 for ; Fri, 2 Apr 2004 00:49:38 -0800 (PST) Received: from h000.c000.snv.cp.net(209.228.32.64) by mcphail.usc.edu via csmap id 892bc50e_8482_11d8_8659_0002b3c946b2_2015; Fri, 02 Apr 2004 00:48:38 -0800 (PST) Received: (cpmta 7378 invoked from network); 2 Apr 2004 00:40:52 -0800 Received: from 66.171.137.19 (HELO usc.edu) by smtp.tawileh.com (209.228.32.64) with SMTP; 2 Apr 2004 00:40:52 -0800 X-Sent: 2 Apr 2004 08:40:52 GMT Message-ID: <406D2714.70200@usc.edu> Date: Fri, 02 Apr 2004 00:40:52 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Final project part 2 notes Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Here's a couple of notes on the final project, based on some of the most common questions I got this week. Do not go out of your way to complete whatever you did not do for part 1. You will not be graded for the same thing twice. for example, if JOIN had some bugs when you submitted part 1, you will not be penalized again if it has the same bugs in part 2. Same thing applies for incomplete or even parts that are not implemented. That being said, focus on part 2 requirements for this submission. Obviously, there has to be a minimum of working part 1 for part 2 to work, but part 1 doesn't have to be perfect. To find file SHA1's you have to use the openssl C/C++ API functions (as in warmup1). However, to sign/verify (used in delete), you may call the openssl unix command from within your program using popen() or system() or any similar function. As far as file sharing is concerned, beacons function exactly like non-beacons. You can work on your project on any one of the Sun stations in the public ISD labs. it is a bit of a hassle to go through those ini files and change the hostnames, but if you're planning to sit down for 2 or 3 hours of work, it's nice to know that you're working on a system where the resources (cpu, memory, network ports...etc) are exclusively yours. --nt Return-Path: tawileh@usc.edu Delivery-Date: Mon Mar 29 09:00:34 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i2TH0YqB019732 for ; Mon, 29 Mar 2004 09:00:34 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id JAA20287 for ; Mon, 29 Mar 2004 09:03:44 -0800 (PST) Received: from h008.c000.snv.cp.net(209.228.32.72) by mcphilmy.usc.edu via csmap id 2c0615a0_81a3_11d8_8474_0002b3c81b7b_538; Mon, 29 Mar 2004 09:04:42 -0800 (PST) Received: (cpmta 1470 invoked from network); 29 Mar 2004 09:00:43 -0800 Received: from 66.171.85.245 (HELO usc.edu) by smtp.tawileh.com (209.228.32.72) with SMTP; 29 Mar 2004 09:00:43 -0800 X-Sent: 29 Mar 2004 17:00:43 GMT Message-ID: <4068563A.8030603@usc.edu> Date: Mon, 29 Mar 2004 09:00:42 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: regarding the tcptrace file.. References: <5f49935f18bc.5f18bc5f4993@usc.edu> In-Reply-To: <5f49935f18bc.5f18bc5f4993@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > Hi Nadeem, > Are we required to modify the log produced in the trace file to that it is > readable by xgraph? > I am not finding any way, apart from writing a C program to do this, but is it > really required? > If not, will you manually delete the unwanted data from each student's trace > file and observe the output? > How do you intend to answer questions about the graph if you don't do the graph or look at it in the first place? Return-Path: tawileh@usc.edu Delivery-Date: Sat Mar 27 23:03:09 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i2S739qB002639 for ; Sat, 27 Mar 2004 23:03:09 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id XAA16065 for ; Sat, 27 Mar 2004 23:06:15 -0800 (PST) Received: from h000.c000.snv.cp.net(209.228.32.64) by mcphail.usc.edu via csmap id 79668668_8086_11d8_9507_0002b3c946b2_4617; Sat, 27 Mar 2004 23:06:45 -0800 (PST) Received: (cpmta 20981 invoked from network); 27 Mar 2004 23:03:14 -0800 Received: from 66.171.85.245 (HELO usc.edu) by smtp.tawileh.com (209.228.32.64) with SMTP; 27 Mar 2004 23:03:14 -0800 X-Sent: 28 Mar 2004 07:03:14 GMT Message-ID: <406678AF.10003@usc.edu> Date: Sat, 27 Mar 2004 23:03:11 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: regarding xgraph... References: <3ccd5f3c565a.3c565a3ccd5f@usc.edu> In-Reply-To: <3ccd5f3c565a.3c565a3ccd5f@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > Hi, > > I have written a ns script which produces a trace file cong.tr . The file when > passed to xgraph by typing xgraph cong.tr produces the graph for the > congestion window . > But on closing the window ,even when using the close on the top left corner of > the xgraph window it says, Unknown event type 16, and when closed using the X > it produces > > Unknown event type: 16 > XIO: fatal IO error 32 (Broken pipe) on X server "128.125.19.26:0.0" > after 310 requests (206 known processed) with 0 events remaining. > The connection was probably broken by a server shutdown or KillClient. > > from the reply to earlier mail , I can assume that this is normal and correct > right ?(and that there will not be a points penalty for it). > right > Secondly one can call in the procedur "finish" > > exec xgraph cong.tr > > to have the graph displayed as the program is run. but then on closing it > produces a message of the effect > > ns: finish Unknown event type 16 > while executing > "exec xgraph cong.tr" > [procedure "finish" line 9] > invoked from within > "finish" > > > which I guess means the same thing? how do you want us to do it ? > you do not have to invoke xgraph from within ns, but if you do and this error is produced as a result, it is OK. > Also do we need to remove the nam output or is it ok to display it alongside ? > I have seen the nam output in HW1. It is OK to display it and it is OK not to. Return-Path: tawileh@usc.edu Delivery-Date: Sat Mar 27 18:52:27 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i2S2qQqB030521 for ; Sat, 27 Mar 2004 18:52:26 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id SAA11492 for ; Sat, 27 Mar 2004 18:55:32 -0800 (PST) Received: from h000.c000.snv.cp.net(209.228.32.64) by mcphilmy.usc.edu via csmap id 7ee63278_8063_11d8_9783_0002b3c81b7b_19187; Sat, 27 Mar 2004 18:56:22 -0800 (PST) Received: (cpmta 13030 invoked from network); 27 Mar 2004 18:55:32 -0800 Received: from 66.171.85.245 (HELO usc.edu) by smtp.tawileh.com (209.228.32.64) with SMTP; 27 Mar 2004 18:55:32 -0800 X-Sent: 28 Mar 2004 02:55:32 GMT Message-ID: <40663EA3.1080001@usc.edu> Date: Sat, 27 Mar 2004 18:55:31 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: hw2 part2 References: <37e22e37bae2.37bae237e22e@usc.edu> In-Reply-To: <37e22e37bae2.37bae237e22e@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > Hi. As about the xgraph matter, based on your previous email, I assume that > we don't need to submit an xgraph-readable file for the homework and the > xgraph is more for aiding us to write the brief analysis, right? > > Thank you. > Right. You have to submit the files specified on the HW page as outlined in the submissions section. That doesn't mean that I will not look at any other file which is submitted. If you think that submitting a file will help in grading your homework, then send it in. Return-Path: tawileh@usc.edu Delivery-Date: Sat Mar 27 18:38:25 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i2S2cPqB030252 for ; Sat, 27 Mar 2004 18:38:25 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id SAA23817 for ; Sat, 27 Mar 2004 18:41:31 -0800 (PST) Received: from h000.c000.snv.cp.net(209.228.32.64) by mcphilmy.usc.edu via csmap id 896f758a_8061_11d8_8bf1_0002b3c81b7b_17349; Sat, 27 Mar 2004 18:42:21 -0800 (PST) Received: (cpmta 5775 invoked from network); 27 Mar 2004 18:38:30 -0800 Received: from 66.171.85.245 (HELO usc.edu) by smtp.tawileh.com (209.228.32.64) with SMTP; 27 Mar 2004 18:38:30 -0800 X-Sent: 28 Mar 2004 02:38:30 GMT Message-ID: <40663AA7.4020604@usc.edu> Date: Sat, 27 Mar 2004 18:38:31 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: regarding xgraph... References: <3793d83761a8.3761a83793d8@usc.edu> In-Reply-To: <3793d83761a8.3761a83793d8@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > > i have written the C program that parses my "tcptrace" file and generates a > file named "congestion" that will go as input to the xgraph utility... > > now when i run xgraph as shown below .. i get the graph.. but when i close > the grahph window.. i get the following message that is shown below.. > > bash-2.05b$ xgraph congestion (congestion is the file name) > Unknown event type: 16 > XIO: fatal IO error 32 (Broken pipe) on X server "128.125.19.26:0.0" > after 310 requests (206 known processed) with 0 events remaining. > The connection was probably broken by a server shutdown or KillClient. > > is this ok? or am i making some mistake..??? > This is OK. I'm sure you've encountered a Broken Pipe situation in one of your projects. It's just telling you that the other end killed the connection (which is you, when you close the graph window). Return-Path: tawileh@usc.edu Delivery-Date: Sat Mar 27 18:34:38 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i2S2YbqB030170 for ; Sat, 27 Mar 2004 18:34:37 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id SAA19359 for ; Sat, 27 Mar 2004 18:37:44 -0800 (PST) Received: from h000.c000.snv.cp.net(209.228.32.64) by mcphilmy.usc.edu via csmap id 01b81ba6_8061_11d8_950a_0002b3c81b7b_16851; Sat, 27 Mar 2004 18:38:33 -0800 (PST) Received: (cpmta 3999 invoked from network); 27 Mar 2004 18:34:43 -0800 Received: from 66.171.85.245 (HELO usc.edu) by smtp.tawileh.com (209.228.32.64) with SMTP; 27 Mar 2004 18:34:43 -0800 X-Sent: 28 Mar 2004 02:34:43 GMT Message-ID: <406639C1.6040609@usc.edu> Date: Sat, 27 Mar 2004 18:34:41 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: hw2 part2 References: <36b53c368442.36844236b53c@usc.edu> In-Reply-To: <36b53c368442.36844236b53c@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > > i am a bit confused with this mail.. so i generate a "tcptrace" file with > the cwnd values but it also contains some other data..( i dont know what they > are ).. > > so after generating tcptrace file.. i write a file c/c++ code which will > take tcptrace file as input and will generate a new file "xyz" which will go > as input to the xgraph utility..??? > > am i gettting it correct??? > yes. this is correct. > one more thing.. i am getting values for congestion window something like > > > |-------- these are congestion window values > | > | > 19.000 > 0.54715 1 0 5 0 cwnd_ 20.000 > 0.55269 1 0 5 0 cwnd_ 20.050 > 0.55824 1 0 5 0 cwnd_ 20.100 > 0.56379 1 0 5 0 cwnd_ 20.150 > 0.56933 1 0 5 0 cwnd_ 20.199 > 0.57488 1 0 5 0 cwnd_ 20.249 > 0.58043 1 0 5 0 cwnd_ 20.298 > 0.58597 1 0 5 0 cwnd_ 20.347 > 0.59152 1 0 5 0 cwnd_ 20.397 > 0.59707 1 0 5 0 cwnd_ 20.446 > 0.60261 1 0 5 0 cwnd_ 20.494 > > > so can i get values in decimal or float..? or they must be just integers... > Use these values directly into xgraph. you don't have to change anything. Return-Path: tawileh@usc.edu Delivery-Date: Sat Mar 27 03:08:32 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i2RB8WqB012405 for ; Sat, 27 Mar 2004 03:08:32 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id DAA10238 for ; Sat, 27 Mar 2004 03:11:37 -0800 (PST) Received: from h000.c000.snv.cp.net(209.228.32.64) by mcphilmy.usc.edu via csmap id 9f50220a_7fdf_11d8_8e2a_0002b3c81b7b_10515; Sat, 27 Mar 2004 03:12:23 -0800 (PST) Received: (cpmta 5087 invoked from network); 27 Mar 2004 03:08:36 -0800 Received: from 66.171.85.245 (HELO usc.edu) by smtp.tawileh.com (209.228.32.64) with SMTP; 27 Mar 2004 03:08:36 -0800 X-Sent: 27 Mar 2004 11:08:36 GMT Message-ID: <406560B4.8080700@usc.edu> Date: Sat, 27 Mar 2004 03:08:36 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: hw2 part2 References: <200403270619.i2R6J4DN020513@bourbon.usc.edu> In-Reply-To: <200403270619.i2R6J4DN020513@bourbon.usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > > I was able to geenrate the cwnd values with the tcl code. However the way they > are generated is not readable by xgraph (i.e. there are columns other than the > required X Y values that we need to plot). I can write a c++ code that parses > the outputed file and gives me a plottable file. Can i submit this additional > c++ file ? is it required that our tcl code produces a file that is plottable > using x-graph directly ?? > Thank you for clarifying. you can submit the additional file, but it is not a requirement. no, you are not required to find a way that produces an xgraph-format file directly Return-Path: tawileh@usc.edu Delivery-Date: Tue Mar 16 19:21:52 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i2H3LqqB011999 for ; Tue, 16 Mar 2004 19:21:52 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id TAA22824 for ; Tue, 16 Mar 2004 19:24:33 -0800 (PST) Received: from h002.c000.snv.cp.net(209.228.32.66) by mcphilmy.usc.edu via csmap id fe49f084_77c3_11d8_87e9_0002b3c81b7b_6969; Tue, 16 Mar 2004 19:34:27 -0800 (PST) Received: (cpmta 18280 invoked from network); 16 Mar 2004 19:21:32 -0800 Received: from 66.171.88.180 (HELO usc.edu) by smtp.tawileh.com (209.228.32.66) with SMTP; 16 Mar 2004 19:21:32 -0800 X-Sent: 17 Mar 2004 03:21:32 GMT Message-ID: <4057C439.1020500@usc.edu> Date: Tue, 16 Mar 2004 19:21:29 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: i will be out of town for the rest of the week Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi everyone, For those of you who are sending me questions regarding the project, I am not going to be in town from Wednesday through Monday. I am not sure how often I will be able to check my email during that time. My replies to your emails might therefore take longer than usual. good luck with your project Return-Path: tawileh@usc.edu Delivery-Date: Mon Mar 15 00:43:53 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i2F8hrqB029257 for ; Mon, 15 Mar 2004 00:43:53 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id AAA16044 for ; Mon, 15 Mar 2004 00:46:30 -0800 (PST) Received: from h002.c000.snv.cp.net(209.228.32.66) by mcphail.usc.edu via csmap id 928baf20_765d_11d8_8ee7_0002b3c946b2_31663; Mon, 15 Mar 2004 00:48:47 -0800 (PST) Received: (cpmta 6923 invoked from network); 15 Mar 2004 00:43:29 -0800 Received: from 66.171.88.180 (HELO usc.edu) by smtp.tawileh.com (209.228.32.66) with SMTP; 15 Mar 2004 00:43:29 -0800 X-Sent: 15 Mar 2004 08:43:29 GMT Message-ID: <40556CAF.2070502@usc.edu> Date: Mon, 15 Mar 2004 00:43:27 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: problem in pthread_Creation.. References: <1095bc41094bf5.1094bf51095bc4@usc.edu> In-Reply-To: <1095bc41094bf5.1094bf51095bc4@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > Dear Professor, > I am creating a read and a write thread for each connection the node > establishes.but what should be the name of the 1st argument in the > pthread_create command: > I mean > "pthread_create(&xxxxxx, &attr, readThread, (void *)N);" > > what should be the xxxxxx here? > name of the pthread_t variable. every thread has a variable associated with it. > If I create an array of pthread_t types, say pthread_t threads[10] and go on > using the threads[i], then at one stage they will be finished (because once a > node goes down, that threads[i] cannot be reused..) > > Please help me professor. > you can reuse the pthread_t variables. if you are not doing any operations on the thread after you create it (like join or kill), you can reuse the same name as many times as you want. also, if you are doing operations on the thread, then when that thread terminates, you can reuse its variable. Return-Path: tawileh@usc.edu Delivery-Date: Sat Mar 13 00:00:11 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i2D80BqB029792 for ; Sat, 13 Mar 2004 00:00:11 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id AAA20215 for ; Sat, 13 Mar 2004 00:02:36 -0800 (PST) Received: from h000.c000.snv.cp.net(209.228.32.64) by mcphilmy.usc.edu via csmap id 200ce376_74c6_11d8_9508_0002b3c81b7b_11170; Sat, 13 Mar 2004 00:12:09 -0800 (PST) Received: (cpmta 4764 invoked from network); 12 Mar 2004 23:59:35 -0800 Received: from 66.171.88.180 (HELO usc.edu) by smtp.tawileh.com (209.228.32.64) with SMTP; 12 Mar 2004 23:59:35 -0800 X-Sent: 13 Mar 2004 07:59:35 GMT Message-ID: <4052BF62.4090808@usc.edu> Date: Fri, 12 Mar 2004 23:59:30 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: regarding BUS error References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > hey nadim > > I am facing the problem of BUS error.. can u have a way out of it?? Can i > know where am i getting it??? I know its caused because of address alignment.. > but how can i avoid it?? > > thanks > A bus error is in some ways similar to a segmentation fault. You can find where it is coming from by using a debugger. avoiding it is just like avoiding any other runtime error: just get those bugs fixed. --nt Return-Path: tawileh@usc.edu Delivery-Date: Wed Mar 3 17:54:14 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i241sEqB031013 for ; Wed, 3 Mar 2004 17:54:14 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id RAA15538 for ; Wed, 3 Mar 2004 17:56:25 -0800 (PST) Received: from h000.c000.snv.cp.net(209.228.32.64) by mcphilmy.usc.edu via csmap id 5dcef9da_6d80_11d8_99f8_0002b3c81b7b_22723; Wed, 03 Mar 2004 18:05:10 -0800 (PST) Received: (cpmta 21484 invoked from network); 3 Mar 2004 17:53:24 -0800 Received: from 66.171.88.180 (HELO usc.edu) by smtp.tawileh.com (209.228.32.64) with SMTP; 3 Mar 2004 17:53:24 -0800 X-Sent: 4 Mar 2004 01:53:24 GMT Message-ID: <40468C13.9080401@usc.edu> Date: Wed, 03 Mar 2004 17:53:23 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: office hours Thursday 03/04 1pm-2pm SAL 211 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit I will do my office hours tomorrow from 1pm-2pm (instead of 2pm-3pm). If you cannot make that time and need to see me, email me and we'll arrange an appointment. Sorry for the inconvenience. --nt Return-Path: tawileh@usc.edu Delivery-Date: Fri Feb 27 08:33:35 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i1RGXZqB005683 for ; Fri, 27 Feb 2004 08:33:35 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id IAA12989 for ; Fri, 27 Feb 2004 08:35:34 -0800 (PST) Received: from h020.c000.snv.cp.net(209.228.32.84) by mcphail.usc.edu via csmap id 212137f0_6943_11d8_8ff2_0002b3c946b2_27919; Fri, 27 Feb 2004 08:36:44 -0800 (PST) Received: (cpmta 2652 invoked from network); 27 Feb 2004 08:32:33 -0800 Received: from 66.171.53.137 (HELO usc.edu) by smtp.tawileh.com (209.228.32.84) with SMTP; 27 Feb 2004 08:32:33 -0800 X-Sent: 27 Feb 2004 16:32:33 GMT Message-ID: <403F711E.2060304@usc.edu> Date: Fri, 27 Feb 2004 08:32:30 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: regarding knowing the beacons References: <2d35829564.295642d358@usc.edu> In-Reply-To: <2d35829564.295642d358@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit someone wrote: > hey nadim.. > > i have problem..as prof said that we should have only one connection between > two beacon nodes.. > > > suppose beacon A comes up and establishes connection with beacon B which has > just come up.. now beacon B also sends connection request to beacon A.. so to > ternimate one of the connections.. i need to compare the hostname and the > port.. number.. but i think i m not getting the correct port number.. .. i m > using getpeername.. to get the port number.. but its seems that it is being > started on some very large value.....like 63993.. etc.. so how can i get the > port number a nd the host name of the peer..??? > The neighbor sends you the port number/hostname in the hello message. Return-Path: tawileh@usc.edu Delivery-Date: Wed Feb 25 21:21:39 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i1Q5LcqB030491 for ; Wed, 25 Feb 2004 21:21:38 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id VAA12800 for ; Wed, 25 Feb 2004 21:23:34 -0800 (PST) Received: from h000.c000.snv.cp.net(209.228.32.64) by mcphilmy.usc.edu via csmap id 0fc3c576_681d_11d8_80a2_0002b3c81b7b_9540; Wed, 25 Feb 2004 21:31:43 -0800 (PST) Received: (cpmta 17331 invoked from network); 25 Feb 2004 21:20:34 -0800 Received: from 66.171.53.137 (HELO usc.edu) by smtp.tawileh.com (209.228.32.64) with SMTP; 25 Feb 2004 21:20:34 -0800 X-Sent: 26 Feb 2004 05:20:34 GMT Message-ID: <403D821E.5030609@usc.edu> Date: Wed, 25 Feb 2004 21:20:30 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: regarding threads References: <52cc3c52b7e6.52b7e652cc3c@usc.edu> In-Reply-To: <52cc3c52b7e6.52b7e652cc3c@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit someone wrote: > hey nadim.. > > i have a few questions.. > > first.. as i told u yesterday i am at present coding for only the beacon > node... what i have done is createed a thread that is waiting for incoming > connections in an infinite for loop.. and what i have done is i m forkin a new > processs in this thread to connect to that peer.. so is this a good programming > practice??? or like can i do this?? > I thought we established that you cannot use multiple processes. The fork() function should be non-existant in the project! Use new threads instead of new processes. > > one more thing to find the node is a beacon node.. i have to compare the port > number and the hostname.. but where can i get the hostname from?? i have to > call gethostbyname() for which i need the IP.. then where should i get the IP > from??? coz i dont know the IP otherwise I have to hardcode it in the program.. > Just like the Unix commands 'uname' and 'hostname', there is a function in C/C++ which will give you the hostname of the system you're running on. > one last thing.. can u hold ur office hours in SAL tomm.. i need to show my > code. before i start developing the code any further. > We can use the computer in my office. Return-Path: tawileh@usc.edu Delivery-Date: Mon Feb 23 22:45:55 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i1O6jtqB009946 for ; Mon, 23 Feb 2004 22:45:55 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id WAA24261 for ; Mon, 23 Feb 2004 22:47:46 -0800 (PST) Received: from h000.c000.snv.cp.net(209.228.32.64) by mcphilmy.usc.edu via csmap id 77fb32f6_6696_11d8_9b72_0002b3c81b7b_17084; Mon, 23 Feb 2004 22:55:45 -0800 (PST) Received: (cpmta 5973 invoked from network); 23 Feb 2004 22:44:45 -0800 Received: from 66.171.53.137 (HELO usc.edu) by smtp.tawileh.com (209.228.32.64) with SMTP; 23 Feb 2004 22:44:45 -0800 X-Sent: 24 Feb 2004 06:44:45 GMT Message-ID: <403AF2DA.1010804@usc.edu> Date: Mon, 23 Feb 2004 22:44:42 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: regarding multi threading?? References: <39daff398679.39867939daff@usc.edu> In-Reply-To: <39daff398679.39867939daff@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit someone wrote: > hey nadim.. > > why does the prof insist on multi threading?? like we can implement the > whole project in the single main function.. or may be multi processing?? then y > threads??? You should be glad he is, because this project would be ten times more difficult if the Prof. insisted that you NOT use multiple threads. you certainly _cannot_ do this in a single process. Your node has to wait for incoming connections, service neighbor requests and have a user interface to get commands and do a lot of other things at the same time. How do you expect to do that with one execution thread? > can u give me a real good example where multi threading can be really useful > ?? over multi processing application??? > This is getting outside the scope of this class. Would Warmup project 2 have been easier or harder if you had not used threads? I think you need to read a bit about threads and why they are used. Come to my office hours this week and I'll help you out if you have questions. > coz in this big project I cant think of what parts can i implement using > threads and where do i have to do multiple threads?? so can u give me some > idea?? > > Return-Path: tawileh@usc.edu Delivery-Date: Fri Feb 20 15:52:36 2004 Received: from postal.usc.edu (postal.usc.edu [128.125.253.6]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i1KNqaqB007961 for ; Fri, 20 Feb 2004 15:52:36 -0800 Received: from [192.168.2.11] (roguex.usc.edu [128.125.163.26]) by postal.usc.edu (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) with ESMTP id <0HTE003JUQEJSQ@postal.usc.edu> for cs551@merlot.usc.edu; Fri, 20 Feb 2004 15:54:20 -0800 (PST) Date: Fri, 20 Feb 2004 15:54:08 -0800 From: nadim tawileh Subject: Re: NS problem In-reply-to: To: cs551@merlot.usc.edu Message-id: <1077321248.6689.10.camel@imlel.usc.edu> Organization: MIME-version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Content-type: text/plain Content-transfer-encoding: 7BIT References: On Fri, 2004-02-20 at 15:46, someone wrote: > Hi, Nadim > > When I tried to ran ns, it always got cut off at the middle, > and another person's error message printed out, > like /auto/scf27/home/****/****/hw1-1.tcl, > erorr message........ > > I think we are having conflict trying to contend for the ns. > > This is really annoying, is there any way to solve this problem? > > > Thank you very much. > I think it is very weird that one user's NS session interfere with another user's. In any case, what you can do, in case the problem is a conflict on nunki, is work on your homework on a Sun station in one of the public ISD labs. If your homework runs on any Solaris system, it will run on nunki. --nt Return-Path: tawileh@usc.edu Delivery-Date: Thu Feb 19 23:30:29 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i1K7UTqB021691 for ; Thu, 19 Feb 2004 23:30:29 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id XAA09932 for ; Thu, 19 Feb 2004 23:32:11 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id fe251f0e_6376_11d8_84bc_0002b3c946b2_10157; Thu, 19 Feb 2004 23:32:53 -0800 (PST) Received: from usc.edu (137.53.171.66.subscriber.vzavenue.net [66.171.53.137]) by smtp.vzavenue.net (MOS 3.4.3-CR) with ESMTP id AGE81155; Fri, 20 Feb 2004 02:28:19 -0500 (EST) Message-ID: <4035B6AF.8090903@usc.edu> Date: Thu, 19 Feb 2004 23:26:39 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: HW#1 simulation termination time glitch References: <2c37452c13ad.2c13ad2c3745@usc.edu> In-Reply-To: <2c37452c13ad.2c13ad2c3745@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > Hi, > > I think the TCP flow needs to end before the simulation termination time on > part 2 of HW#1. > > Currently they end at the same time (3.0 seconds), which leaves some packets > in the queue. > > I think the the specification on simulation termination time needs to be > modified to, say, 4.0 sec. > > You are missing the point of the exercise. The simulation is not to see a TCP session from beginning to end. You are simulating a problem, and your answer should talk about that problem. The TCP session could go on for another 10 seconds and the answer to the exercise would still be the same. --nt Return-Path: tawileh@usc.edu Delivery-Date: Thu Feb 19 23:30:23 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i1K7UNqB021681 for ; Thu, 19 Feb 2004 23:30:23 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id XAA09791 for ; Thu, 19 Feb 2004 23:32:05 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id faa28aa6_6376_11d8_9c91_0002b3c946b2_10146; Thu, 19 Feb 2004 23:32:47 -0800 (PST) Received: from usc.edu (137.53.171.66.subscriber.vzavenue.net [66.171.53.137]) by smtp.vzavenue.net (MOS 3.4.3-CR) with ESMTP id AGE81151; Fri, 20 Feb 2004 02:28:17 -0500 (EST) Message-ID: <4035B5DA.8040403@usc.edu> Date: Thu, 19 Feb 2004 23:23:06 -0800 From: nadim tawileh Organization: USC User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cs551@merlot.usc.edu Subject: Re: for problem 2, at the end, the queue shows 4 red packets inside it References: <259a1025c493.25c493259a10@usc.edu> In-Reply-To: <259a1025c493.25c493259a10@usc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > Dear Professor, > I executed the 2nd problem for homework. > At the end of the simulation in NAM, it still shows 4 red packets in the queue. > Does that mean there are 4 packets still left in the queue and the simulation > has stopped? yes > Well, the observation is almost the same all the time for both the problems. > Is it correct or the observation should be different every time? > I think it should be the same as we are using same constants every time. > > Thanks The observation should not be different every time. --nt Return-Path: tawileh@usc.edu Delivery-Date: Wed Feb 18 01:44:19 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i1I9iJqB000833 for ; Wed, 18 Feb 2004 01:44:19 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id BAA02691 for ; Wed, 18 Feb 2004 01:45:53 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id 522995c0_61f7_11d8_8550_0002b3c946b2_15691; Wed, 18 Feb 2004 01:46:27 -0800 (PST) Received: from nt (137.53.171.66.subscriber.vzavenue.net [66.171.53.137]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id AFZ13927; Wed, 18 Feb 2004 04:41:33 -0500 (EST) Message-ID: <007101c3f603$62996260$6400a8c0@nt> From: "nadim tawileh" To: References: Subject: Re: NS from MAC Date: Wed, 18 Feb 2004 01:39:46 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > hey nadim... > > 2 quick questions for you... can i run my simulation from a MAC??? > > another one is .. is there any way that I can see the analysis of after the > simulation?? does NS provide ne such facility so that i can analyze the > network?? > thanks As far as I know, there is no version of ns that runs on a mac OS; only windows and Unix. In any case, like the projects, the homeworks are graded on nunki, so as long as you know that your simulation will run on nunki, you can work on it wherever you like. I'm not sure I understand your second question. What exactly do you want to analyze? The simulation will be graphically displayed in NAM and you can have NS can give you all the statistics and network states you want while its running. --nt Return-Path: tawileh@usc.edu Delivery-Date: Wed Feb 18 00:43:24 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i1I8hOqB032127 for ; Wed, 18 Feb 2004 00:43:24 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id AAA10616 for ; Wed, 18 Feb 2004 00:45:02 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id d19aed44_61ee_11d8_8fde_0002b3c946b2_5847; Wed, 18 Feb 2004 00:45:35 -0800 (PST) Received: from nt (137.53.171.66.subscriber.vzavenue.net [66.171.53.137]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id AFZ10203; Wed, 18 Feb 2004 03:41:13 -0500 (EST) Message-ID: <003501c3f5fa$f66ca410$6400a8c0@nt> From: "nadim tawileh" To: References: <20040218082404.43968.qmail@web21202.mail.yahoo.com> Subject: Re: "Invoked from within" error message Date: Wed, 18 Feb 2004 00:41:07 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > Nadim: > > Hi! Thank you for your reply to my msgs, I got new Q > for you. While testing my tcl code, error message > > "new Agent/NULL" > invoked from within > "set udst [new Agent/NULL]" > > is displayed. Do you know what that means? > > Thanks. > try new Agent/Null instead of NULL Return-Path: tawileh@usc.edu Delivery-Date: Tue Feb 17 23:58:56 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i1I7wuqB031317 for ; Tue, 17 Feb 2004 23:58:56 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id AAA01964 for ; Wed, 18 Feb 2004 00:00:06 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id 8a93a180_61e8_11d8_8563_0002b3c946b2_30992; Wed, 18 Feb 2004 00:00:39 -0800 (PST) Received: from nt (137.53.171.66.subscriber.vzavenue.net [66.171.53.137]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id AFZ03456; Wed, 18 Feb 2004 02:56:18 -0500 (EST) Message-ID: <002c01c3f5f4$afd96070$6400a8c0@nt> From: "nadim tawileh" To: References: <20040218063836.22748.qmail@web21202.mail.yahoo.com> Subject: Re: About Tcl assignment statement Date: Tue, 17 Feb 2004 23:56:10 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > Nadim: > > Hi! While working on homework 1 Q1, I encountered the > error message "can't read n0, no such variable" while > trying to create 5 nodes. > > # Create 5 nodes > for {set i 0} {$i < 5} {incr i} { > # ... FILL IN HERE ... > set n($i) [$ns node] <------- > > But that's syntax for Tcl assign statement, isn't it? > > Please read my post with timestamp 16 Feb 18:28. Return-Path: tawileh@usc.edu Delivery-Date: Tue Feb 17 21:12:46 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i1I5CkqB028324 for ; Tue, 17 Feb 2004 21:12:46 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id VAA18304 for ; Tue, 17 Feb 2004 21:14:23 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphilmy.usc.edu via csmap id 5a953054_61d2_11d8_966d_0002b3c81b7b_6507; Tue, 17 Feb 2004 21:21:50 -0800 (PST) Received: from nt (137.53.171.66.subscriber.vzavenue.net [66.171.53.137]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id AFY91331; Wed, 18 Feb 2004 00:10:26 -0500 (EST) Message-ID: <001201c3f5dd$8495e760$6400a8c0@nt> From: "nadim tawileh" To: References: Subject: Re: difference between Q length and Q limit? Date: Tue, 17 Feb 2004 21:08:18 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net length is the current length of the queue. limit is the maximum number of packets the queue can buffer before it starts dropping packets. ----- Original Message ----- To: Cc: Sent: Tuesday, February 17, 2004 2:24 PM Subject: difference between Q length and Q limit? > Hi professor, > > On homework#1 part2 template file there are these two lines. > > #Show queue length at the bottleneck link > #Set up queue limit of the bottleneck link > > Can you tell me the difference between queue length and queue limit? > > Thanks. > > Return-Path: tawileh@usc.edu Delivery-Date: Tue Feb 17 12:19:38 2004 Received: from postal.usc.edu (postal.usc.edu [128.125.253.6]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i1HKJcqB018452 for ; Tue, 17 Feb 2004 12:19:38 -0800 Received: from usc.edu (localhost.usc.edu [127.0.0.1]) by postal.usc.edu (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) with ESMTP id <0HT800DEWWJFM8@postal.usc.edu> for cs551@merlot.usc.edu; Tue, 17 Feb 2004 12:21:15 -0800 (PST) Received: from [128.125.3.135] by postal.usc.edu (mshttpd); Tue, 17 Feb 2004 12:21:15 -0800 Date: Tue, 17 Feb 2004 12:21:15 -0800 From: nadim tawileh Subject: Re: regarding set path To: cs551@merlot.usc.edu Message-id: MIME-version: 1.0 X-Mailer: iPlanet Messenger Express 5.2 HotFix 1.21 (built Sep 8 2003) Content-type: text/plain; charset=us-ascii Content-language: en Content-transfer-encoding: 7BIT Content-disposition: inline X-Accept-Language: en Priority: normal > Hi, > Is it fine if I write the following set command in my .cshrc file : > > set path=(/home/scf-22/csci551 $path) > rehash > > and then in all my programs I write only "exec nam" instead of "exec > ~csci551/nam" ? > Will this affect while grading? > Since there is no separate README file for this homework, I cannot > document > this while submission. > If the account on which we are grading your homework does not have the same line in its environment, then the exec command in your script will fail. Modifying your .cshrc affects only your environment. I would stay on the safe side and do things the way they are stated in the spec. If I'm not mistaken, the line is actually written for you in the template anyways, so you don't even have to write it! --nt Return-Path: tawileh@usc.edu Delivery-Date: Mon Feb 16 19:58:17 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i1H3wHcM005957 for ; Mon, 16 Feb 2004 19:58:17 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id TAA28583 for ; Mon, 16 Feb 2004 19:59:49 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphilmy.usc.edu via csmap id c1d15682_60fe_11d8_9f5c_0002b3c81b7b_28094; Mon, 16 Feb 2004 20:07:09 -0800 (PST) Received: from nt (137.53.171.66.subscriber.vzavenue.net [66.171.53.137]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id AFU66228; Mon, 16 Feb 2004 22:54:29 -0500 (EST) Message-ID: <002801c3f509$bc81f490$6400a8c0@nt> From: "nadim tawileh" To: References: <200402170328.TAA22863@usc.edu> Subject: Re: HW 1 Question Date: Mon, 16 Feb 2004 19:52:15 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/100, host=smtp.vzavenue.net ----- Original Message ----- To: "'nadim tawileh'" Cc: Sent: Monday, February 16, 2004 7:28 PM Subject: RE: HW 1 Question > Can more than one person not run nam at the same time? It was running fine > for me, but now when trying to run nam quits in the middle of the simulation > and says: > > bash-2.05b$ ~csci551/nam > Cannot connect to existing nam instance. Starting a new one... > > nam: Unable to open the file "/auto/home-scf-27/yuseonki/CS551/hw1/p1.nam" > > I'm assuming that yuseonki is another student in 551 also trying to run nam. > > Thanks, I don't know why this is happening with you. Each user can open his own instance of nam at the same time. I just opened three nam sessions from three different users on nunki to make sure. --nt Return-Path: tawileh@usc.edu Delivery-Date: Mon Feb 16 18:39:51 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i1H2dpcM004504 for ; Mon, 16 Feb 2004 18:39:51 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id SAA22261 for ; Mon, 16 Feb 2004 18:41:26 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id d826e19c_60f2_11d8_87f7_0002b3c946b2_13280; Mon, 16 Feb 2004 18:41:54 -0800 (PST) Received: from nt (137.53.171.66.subscriber.vzavenue.net [66.171.53.137]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id AFU58803; Mon, 16 Feb 2004 21:28:35 -0500 (EST) Message-ID: <001401c3f4fd$bc67fa60$6400a8c0@nt> From: "nadim tawileh" To: References: <200402170053.QAA12144@usc.edu> Subject: Re: HW 1 Question Date: Mon, 16 Feb 2004 18:28:28 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/100, host=smtp.vzavenue.net ----- Original Message ----- To: ; Sent: Monday, February 16, 2004 4:53 PM Subject: HW 1 Question > Hi - > I'm working on part 1 one of the homework, and I've got a problem. I set up > the nodes just like in the tutorial using > > # Create 5 nodes > for {set i 0} {$i < 5} {incr i} { > set n($i) [$ns node] > } > > The next line in the code is > # Create links > # All links have 10Mbps bandwidth and 5ms delay > $ns duplex-link $n0 $n1 10Mb 5ms DropTail > ... > > However, when running ns, I get an error saying > can't read "n0": no such variable > while executing > "$ns duplex-link $n0 $n1 10Mb 5ms DropTail" > (file "hw1-1.tcl" line 17) > > Why is it saying there is no such variable? I clearly created n0, n1,..., > n4 in the for loop? > > Thanks, You created $n(0), $n(1)...etc not $n0 and $n1. $n0/$n1 are variables. $n(0) is the first element of the array $n. Return-Path: tawileh@usc.edu Delivery-Date: Mon Feb 16 00:17:38 2004 Received: from postal.usc.edu (postal.usc.edu [128.125.253.6]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i1G8HccM016371 for ; Mon, 16 Feb 2004 00:17:38 -0800 Received: from usc.edu (localhost.usc.edu [127.0.0.1]) by postal.usc.edu (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) with ESMTP id <0HT6007G14FZH0@postal.usc.edu> for cs551@merlot.usc.edu; Mon, 16 Feb 2004 00:19:11 -0800 (PST) Received: from [66.171.53.137] by postal.usc.edu (mshttpd); Mon, 16 Feb 2004 00:19:11 -0800 Date: Mon, 16 Feb 2004 00:19:11 -0800 From: nadim tawileh Subject: Re: HW1 To: cs551@merlot.usc.edu Message-id: <7d96ac7d52ff.7d52ff7d96ac@usc.edu> MIME-version: 1.0 X-Mailer: iPlanet Messenger Express 5.2 HotFix 1.21 (built Sep 8 2003) Content-type: text/plain; charset=us-ascii Content-language: en Content-transfer-encoding: 7BIT Content-disposition: inline X-Accept-Language: en Priority: normal In the ns questions, when you are asked to set-up a topology, the important thing is to create the nodes and connect them as required. You do not have to make the layout in nam appear exactly as shown in the spec by using link orientation commands. The nodes can be repositioned anyways in nam by simply dragging them to the desired location. In your case, I can't figure out why it would work in a statement and not the other. You probably have a minor syntax glitch somewhere, but again, you do not need to worry about orientation. I don't quite understand your other question about part 1. You do not need to draw charts or anything like that. Just write down what happened in your simulation and at what time. > -----Original Message----- > Date: Sun, 15 Feb 2004 18:31:27 -0800 > To: william@bourbon.usc.edu > Subject: Re: HW1 > > Proffesor, > Few ques: > 1. > refer hw1 ... ques 1. > > I've added this to code... to orient the link b/w n0-n2... > > $ns duplex-link-op $n(0) $n(2) orient right-down > > All other links except this link are drawn propely..... there is no > repitition > in code... > this link is drawn right up(wrong ) ......n(1)-n(2) is also drawn right > up....as required... > > Where as similar kinda code in ques 2. draws right-down properly..... > Any comments.... > > And against this... > ** 3. Prepare a short write-up where you describe what you have seen and > name > the problem we have reproduced.** > > Can we explain y this happened... bcz it's easily visible what's > happening n > y.... > Do we need to make a chart or something..against.. > > ** You DO NOT need to explain why, but DO need to report what happened > and > when. ** > > Like at t = 0.0 ---- start of simulation.. > at t = 0.0 ----- this happened.... > ----- > at t = 3.0 ---- simulation ended.... > > or something similar... > > Regards > Return-Path: tawileh@usc.edu Delivery-Date: Wed Feb 4 15:31:44 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i14NVicM003690 for ; Wed, 4 Feb 2004 15:31:44 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id PAA23536 for ; Wed, 4 Feb 2004 15:32:53 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphilmy.usc.edu via csmap id 54820546_576b_11d8_871f_0002b3c81b7b_31763; Wed, 04 Feb 2004 15:39:10 -0800 (PST) Received: from nt (112.89.171.66.subscriber.vzavenue.net [66.171.89.112]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id AED93978; Wed, 4 Feb 2004 18:27:56 -0500 (EST) Message-ID: <002b01c3eb76$846314a0$6800a8c0@nt> From: "nadim tawileh" To: Subject: office location Date: Wed, 4 Feb 2004 15:27:50 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/100, host=smtp.vzavenue.net starting tomorrow, I will be in SAL211 during office hours. --nt Return-Path: tawileh@usc.edu Delivery-Date: Mon Feb 2 11:41:27 2004 Received: from postal.usc.edu (postal.usc.edu [128.125.253.6]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i12JfRcM010531 for ; Mon, 2 Feb 2004 11:41:27 -0800 Received: from usc.edu (localhost.usc.edu [127.0.0.1]) by postal.usc.edu (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) with ESMTP id <0HSH002TO2QVZW@postal.usc.edu> for cs551@merlot.usc.edu; Mon, 02 Feb 2004 11:42:31 -0800 (PST) Received: from [128.125.163.26] by postal.usc.edu (mshttpd); Mon, 02 Feb 2004 11:42:31 -0800 Date: Mon, 02 Feb 2004 11:42:31 -0800 From: nadim tawileh Subject: Re: office hours To: cs551@merlot.usc.edu Message-id: <28adb428ae49.28ae4928adb4@usc.edu> MIME-version: 1.0 X-Mailer: iPlanet Messenger Express 5.2 HotFix 1.21 (built Sep 8 2003) Content-type: text/plain; charset=us-ascii Content-language: en Content-transfer-encoding: 7BIT Content-disposition: inline X-Accept-Language: en Priority: normal I will do my office hours this week in SAL lab on Sun station 40. ----- Original Message ----- Date: Monday, February 2, 2004 10:18 am Subject: cs 551 > HI > > Just want to know where can I reach you in your office hours . > > Location of your office hours > > thanks > Return-Path: tawileh@usc.edu Delivery-Date: Fri Jan 30 19:45:53 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i0V3jrcM022454 for ; Fri, 30 Jan 2004 19:45:53 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id TAA16658 for ; Fri, 30 Jan 2004 19:46:50 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id f6d97dfc_53a0_11d8_9d84_0002b3c946b2_601; Fri, 30 Jan 2004 19:53:01 -0800 (PST) Received: from nt (14.49.171.66.subscriber.vzavenue.net [66.171.49.14]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id ADQ76700; Fri, 30 Jan 2004 22:43:01 -0500 (EST) Message-ID: <001001c3e7ac$50c7d310$6800a8c0@nt> From: "nadim tawileh" To: References: Subject: Re: LD_LIBRARY_PATH Date: Fri, 30 Jan 2004 19:42:54 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > Hi, > I set the LD_LIBRARY_PATH in my .cshrc file in my account. I forgot to mention it in my README file. Is that significant enough such that i have to make another submission. The grader probably is going to do the same thing i suppose. > > -Thanks > you do not need to mention that in your readme. The grader will have the path set to whatever is in the spec. Return-Path: tawileh@nunki.usc.edu Delivery-Date: Fri Jan 30 16:17:56 2004 Received: from postal.usc.edu (postal.usc.edu [128.125.253.6]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i0V0HucM018392 for ; Fri, 30 Jan 2004 16:17:56 -0800 Received: from nunki.usc.edu (nunki.usc.edu [128.125.5.168]) by postal.usc.edu (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) with ESMTP id <0HSB00IVDVJHCF@postal.usc.edu> for cs551@merlot.usc.edu; Fri, 30 Jan 2004 16:18:53 -0800 (PST) Date: Fri, 30 Jan 2004 16:18:53 -0800 (PST) From: tawileh Subject: Re: regardin makefile In-reply-to: To: cs551@merlot.usc.edu Message-id: MIME-version: 1.0 Content-type: TEXT/PLAIN; charset=US-ASCII Content-transfer-encoding: 7BIT On Fri, 30 Jan 2004, someone wrote: > hey nadim.. > > i have written my make file like this.. > > server: server.c common.h > cc -o server server.c -lsocket -lnsl -lgen > client: client.c common.h > cc -o client client.c -lsocket -lgen -lnsl -L/usr/ usc/openssl/default/lib -lcrypto -I/usr/usc/openssl/default/ > include/ > > > so when i run make i have specify like.. > > make client server... > > so is that ok??? > the grader is going to type 'make'. just 'make'. your project (both the client and the server shoud be built). using _only_ 'make'. > > for clean ups.. > > my clean file is below : > rm client > rm server > > and then after doin 'make clean' > i have to execute ./clean.. > > is that ok?? > when the grader types 'make clean', your binary files and object files (if any) should be removed. Return-Path: tawileh@usc.edu Delivery-Date: Thu Jan 29 23:05:26 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i0U75QcM030866 for ; Thu, 29 Jan 2004 23:05:26 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id XAA15248 for ; Thu, 29 Jan 2004 23:06:21 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id a98a6e10_52f3_11d8_9003_0002b3c946b2_351; Thu, 29 Jan 2004 23:12:28 -0800 (PST) Received: from nt (14.49.171.66.subscriber.vzavenue.net [66.171.49.14]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id ADO57194; Fri, 30 Jan 2004 02:02:23 -0500 (EST) Message-ID: <001701c3e6ff$00684bf0$6800a8c0@nt> From: "nadim tawileh" To: Subject: Project 1 Notes Date: Thu, 29 Jan 2004 23:02:14 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net Some notes based on some of the frequently asked questions today: - You have to compute MD5 on the fly. Do not store the file then find the hash. - Yes, you are required to do a Makefile. 'make' should compile your project (client and server) and 'make clean' should remove all binary and object files (.o). Do a 'make clean' on your code before submitting it. - Yes, you are required to include a readme file in your submission. This should include: * assumptions and design decisions you made * anything in your project that is not in the spec (if any) * things that you have NOT implemented (if any) Please do not paraphrase the project specs in the readme. You can safely assume that the grader knows the specs very well. - Yes, you have to handle malicious clients and servers. By malicious, we mean non-conforming to the project specifications. - No, we do not provide test cases or grading guidelines. - You can make several submissions to the bistro server. Then after the deadline, you can send in an email and tell us which submission you want to be graded. good luck! Return-Path: tawileh@usc.edu Delivery-Date: Wed Jan 28 21:33:02 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i0T5X2cM001581 for ; Wed, 28 Jan 2004 21:33:02 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id VAA13499 for ; Wed, 28 Jan 2004 21:33:42 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphilmy.usc.edu via csmap id 7e23b2d0_521d_11d8_9f58_0002b3c81b7b_16987; Wed, 28 Jan 2004 21:39:23 -0800 (PST) Received: from localhost.localdomain (14.49.171.66.subscriber.vzavenue.net [66.171.49.14]) by smtp.vzavenue.net (MOS 3.4.3-CR) with ESMTP id ADM17498; Thu, 29 Jan 2004 00:25:31 -0500 (EST) Subject: Re: zombies for threads From: nadim tawileh Reply-To: tawileh@usc.edu To: cs551@merlot.usc.edu In-Reply-To: <700ed07007a6.7007a6700ed0@usc.edu> References: <700ed07007a6.7007a6700ed0@usc.edu> Content-Type: text/plain Organization: USC Message-Id: <1075353927.1097.4.camel@odin> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 28 Jan 2004 21:25:28 -0800 Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net On Wed, 2004-01-28 at 20:30, someone wrote: > Hi, > Should I take care of the zombie condition even if i am using > pthreads. I am *not* doing a fork() and also I have never observed > a zombie condition till now. A zombie is an abandoned process. Threads are not processes and hence cannot become zombies. --nt Return-Path: tawileh@usc.edu Delivery-Date: Wed Jan 28 19:56:15 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i0T3uFcM032258 for ; Wed, 28 Jan 2004 19:56:15 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id TAA25284 for ; Wed, 28 Jan 2004 19:57:08 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id 0d7a63a6_5210_11d8_914a_0002b3c946b2_2850; Wed, 28 Jan 2004 20:03:10 -0800 (PST) Received: from localhost.localdomain (14.49.171.66.subscriber.vzavenue.net [66.171.49.14]) by smtp.vzavenue.net (MOS 3.4.3-CR) with ESMTP id ADM03761; Wed, 28 Jan 2004 22:51:37 -0500 (EST) Subject: Re: misc..! From: nadim tawileh Reply-To: tawileh@usc.edu To: cs551@merlot.usc.edu In-Reply-To: <6cabd36c94d8.6c94d86cabd3@usc.edu> References: <6cabd36c94d8.6c94d86cabd3@usc.edu> Content-Type: text/plain Organization: USC Message-Id: <1075348248.25759.35.camel@odin> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 28 Jan 2004 19:51:33 -0800 Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net On Wed, 2004-01-28 at 18:55, someone wrote: > 1. first is regarding MD5... heres what i am going to do.. i read the from teh network one byte at a time.. > and write all that into a temp file.. then compute the MD5 on that file.. and then delete that file.. > For this i have to open a file.. which will create a new file on the system... > now consider the case when oneclient is transfering long file.. if aonther client starts up to transfer a file.. > it will also try to create a file with same temporary name... would this cause me problems right???? > how can i avoid that..? > > or should i find a better way to do this?? The spec states that you have to compute the MD5 "on the fly" and specifically tells you not to save the file then find the hash. You should compute MD5 as you receive the file using the md5 functions. > > 2) > another thing is proff Cheng.. asks students to shut down the connection or socket *gracefully*.. > can u tell me what does this mean???? coz i m new to sockets.. and cant understand him .. graceful shutdown means that when it is time to shutdown, you do some necessary cleanups before you bring the process down. in our case, cleaning up includes closing the socket(s) you were using, freeing any memory allocations you did...etc and after that, you can exit the process. > > what i done is .. i set an alram for 60 sec and call function shut().. what i do is just do an exit... > in this function... but u know. then it will give me BROKEN PIPE error.. next time i try to run the client... > moreover i have defined the sockfd and connfd.. in the int main function..so it doesnt allow me to close the fds > in shut function?? can u throw some light on this.. Broken pipe happens when you try to write to a connection that has been closed by the other host. It is a signal (SIGPIPE) sent to the process and can be ignored/treated like any other signal. You can make your fd's global variables or have global pointers to them. This way, they can be accessed from virtually everywhere in your code. > > 3) abt.. EINTR interuupt.. should i neglect it.. if the server is executing..???? and just continue..?? > EINTR is returned when you get a signal while waiting on a function like accept() or read(). what you do depends on the signal received. > 4) to avoid zombies.. i have to call wait pid function.. right?? the best thing is to place htem in shut function.. > but that would delay.. the shutdown of the server.. is this implementaiton correct??? > The best way to do this would be to do the wait when you get a child signal. > and i would like to show u my code. tomm.. what ever i have compelted.. so would be there at SAL tomm ??? > I will be in SAL during my office hour. I'm not sure how much of your code I will have time to read though. It would be better if you prepared questions. --nt Return-Path: tawileh@usc.edu Delivery-Date: Mon Jan 26 23:06:39 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i0R76dcM013104 for ; Mon, 26 Jan 2004 23:06:39 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id XAA27363 for ; Mon, 26 Jan 2004 23:07:28 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphilmy.usc.edu via csmap id 3cb0af8c_5098_11d8_8c69_0002b3c81b7b_17144; Mon, 26 Jan 2004 23:12:59 -0800 (PST) Received: from nt (14.49.171.66.subscriber.vzavenue.net [66.171.49.14]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id ADF39432; Tue, 27 Jan 2004 02:03:35 -0500 (EST) Message-ID: <003501c3e4a3$abbe6650$6600a8c0@nt> From: "nadim tawileh" To: References: <200401270624.WAA03288@usc.edu> Subject: Re: regarding reading one byte Date: Mon, 26 Jan 2004 23:03:28 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net ----- Original Message ----- To: "'nadim tawileh'" Sent: Monday, January 26, 2004 8:23 PM Subject: RE: regarding reading one byte > Hey Nadim - ... ... > Even when it says my length is correct after reading and translating, (say > 14) sometimes it will read the whole length, and sometimes it will only read > 3 characters. I am reading like this: > > ... > cout << "Length is " << (int)rcv_msg_len_n << endl; > n = read(ClientSocket, &rcv_buf[6], (int)rcv_msg_len_n); > > rcv_msg_len_n is a uint32_t. > > Any ideas why this is happening? > the read() system call will try to read rcv_msg_len_n, but it will not wait around for that many bytes to return. in other words, read will give you what is available in the tcp stack (with a maximum of rcv_msg_len_n) at the time you call read(). If only 3 bytes are available, it will only return 3 bytes. The other bytes may still be at the other host, or in transit in one of the network layers. what you need to do is a function which basically does a loop on a read() call until you have all your bytes (keeping in mind timeout mechanisms). Then you can use this function instead of read() in your code. You will find some of these functions in network tutorials or in examples on the internet. --nt Return-Path: tawileh@usc.edu Delivery-Date: Mon Jan 26 21:05:01 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i0R551cM010901 for ; Mon, 26 Jan 2004 21:05:01 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id VAA25397 for ; Mon, 26 Jan 2004 21:05:49 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphilmy.usc.edu via csmap id 3e247a80_5087_11d8_962a_0002b3c81b7b_19768; Mon, 26 Jan 2004 21:11:20 -0800 (PST) Received: from nt (14.49.171.66.subscriber.vzavenue.net [66.171.49.14]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id ADF26743; Tue, 27 Jan 2004 00:04:32 -0500 (EST) Message-ID: <002601c3e493$0b38c0a0$6600a8c0@nt> From: "nadim tawileh" To: Subject: office hours this week Date: Mon, 26 Jan 2004 21:04:22 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net i will be in SAL lab on Sun station 40 for the duration of my office hours this week. --nt Return-Path: tawileh@usc.edu Delivery-Date: Mon Jan 26 21:05:00 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i0R550cM010891 for ; Mon, 26 Jan 2004 21:05:00 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id VAA25373 for ; Mon, 26 Jan 2004 21:05:48 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id 4c3ebdba_5087_11d8_9a70_0002b3c946b2_711; Mon, 26 Jan 2004 21:11:43 -0800 (PST) Received: from nt (14.49.171.66.subscriber.vzavenue.net [66.171.49.14]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id ADF26742; Tue, 27 Jan 2004 00:04:31 -0500 (EST) Message-ID: <002501c3e493$0af88350$6600a8c0@nt> From: "nadim tawileh" To: References: <146bfcb14680ed.14680ed146bfcb@usc.edu> Subject: Re: regarding reading one byte Date: Mon, 26 Jan 2004 21:01:54 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net ----- Original Message ----- To: "nadim tawileh" Sent: Monday, January 26, 2004 7:07 PM Subject: regarding reading one byte > hey nadim.. > > how are u?? one more question initially i was reading the complete buffer from the network.. but now when i am trying to read one single byte at a time the server is getting hanged.. and so is the client... i dont know.. they are into some kinda infinite looop... > > how do i know how many bytes am i suppose to read from the client.. ??? like i m always checking.. the return value from read and write but .. the loop doesnt terminate... ??? > you first read the msg type (2 bytes), then the datalength (4 bytes), then datalength bytes! you should also tackle situations where the client is malicious and sends incorrect lengths. for this you use timeouts as described by Prof. Cheng. As for your infinite loop, I have no way of knowing why it is happening. > you have your office timings tommorow right??? can i meet u tomm??? > yes > thanks... > Return-Path: tawileh@usc.edu Delivery-Date: Mon Jan 26 21:04:51 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i0R54pcM010881 for ; Mon, 26 Jan 2004 21:04:51 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id VAA24885 for ; Mon, 26 Jan 2004 21:05:40 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id 462291ea_5087_11d8_9c60_0002b3c946b2_676; Mon, 26 Jan 2004 21:11:33 -0800 (PST) Received: from nt (14.49.171.66.subscriber.vzavenue.net [66.171.49.14]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id ADF26397; Tue, 27 Jan 2004 00:01:35 -0500 (EST) Message-ID: <001e01c3e492$a157cd70$6600a8c0@nt> From: "nadim tawileh" To: References: <141f6421422a7a.1422a7a141f642@usc.edu> Subject: Re: stat error.. Date: Mon, 26 Jan 2004 20:50:48 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net ----- Original Message ----- To: "nadim tawileh" Sent: Monday, January 26, 2004 5:33 PM Subject: stat error.. > hey nadim.. > > > i have a really weird problem with stat function to give me the size of the file... initially yesterday it was printing.. all the file size correctly.. but today when i was doin it.. its showing me stat error.. and the error shown is BAD ADDRESS..!! > > can u tell me whats wrong.. here or is there ne other way that i can use to find the file size..?? > > bye thanks..!! > This error is returned by stat when one of the two arguments passed to the function refers to an illegal address. --nt Return-Path: tawileh@usc.edu Delivery-Date: Sun Jan 25 21:11:31 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i0Q5BVcM015866 for ; Sun, 25 Jan 2004 21:11:31 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id VAA10334 for ; Sun, 25 Jan 2004 21:12:17 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphilmy.usc.edu via csmap id f7bd02d8_4fbe_11d8_91cc_0002b3c81b7b_9802; Sun, 25 Jan 2004 21:17:42 -0800 (PST) Received: from nt (14.49.171.66.subscriber.vzavenue.net [66.171.49.14]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id ADA58505; Mon, 26 Jan 2004 00:08:29 -0500 (EST) Message-ID: <002901c3e3ca$6e762000$6600a8c0@nt> From: "nadim tawileh" To: References: <10f385210f368d.10f368d10f3852@usc.edu> Subject: Re: regarding part3 Date: Sun, 25 Jan 2004 21:08:22 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net The server sends the file itself as data in the GET_REPLY packet. The client computes the MD5 hash for that file. --nt ----- Original Message ----- To: Cc: Sent: Sunday, January 25, 2004 8:15 PM Subject: regarding part3 > hi > > i have a question . > > in part3 of the project the client sends the name of the file to the server .the server claculates the md5() of the file and sends the header GET_RPLY and the file is sent in the data field as clear text (this is what the specs say ).now what do we have to send in the data length field in this problem ?.do we send the length of the file ? > do we send the length of md5() which we have calculated ? do we send the value of md5() at all from the server to the client ? > > or > > do we receive only the file as clear text from the server and THEN compute the value of md5() and print it out to the user? the specs are not very clear abt this. > > thanks a lot for your help > > > Return-Path: tawileh@usc.edu Delivery-Date: Sun Jan 25 19:17:44 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i0Q3HicM013801 for ; Sun, 25 Jan 2004 19:17:44 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id TAA03784 for ; Sun, 25 Jan 2004 19:18:30 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id 21891da0_4faf_11d8_9a77_0002b3c946b2_16008; Sun, 25 Jan 2004 19:24:20 -0800 (PST) Received: from nt (14.49.171.66.subscriber.vzavenue.net [66.171.49.14]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id ADA50847; Sun, 25 Jan 2004 22:14:42 -0500 (EST) Message-ID: <001f01c3e3ba$8900f770$6600a8c0@nt> From: "nadim tawileh" To: References: <10f1cc810f10d9.10f10d910f1cc8@usc.edu> Subject: Re: regarding gethostbyname Date: Sun, 25 Jan 2004 19:14:37 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net ----- Original Message ----- To: "nadim tawileh" Sent: Sunday, January 25, 2004 6:54 PM Subject: regarding gethostbyname > hey.. thanks.. for the answer.. > > one more question... i m sending the message structure.. using write from client side.. in this statement.. > > n=write(sockfd,mess,sizeof(mess)); > > but do i have to convert the int arguments in to network byte order..??? i m changing the port number into network byte order.. > you have to convert all integer values to network byte-order. > i m also able to receive the url on the other side by the server.. but as soon as i call gethostbyname.. function.. my server gets blocked.. it doesnt eve return a NULL pointer to hostent structure... > make sure you are giving gethostbyname a null-terminated string > so is this is a problem of byte orders or not??? > when you are running things off of thesame machine, or achitecture, the byte order should not give you problems, unless of course you convert on one side and not the other. keep in mind that are required to change integer values to network byte order. > thanks..! > Return-Path: tawileh@usc.edu Delivery-Date: Sat Jan 24 23:42:37 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i0P7gbcM013055 for ; Sat, 24 Jan 2004 23:42:37 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id XAA03329 for ; Sat, 24 Jan 2004 23:43:21 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id f5208630_4f0a_11d8_8944_0002b3c946b2_18257; Sat, 24 Jan 2004 23:49:09 -0800 (PST) Received: from nt (14.49.171.66.subscriber.vzavenue.net [66.171.49.14]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id ACZ44479; Sun, 25 Jan 2004 02:39:34 -0500 (EST) Message-ID: <002401c3e316$5f644ba0$6600a8c0@nt> From: "nadim tawileh" To: References: Subject: Re: question for MD5_final() Date: Sat, 24 Jan 2004 23:39:23 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net ----- Original Message ----- To: "Nadim Tawileh" Sent: Saturday, January 24, 2004 9:57 PM Subject: question for MD5_final() > Hi > > I have a question about how to get checksum from MD5_Final(). > > I got char md[16] in MD5_Final(unsinged char *md, MD5_CTX *c), then I use memcpy(&checksum, md, 4) to get checksum. It is weird that what I get is only the first 8 bit of th checksum of that file. > > Could you tell me what's wrong ? > > thanks > The MD5_Final function will store the md5 checksum (16 bytes) into the buffer 'md'. I'm not sure what kind of variable 'checksum' is and why you want to copy only 4 bytes of md into it. The md5 hash is 16 bytes, not 4. Please read the man pages carefully. This should be very straightforward. --nt Return-Path: tawileh@usc.edu Delivery-Date: Sat Jan 24 18:12:49 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i0P2CncM006811 for ; Sat, 24 Jan 2004 18:12:49 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id SAA05831 for ; Sat, 24 Jan 2004 18:13:33 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id e1da0ab6_4edc_11d8_8c83_0002b3c946b2_3274; Sat, 24 Jan 2004 18:19:19 -0800 (PST) Received: from nt (14.49.171.66.subscriber.vzavenue.net [66.171.49.14]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id ACZ26784; Sat, 24 Jan 2004 21:10:59 -0500 (EST) Message-ID: <001201c3e2e8$789de690$6600a8c0@nt> From: "Nadim Tawileh" To: References: Subject: Re: how to debug for the server Date: Sat, 24 Jan 2004 18:10:45 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net ----- Original Message ----- To: "Nadim Tawileh" Cc: Sent: Saturday, January 24, 2004 2:09 PM Subject: how to debug for the server > Hi > > I have some question about debugging in the server. > > I try to use gdb or printf () to follow the server code, but it doesnot work and cannot show up the messages, especially in the child process. Could you tell you how I can debug for the server? > > thanks > There are a number of ways to debug a program. What I do sometimes when I'm writing a concurrent server is doing the whole thing as a single process first. i.e. i do not call fork() and have only one process handling everything. this makes the server iterative and will be able to handle only one client at a time. it also makes debugging easier since gdb is tracing only one process. after i make sure that my code works, i add the fork call in the server main loop. you can do debugging in a number of different ways, depending on how familiar you become with gdb. What I don't advise you to do, however, is using lots of printf()'s for debugging. Use these warmups to become familiar with gdb, because in the final project, when your code gets to 4K lines and more, sprinkling printf's around will not be very convenient. --nt Return-Path: tawileh@usc.edu Delivery-Date: Sat Jan 24 10:20:06 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i0OIK6cM030253 for ; Sat, 24 Jan 2004 10:20:06 -0800 Received: from mcphail.usc.edu (mcphail.usc.edu [128.125.253.51]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id KAA28470 for ; Sat, 24 Jan 2004 10:20:48 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphail.usc.edu via csmap id d698e920_4e9a_11d8_9a06_0002b3c946b2_31297; Sat, 24 Jan 2004 10:26:34 -0800 (PST) Received: from nt (14.49.171.66.subscriber.vzavenue.net [66.171.49.14]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id ACY38487; Sat, 24 Jan 2004 13:18:12 -0500 (EST) Message-ID: <000701c3e2a6$6c8d3d70$6600a8c0@nt> From: "Nadim Tawileh" To: References: Subject: Re: abt ADR_REQ Date: Sat, 24 Jan 2004 10:17:54 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net > i am really confused about this two values ADR_REQ and 0xFE10.... and like do i use a single char buff array for the message type from client to server... or i use a structure... if i use a structure can i use send() function ....??? > > moreover what does exactly goes into the structure or the bufer array...??? the string ADR_REQ or 0xFE10????? > > thanks.. > bye... > I'm not sure I understand your first question. The msg type is the first thing you send to the server. It is a 2-byte integer field. What actually goes in the packet is the hex value 0xFE10. You can definitely send a structure to the other end. For example, if I have struct foo { int x; int y; }; and I write a struct variable of type 'foo' to the socket, it is equivalent to writing int x and then int y to the socket, in that order. You can alternatively stack all the variables you want to send in a big char array and send that too, which boils down to the same thing. Don't forget to convert the integers to network byte order. --nt Return-Path: tawileh@usc.edu Delivery-Date: Fri Jan 23 22:39:23 2004 Received: from usc.edu (usc.edu [128.125.253.136]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i0O6dNcM017010 for ; Fri, 23 Jan 2004 22:39:23 -0800 Received: from mcphilmy.usc.edu (mcphilmy.usc.edu [128.125.253.115]) by usc.edu (8.9.3.1/8.9.3/usc) with SMTP id WAA24143 for ; Fri, 23 Jan 2004 22:40:05 -0800 (PST) Received: from smtp.vzavenue.net(66.171.59.140) by mcphilmy.usc.edu via csmap id e11af6ca_4e38_11d8_9c83_0002b3c81b7b_3778; Fri, 23 Jan 2004 22:45:21 -0800 (PST) Received: from nt (14.49.171.66.subscriber.vzavenue.net [66.171.49.14]) by smtp.vzavenue.net (MOS 3.4.3-CR) with SMTP id ACX85129; Sat, 24 Jan 2004 01:37:31 -0500 (EST) Message-ID: <004901c3e244$899d3260$6600a8c0@nt> From: "Nadim Tawileh" To: References: Subject: Re: question for memcpy() Date: Fri, 23 Jan 2004 22:37:13 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net You have to keep in mind that the data you are sending back and forth should _not_ be null terminated. The functions strcpy and strcat that you are using on the stream are designed for strings. They regard the string as the sequence of all characters up until a null ('\0'). Since the data in the packet does not or should not contain a null, using string functions will cause unexpected behavior and is certainly not correct. For example, your strcpy(data, buf+2) will regard buf+2 as a null-terminated string. Actually here I think you meant buf+6: buf+2 puts you at the start of datalen, not data. Since the data you are supposed to be receiving shoud not be null-terminated, there is no telling where strcpy will stop. Use memcpy instead of string functions. And remember to convert all integers to network byte order. Keep in mind that your code will be tested against other code, so it is very important to follow the spec to the letter. You might get satisfactory results for example if both your client and server work under the assumption of null-terminated data, but when your code is tested against other code, a lot of things will fail in this case. --nt ----- Original Message ----- From: To: "nadim tawileh" Cc: Sent: Friday, January 23, 2004 9:26 PM Subject: question for memcpy() > > Hi nadim > > I have a little confuse about memcpy(). Could you tell me what mistakes I made in the following? > > In our project, we are asked TCP stream as: > > struct Msg{ > > unsigned short msgType; > > unsigned int datalen; > > char *data; > > } > > First I want to transfer structure msg to stream buffer, I used memcpy() to implement msgType and datalen, and it works.The code is: > > memcpy(buf, &msg.msgType,sizeof(unsigned short)); > > memcpy(buf+2, &msg.datalen,sizeof(unsigned int)); > > strcat(buf+2, data); > > Then, when I want to transfer stream buffer to structure msg, I still use memcpy() to do msgType and datalen. It is weird that I can get msgType back, but not for datalen. I dont know why. The code is > > memcpy(&msg.msgType, buf, sizeof(unsigned short)); > > memcpy(&msg.datalen, but+2, sizeof(unsigned int)); > > strcpy(data, buf+2); > > Thanks for your help. >