su.class.cs244a



Path: shelby.stanford.edu!not-for-mail
From: Daniel Holbert <dholbert.NOSPAM@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Typo in problem set question 1?
Date: Wed, 11 Jan 2006 01:17:13 -0800
Lines: 15
Distribution: su
Message-ID: <dq2ier$88t$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7-1.4.1.centos4 (X11/20051007)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9412

The first question on Problem Set #1 is:

"If there are students taking CS244a, what is the probability that none 
of them has a birthday on the first day of class?"

The problem statement leaves out the number of students. (I think it's 
just a typo in the first clause, "If there are students taking CS244a".) 
   Is there supposed to be an actual number given, or should we just use 
a variable "n" to represent the number of students?

Thanks,
~Daniel

P.S. For reference, here's the URL:
http://www.stanford.edu/class/cs244a/homeworks/ps1/problem_set1_win06.pdf
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Typo in problem set question 1?
Date: Wed, 11 Jan 2006 01:53:47 -0800
Lines: 21
Distribution: su
Message-ID: <dq2kjn$a2i$1@news.Stanford.EDU>
References: <dq2ier$88t$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dq2ier$88t$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9413

Good catch.  It should read: "if there are N students..."

-Matt


Daniel Holbert wrote:
> The first question on Problem Set #1 is:
> 
> "If there are students taking CS244a, what is the probability that none 
> of them has a birthday on the first day of class?"
> 
> The problem statement leaves out the number of students. (I think it's 
> just a typo in the first clause, "If there are students taking CS244a".) 
>   Is there supposed to be an actual number given, or should we just use 
> a variable "n" to represent the number of students?
> 
> Thanks,
> ~Daniel
> 
> P.S. For reference, here's the URL:
> http://www.stanford.edu/class/cs244a/homeworks/ps1/problem_set1_win06.pdf
.

Path: shelby.stanford.edu!not-for-mail
From: Stefan Thomas Mohler <smohler@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Purify
Date: Wed, 11 Jan 2006 20:06:14 +0000 (UTC)
Lines: 17
Distribution: su
Message-ID: <dq3ofm$er3$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:9414


You can make the missing demangler error go away by adding:

   -demangle-program=/usr/pubsw/bin/c++filt

to your PFLAGS variable in the makefile.  I havent a clue what its problem
with linking against /usr/lib.  If you give it the -best-effort flag it will
tell you:

ld: fatal: option -dn and -P are incompatible
ld: fatal: Flags processing errors

But I didnt see what -P meant to ld. (-dn means link statically).  I dont
set LD_LIBRARY_PATH so it just looks in /usr/lib by default, perhaps someone
who knows purify can say whether it needs a special path added...

stefan
.

Path: shelby.stanford.edu!myth29.Stanford.EDU!wachs
From: Megan Anneke Wachs <wachs@stanford.edu>
Newsgroups: su.class.cs244a
Subject: HW 1 prob 5
Date: Wed, 11 Jan 2006 16:26:17 -0800
Lines: 6
Distribution: su
Message-ID: <Pine.LNX.4.44.0601111625270.29375-100000@myth29.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9415

In a  store-and-forward router, is the packet completely stored before
forwarding begins, even if the buffer is empty?

Thanks,
Megan

.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW 1 prob 5
Date: Wed, 11 Jan 2006 16:54:06 -0800
Lines: 9
Distribution: su
Message-ID: <dq49bq$6gc$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0601111625270.29375-100000@myth29.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.LNX.4.44.0601111625270.29375-100000@myth29.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9416

Yep.

Megan Anneke Wachs wrote:
> In a  store-and-forward router, is the packet completely stored before
> forwarding begins, even if the buffer is empty?
> 
> Thanks,
> Megan
> 
.

Path: shelby.stanford.edu!elaine34.Stanford.EDU!lamskm
From: lamskm@Stanford.EDU (Michael Lam)
Newsgroups: su.class.cs244a
Subject: echodemo failing on elaine34
Date: Thu, 12 Jan 2006 19:14:10 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <dq69q2$gec$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
Summary: had echodemo on another unix box, but failing on elaine34
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:9419

I had echodemo working on another unix box.
But when I copied it to elaine34, it fails
(on the call to socket).  Should we be using elaine34
for the assignment?  Are there other boxes we can use?

Also, I downloaded echodemo.c to my pc and I want to ftp it to
elaine34 but it seems elaine34 (and transfer.stanford.edu) doesn't
allow ftp.   Is there a better way of file transfer (from my pc)?

Thanks.

-Michael Lam


.

Path: shelby.stanford.edu!myth2.Stanford.EDU!arigreen
From: Ari David Greenberg <arigreen@myth2.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: echodemo failing on elaine34
Date: Thu, 12 Jan 2006 11:51:35 -0800
Lines: 32
Distribution: su
Message-ID: <Pine.LNX.4.44.0601121143010.29534-100000@myth2.Stanford.EDU>
References: <dq69q2$gec$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
To: Michael Lam <lamskm@Stanford.EDU>
In-Reply-To: <dq69q2$gec$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9420

That's weird. I tried compiling and running echodemo on elaine34 and
experienced no problems. You can try connecting to any of the Sweet Hall
Solaris machines (epic, saga, elaine, etc.) Just make sure that it is
running Solaris, as some of the sweet hall machines run Linux. (To
determine what version of *nix the OS is running, use the uname command.)



On Thu, 12 Jan 2006, Michael Lam wrote:

> I had echodemo working on another unix box.
> But when I copied it to elaine34, it fails
> (on the call to socket).  Should we be using elaine34
> for the assignment?  Are there other boxes we can use?
>
> Also, I downloaded echodemo.c to my pc and I want to ftp it to
> elaine34 but it seems elaine34 (and transfer.stanford.edu) doesn't
> allow ftp.   Is there a better way of file transfer (from my pc)?

Sure. From a windows machine, try running pscp
(http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
from the command prompt.

Ari
>
> Thanks.
>
> -Michael Lam
>
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Stefan Thomas Mohler <smohler@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: ftp --> sftp
Date: Thu, 12 Jan 2006 19:53:06 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <dq6c31$jig$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:9421


Try using sftp instead of ftp (it works for me with transfer.stanford.edu).
Stanford likes us to use the secure versions of things (like ssh instead
of rsh).

Stefan
.

Path: shelby.stanford.edu!myth2.Stanford.EDU!arigreen
From: Ari David Greenberg <arigreen@myth2.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: echodemo failing on elaine34
Date: Thu, 12 Jan 2006 11:53:49 -0800
Lines: 22
Distribution: su
Message-ID: <Pine.LNX.4.44.0601121153070.29534-100000@myth2.Stanford.EDU>
References: <dq69q2$gec$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
To: Michael Lam <lamskm@Stanford.EDU>
In-Reply-To: <dq69q2$gec$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9422

Btw, did you try make clean and running make again on elaine34?

Ari

On Thu, 12 Jan 2006, Michael Lam wrote:

> I had echodemo working on another unix box.
> But when I copied it to elaine34, it fails
> (on the call to socket).  Should we be using elaine34
> for the assignment?  Are there other boxes we can use?
>
> Also, I downloaded echodemo.c to my pc and I want to ftp it to
> elaine34 but it seems elaine34 (and transfer.stanford.edu) doesn't
> allow ftp.   Is there a better way of file transfer (from my pc)?
>
> Thanks.
>
> -Michael Lam
>
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: problem set #1 2-c
Date: Thu, 12 Jan 2006 17:50:50 -0800
Lines: 4
Distribution: su
Message-ID: <dq711n$dro$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9423

Can I assume the speed of light in the optical fiber
is 3 X 10^8 m/s?

--Michi
.

Path: shelby.stanford.edu!not-for-mail
From: "Krishna Monian" <kmonian@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Running purify remotely
Date: Thu, 12 Jan 2006 16:58:31 -0800
Lines: 3
Distribution: su
Message-ID: <dq72q0$fsl$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9424

Are there issues in running purify remotely with window exporting?


.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problem set #1 2-c
Date: Thu, 12 Jan 2006 19:02:56 -0800
Lines: 9
Distribution: su
Message-ID: <dq7591$i2a$1@news.Stanford.EDU>
References: <dq711n$dro$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dq711n$dro$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9425

Sure, just state your assumption.

-Matt

Michi Mutsuzaki wrote:
> Can I assume the speed of light in the optical fiber
> is 3 X 10^8 m/s?
> 
> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Running purify remotely
Date: Thu, 12 Jan 2006 19:14:48 -0800
Lines: 10
Distribution: su
Message-ID: <dq75v9$ik8$1@news.Stanford.EDU>
References: <dq72q0$fsl$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dq72q0$fsl$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9426

Is there a specific issue you're worried about or seeing?  It shouldn't 
be a problem... personally I can't click on the Purify menus when using 
Cygwin/X, but I never really had to use the menus anyway.

-Matt

Krishna Monian wrote:
> Are there issues in running purify remotely with window exporting?
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Krishna Monian" <kmonian@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Running purify remotely
Date: Thu, 12 Jan 2006 19:34:43 -0800
Lines: 18
Distribution: su
Message-ID: <dq774o$jnj$1@news.Stanford.EDU>
References: <dq72q0$fsl$1@news.Stanford.EDU> <dq75v9$ik8$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:9427

The purify windo pops up for me and then the whole thing just hangs. I cant 
really do anything. However running it without windows seems to work ok.

Thanks
Krishna

"Matt Falkenhagen" <mjf@stanford.edu> wrote in message 
news:dq75v9$ik8$1@news.Stanford.EDU...
> Is there a specific issue you're worried about or seeing?  It shouldn't be 
> a problem... personally I can't click on the Purify menus when using 
> Cygwin/X, but I never really had to use the menus anyway.
>
> -Matt
>
> Krishna Monian wrote:
>> Are there issues in running purify remotely with window exporting?
>> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Bill Dwyer" <wdwyer@stanford.edu>
Newsgroups: su.class.cs244a
Subject: SSH Public Private Keys...
Date: Thu, 12 Jan 2006 19:58:22 -0800
Lines: 9
Distribution: su
Message-ID: <dq78gu$kua$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9428

I've been trying to set up public/private key authentication so I don't have 
to login to the servers every time ssh in. It seems like i've tried 
EVERYTHING, but i just can't seem to get it working. Has anyone else had 
success with this? TA's, is there some trick to stanford's network im 
missing?

Bill 


.

Path: shelby.stanford.edu!not-for-mail
From: "Jesse Young" <jesse.young@stanford.edu>
Newsgroups: su.class.cs244a
Subject: test_code script issues
Date: Thu, 12 Jan 2006 20:37:08 -0800
Lines: 31
Distribution: su
Message-ID: <dq7apl$mr3$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9429

Hi,

I had a couple of issues with the test script ....

First, three of the runs that should succeed are failing, seemingly because 
the test script is supplying a nonexistent local path . Shouldn't all the 
local directories be prefixed by ./grading_src/build/?

../ftpcopy   mif 5 ftp.slac.stanford.edu 
/afs/ir.stanford.edu/users/y/o/youngj/cs244a/grading_src/build/ftp.slac.stanford.edu_mif_5_1 
/doc
../ftpcopy   mif 5 ftp.slac.stanford.edu ftp.slac.stanford.edu_mif_5_0 /doc
../ftpcopy   ch 1 ftp.cs.stanford.edu 
/afs/ir.stanford.edu/users/y/o/youngj/cs244a/grading_src/build/ftp.cs.stanford.edu_ch_1_1 
/pub/cweb
../ftpcopy   gz 2 ftp.stanford.edu ftp.stanford.edu_gz_2_0 /pub/packages
../ftpcopy   txt 0 134.79.18.30 134.79.18.30_txt_0_0 .

Also, one of the regular expressions in Test O is failing. It seems like 
it's supposed to match the line:

" * Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) Copyright 
IBM Corp. 1992, 2005 All rights reserved.  "

but it doesn't match anymore.

Thanks for your help,

Jesse


.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: test_code script issues
Date: Fri, 13 Jan 2006 02:35:27 -0800
Lines: 42
Distribution: su
Message-ID: <dq7vpg$gp0$1@news.Stanford.EDU>
References: <dq7apl$mr3$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dq7apl$mr3$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9430

Jesse Young wrote:
> Hi,
> 
> I had a couple of issues with the test script ....
> 
> First, three of the runs that should succeed are failing, seemingly because 
> the test script is supplying a nonexistent local path . Shouldn't all the 
> local directories be prefixed by ./grading_src/build/?
> 
> ./ftpcopy   mif 5 ftp.slac.stanford.edu 
> /afs/ir.stanford.edu/users/y/o/youngj/cs244a/grading_src/build/ftp.slac.stanford.edu_mif_5_1 
> /doc
> ./ftpcopy   mif 5 ftp.slac.stanford.edu ftp.slac.stanford.edu_mif_5_0 /doc
> ./ftpcopy   ch 1 ftp.cs.stanford.edu 
> /afs/ir.stanford.edu/users/y/o/youngj/cs244a/grading_src/build/ftp.cs.stanford.edu_ch_1_1 
> /pub/cweb
> ./ftpcopy   gz 2 ftp.stanford.edu ftp.stanford.edu_gz_2_0 /pub/packages
> ./ftpcopy   txt 0 134.79.18.30 134.79.18.30_txt_0_0 .
> 

No, the test script seems to be fine.  My ftpcopy solution passes all 
the tests...

> Also, one of the regular expressions in Test O is failing. It seems like 
> it's supposed to match the line:
> 
> " * Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) Copyright 
> IBM Corp. 1992, 2005 All rights reserved.  "
> 
> but it doesn't match anymore.

Ah yes, you're right.  We'll update the script to fix this, for now 
ignore Test O saying you didn't run purify if you know you did.

-Matt

> 
> Thanks for your help,
> 
> Jesse
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: SSH Public Private Keys...
Date: Fri, 13 Jan 2006 12:11:56 -0800
Organization: Stanford University
Lines: 30
Distribution: su
Message-ID: <20060113121156.6f5eeba3@ballpoint>
References: <dq78gu$kua$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9431

----------  Forwarded Message  ----------

Subject: Re: HelpSU Request HD0000000260591
Date: Friday 30 September 2005 01:51 am
From: Jason Cowart <jcowart@stanford.edu>
To: lzen@cs.stanford.edu

Hi Lee,

Unfortunately public-private key authentication won't work either--
there's apparently not a way to integrate it with Kerberos/AFS.  As
of now password authentication is the only option.

Best,
jason



On Thu, 12 Jan 2006 19:58:22 -0800
"Bill Dwyer" <wdwyer@stanford.edu> wrote:

> I've been trying to set up public/private key authentication so I don't have 
> to login to the servers every time ssh in. It seems like i've tried 
> EVERYTHING, but i just can't seem to get it working. Has anyone else had 
> success with this? TA's, is there some trick to stanford's network im 
> missing?
> 
> Bill 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: FTP server connection problems
Date: Fri, 13 Jan 2006 23:15:04 -0800
Lines: 10
Distribution: su
Message-ID: <dqa897$185$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:9432

I'm trying to test my program against random FTP servers.  I can
successfully connect to the ftpd program supplied, but when I try to connect
to the ftp server I'm running locally on my Windows desktop (BPFTP server),
it hangs on connect and never completes.  I'm running on port 900, but it
still doesn't seem to work.  Ethereal shows that I never receive the packet
server-side.  Anyone have any ideas?  I'm just curious why it isn't working.

Waynn


.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: FTP server connection problems
Date: Fri, 13 Jan 2006 23:25:40 -0800
Lines: 20
Distribution: su
Message-ID: <dqa8t5$1lt$1@news.Stanford.EDU>
References: <dqa897$185$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:9433

Oh, and I should add that telnet <myip> 900 does return 220.

"Waynn Lue" <wlue@stanford.edu> wrote in message
news:dqa897$185$1@news.Stanford.EDU...
> I'm trying to test my program against random FTP servers.  I can
> successfully connect to the ftpd program supplied, but when I try to
connect
> to the ftp server I'm running locally on my Windows desktop (BPFTP
server),
> it hangs on connect and never completes.  I'm running on port 900, but it
> still doesn't seem to work.  Ethereal shows that I never receive the
packet
> server-side.  Anyone have any ideas?  I'm just curious why it isn't
working.
>
> Waynn
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: FTP server connection problems
Date: Sat, 14 Jan 2006 04:19:58 -0800
Lines: 27
Distribution: su
Message-ID: <dqaq4s$li9$1@news.Stanford.EDU>
References: <dqa897$185$1@news.Stanford.EDU> <dqa8t5$1lt$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:9434

Hm, the problem went away.  Please ignore...no idea what happened.

"Waynn Lue" <wlue@stanford.edu> wrote in message
news:dqa8t5$1lt$1@news.Stanford.EDU...
> Oh, and I should add that telnet <myip> 900 does return 220.
>
> "Waynn Lue" <wlue@stanford.edu> wrote in message
> news:dqa897$185$1@news.Stanford.EDU...
> > I'm trying to test my program against random FTP servers.  I can
> > successfully connect to the ftpd program supplied, but when I try to
> connect
> > to the ftp server I'm running locally on my Windows desktop (BPFTP
> server),
> > it hangs on connect and never completes.  I'm running on port 900, but
it
> > still doesn't seem to work.  Ethereal shows that I never receive the
> packet
> > server-side.  Anyone have any ideas?  I'm just curious why it isn't
> working.
> >
> > Waynn
> >
> >
>
>


.

Path: shelby.stanford.edu!elaine24.Stanford.EDU!zeighami
From: Roy Mehdi Zeighami <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: using snprintf
Date: Sat, 14 Jan 2006 11:40:48 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.GSO.4.44.0601141138060.23768-100000@elaine24.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9435

Hello...

Is anyone else using snprintf?  gcc compiles with warnings when I use it.
It says:

warning: implicit declaration of function 'snprintf'

but seems to work fine.  The man page says I need to include stdio.h but
that doesn't seem to shut it up.

Any suggestions?

Thanks,

Roy

.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: using snprintf
Date: Sat, 14 Jan 2006 12:49:41 -0800
Lines: 32
Distribution: su
Message-ID: <dqbo59$hba$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601141138060.23768-100000@elaine24.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601141138060.23768-100000@elaine24.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9436

snprintf is a C99 function.  We require your code to compile with the 
gcc -ansi flag (old C89).  That's probably what you're doing and why 
you're getting that warning: -ansi won't include the declaration of 
snprintf.

In general, you can't use C99 features, but functions like snprintf that 
were widely available before C99 are fine.  Basically, if your code 
compiles under -ansi, you should be ok.

In this case, to fix the warning, just add a prototype for snprintf:

extern int snprintf(char *s, size_t n, const char *fmt, ...);

-Matt

Roy Mehdi Zeighami wrote:
> Hello...
> 
> Is anyone else using snprintf?  gcc compiles with warnings when I use it.
> It says:
> 
> warning: implicit declaration of function 'snprintf'
> 
> but seems to work fine.  The man page says I need to include stdio.h but
> that doesn't seem to shut it up.
> 
> Any suggestions?
> 
> Thanks,
> 
> Roy
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Jeremy Robin" <jirobin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: purify FIU errors
Date: Sat, 14 Jan 2006 13:45:36 -0800
Lines: 7
Distribution: su
Message-ID: <dqbre0$jv3$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9437

Aside from the name_service_door error mentioned in the faq, there are also 
purify errors for the 3 std streams and 2 for fd's for "Purify internal 
use".  are these also FIU errors that we can ignore?

jeremy 


.

Path: shelby.stanford.edu!not-for-mail
From: Stefan Thomas Mohler <smohler@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: purify errors
Date: Sat, 14 Jan 2006 22:04:52 +0000 (UTC)
Lines: 3
Distribution: su
Message-ID: <dqbsi4$kga$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:9438

When handling an error, do you expect us to explicitely close down each fd
that we have open at the time or can we let the OS do it on exit (and thus
generate several FIU purify errors).
.

Path: shelby.stanford.edu!not-for-mail
From: Mark Slee <mcslee@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Running purify remotely
Date: Sat, 14 Jan 2006 14:45:36 -0800
Lines: 25
Distribution: su
Message-ID: <dqbuut$mdh$1@news.Stanford.EDU>
References: <dq72q0$fsl$1@news.Stanford.EDU> <dq75v9$ik8$1@news.Stanford.EDU> <dq774o$jnj$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <dq774o$jnj$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9439

I have the same issue, also running on Cygwin/X. Locks up the entire ssh 
session.

Krishna Monian wrote:
> The purify windo pops up for me and then the whole thing just hangs. I cant 
> really do anything. However running it without windows seems to work ok.
> 
> Thanks
> Krishna
> 
> "Matt Falkenhagen" <mjf@stanford.edu> wrote in message 
> news:dq75v9$ik8$1@news.Stanford.EDU...
> 
>>Is there a specific issue you're worried about or seeing?  It shouldn't be 
>>a problem... personally I can't click on the Purify menus when using 
>>Cygwin/X, but I never really had to use the menus anyway.
>>
>>-Matt
>>
>>Krishna Monian wrote:
>>
>>>Are there issues in running purify remotely with window exporting?
>>>
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: purify FIU errors
Date: Sat, 14 Jan 2006 15:29:16 -0800
Lines: 12
Distribution: su
Message-ID: <dqc1gg$or0$1@news.Stanford.EDU>
References: <dqbre0$jv3$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqbre0$jv3$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9440

These are fine.

-Matt

Jeremy Robin wrote:
> Aside from the name_service_door error mentioned in the faq, there are also 
> purify errors for the 3 std streams and 2 for fd's for "Purify internal 
> use".  are these also FIU errors that we can ignore?
> 
> jeremy 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: purify errors
Date: Sat, 14 Jan 2006 15:40:46 -0800
Lines: 9
Distribution: su
Message-ID: <dqc262$pce$1@news.Stanford.EDU>
References: <dqbsi4$kga$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqbsi4$kga$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9441

On a fatal error, you can just abort without worrying about freeing 
memory or closing file descriptors.

-Matt

Stefan Thomas Mohler wrote:
> When handling an error, do you expect us to explicitely close down each fd
> that we have open at the time or can we let the OS do it on exit (and thus
> generate several FIU purify errors).
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: purify errors
Date: Sat, 14 Jan 2006 16:02:00 -0800
Lines: 18
Distribution: su
Message-ID: <dqc3ds$qqq$1@news.Stanford.EDU>
References: <dqbsi4$kga$1@news.Stanford.EDU> <dqc262$pce$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqc262$pce$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9442

Clarification: you do need to print the "ERROR:" message before 
aborting, as the assignment handout states.

-Matt

Matt Falkenhagen wrote:
> On a fatal error, you can just abort without worrying about freeing 
> memory or closing file descriptors.
> 
> -Matt
> 
> Stefan Thomas Mohler wrote:
> 
>> When handling an error, do you expect us to explicitely close down 
>> each fd
>> that we have open at the time or can we let the OS do it on exit (and 
>> thus
>> generate several FIU purify errors).
.

Path: shelby.stanford.edu!not-for-mail
From: Mark Slee <mcslee@stanford.edu>
Newsgroups: su.class.cs244a
Subject: 2MSL Delay on Web Servers
Date: Sat, 14 Jan 2006 18:30:46 -0800
Lines: 11
Distribution: su
Message-ID: <dqcc53$54j$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9443

Just out of curiosity, how do large servers that accept many connections 
on the same port deal with the 2MSL timeout issue? Our FTP client has to 
choose a new port for each data connection because of the way TCP 
enforces this timeout.

A server like Apache, however, can run many simultaneous connections on 
the same port (i.e. 80). What's the distinction here? Are they using a 
different type of socket?

Thanks,
Mark
.

Path: shelby.stanford.edu!not-for-mail
From: Stefan Thomas Mohler <smohler@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: 2MSL delay
Date: Sun, 15 Jan 2006 02:54:59 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <dqcdi3$5lq$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:9444

never done it, but it was mentioned in another class..

If you want, you can flag the adress not to wait.  If fd is the socket you
are listening on:

int n = 1;
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &n, sizeof(n))
.

Path: shelby.stanford.edu!elaine30.Stanford.EDU!zeighami
From: Roy Mehdi Zeighami <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Using PORT
Date: Sat, 14 Jan 2006 20:06:54 -0800
Lines: 25
Distribution: su
Message-ID: <Pine.GSO.4.44.0601142002090.24607-100000@elaine30.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9445

Hello...

I am trying to using the PORT command but my program never wakes up from
the accept call.  I have an ftp daemon that prints out the commands as it
gets them. For example, I see the line

PORT set to 15.99.202.18 - 52768 (206,51)

and I get the success response from the server.  However, my program never
wakes up from the accept.  I am sure this ip address and port number are
correct because I can write a little toy program to connect to this port
and the program returns from accept.

Also, I was watching the tcp traffic with tcpdump and don't see the syn
packet.

Is there something else I have to do after calling port to make the server
call me back?

I am probably missing something obvious.

Thanks,

Roy

.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: 2MSL Delay on Web Servers
Date: Sat, 14 Jan 2006 20:23:56 -0800
Lines: 29
Distribution: su
Message-ID: <dqcip0$alv$1@news.Stanford.EDU>
References: <dqcc53$54j$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqcc53$54j$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9446

On each side of a TCP connection, the connection is identified by (local 
ip, local port, dest ip, dest port).  So on connection teardown, the 
closing side waits for 2MSL before allowing a new connection with the 
same two ip/port pairs.

So yes, after I've connected to a web server and the connection closed, 
I can't reuse my same local port if I want to immediately open a new 
connection... the server wouldn't allow that.  I need a different port, 
and, presumably, when I call bind() again the OS knows to give me a 
different one.  The OS probably just cycles through available ports, 
exactly because of this problem.

Hope that's clear.

-Matt


Mark Slee wrote:
> Just out of curiosity, how do large servers that accept many connections 
> on the same port deal with the 2MSL timeout issue? Our FTP client has to 
> choose a new port for each data connection because of the way TCP 
> enforces this timeout.
> 
> A server like Apache, however, can run many simultaneous connections on 
> the same port (i.e. 80). What's the distinction here? Are they using a 
> different type of socket?
> 
> Thanks,
> Mark
.

Path: shelby.stanford.edu!elaine24.Stanford.EDU!zeighami
From: Roy Mehdi Zeighami <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Using PORT
Date: Sat, 14 Jan 2006 20:25:49 -0800
Lines: 38
Distribution: su
Message-ID: <Pine.GSO.4.44.0601142024480.7253-100000@elaine24.Stanford.EDU>
References: <Pine.GSO.4.44.0601142002090.24607-100000@elaine30.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0601142002090.24607-100000@elaine30.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9447

Never mind...

I finally figured out you have to actually give a command that requires
that it call you back on the data connection ;)

Sorry for the spam.

Thanks, Roy

On Sat, 14 Jan 2006, Roy Mehdi Zeighami wrote:

> Hello...
>
> I am trying to using the PORT command but my program never wakes up from
> the accept call.  I have an ftp daemon that prints out the commands as it
> gets them. For example, I see the line
>
> PORT set to 15.99.202.18 - 52768 (206,51)
>
> and I get the success response from the server.  However, my program never
> wakes up from the accept.  I am sure this ip address and port number are
> correct because I can write a little toy program to connect to this port
> and the program returns from accept.
>
> Also, I was watching the tcp traffic with tcpdump and don't see the syn
> packet.
>
> Is there something else I have to do after calling port to make the server
> call me back?
>
> I am probably missing something obvious.
>
> Thanks,
>
> Roy
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: 2MSL delay
Date: Sat, 14 Jan 2006 20:31:08 -0800
Lines: 14
Distribution: su
Message-ID: <dqcj6g$b23$1@news.Stanford.EDU>
References: <dqcdi3$5lq$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqcdi3$5lq$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9448

SO_REUSEADDR is probably useful in some cases, but definately not for 
this project.  The waiting is there for good reason, we'll cover it when 
we talk about TCP in a few weeks.

-Matt

Stefan Thomas Mohler wrote:
> never done it, but it was mentioned in another class..
> 
> If you want, you can flag the adress not to wait.  If fd is the socket you
> are listening on:
> 
> int n = 1;
> setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &n, sizeof(n))
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: 2MSL delay
Date: Sat, 14 Jan 2006 20:37:10 -0800
Lines: 20
Distribution: su
Message-ID: <dqcjhq$b23$2@news.Stanford.EDU>
References: <dqcdi3$5lq$1@news.Stanford.EDU> <dqcj6g$b23$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqcj6g$b23$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9449

Oops, I didn't realize you were responding to the above post about web 
servers.  Yeah, maybe web servers use it.

Matt Falkenhagen wrote:
> SO_REUSEADDR is probably useful in some cases, but definately not for 
> this project.  The waiting is there for good reason, we'll cover it when 
> we talk about TCP in a few weeks.
> 
> -Matt
> 
> Stefan Thomas Mohler wrote:
> 
>> never done it, but it was mentioned in another class..
>>
>> If you want, you can flag the adress not to wait.  If fd is the socket 
>> you
>> are listening on:
>>
>> int n = 1;
>> setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &n, sizeof(n))
.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: tcpdump?
Date: Sat, 14 Jan 2006 22:03:26 -0800
Lines: 7
Distribution: su
Message-ID: <dqcoer$f7e$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:9450

I can't seem to find tcpdump on the elaines, anyone know where it is (or
something equivalent)?

Thanks,
Waynn


.

Path: shelby.stanford.edu!not-for-mail
From: "Kevin Hart" <kevin.hart@hp.com>
Newsgroups: su.class.cs244a
Subject: Purify and memory leaks
Date: Sat, 14 Jan 2006 23:40:12 -0700
Lines: 5
Distribution: su
Message-ID: <dqcqoe$h8h$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9451

If you dynamically allocate memory and then don't free it before the program 
ends, isn't Purify supposed to report that as a memory leak?  For some 
reason Purify does not report any memory leaks when I run echodemo. 


.

Path: shelby.stanford.edu!saga12.Stanford.EDU!vijayk
From: Vijay K Kulkarni <vijayk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: tcpdump?
Date: Sun, 15 Jan 2006 00:58:26 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.GSO.4.44.0601150058001.5632-100000@saga12.Stanford.EDU>
References: <dqcoer$f7e$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
To: Waynn Lue <wlue@stanford.edu>
In-Reply-To: <dqcoer$f7e$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9452

same here..I can't find it on saga.

thanks,
Vijay.

On Sat, 14 Jan 2006, Waynn Lue wrote:

> I can't seem to find tcpdump on the elaines, anyone know where it is (or
> something equivalent)?
>
> Thanks,
> Waynn
>
>
>

.

Path: shelby.stanford.edu!saga12.Stanford.EDU!vijayk
From: Vijay K Kulkarni <vijayk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PORT command
Date: Sun, 15 Jan 2006 01:52:28 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0601150145020.6286-100000@saga12.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9453

Hi,
    I am ending up with sending client's IP address as zeros in the
PORT command as after the bind with INADDR_ANY and getsockname() for the
client_addr, the client_addr.sin_addr.s_addr is still set to zero. The
client_addr.sin_port seems to be picking up the port number correctly
after the bind but the ip address is all zeros. Is this expected? Client
side accept hangs on the data port while waiting to hear from the server.

thanks,
Vijay.

.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PORT command
Date: Sun, 15 Jan 2006 02:38:17 -0800
Lines: 23
Distribution: su
Message-ID: <dqd8mp$1fe$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601150145020.6286-100000@saga12.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <Pine.GSO.4.44.0601150145020.6286-100000@saga12.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9454

The reason accept() hangs is that the server hasn't connected to the 
client yet, most likely because it doesn't know the client's IP.

I struggled with the same problem for a couple of hours. The answer lies 
within the newsgroup posts from previous years. I would start here:

http://www.stanford.edu/class/cs244a/news/news2002.html#2448

-Naeim


Vijay K Kulkarni wrote:
> Hi,
>     I am ending up with sending client's IP address as zeros in the
> PORT command as after the bind with INADDR_ANY and getsockname() for the
> client_addr, the client_addr.sin_addr.s_addr is still set to zero. The
> client_addr.sin_port seems to be picking up the port number correctly
> after the bind but the ip address is all zeros. Is this expected? Client
> side accept hangs on the data port while waiting to hear from the server.
> 
> thanks,
> Vijay.
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PORT command
Date: Sun, 15 Jan 2006 10:43:22 -0800
Lines: 20
Distribution: su
Message-ID: <dqe54f$rak$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601150145020.6286-100000@saga12.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601150145020.6286-100000@saga12.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9455

I saw this too.  I'm no expert, but from what I read, I don't think 
getsockname is supposed to fill in the address.  I used 
gethostbyname(getenv("HOST")), which fills a hostent object, and then 
inet_ntop, as described in stevens, to get the address in "presentation" 
form for the PORT command.

Steve

Vijay K Kulkarni wrote:
> Hi,
>     I am ending up with sending client's IP address as zeros in the
> PORT command as after the bind with INADDR_ANY and getsockname() for the
> client_addr, the client_addr.sin_addr.s_addr is still set to zero. The
> client_addr.sin_port seems to be picking up the port number correctly
> after the bind but the ip address is all zeros. Is this expected? Client
> side accept hangs on the data port while waiting to hear from the server.
> 
> thanks,
> Vijay.
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Sesha Narahari <narahari@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PORT command
Date: Sun, 15 Jan 2006 12:48:04 -0800
Lines: 32
Distribution: su
Message-ID: <43CAB504.9030301@stanford.edu>
References: <Pine.GSO.4.44.0601150145020.6286-100000@saga12.Stanford.EDU> <dqd8mp$1fe$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9456

Here are some options & sample code:

http://www.stanford.edu/class/cs244a/news/news2004.html#4952

Sesha

Naeim Semsarilar wrote:
> The reason accept() hangs is that the server hasn't connected to the 
> client yet, most likely because it doesn't know the client's IP.
> 
> I struggled with the same problem for a couple of hours. The answer lies 
> within the newsgroup posts from previous years. I would start here:
> 
> http://www.stanford.edu/class/cs244a/news/news2002.html#2448
> 
> -Naeim
> 
> 
> Vijay K Kulkarni wrote:
> 
>> Hi,
>>     I am ending up with sending client's IP address as zeros in the
>> PORT command as after the bind with INADDR_ANY and getsockname() for the
>> client_addr, the client_addr.sin_addr.s_addr is still set to zero. The
>> client_addr.sin_port seems to be picking up the port number correctly
>> after the bind but the ip address is all zeros. Is this expected? Client
>> side accept hangs on the data port while waiting to hear from the server.
>>
>> thanks,
>> Vijay.
>>

.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Running purify remotely
Date: Sun, 15 Jan 2006 12:51:50 -0800
Lines: 38
Distribution: su
Message-ID: <dqecla$4p2$1@news.Stanford.EDU>
References: <dq72q0$fsl$1@news.Stanford.EDU> <dq75v9$ik8$1@news.Stanford.EDU> <dq774o$jnj$1@news.Stanford.EDU> <dqbuut$mdh$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqbuut$mdh$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9457

I haven't experienced any problems, running on Cygwin.X. I connected to 
elaine.stanford.edu using Putty, with the Enable X Forwarding option 
checked. If you are still having problems you can always set the 
-windows=no option (from the shell type:
setenv PURIFYOPTIONS "-windows=no -log-file=purify.output")
to have purify write its output to a log file.

Ari

Mark Slee wrote:
> I have the same issue, also running on Cygwin/X. Locks up the entire ssh 
> session.
> 
> Krishna Monian wrote:
> 
>> The purify windo pops up for me and then the whole thing just hangs. I 
>> cant really do anything. However running it without windows seems to 
>> work ok.
>>
>> Thanks
>> Krishna
>>
>> "Matt Falkenhagen" <mjf@stanford.edu> wrote in message 
>> news:dq75v9$ik8$1@news.Stanford.EDU...
>>
>>> Is there a specific issue you're worried about or seeing?  It 
>>> shouldn't be a problem... personally I can't click on the Purify 
>>> menus when using Cygwin/X, but I never really had to use the menus 
>>> anyway.
>>>
>>> -Matt
>>>
>>> Krishna Monian wrote:
>>>
>>>> Are there issues in running purify remotely with window exporting?
>>>>
>>
>>
.

Path: shelby.stanford.edu!not-for-mail
From: Sesha Narahari <narahari@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftpd problem
Date: Sun, 15 Jan 2006 12:55:23 -0800
Lines: 9
Distribution: su
Message-ID: <43CAB6BB.4090709@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9458

When I try to connect to my instance of ftpd, I see this:

62461@elaine1: unknown host or invalid literal address

Using elaine1.stanford.edu or elaine doesnt seem to help.

Thanks,
Sesha

.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PORT command
Date: Sun, 15 Jan 2006 13:08:32 -0800
Lines: 20
Distribution: su
Message-ID: <dqedkg$5ms$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601150145020.6286-100000@saga12.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:9459

I just used getsockname on the server socket, and then looked at the
struct's .sin_addr.s_addr field.

Waynn

"Vijay K Kulkarni" <vijayk@stanford.edu> wrote in message
news:Pine.GSO.4.44.0601150145020.6286-100000@saga12.Stanford.EDU...
> Hi,
>     I am ending up with sending client's IP address as zeros in the
> PORT command as after the bind with INADDR_ANY and getsockname() for the
> client_addr, the client_addr.sin_addr.s_addr is still set to zero. The
> client_addr.sin_port seems to be picking up the port number correctly
> after the bind but the ip address is all zeros. Is this expected? Client
> side accept hangs on the data port while waiting to hear from the server.
>
> thanks,
> Vijay.
>


.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!olegs
From: olegs@Stanford.EDU (Oleg Slezberg)
Newsgroups: su.class.cs244a
Subject: Re: ftpd problem
Date: Sun, 15 Jan 2006 21:08:46 +0000 (UTC)
Organization: Stanford University, CA 94305, USA
Lines: 19
Distribution: su
Message-ID: <dqedku$5nn$1@news.Stanford.EDU>
References: <43CAB6BB.4090709@stanford.edu>
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9460

You likely have your port number defined as a 2-byte signed
integer. Try to use 2-byte unsigned instead. This solved it 
for me.

Oleg.

In article <43CAB6BB.4090709@stanford.edu>,
Sesha Narahari  <narahari@stanford.edu> wrote:
>When I try to connect to my instance of ftpd, I see this:
>
>62461@elaine1: unknown host or invalid literal address
>
>Using elaine1.stanford.edu or elaine doesnt seem to help.
>
>Thanks,
>Sesha
>


.

Path: shelby.stanford.edu!not-for-mail
From: Sesha Narahari <narahari@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftpd problem
Date: Sun, 15 Jan 2006 13:20:35 -0800
Lines: 29
Distribution: su
Message-ID: <43CABCA3.9000507@stanford.edu>
References: <43CAB6BB.4090709@stanford.edu> <dqedku$5nn$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9461

I am just using the stock ftp client to connect to the ftpd. Not my 
ftpcopy code.

Thanks,
Sesha

Oleg Slezberg wrote:
> You likely have your port number defined as a 2-byte signed
> integer. Try to use 2-byte unsigned instead. This solved it 
> for me.
> 
> Oleg.
> 
> In article <43CAB6BB.4090709@stanford.edu>,
> Sesha Narahari  <narahari@stanford.edu> wrote:
> 
>>When I try to connect to my instance of ftpd, I see this:
>>
>>62461@elaine1: unknown host or invalid literal address
>>
>>Using elaine1.stanford.edu or elaine doesnt seem to help.
>>
>>Thanks,
>>Sesha
>>
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Stefan Thomas Mohler <smohler@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PASV vs PORT
Date: Sun, 15 Jan 2006 23:26:49 +0000 (UTC)
Lines: 4
Distribution: su
Message-ID: <dqelnp$cv7$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:9462


I thought this was covered in the review session but I am not sure.  Are we
allowed to use PASV instead of PORT?

.

Path: shelby.stanford.edu!not-for-mail
From: Samantha Kwan Chan <huichan@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: deliverable echodemo
Date: Mon, 16 Jan 2006 00:14:23 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <dqeogv$eir$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.6.14.2smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:9463

what is the actual deliverable regarding the echodemo?  Are we suppose to
turn in the fixed code besides the writeup? or should it be just a writeup
and no code involved?  The homework sheet is unclear on this.

-S.
.

Path: shelby.stanford.edu!not-for-mail
From: Mark Slee <mcslee@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftpparse() determining symlinks?
Date: Sun, 15 Jan 2006 16:40:00 -0800
Lines: 16
Distribution: su
Message-ID: <dqeq1e$ghq$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9464

The FAQ states:

Q9. How do I handle symbolic links?

A. You don't. If ftpparse() indicates that a directory entry is a 
symbolic link, you can just ignore it during processing.

Maybe I'm missing something, but it doesn't seem like ftpparse() really 
tells us whether something is a symbolic link or not. What should be the 
rule on determining this?

It seems like if both flagtrycwd and flagtryretr are set then the item 
is most likely a symbolic link. Can we use this as a criteria?

Thanks,
Mark
.

Path: shelby.stanford.edu!not-for-mail
From: Hector Chan <chanhp@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: FTP: the "." and ".." directories
Date: Mon, 16 Jan 2006 03:08:38 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <dqf2nm$o2u$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:9465

Hi,

How are we going treat the "." and ".." directories?  Should we just ignore them?

Thanks,
Hector
.

Path: shelby.stanford.edu!not-for-mail
From: Jens Pillgram-Larsen <jenspl@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Allowing scripting wrappers
Date: Sun, 15 Jan 2006 20:15:27 -0800
Lines: 10
Distribution: su
Message-ID: <dqf6l0$ra0$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9466

I was just wondering if you guys would consider allowing us to write 
wrappers for our programs in a scripting language. I find myself 
spending most of my time doing string parsing, which I don't really 
think is the point of this class. If I was allowed to write a Perl 
wrapper I would be able to concentrate much more on the networking 
programming.

Just my 2 cents.

Jens.
.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!zeighami
From: Roy Mehdi Zeighami <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: local and remote paths
Date: Sun, 15 Jan 2006 21:03:47 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0601152102070.17348-100000@elaine1.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9467

Can we assume that the local and remote paths are absolute, or should we
handle relative paths as well?

Thanks,

Roy

.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: tcpdump?
Date: Sun, 15 Jan 2006 22:19:10 -0800
Lines: 23
Distribution: su
Message-ID: <dqfdt6$4o7$1@news.Stanford.EDU>
References: <dqcoer$f7e$1@news.Stanford.EDU> <Pine.GSO.4.44.0601150058001.5632-100000@saga12.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601150058001.5632-100000@saga12.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9468

Does /usr/class/cs244a/bin/tcpdump not work on these machines?

Ari

Vijay K Kulkarni wrote:
> same here..I can't find it on saga.
> 
> thanks,
> Vijay.
> 
> On Sat, 14 Jan 2006, Waynn Lue wrote:
> 
> 
>>I can't seem to find tcpdump on the elaines, anyone know where it is (or
>>something equivalent)?
>>
>>Thanks,
>>Waynn
>>
>>
>>
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: local and remote paths
Date: Sun, 15 Jan 2006 22:20:52 -0800
Lines: 12
Distribution: su
Message-ID: <dqfe0b$4o7$2@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601152102070.17348-100000@elaine1.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601152102070.17348-100000@elaine1.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9469

You should handle absolute and relative paths.

Ari

Roy Mehdi Zeighami wrote:
> Can we assume that the local and remote paths are absolute, or should we
> handle relative paths as well?
> 
> Thanks,
> 
> Roy
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: deliverable echodemo
Date: Sun, 15 Jan 2006 22:22:19 -0800
Lines: 10
Distribution: su
Message-ID: <dqfe32$4o7$3@news.Stanford.EDU>
References: <dqeogv$eir$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqeogv$eir$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9470

Just the writeup is fine.

Ari

Samantha Kwan Chan wrote:
> what is the actual deliverable regarding the echodemo?  Are we suppose to
> turn in the fixed code besides the writeup? or should it be just a writeup
> and no code involved?  The homework sheet is unclear on this.
> 
> -S.
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PASV vs PORT
Date: Sun, 15 Jan 2006 22:57:02 -0800
Lines: 8
Distribution: su
Message-ID: <dqfg48$6kq$1@news.Stanford.EDU>
References: <dqelnp$cv7$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqelnp$cv7$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9471

You can use PASV, but we recommend using PORT.

Ari

Stefan Thomas Mohler wrote:
> I thought this was covered in the review session but I am not sure.  Are we
> allowed to use PASV instead of PORT?
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Nick Puz <npuz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: using snprintf
Date: Sun, 15 Jan 2006 22:57:32 -0800
Lines: 39
Distribution: su
Message-ID: <dqfg50$6l9$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601141138060.23768-100000@elaine24.Stanford.EDU> <dqbo59$hba$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqbo59$hba$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9472

Hi Matt,
So just to clarify, is it ok to use other C99 features (such as 
stdbool.h) that compile with -ansi ?
-nick

Matt Falkenhagen wrote:
> snprintf is a C99 function.  We require your code to compile with the 
> gcc -ansi flag (old C89).  That's probably what you're doing and why 
> you're getting that warning: -ansi won't include the declaration of 
> snprintf.
> 
> In general, you can't use C99 features, but functions like snprintf that 
> were widely available before C99 are fine.  Basically, if your code 
> compiles under -ansi, you should be ok.
> 
> In this case, to fix the warning, just add a prototype for snprintf:
> 
> extern int snprintf(char *s, size_t n, const char *fmt, ...);
> 
> -Matt
> 
> Roy Mehdi Zeighami wrote:
> 
>> Hello...
>>
>> Is anyone else using snprintf?  gcc compiles with warnings when I use it.
>> It says:
>>
>> warning: implicit declaration of function 'snprintf'
>>
>> but seems to work fine.  The man page says I need to include stdio.h but
>> that doesn't seem to shut it up.
>>
>> Any suggestions?
>>
>> Thanks,
>>
>> Roy
>>
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: FTP: the "." and ".." directories
Date: Sun, 15 Jan 2006 23:06:43 -0800
Lines: 9
Distribution: su
Message-ID: <dqfgmb$72q$1@news.Stanford.EDU>
References: <dqf2nm$o2u$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqf2nm$o2u$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9473

Yep.

Hector Chan wrote:
> Hi,
> 
> How are we going treat the "." and ".." directories?  Should we just ignore them?
> 
> Thanks,
> Hector
.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: tcpdump?
Date: Sun, 15 Jan 2006 23:52:49 -0800
Lines: 33
Distribution: su
Message-ID: <dqfjci$b0o$1@news.Stanford.EDU>
References: <dqcoer$f7e$1@news.Stanford.EDU> <Pine.GSO.4.44.0601150058001.5632-100000@saga12.Stanford.EDU> <dqfdt6$4o7$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:9474

elaine26:~/cs244a/hw1> /usr/class/cs244a/bin/tcpdump
tcpdump: /dev/eri: Permission denied

You have to be root to run tcpdump, right?  Is there any way to get it to
work?

"Ari Greenberg" <arigreen@cs.stanford.edu> wrote in message
news:dqfdt6$4o7$1@news.Stanford.EDU...
> Does /usr/class/cs244a/bin/tcpdump not work on these machines?
>
> Ari
>
> Vijay K Kulkarni wrote:
> > same here..I can't find it on saga.
> >
> > thanks,
> > Vijay.
> >
> > On Sat, 14 Jan 2006, Waynn Lue wrote:
> >
> >
> >>I can't seem to find tcpdump on the elaines, anyone know where it is (or
> >>something equivalent)?
> >>
> >>Thanks,
> >>Waynn
> >>
> >>
> >>
> >
> >


.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftpparse() determining symlinks?
Date: Mon, 16 Jan 2006 00:11:23 -0800
Lines: 22
Distribution: su
Message-ID: <dqfkfi$cdq$1@news.Stanford.EDU>
References: <dqeq1e$ghq$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqeq1e$ghq$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9475

Yes, it's fair to assume that a file is a symlink if and only if both 
flagtycmd and flagtryretr are set.

Ari

Mark Slee wrote:
> The FAQ states:
> 
> Q9. How do I handle symbolic links?
> 
> A. You don't. If ftpparse() indicates that a directory entry is a 
> symbolic link, you can just ignore it during processing.
> 
> Maybe I'm missing something, but it doesn't seem like ftpparse() really 
> tells us whether something is a symbolic link or not. What should be the 
> rule on determining this?
> 
> It seems like if both flagtrycwd and flagtryretr are set then the item 
> is most likely a symbolic link. Can we use this as a criteria?
> 
> Thanks,
> Mark
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Purify and memory leaks
Date: Mon, 16 Jan 2006 00:13:25 -0800
Lines: 28
Distribution: su
Message-ID: <dqfkjd$cdq$2@news.Stanford.EDU>
References: <dqcqoe$h8h$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqcqoe$h8h$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9476

 From a previous year's newsgroup:

My experience has been that purify will catch memory leaks for memory 
that is no longer accessible by any pointer in the program.  If you 
malloc memory, retain the pointer to it, and just fail to free the 
memory, purify doesn't consider it a leak.  This jives with the text 
from the purify man page (a great source of more info on purify):

      The memory leak message reports blocks on the heap which are
      no  longer  accessible  through any pointer, which have been
      leaked since the program started or since the last  call  to
      purify_new_leaks().   Other  functions  can  be  invoked  to
      profile non-leaked blocks, or to list all  leaks  or  blocks
      instead of just those generated since the last call.

Purify would consider something like this to be a leak:

         my_ptr = (char*) malloc(10);
         my_ptr = (char*) malloc(5);

since the malloc of 10 bytes no longer has any pointer to it.

Kevin Hart wrote:
> If you dynamically allocate memory and then don't free it before the program 
> ends, isn't Purify supposed to report that as a memory leak?  For some 
> reason Purify does not report any memory leaks when I run echodemo. 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: /usr/include/limits.h
Date: Mon, 16 Jan 2006 03:18:21 -0800
Lines: 8
Distribution: su
Message-ID: <dqfvds$mha$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:9477

I'm trying to use the #defines in limits.h, and I've #included <limits.h>,
but none of the numbers there seem defined.  I can just write my own in my
file, but does anyone know what I'm doing wrong?  What do I need to do
besides #include to get it to work?

Waynn


.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PORT command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 08:58:36 -0800
Lines: 9
Distribution: su
Message-ID: <dqgjbt$d3k$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9478

Hello,

I'm having a problem with the PORT command. The server 
ftp.cs.stanford.edu doesn't respond to the command. I've
tried different servers (ftp.microsoft.com, ftp.stanford.edu,
etc...), and it works fine. Any idea why this is happening?

Thank you,
--Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PORT command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 09:29:57 -0800
Lines: 29
Distribution: su
Message-ID: <dqgl6s$esb$1@news.Stanford.EDU>
References: <dqgjbt$d3k$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqgjbt$d3k$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9479

I'm getting this same behavior.  Clearly the server is not connecting to 
the data socket we open for it, which makes me think that we are sending 
incorrect IP and/or port info.  At first I thought it had to do with 
byte ordering, since it works on some servers but not others.  Now I am 
thinking it has to do with how we determine our own IP address.  In a 
previous post, someone said that getsockname populates the port info in 
the sockaddr_in struct, but not the IP address info.  That was what 
happened with me.  So I used gethostbyname on getenv("HOST") to get the 
IP.  I am starting to think that this may not *always* be the correct IP 
to send to the server.  So, to Wayne Lue: I wonder why getsockname gives 
some of us IP info and others only port info.  To everyone: any ideas?

Thanks,
Steve

PS -- Servers that my program works on: ftp.stanford.edu, 
ftp.microsoft.com.  Servers where it doesn't: ftp.cs.stanford.edu, 
ftp.fedworld.gov.

Michi Mutsuzaki wrote:
> Hello,
> 
> I'm having a problem with the PORT command. The server 
> ftp.cs.stanford.edu doesn't respond to the command. I've
> tried different servers (ftp.microsoft.com, ftp.stanford.edu,
> etc...), and it works fine. Any idea why this is happening?
> 
> Thank you,
> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: using snprintf
Date: Mon, 16 Jan 2006 09:45:33 -0800
Lines: 64
Distribution: su
Message-ID: <dqgm44$fcp$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601141138060.23768-100000@elaine24.Stanford.EDU> <dqbo59$hba$1@news.Stanford.EDU> <dqfg50$6l9$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqfg50$6l9$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9480

No, please don't include header files that were introduced in C99 and 
not available before.

The reasons for disallowing C99 are:

1. To ensure compatibility with the grading scripts and later 
assignments, which have only been tested with C89.
2. To help TA's grade.  I don't know about Ari, but I'm not greatly 
familiar with all the new C99 features...

I find it surprising that stdbool.h works under -ansi, because it relies 
on the new C99 type _Bool, but I guess it does.

Anyway, it should be easy to define your own bool type:

typedef enum { FALSE, TRUE } bool;

or something like that.  Were there any other C99 libraries you were 
planning on using?

-Matt

Nick Puz wrote:
> Hi Matt,
> So just to clarify, is it ok to use other C99 features (such as 
> stdbool.h) that compile with -ansi ?
> -nick
> 
> Matt Falkenhagen wrote:
> 
>> snprintf is a C99 function.  We require your code to compile with the 
>> gcc -ansi flag (old C89).  That's probably what you're doing and why 
>> you're getting that warning: -ansi won't include the declaration of 
>> snprintf.
>>
>> In general, you can't use C99 features, but functions like snprintf 
>> that were widely available before C99 are fine.  Basically, if your 
>> code compiles under -ansi, you should be ok.
>>
>> In this case, to fix the warning, just add a prototype for snprintf:
>>
>> extern int snprintf(char *s, size_t n, const char *fmt, ...);
>>
>> -Matt
>>
>> Roy Mehdi Zeighami wrote:
>>
>>> Hello...
>>>
>>> Is anyone else using snprintf?  gcc compiles with warnings when I use 
>>> it.
>>> It says:
>>>
>>> warning: implicit declaration of function 'snprintf'
>>>
>>> but seems to work fine.  The man page says I need to include stdio.h but
>>> that doesn't seem to shut it up.
>>>
>>> Any suggestions?
>>>
>>> Thanks,
>>>
>>> Roy
>>>
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Purify and the test script
Date: Mon, 16 Jan 2006 11:22:41 -0800
Lines: 9
Distribution: su
Message-ID: <dqgrq7$ks4$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9481

My program is failing the last test in the script, the one that checks 
if we "actually used purify."  I have no memory leaks and no open file 
descriptors (except the .name_service_door, which we were instructed to 
ignore).  From what I can tell, I am error free.  Is there something I 
need to put in my .purify file (besides to two suggestions on the purify 
FAQ) to suppress whatever data is causing the failure?

Thanks,
Steve
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Purify and the test script
Date: Mon, 16 Jan 2006 11:25:21 -0800
Lines: 92
Distribution: su
Message-ID: <dqgrv8$ks4$2@news.Stanford.EDU>
References: <dqgrq7$ks4$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqgrq7$ks4$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9482

Actually, I don't really know if I'm error free since I've never used 
Purify before.  Here is my output:

saga2:~/class/cs244a/ftp> ./ftpcopy.purify mif 5 ftp.slac.stanford.edu 
test /doc
****  Purify instrumented ftpcopy.purify (pid 15431 at Mon Jan 16 
11:18:55 2006)
   * Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) 
Copyright IBM Corp. 1992, 2005 All rights reserved.
   * For contact information type: "purify -help"
   * For Purify Viewer output, set the DISPLAY environment variable.
   * Options settings: -purify -cache-dir=/tmp/rational.goldmasd \
     -cache-dir=/tmp/goldmasd -best-effort -linker=/usr/pubsw/bin/ld \
     -demangle-program=/usr/pubsw/bin/c++filt \
 
-purify-home=/usr/pubsw/apps/rational-2003.06.13/releases/purify.sol.2003a.06.13.FixPack.0172 
\
     -gcc3_path=/usr/pubsw/package/Languages/gcc-3.4.4/sun4x_58/bin/gcc \
     -cache-dir=/tmp/rational.goldmasd
   * License successfully checked out.
   * Command-line: ./ftpcopy.purify mif 5 ftp.slac.stanford.edu test /doc
OK: 966077 bytes copied

****  Purify instrumented ftpcopy.purify (pid 15431)  ****
Current file descriptors in use: 6
FIU: file descriptor 0: <stdin>
FIU: file descriptor 1: <stdout>
FIU: file descriptor 2: <stderr>
FIU: file descriptor 4: "/etc/.name_service_door", O_RDONLY
    * File info: ?r--r--r--  1 root     root             0 Jul  5  2001
    * This file descriptor was allocated from:
         __open64       [libc.so.1]
         _open64        [libc.so.1]
         _nsc_trydoorcall [libc.so.1]
         _door_gethostbyname_r [gethostby_door.c]
         _get_hostserv_inetnetdir_byname [netdir_inet.c]
         gethostbyname_r [gethostbyname_r.c]
FIU: file descriptor 26: <reserved for Purify internal use>
FIU: file descriptor 27: <reserved for Purify internal use>

****  Purify instrumented ftpcopy.purify (pid 15431)  ****
Purify: Searching for all memory leaks...

Memory leaked: 0 bytes (0%); potentially leaked: 0 bytes (0%)

Purify Heap Analysis (combining suppressed and unsuppressed blocks)
                          Blocks        Bytes
               Leaked          0            0
   Potentially Leaked          0            0
               In-Use         50         3195
   ----------------------------------------
      Total Allocated         50         3195

****  Purify instrumented ftpcopy.purify (pid 15431)  ****
   * Program exited with status code 0.
   * 0 access errors, 0 total occurrences.
   * 0 bytes leaked.
   * 0 bytes potentially leaked.
   * Basic memory usage (including Purify overhead):
     333868 code
     126032 data/bss
     32768 heap (peak use)
     2168 stack
   * Shared library memory usage (including Purify overhead):
     992 libpure_solaris2_init.so.1 (shared code)
     280 libpure_solaris2_init.so.1 (private data)
     57648 libsocket.so.1_pure_p3_c0_101102117_58_32 (shared code)
     4984 libsocket.so.1_pure_p3_c0_101102117_58_32 (private data)
     984416 libnsl.so.1_pure_p3_c0_101102117_58_32 (shared code)
     64224 libnsl.so.1_pure_p3_c0_101102117_58_32 (private data)
     1107224 libc.so.1_pure_p3_c0_101102117_58_32 (shared code)
     31348 libc.so.1_pure_p3_c0_101102117_58_32 (private data)
     2512 libdl.so.1_pure_p3_c0_101102117_58_32 (shared code)
     76 libdl.so.1_pure_p3_c0_101102117_58_32 (private data)
     15416 libinternal_stubs.so.1 (shared code)
     1044 libinternal_stubs.so.1 (private data)
     16520 libmp.so.2_pure_p3_c0_101102117_58_32 (shared code)
     892 libmp.so.2_pure_p3_c0_101102117_58_32 (private data)
     3476 libc_psr.so.1_pure_p3_c0_101102117_58_32 (shared code)
     76 libc_psr.so.1_pure_p3_c0_101102117_58_32 (private data)


Steve Goldman wrote:
> My program is failing the last test in the script, the one that checks 
> if we "actually used purify."  I have no memory leaks and no open file 
> descriptors (except the .name_service_door, which we were instructed to 
> ignore).  From what I can tell, I am error free.  Is there something I 
> need to put in my .purify file (besides to two suggestions on the purify 
> FAQ) to suppress whatever data is causing the failure?
> 
> Thanks,
> Steve
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Purify and the test script
Date: Mon, 16 Jan 2006 12:13:27 -0800
Lines: 103
Distribution: su
Message-ID: <dqgupe$npe$1@news.Stanford.EDU>
References: <dqgrq7$ks4$1@news.Stanford.EDU> <dqgrv8$ks4$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqgrv8$ks4$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9483

Please see my post under "test_code script issues" on 1/13/2006 2:35 AM.

In addition, all Test O checks is whether you actually ran purify and 
included the output in your submission.  It doesn't matter whether you 
are error-free or not.  We run your code again with purify in Test M and 
N and check for errors there.  So if those passed, you are fine.

-Matt

Steve Goldman wrote:
> Actually, I don't really know if I'm error free since I've never used 
> Purify before.  Here is my output:
> 
> saga2:~/class/cs244a/ftp> ./ftpcopy.purify mif 5 ftp.slac.stanford.edu 
> test /doc
> ****  Purify instrumented ftpcopy.purify (pid 15431 at Mon Jan 16 
> 11:18:55 2006)
>   * Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) 
> Copyright IBM Corp. 1992, 2005 All rights reserved.
>   * For contact information type: "purify -help"
>   * For Purify Viewer output, set the DISPLAY environment variable.
>   * Options settings: -purify -cache-dir=/tmp/rational.goldmasd \
>     -cache-dir=/tmp/goldmasd -best-effort -linker=/usr/pubsw/bin/ld \
>     -demangle-program=/usr/pubsw/bin/c++filt \
> 
> -purify-home=/usr/pubsw/apps/rational-2003.06.13/releases/purify.sol.2003a.06.13.FixPack.0172 
> \
>     -gcc3_path=/usr/pubsw/package/Languages/gcc-3.4.4/sun4x_58/bin/gcc \
>     -cache-dir=/tmp/rational.goldmasd
>   * License successfully checked out.
>   * Command-line: ./ftpcopy.purify mif 5 ftp.slac.stanford.edu test /doc
> OK: 966077 bytes copied
> 
> ****  Purify instrumented ftpcopy.purify (pid 15431)  ****
> Current file descriptors in use: 6
> FIU: file descriptor 0: <stdin>
> FIU: file descriptor 1: <stdout>
> FIU: file descriptor 2: <stderr>
> FIU: file descriptor 4: "/etc/.name_service_door", O_RDONLY
>    * File info: ?r--r--r--  1 root     root             0 Jul  5  2001
>    * This file descriptor was allocated from:
>         __open64       [libc.so.1]
>         _open64        [libc.so.1]
>         _nsc_trydoorcall [libc.so.1]
>         _door_gethostbyname_r [gethostby_door.c]
>         _get_hostserv_inetnetdir_byname [netdir_inet.c]
>         gethostbyname_r [gethostbyname_r.c]
> FIU: file descriptor 26: <reserved for Purify internal use>
> FIU: file descriptor 27: <reserved for Purify internal use>
> 
> ****  Purify instrumented ftpcopy.purify (pid 15431)  ****
> Purify: Searching for all memory leaks...
> 
> Memory leaked: 0 bytes (0%); potentially leaked: 0 bytes (0%)
> 
> Purify Heap Analysis (combining suppressed and unsuppressed blocks)
>                          Blocks        Bytes
>               Leaked          0            0
>   Potentially Leaked          0            0
>               In-Use         50         3195
>   ----------------------------------------
>      Total Allocated         50         3195
> 
> ****  Purify instrumented ftpcopy.purify (pid 15431)  ****
>   * Program exited with status code 0.
>   * 0 access errors, 0 total occurrences.
>   * 0 bytes leaked.
>   * 0 bytes potentially leaked.
>   * Basic memory usage (including Purify overhead):
>     333868 code
>     126032 data/bss
>     32768 heap (peak use)
>     2168 stack
>   * Shared library memory usage (including Purify overhead):
>     992 libpure_solaris2_init.so.1 (shared code)
>     280 libpure_solaris2_init.so.1 (private data)
>     57648 libsocket.so.1_pure_p3_c0_101102117_58_32 (shared code)
>     4984 libsocket.so.1_pure_p3_c0_101102117_58_32 (private data)
>     984416 libnsl.so.1_pure_p3_c0_101102117_58_32 (shared code)
>     64224 libnsl.so.1_pure_p3_c0_101102117_58_32 (private data)
>     1107224 libc.so.1_pure_p3_c0_101102117_58_32 (shared code)
>     31348 libc.so.1_pure_p3_c0_101102117_58_32 (private data)
>     2512 libdl.so.1_pure_p3_c0_101102117_58_32 (shared code)
>     76 libdl.so.1_pure_p3_c0_101102117_58_32 (private data)
>     15416 libinternal_stubs.so.1 (shared code)
>     1044 libinternal_stubs.so.1 (private data)
>     16520 libmp.so.2_pure_p3_c0_101102117_58_32 (shared code)
>     892 libmp.so.2_pure_p3_c0_101102117_58_32 (private data)
>     3476 libc_psr.so.1_pure_p3_c0_101102117_58_32 (shared code)
>     76 libc_psr.so.1_pure_p3_c0_101102117_58_32 (private data)
> 
> 
> Steve Goldman wrote:
> 
>> My program is failing the last test in the script, the one that checks 
>> if we "actually used purify."  I have no memory leaks and no open file 
>> descriptors (except the .name_service_door, which we were instructed 
>> to ignore).  From what I can tell, I am error free.  Is there 
>> something I need to put in my .purify file (besides to two suggestions 
>> on the purify FAQ) to suppress whatever data is causing the failure?
>>
>> Thanks,
>> Steve
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Purify and the test script
Date: Mon, 16 Jan 2006 12:18:42 -0800
Lines: 26
Distribution: su
Message-ID: <dqgv32$o64$1@news.Stanford.EDU>
References: <dqgrq7$ks4$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqgrq7$ks4$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9484

The grading script output says:

purify.output did not match expected regexp:

   \* Purify 200\S+ Solaris 2 \(32-bit\) Copyright \(C\) 1992-200\d 
Rational Software Corp\.\s+All rights reserved\.

The corresponding line in my purify.output is:

   * Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) 
Copyright IBM Corp. 1992, 2005 All rights reserved.

If this is the only part of the file that doesn't match, then maybe it's 
a problem with the script?  Maybe the Purify people changed the 
copyright line in their output?

Steve Goldman wrote:
> My program is failing the last test in the script, the one that checks 
> if we "actually used purify."  I have no memory leaks and no open file 
> descriptors (except the .name_service_door, which we were instructed to 
> ignore).  From what I can tell, I am error free.  Is there something I 
> need to put in my .purify file (besides to two suggestions on the purify 
> FAQ) to suppress whatever data is causing the failure?
> 
> Thanks,
> Steve
.

Path: shelby.stanford.edu!not-for-mail
From: Ryan Matthew Smith <rysmi@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PORT command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 21:12:41 +0000 (UTC)
Lines: 52
Distribution: su
Message-ID: <dqh289$okn$1@news.Stanford.EDU>
References: <dqgjbt$d3k$1@news.Stanford.EDU> <dqgl6s$esb$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.6.12.6smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:9485

hey steve / michi -- 

i had this same problem with ftp.cs.stanford.edu, but it worked with
other servers. 

you might want to find out if you are hanging in the 
read() for the response to the PORT command or in the
accept() for the data socket. 

in the case of a the server never replying, check out question 2.11: 
http://www.unixguide.net/network/socketfaq/2.16.shtml

in my experience, the server will complain (give a 500 response) if you 
give it an IP that doesn't match where your control connection is from. 

(which does seem to disagree with the RFC, but it still seems
reasonable to not want to send data directly to a random host.)

thanks,
ryan. 


Steve Goldman <steve.goldman@stanford.edu> wrote:
> I'm getting this same behavior.  Clearly the server is not connecting to 
> the data socket we open for it, which makes me think that we are sending 
> incorrect IP and/or port info.  At first I thought it had to do with 
> byte ordering, since it works on some servers but not others.  Now I am 
> thinking it has to do with how we determine our own IP address.  In a 
> previous post, someone said that getsockname populates the port info in 
> the sockaddr_in struct, but not the IP address info.  That was what 
> happened with me.  So I used gethostbyname on getenv("HOST") to get the 
> IP.  I am starting to think that this may not *always* be the correct IP 
> to send to the server.  So, to Wayne Lue: I wonder why getsockname gives 
> some of us IP info and others only port info.  To everyone: any ideas?

> Thanks,
> Steve

> PS -- Servers that my program works on: ftp.stanford.edu, 
> ftp.microsoft.com.  Servers where it doesn't: ftp.cs.stanford.edu, 
> ftp.fedworld.gov.

> Michi Mutsuzaki wrote:
>> Hello,
>> 
>> I'm having a problem with the PORT command. The server 
>> ftp.cs.stanford.edu doesn't respond to the command. I've
>> tried different servers (ftp.microsoft.com, ftp.stanford.edu,
>> etc...), and it works fine. Any idea why this is happening?
>> 
>> Thank you,
>> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Drew Willcoxon <drew.willcoxon@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PORT command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 13:43:34 -0800
Lines: 23
Distribution: su
Message-ID: <dqh41d$shc$1@news.Stanford.EDU>
References: <dqgjbt$d3k$1@news.Stanford.EDU> <dqgl6s$esb$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <dqgl6s$esb$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9486

I think you can get the local IP address by calling getsockname on the 
*control* socket, not the *data* socket -- i.e., yeah, you have to call 
getsockname on the data socket to find out the port the OS assigned it, 
but this won't tell you the local IP.  But if you call getsockname on 
the control socket, it will.

Drew

Steve Goldman wrote:
> I'm getting this same behavior.  Clearly the server is not connecting to 
> the data socket we open for it, which makes me think that we are sending 
> incorrect IP and/or port info.  At first I thought it had to do with 
> byte ordering, since it works on some servers but not others.  Now I am 
> thinking it has to do with how we determine our own IP address.  In a 
> previous post, someone said that getsockname populates the port info in 
> the sockaddr_in struct, but not the IP address info.  That was what 
> happened with me.  So I used gethostbyname on getenv("HOST") to get the 
> IP.  I am starting to think that this may not *always* be the correct IP 
> to send to the server.  So, to Wayne Lue: I wonder why getsockname gives 
> some of us IP info and others only port info.  To everyone: any ideas?
> 
> Thanks,
> Steve
.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PORT command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 13:46:43 -0800
Lines: 64
Distribution: su
Message-ID: <dqh484$srp$1@news.Stanford.EDU>
References: <dqgjbt$d3k$1@news.Stanford.EDU> <dqgl6s$esb$1@news.Stanford.EDU> <dqh289$okn$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <dqh289$okn$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9487

Ryan,

I set the TCP_NODELAY option, and now it works! Thanks a lot for the info.

--Michi

Ryan Matthew Smith wrote:
> hey steve / michi -- 
> 
> i had this same problem with ftp.cs.stanford.edu, but it worked with
> other servers. 
> 
> you might want to find out if you are hanging in the 
> read() for the response to the PORT command or in the
> accept() for the data socket. 
> 
> in the case of a the server never replying, check out question 2.11: 
> http://www.unixguide.net/network/socketfaq/2.16.shtml
> 
> in my experience, the server will complain (give a 500 response) if you 
> give it an IP that doesn't match where your control connection is from. 
> 
> (which does seem to disagree with the RFC, but it still seems
> reasonable to not want to send data directly to a random host.)
> 
> thanks,
> ryan. 
> 
> 
> Steve Goldman <steve.goldman@stanford.edu> wrote:
> 
>>I'm getting this same behavior.  Clearly the server is not connecting to 
>>the data socket we open for it, which makes me think that we are sending 
>>incorrect IP and/or port info.  At first I thought it had to do with 
>>byte ordering, since it works on some servers but not others.  Now I am 
>>thinking it has to do with how we determine our own IP address.  In a 
>>previous post, someone said that getsockname populates the port info in 
>>the sockaddr_in struct, but not the IP address info.  That was what 
>>happened with me.  So I used gethostbyname on getenv("HOST") to get the 
>>IP.  I am starting to think that this may not *always* be the correct IP 
>>to send to the server.  So, to Wayne Lue: I wonder why getsockname gives 
>>some of us IP info and others only port info.  To everyone: any ideas?
> 
> 
>>Thanks,
>>Steve
> 
> 
>>PS -- Servers that my program works on: ftp.stanford.edu, 
>>ftp.microsoft.com.  Servers where it doesn't: ftp.cs.stanford.edu, 
>>ftp.fedworld.gov.
> 
> 
>>Michi Mutsuzaki wrote:
>>
>>>Hello,
>>>
>>>I'm having a problem with the PORT command. The server 
>>>ftp.cs.stanford.edu doesn't respond to the command. I've
>>>tried different servers (ftp.microsoft.com, ftp.stanford.edu,
>>>etc...), and it works fine. Any idea why this is happening?
>>>
>>>Thank you,
>>>--Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Sesha Narahari <narahari@stanford.edu>
Newsgroups: su.class.cs244a
Subject: problem set submission
Date: Mon, 16 Jan 2006 14:18:05 -0800
Lines: 5
Distribution: su
Message-ID: <43CC1B9D.2080209@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9488

Should these be hand-written?

Thanks,
Sesha

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan Matthew Smith <rysmi@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PORT command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 22:20:44 +0000 (UTC)
Lines: 73
Distribution: su
Message-ID: <dqh67s$tp$1@news.Stanford.EDU>
References: <dqgjbt$d3k$1@news.Stanford.EDU> <dqgl6s$esb$1@news.Stanford.EDU> <dqh289$okn$1@news.Stanford.EDU> <dqh484$srp$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.6.12.6smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:9489

also, for what it's worth, i think you can get around setting that 
option by carefully formatting the data that you send to the server -- 
ie. avoiding multiple socket writes which will only get one response. 

thanks, 
ryan. 


Michi Mutsuzaki <michi2@stanford.edu> wrote:
> Ryan,

> I set the TCP_NODELAY option, and now it works! Thanks a lot for the info.

> --Michi

> Ryan Matthew Smith wrote:
>> hey steve / michi -- 
>> 
>> i had this same problem with ftp.cs.stanford.edu, but it worked with
>> other servers. 
>> 
>> you might want to find out if you are hanging in the 
>> read() for the response to the PORT command or in the
>> accept() for the data socket. 
>> 
>> in the case of a the server never replying, check out question 2.11: 
>> http://www.unixguide.net/network/socketfaq/2.16.shtml
>> 
>> in my experience, the server will complain (give a 500 response) if you 
>> give it an IP that doesn't match where your control connection is from. 
>> 
>> (which does seem to disagree with the RFC, but it still seems
>> reasonable to not want to send data directly to a random host.)
>> 
>> thanks,
>> ryan. 
>> 
>> 
>> Steve Goldman <steve.goldman@stanford.edu> wrote:
>> 
>>>I'm getting this same behavior.  Clearly the server is not connecting to 
>>>the data socket we open for it, which makes me think that we are sending 
>>>incorrect IP and/or port info.  At first I thought it had to do with 
>>>byte ordering, since it works on some servers but not others.  Now I am 
>>>thinking it has to do with how we determine our own IP address.  In a 
>>>previous post, someone said that getsockname populates the port info in 
>>>the sockaddr_in struct, but not the IP address info.  That was what 
>>>happened with me.  So I used gethostbyname on getenv("HOST") to get the 
>>>IP.  I am starting to think that this may not *always* be the correct IP 
>>>to send to the server.  So, to Wayne Lue: I wonder why getsockname gives 
>>>some of us IP info and others only port info.  To everyone: any ideas?
>> 
>> 
>>>Thanks,
>>>Steve
>> 
>> 
>>>PS -- Servers that my program works on: ftp.stanford.edu, 
>>>ftp.microsoft.com.  Servers where it doesn't: ftp.cs.stanford.edu, 
>>>ftp.fedworld.gov.
>> 
>> 
>>>Michi Mutsuzaki wrote:
>>>
>>>>Hello,
>>>>
>>>>I'm having a problem with the PORT command. The server 
>>>>ftp.cs.stanford.edu doesn't respond to the command. I've
>>>>tried different servers (ftp.microsoft.com, ftp.stanford.edu,
>>>>etc...), and it works fine. Any idea why this is happening?
>>>>
>>>>Thank you,
>>>>--Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PORT command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 14:38:14 -0800
Lines: 65
Distribution: su
Message-ID: <dqh78n$25v$1@news.Stanford.EDU>
References: <dqgjbt$d3k$1@news.Stanford.EDU> <dqgl6s$esb$1@news.Stanford.EDU> <dqh289$okn$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqh289$okn$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9490

Ryan,

You are a wonderful human being.

Thanks,
Steve

Ryan Matthew Smith wrote:
> hey steve / michi -- 
> 
> i had this same problem with ftp.cs.stanford.edu, but it worked with
> other servers. 
> 
> you might want to find out if you are hanging in the 
> read() for the response to the PORT command or in the
> accept() for the data socket. 
> 
> in the case of a the server never replying, check out question 2.11: 
> http://www.unixguide.net/network/socketfaq/2.16.shtml
> 
> in my experience, the server will complain (give a 500 response) if you 
> give it an IP that doesn't match where your control connection is from. 
> 
> (which does seem to disagree with the RFC, but it still seems
> reasonable to not want to send data directly to a random host.)
> 
> thanks,
> ryan. 
> 
> 
> Steve Goldman <steve.goldman@stanford.edu> wrote:
> 
>>I'm getting this same behavior.  Clearly the server is not connecting to 
>>the data socket we open for it, which makes me think that we are sending 
>>incorrect IP and/or port info.  At first I thought it had to do with 
>>byte ordering, since it works on some servers but not others.  Now I am 
>>thinking it has to do with how we determine our own IP address.  In a 
>>previous post, someone said that getsockname populates the port info in 
>>the sockaddr_in struct, but not the IP address info.  That was what 
>>happened with me.  So I used gethostbyname on getenv("HOST") to get the 
>>IP.  I am starting to think that this may not *always* be the correct IP 
>>to send to the server.  So, to Wayne Lue: I wonder why getsockname gives 
>>some of us IP info and others only port info.  To everyone: any ideas?
> 
> 
>>Thanks,
>>Steve
> 
> 
>>PS -- Servers that my program works on: ftp.stanford.edu, 
>>ftp.microsoft.com.  Servers where it doesn't: ftp.cs.stanford.edu, 
>>ftp.fedworld.gov.
> 
> 
>>Michi Mutsuzaki wrote:
>>
>>>Hello,
>>>
>>>I'm having a problem with the PORT command. The server 
>>>ftp.cs.stanford.edu doesn't respond to the command. I've
>>>tried different servers (ftp.microsoft.com, ftp.stanford.edu,
>>>etc...), and it works fine. Any idea why this is happening?
>>>
>>>Thank you,
>>>--Michi
.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PORT command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 15:15:52 -0800
Lines: 62
Distribution: su
Message-ID: <dqh9f8$48a$1@news.Stanford.EDU>
References: <dqgjbt$d3k$1@news.Stanford.EDU> <dqgl6s$esb$1@news.Stanford.EDU> <dqh289$okn$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:9491

The RFC allows for giving other IPs in the PORT command, but servers usually
have the option to disable it.  I usually leave it enabled so you can FXP,
but disabling prevents bounce attacks.

Waynn

"Ryan Matthew Smith" <rysmi@Stanford.EDU> wrote in message
news:dqh289$okn$1@news.Stanford.EDU...
> hey steve / michi -- 
>
> i had this same problem with ftp.cs.stanford.edu, but it worked with
> other servers.
>
> you might want to find out if you are hanging in the
> read() for the response to the PORT command or in the
> accept() for the data socket.
>
> in the case of a the server never replying, check out question 2.11:
> http://www.unixguide.net/network/socketfaq/2.16.shtml
>
> in my experience, the server will complain (give a 500 response) if you
> give it an IP that doesn't match where your control connection is from.
>
> (which does seem to disagree with the RFC, but it still seems
> reasonable to not want to send data directly to a random host.)
>
> thanks,
> ryan.
>
>
> Steve Goldman <steve.goldman@stanford.edu> wrote:
> > I'm getting this same behavior.  Clearly the server is not connecting to
> > the data socket we open for it, which makes me think that we are sending
> > incorrect IP and/or port info.  At first I thought it had to do with
> > byte ordering, since it works on some servers but not others.  Now I am
> > thinking it has to do with how we determine our own IP address.  In a
> > previous post, someone said that getsockname populates the port info in
> > the sockaddr_in struct, but not the IP address info.  That was what
> > happened with me.  So I used gethostbyname on getenv("HOST") to get the
> > IP.  I am starting to think that this may not *always* be the correct IP
> > to send to the server.  So, to Wayne Lue: I wonder why getsockname gives
> > some of us IP info and others only port info.  To everyone: any ideas?
>
> > Thanks,
> > Steve
>
> > PS -- Servers that my program works on: ftp.stanford.edu,
> > ftp.microsoft.com.  Servers where it doesn't: ftp.cs.stanford.edu,
> > ftp.fedworld.gov.
>
> > Michi Mutsuzaki wrote:
> >> Hello,
> >>
> >> I'm having a problem with the PORT command. The server
> >> ftp.cs.stanford.edu doesn't respond to the command. I've
> >> tried different servers (ftp.microsoft.com, ftp.stanford.edu,
> >> etc...), and it works fine. Any idea why this is happening?
> >>
> >> Thank you,
> >> --Michi


.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PORT command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 15:16:31 -0800
Lines: 32
Distribution: su
Message-ID: <dqh9gd$4a6$1@news.Stanford.EDU>
References: <dqgjbt$d3k$1@news.Stanford.EDU> <dqgl6s$esb$1@news.Stanford.EDU> <dqh41d$shc$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:9492

Yeah, this is what I'm doing.  I'm calling getsockname on the control
socket.

Waynn

"Drew Willcoxon" <drew.willcoxon@cs.stanford.edu> wrote in message
news:dqh41d$shc$1@news.Stanford.EDU...
> I think you can get the local IP address by calling getsockname on the
> *control* socket, not the *data* socket -- i.e., yeah, you have to call
> getsockname on the data socket to find out the port the OS assigned it,
> but this won't tell you the local IP.  But if you call getsockname on
> the control socket, it will.
>
> Drew
>
> Steve Goldman wrote:
> > I'm getting this same behavior.  Clearly the server is not connecting to
> > the data socket we open for it, which makes me think that we are sending
> > incorrect IP and/or port info.  At first I thought it had to do with
> > byte ordering, since it works on some servers but not others.  Now I am
> > thinking it has to do with how we determine our own IP address.  In a
> > previous post, someone said that getsockname populates the port info in
> > the sockaddr_in struct, but not the IP address info.  That was what
> > happened with me.  So I used gethostbyname on getenv("HOST") to get the
> > IP.  I am starting to think that this may not *always* be the correct IP
> > to send to the server.  So, to Wayne Lue: I wonder why getsockname gives
> > some of us IP info and others only port info.  To everyone: any ideas?
> >
> > Thanks,
> > Steve


.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: LIST command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 15:25:37 -0800
Lines: 35
Distribution: su
Message-ID: <dqha1h$555$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9493

So now LIST command takes really long time (>5 min) to complete on 
ftp.cs. I also noticed the output of the command is a little bit 
different from that of UNIX ftp program. Here are the outputs:

UNIX ftp program:
drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 .
drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 ..
lrwxr-xr-x   1 miles    root            9 Aug 20  2004 alpha -> pub/alpha
drwxr-xr-x   2 miles    users        2048 Oct 13 21:51 bin
drwxr-xr-x   2 miles    users        2048 Aug 22  2004 cs
lrwxr-xr-x   1 miles    root           25 Aug 20  2004 emlp -> 
cs/theory/pub/ullman/emlp
drwxr-xr-x   2 miles    users        2048 Jun  7  2005 etc
lrwxr-xr-x   1 ftp      users          25 Aug 20  2004 fcsc -> 
cs/theory/pub/ullman/fcsc
....

My ftpcopy program:
drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 .
drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 ..
lrwxr-xr-x   1 (?)      root            9 Aug 20  2004 alpha -> pub/alpha
drwxr-xr-x   2 (?)      users        2048 Oct 13 21:51 bin
drwxr-xr-x   2 (?)      users        2048 Aug 22  2004 cs
lrwxr-xr-x   1 (?)      root           25 Aug 20  2004 emlp -> 
cs/theory/pub/ullman/emlp
drwxr-xr-x   2 (?)      users        2048 Jun  7  2005 etc
lrwxr-xr-x   1 ftp      users          25 Aug 20  2004 fcsc -> 
cs/theory/pub/ullman/fcsc
....

In my program, the owner of symlinks are "(?)" instead of "miles". Does 
it have anything to do with my program being extremely slow?

Thanks,
--Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: LIST command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 15:36:41 -0800
Lines: 43
Distribution: su
Message-ID: <dqhama$5o0$1@news.Stanford.EDU>
References: <dqha1h$555$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqha1h$555$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9494

Try Ryan's second suggestion, the one about writing data in atomic 
chunks so that you expect a reply after every call to write.  I tried 
the NO_DELAY business and got mixed results, but this other way works 
very well.  Hopefully that will help with your delay problems.

Steve

Michi Mutsuzaki wrote:
> So now LIST command takes really long time (>5 min) to complete on 
> ftp.cs. I also noticed the output of the command is a little bit 
> different from that of UNIX ftp program. Here are the outputs:
> 
> UNIX ftp program:
> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 .
> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 ..
> lrwxr-xr-x   1 miles    root            9 Aug 20  2004 alpha -> pub/alpha
> drwxr-xr-x   2 miles    users        2048 Oct 13 21:51 bin
> drwxr-xr-x   2 miles    users        2048 Aug 22  2004 cs
> lrwxr-xr-x   1 miles    root           25 Aug 20  2004 emlp -> 
> cs/theory/pub/ullman/emlp
> drwxr-xr-x   2 miles    users        2048 Jun  7  2005 etc
> lrwxr-xr-x   1 ftp      users          25 Aug 20  2004 fcsc -> 
> cs/theory/pub/ullman/fcsc
> ...
> 
> My ftpcopy program:
> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 .
> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 ..
> lrwxr-xr-x   1 (?)      root            9 Aug 20  2004 alpha -> pub/alpha
> drwxr-xr-x   2 (?)      users        2048 Oct 13 21:51 bin
> drwxr-xr-x   2 (?)      users        2048 Aug 22  2004 cs
> lrwxr-xr-x   1 (?)      root           25 Aug 20  2004 emlp -> 
> cs/theory/pub/ullman/emlp
> drwxr-xr-x   2 (?)      users        2048 Jun  7  2005 etc
> lrwxr-xr-x   1 ftp      users          25 Aug 20  2004 fcsc -> 
> cs/theory/pub/ullman/fcsc
> ...
> 
> In my program, the owner of symlinks are "(?)" instead of "miles". Does 
> it have anything to do with my program being extremely slow?
> 
> Thanks,
> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Hector Chan <chanhp@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: FTP: ftp protocol error handling
Date: Mon, 16 Jan 2006 23:41:34 +0000 (UTC)
Lines: 4
Distribution: su
Message-ID: <dqhave$5ld$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:9495

What are we going to do if the user specified a remote directory from the command line that does not exist?  Also, what about when the ftp server does not allow anonymous login?  Do we have to parse all the FTP reply codes, or just selectively or not at all, to check for errors?  Would there any file permission issues such as a file or directory can be listed but not accessible?  I am sorry I am just a little paranoid...

Thanks,
Hector
.

Path: shelby.stanford.edu!not-for-mail
From: Drew Willcoxon <drew.willcoxon@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: LIST command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 16:18:35 -0800
Lines: 43
Distribution: su
Message-ID: <dqhd47$8gt$1@news.Stanford.EDU>
References: <dqha1h$555$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <dqha1h$555$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9496

I'm getting the same results.  I send one LIST command over, and I read 
one 150 reply.  ftp.cs sends the ls contents over the data connection 
right away, but on the control connection it just sits on the 150 until 
about 5 minutes later, when it sends a 226.  I'm at a loss.

Drew

Michi Mutsuzaki wrote:
> So now LIST command takes really long time (>5 min) to complete on 
> ftp.cs. I also noticed the output of the command is a little bit 
> different from that of UNIX ftp program. Here are the outputs:
> 
> UNIX ftp program:
> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 .
> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 ..
> lrwxr-xr-x   1 miles    root            9 Aug 20  2004 alpha -> pub/alpha
> drwxr-xr-x   2 miles    users        2048 Oct 13 21:51 bin
> drwxr-xr-x   2 miles    users        2048 Aug 22  2004 cs
> lrwxr-xr-x   1 miles    root           25 Aug 20  2004 emlp -> 
> cs/theory/pub/ullman/emlp
> drwxr-xr-x   2 miles    users        2048 Jun  7  2005 etc
> lrwxr-xr-x   1 ftp      users          25 Aug 20  2004 fcsc -> 
> cs/theory/pub/ullman/fcsc
> ...
> 
> My ftpcopy program:
> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 .
> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 ..
> lrwxr-xr-x   1 (?)      root            9 Aug 20  2004 alpha -> pub/alpha
> drwxr-xr-x   2 (?)      users        2048 Oct 13 21:51 bin
> drwxr-xr-x   2 (?)      users        2048 Aug 22  2004 cs
> lrwxr-xr-x   1 (?)      root           25 Aug 20  2004 emlp -> 
> cs/theory/pub/ullman/emlp
> drwxr-xr-x   2 (?)      users        2048 Jun  7  2005 etc
> lrwxr-xr-x   1 ftp      users          25 Aug 20  2004 fcsc -> 
> cs/theory/pub/ullman/fcsc
> ...
> 
> In my program, the owner of symlinks are "(?)" instead of "miles". Does 
> it have anything to do with my program being extremely slow?
> 
> Thanks,
> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: LIST command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 16:27:37 -0800
Lines: 55
Distribution: su
Message-ID: <dqhdlq$8vb$1@news.Stanford.EDU>
References: <dqha1h$555$1@news.Stanford.EDU> <dqhama$5o0$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <dqhama$5o0$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9497

Hi Steve,

I'm sending data in one write call (i.e. write(s, "LIST /\r\n", len)), 
but the LIST command is still very slow.

ftp.cs is the only server that's giving me the slow response. I wonder 
why...

--Michi

Steve Goldman wrote:
> Try Ryan's second suggestion, the one about writing data in atomic 
> chunks so that you expect a reply after every call to write.  I tried 
> the NO_DELAY business and got mixed results, but this other way works 
> very well.  Hopefully that will help with your delay problems.
> 
> Steve
> 
> Michi Mutsuzaki wrote:
> 
>> So now LIST command takes really long time (>5 min) to complete on 
>> ftp.cs. I also noticed the output of the command is a little bit 
>> different from that of UNIX ftp program. Here are the outputs:
>>
>> UNIX ftp program:
>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 .
>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 ..
>> lrwxr-xr-x   1 miles    root            9 Aug 20  2004 alpha -> pub/alpha
>> drwxr-xr-x   2 miles    users        2048 Oct 13 21:51 bin
>> drwxr-xr-x   2 miles    users        2048 Aug 22  2004 cs
>> lrwxr-xr-x   1 miles    root           25 Aug 20  2004 emlp -> 
>> cs/theory/pub/ullman/emlp
>> drwxr-xr-x   2 miles    users        2048 Jun  7  2005 etc
>> lrwxr-xr-x   1 ftp      users          25 Aug 20  2004 fcsc -> 
>> cs/theory/pub/ullman/fcsc
>> ...
>>
>> My ftpcopy program:
>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 .
>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 ..
>> lrwxr-xr-x   1 (?)      root            9 Aug 20  2004 alpha -> pub/alpha
>> drwxr-xr-x   2 (?)      users        2048 Oct 13 21:51 bin
>> drwxr-xr-x   2 (?)      users        2048 Aug 22  2004 cs
>> lrwxr-xr-x   1 (?)      root           25 Aug 20  2004 emlp -> 
>> cs/theory/pub/ullman/emlp
>> drwxr-xr-x   2 (?)      users        2048 Jun  7  2005 etc
>> lrwxr-xr-x   1 ftp      users          25 Aug 20  2004 fcsc -> 
>> cs/theory/pub/ullman/fcsc
>> ...
>>
>> In my program, the owner of symlinks are "(?)" instead of "miles". 
>> Does it have anything to do with my program being extremely slow?
>>
>> Thanks,
>> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: LIST command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 16:40:59 -0800
Lines: 64
Distribution: su
Message-ID: <dqhees$9hc$1@news.Stanford.EDU>
References: <dqha1h$555$1@news.Stanford.EDU> <dqhama$5o0$1@news.Stanford.EDU> <dqhdlq$8vb$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqhdlq$8vb$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9498

Are you writing in one call for every command and not just LIST?  The 
idea I got from Ryan was that every call to write should anticipate a reply.

Steve

Michi Mutsuzaki wrote:
> Hi Steve,
> 
> I'm sending data in one write call (i.e. write(s, "LIST /\r\n", len)), 
> but the LIST command is still very slow.
> 
> ftp.cs is the only server that's giving me the slow response. I wonder 
> why...
> 
> --Michi
> 
> Steve Goldman wrote:
> 
>> Try Ryan's second suggestion, the one about writing data in atomic 
>> chunks so that you expect a reply after every call to write.  I tried 
>> the NO_DELAY business and got mixed results, but this other way works 
>> very well.  Hopefully that will help with your delay problems.
>>
>> Steve
>>
>> Michi Mutsuzaki wrote:
>>
>>> So now LIST command takes really long time (>5 min) to complete on 
>>> ftp.cs. I also noticed the output of the command is a little bit 
>>> different from that of UNIX ftp program. Here are the outputs:
>>>
>>> UNIX ftp program:
>>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 .
>>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 ..
>>> lrwxr-xr-x   1 miles    root            9 Aug 20  2004 alpha -> 
>>> pub/alpha
>>> drwxr-xr-x   2 miles    users        2048 Oct 13 21:51 bin
>>> drwxr-xr-x   2 miles    users        2048 Aug 22  2004 cs
>>> lrwxr-xr-x   1 miles    root           25 Aug 20  2004 emlp -> 
>>> cs/theory/pub/ullman/emlp
>>> drwxr-xr-x   2 miles    users        2048 Jun  7  2005 etc
>>> lrwxr-xr-x   1 ftp      users          25 Aug 20  2004 fcsc -> 
>>> cs/theory/pub/ullman/fcsc
>>> ...
>>>
>>> My ftpcopy program:
>>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 .
>>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 ..
>>> lrwxr-xr-x   1 (?)      root            9 Aug 20  2004 alpha -> 
>>> pub/alpha
>>> drwxr-xr-x   2 (?)      users        2048 Oct 13 21:51 bin
>>> drwxr-xr-x   2 (?)      users        2048 Aug 22  2004 cs
>>> lrwxr-xr-x   1 (?)      root           25 Aug 20  2004 emlp -> 
>>> cs/theory/pub/ullman/emlp
>>> drwxr-xr-x   2 (?)      users        2048 Jun  7  2005 etc
>>> lrwxr-xr-x   1 ftp      users          25 Aug 20  2004 fcsc -> 
>>> cs/theory/pub/ullman/fcsc
>>> ...
>>>
>>> In my program, the owner of symlinks are "(?)" instead of "miles". 
>>> Does it have anything to do with my program being extremely slow?
>>>
>>> Thanks,
>>> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: LIST command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 16:50:49 -0800
Lines: 73
Distribution: su
Message-ID: <dqhf19$ajf$1@news.Stanford.EDU>
References: <dqha1h$555$1@news.Stanford.EDU> <dqhama$5o0$1@news.Stanford.EDU> <dqhdlq$8vb$1@news.Stanford.EDU> <dqhees$9hc$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <dqhees$9hc$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9499

Steve,

Yes, I'm writing in one write call for all the commands.

--Michi

Steve Goldman wrote:
> Are you writing in one call for every command and not just LIST?  The 
> idea I got from Ryan was that every call to write should anticipate a 
> reply.
> 
> Steve
> 
> Michi Mutsuzaki wrote:
> 
>> Hi Steve,
>>
>> I'm sending data in one write call (i.e. write(s, "LIST /\r\n", len)), 
>> but the LIST command is still very slow.
>>
>> ftp.cs is the only server that's giving me the slow response. I wonder 
>> why...
>>
>> --Michi
>>
>> Steve Goldman wrote:
>>
>>> Try Ryan's second suggestion, the one about writing data in atomic 
>>> chunks so that you expect a reply after every call to write.  I tried 
>>> the NO_DELAY business and got mixed results, but this other way works 
>>> very well.  Hopefully that will help with your delay problems.
>>>
>>> Steve
>>>
>>> Michi Mutsuzaki wrote:
>>>
>>>> So now LIST command takes really long time (>5 min) to complete on 
>>>> ftp.cs. I also noticed the output of the command is a little bit 
>>>> different from that of UNIX ftp program. Here are the outputs:
>>>>
>>>> UNIX ftp program:
>>>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 .
>>>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 ..
>>>> lrwxr-xr-x   1 miles    root            9 Aug 20  2004 alpha -> 
>>>> pub/alpha
>>>> drwxr-xr-x   2 miles    users        2048 Oct 13 21:51 bin
>>>> drwxr-xr-x   2 miles    users        2048 Aug 22  2004 cs
>>>> lrwxr-xr-x   1 miles    root           25 Aug 20  2004 emlp -> 
>>>> cs/theory/pub/ullman/emlp
>>>> drwxr-xr-x   2 miles    users        2048 Jun  7  2005 etc
>>>> lrwxr-xr-x   1 ftp      users          25 Aug 20  2004 fcsc -> 
>>>> cs/theory/pub/ullman/fcsc
>>>> ...
>>>>
>>>> My ftpcopy program:
>>>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 .
>>>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 ..
>>>> lrwxr-xr-x   1 (?)      root            9 Aug 20  2004 alpha -> 
>>>> pub/alpha
>>>> drwxr-xr-x   2 (?)      users        2048 Oct 13 21:51 bin
>>>> drwxr-xr-x   2 (?)      users        2048 Aug 22  2004 cs
>>>> lrwxr-xr-x   1 (?)      root           25 Aug 20  2004 emlp -> 
>>>> cs/theory/pub/ullman/emlp
>>>> drwxr-xr-x   2 (?)      users        2048 Jun  7  2005 etc
>>>> lrwxr-xr-x   1 ftp      users          25 Aug 20  2004 fcsc -> 
>>>> cs/theory/pub/ullman/fcsc
>>>> ...
>>>>
>>>> In my program, the owner of symlinks are "(?)" instead of "miles". 
>>>> Does it have anything to do with my program being extremely slow?
>>>>
>>>> Thanks,
>>>> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: LIST command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 16:54:13 -0800
Lines: 87
Distribution: su
Message-ID: <dqhf7m$ao3$1@news.Stanford.EDU>
References: <dqha1h$555$1@news.Stanford.EDU> <dqhama$5o0$1@news.Stanford.EDU> <dqhdlq$8vb$1@news.Stanford.EDU> <dqhees$9hc$1@news.Stanford.EDU> <dqhf19$ajf$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqhf19$ajf$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9500

There's one thing that I ran into the other day that is tricky depending 
on the server...

Make sure that you shut down and close the data socket immediately after 
getting all the LIST information and before you read from the control 
socket for the reply.  Initially I had them reversed and some sites 
froze up (and might have come back in 5 minutes but I never waited that 
long).

Steve

Michi Mutsuzaki wrote:
> Steve,
> 
> Yes, I'm writing in one write call for all the commands.
> 
> --Michi
> 
> Steve Goldman wrote:
> 
>> Are you writing in one call for every command and not just LIST?  The 
>> idea I got from Ryan was that every call to write should anticipate a 
>> reply.
>>
>> Steve
>>
>> Michi Mutsuzaki wrote:
>>
>>> Hi Steve,
>>>
>>> I'm sending data in one write call (i.e. write(s, "LIST /\r\n", 
>>> len)), but the LIST command is still very slow.
>>>
>>> ftp.cs is the only server that's giving me the slow response. I 
>>> wonder why...
>>>
>>> --Michi
>>>
>>> Steve Goldman wrote:
>>>
>>>> Try Ryan's second suggestion, the one about writing data in atomic 
>>>> chunks so that you expect a reply after every call to write.  I 
>>>> tried the NO_DELAY business and got mixed results, but this other 
>>>> way works very well.  Hopefully that will help with your delay 
>>>> problems.
>>>>
>>>> Steve
>>>>
>>>> Michi Mutsuzaki wrote:
>>>>
>>>>> So now LIST command takes really long time (>5 min) to complete on 
>>>>> ftp.cs. I also noticed the output of the command is a little bit 
>>>>> different from that of UNIX ftp program. Here are the outputs:
>>>>>
>>>>> UNIX ftp program:
>>>>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 .
>>>>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 ..
>>>>> lrwxr-xr-x   1 miles    root            9 Aug 20  2004 alpha -> 
>>>>> pub/alpha
>>>>> drwxr-xr-x   2 miles    users        2048 Oct 13 21:51 bin
>>>>> drwxr-xr-x   2 miles    users        2048 Aug 22  2004 cs
>>>>> lrwxr-xr-x   1 miles    root           25 Aug 20  2004 emlp -> 
>>>>> cs/theory/pub/ullman/emlp
>>>>> drwxr-xr-x   2 miles    users        2048 Jun  7  2005 etc
>>>>> lrwxr-xr-x   1 ftp      users          25 Aug 20  2004 fcsc -> 
>>>>> cs/theory/pub/ullman/fcsc
>>>>> ...
>>>>>
>>>>> My ftpcopy program:
>>>>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 .
>>>>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 ..
>>>>> lrwxr-xr-x   1 (?)      root            9 Aug 20  2004 alpha -> 
>>>>> pub/alpha
>>>>> drwxr-xr-x   2 (?)      users        2048 Oct 13 21:51 bin
>>>>> drwxr-xr-x   2 (?)      users        2048 Aug 22  2004 cs
>>>>> lrwxr-xr-x   1 (?)      root           25 Aug 20  2004 emlp -> 
>>>>> cs/theory/pub/ullman/emlp
>>>>> drwxr-xr-x   2 (?)      users        2048 Jun  7  2005 etc
>>>>> lrwxr-xr-x   1 ftp      users          25 Aug 20  2004 fcsc -> 
>>>>> cs/theory/pub/ullman/fcsc
>>>>> ...
>>>>>
>>>>> In my program, the owner of symlinks are "(?)" instead of "miles". 
>>>>> Does it have anything to do with my program being extremely slow?
>>>>>
>>>>> Thanks,
>>>>> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: LIST command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 17:01:15 -0800
Lines: 95
Distribution: su
Message-ID: <dqhfks$b63$1@news.Stanford.EDU>
References: <dqha1h$555$1@news.Stanford.EDU> <dqhama$5o0$1@news.Stanford.EDU> <dqhdlq$8vb$1@news.Stanford.EDU> <dqhees$9hc$1@news.Stanford.EDU> <dqhf19$ajf$1@news.Stanford.EDU> <dqhf7m$ao3$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <dqhf7m$ao3$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9501

Yes! That was the problem. I wasn't closing the data connection before 
I check the control connection for reply.

Steve, thank you so much.
--Michi

Steve Goldman wrote:
> There's one thing that I ran into the other day that is tricky depending 
> on the server...
> 
> Make sure that you shut down and close the data socket immediately after 
> getting all the LIST information and before you read from the control 
> socket for the reply.  Initially I had them reversed and some sites 
> froze up (and might have come back in 5 minutes but I never waited that 
> long).
> 
> Steve
> 
> Michi Mutsuzaki wrote:
> 
>> Steve,
>>
>> Yes, I'm writing in one write call for all the commands.
>>
>> --Michi
>>
>> Steve Goldman wrote:
>>
>>> Are you writing in one call for every command and not just LIST?  The 
>>> idea I got from Ryan was that every call to write should anticipate a 
>>> reply.
>>>
>>> Steve
>>>
>>> Michi Mutsuzaki wrote:
>>>
>>>> Hi Steve,
>>>>
>>>> I'm sending data in one write call (i.e. write(s, "LIST /\r\n", 
>>>> len)), but the LIST command is still very slow.
>>>>
>>>> ftp.cs is the only server that's giving me the slow response. I 
>>>> wonder why...
>>>>
>>>> --Michi
>>>>
>>>> Steve Goldman wrote:
>>>>
>>>>> Try Ryan's second suggestion, the one about writing data in atomic 
>>>>> chunks so that you expect a reply after every call to write.  I 
>>>>> tried the NO_DELAY business and got mixed results, but this other 
>>>>> way works very well.  Hopefully that will help with your delay 
>>>>> problems.
>>>>>
>>>>> Steve
>>>>>
>>>>> Michi Mutsuzaki wrote:
>>>>>
>>>>>> So now LIST command takes really long time (>5 min) to complete on 
>>>>>> ftp.cs. I also noticed the output of the command is a little bit 
>>>>>> different from that of UNIX ftp program. Here are the outputs:
>>>>>>
>>>>>> UNIX ftp program:
>>>>>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 .
>>>>>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 ..
>>>>>> lrwxr-xr-x   1 miles    root            9 Aug 20  2004 alpha -> 
>>>>>> pub/alpha
>>>>>> drwxr-xr-x   2 miles    users        2048 Oct 13 21:51 bin
>>>>>> drwxr-xr-x   2 miles    users        2048 Aug 22  2004 cs
>>>>>> lrwxr-xr-x   1 miles    root           25 Aug 20  2004 emlp -> 
>>>>>> cs/theory/pub/ullman/emlp
>>>>>> drwxr-xr-x   2 miles    users        2048 Jun  7  2005 etc
>>>>>> lrwxr-xr-x   1 ftp      users          25 Aug 20  2004 fcsc -> 
>>>>>> cs/theory/pub/ullman/fcsc
>>>>>> ...
>>>>>>
>>>>>> My ftpcopy program:
>>>>>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 .
>>>>>> drwxrwxrwx   7 ftp      root         2048 Oct  7 13:55 ..
>>>>>> lrwxr-xr-x   1 (?)      root            9 Aug 20  2004 alpha -> 
>>>>>> pub/alpha
>>>>>> drwxr-xr-x   2 (?)      users        2048 Oct 13 21:51 bin
>>>>>> drwxr-xr-x   2 (?)      users        2048 Aug 22  2004 cs
>>>>>> lrwxr-xr-x   1 (?)      root           25 Aug 20  2004 emlp -> 
>>>>>> cs/theory/pub/ullman/emlp
>>>>>> drwxr-xr-x   2 (?)      users        2048 Jun  7  2005 etc
>>>>>> lrwxr-xr-x   1 ftp      users          25 Aug 20  2004 fcsc -> 
>>>>>> cs/theory/pub/ullman/fcsc
>>>>>> ...
>>>>>>
>>>>>> In my program, the owner of symlinks are "(?)" instead of "miles". 
>>>>>> Does it have anything to do with my program being extremely slow?
>>>>>>
>>>>>> Thanks,
>>>>>> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Drew Willcoxon <drew.willcoxon@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: LIST command on ftp.cs.stanford.edu
Date: Mon, 16 Jan 2006 17:14:56 -0800
Lines: 15
Distribution: su
Message-ID: <dqhgdm$bp5$1@news.Stanford.EDU>
References: <dqha1h$555$1@news.Stanford.EDU> <dqhama$5o0$1@news.Stanford.EDU> <dqhdlq$8vb$1@news.Stanford.EDU> <dqhees$9hc$1@news.Stanford.EDU> <dqhf19$ajf$1@news.Stanford.EDU> <dqhf7m$ao3$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <dqhf7m$ao3$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9502

Thanks, Steve, this fixed my problem too. :)

Drew

Steve Goldman wrote:
> There's one thing that I ran into the other day that is tricky depending 
> on the server...
> 
> Make sure that you shut down and close the data socket immediately after 
> getting all the LIST information and before you read from the control 
> socket for the reply.  Initially I had them reversed and some sites 
> froze up (and might have come back in 5 minutes but I never waited that 
> long).
> 
> Steve
.

Path: shelby.stanford.edu!not-for-mail
From: Ryan Matthew Smith <rysmi@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: problem set 1, question 3
Date: Tue, 17 Jan 2006 01:52:30 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <dqhiku$d9q$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.6.12.6smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:9503

problem set 1, question 3 says: 
"a packet is buffered, on average, 10ms by the router" 

does this mean that the time from when the first bit of the packet
reaches the buffer to the time that the last bit of the packet 
leaves the buffer is, on average, 10ms? 

thanks, 
ryan. 
.

Path: shelby.stanford.edu!not-for-mail
From: Jens Pillgram-Larsen <jenspl@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Stray output
Date: Mon, 16 Jan 2006 18:21:38 -0800
Lines: 51
Distribution: su
Message-ID: <dqhkbj$ff8$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9504

Hi,

When I'm displaying debug information I receive the following unexpected 
output.

99
#
# maintained by action@leland.stanford.edu
#
# Do not edit this file directly, as it will be overwritten by bundle.
#
# See rfc1700 for the official list of assigned services
#
#
# Network services, Internet style
#
tcpmux          1/tcp
echo            7/udp
echo            7/tcp
discard         9/udp           sink null
discard         9/tcp           sink null
systat          11/tcp          users
systat          11/udp          users
daytime         13/udp
daytime         13/tcp
netstat         15/tcp
qotd            17/tcp          quote
qotd            17/udp          quote
msp             18/tcp                          # message send protocol
msp             18/udp                          # message send protocol
chargen         19/tcp          ttytst source
chargen         19/udp          ttytst source
ftp-data        20/tcp
ftp             21/tcp
ssh             22/tcp                          # Secure Shell Login
ssh             22/udp
telnet          23/tcp
smtp            25/tcp          mail
time            37/tcp          timserver
time            37/udp          timserver
rlp             39/udp          resource        # resource location
nameserver      42/tcp          name            # IEN 116
nameserver      42/udp          name            # IEN 116
whois           43/tcp          nicname         # usually to sri-nic
re-mail-ck      50/tcp          mailcheck       # rfc1339
re-mail-ck      50/udp          mailcheck       #

Anybody have any ideas on where this is coming from and how to make it 
go away?

Thanks, Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Stray output
Date: Mon, 16 Jan 2006 18:34:04 -0800
Lines: 55
Distribution: su
Message-ID: <dqhl33$g21$1@news.Stanford.EDU>
References: <dqhkbj$ff8$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqhkbj$ff8$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9505

I don't know what you mean by debug information, but your output looks 
like part of /etc/services, which getservbyname reads.

Jens Pillgram-Larsen wrote:
> Hi,
> 
> When I'm displaying debug information I receive the following unexpected 
> output.
> 
> 99
> #
> # maintained by action@leland.stanford.edu
> #
> # Do not edit this file directly, as it will be overwritten by bundle.
> #
> # See rfc1700 for the official list of assigned services
> #
> #
> # Network services, Internet style
> #
> tcpmux          1/tcp
> echo            7/udp
> echo            7/tcp
> discard         9/udp           sink null
> discard         9/tcp           sink null
> systat          11/tcp          users
> systat          11/udp          users
> daytime         13/udp
> daytime         13/tcp
> netstat         15/tcp
> qotd            17/tcp          quote
> qotd            17/udp          quote
> msp             18/tcp                          # message send protocol
> msp             18/udp                          # message send protocol
> chargen         19/tcp          ttytst source
> chargen         19/udp          ttytst source
> ftp-data        20/tcp
> ftp             21/tcp
> ssh             22/tcp                          # Secure Shell Login
> ssh             22/udp
> telnet          23/tcp
> smtp            25/tcp          mail
> time            37/tcp          timserver
> time            37/udp          timserver
> rlp             39/udp          resource        # resource location
> nameserver      42/tcp          name            # IEN 116
> nameserver      42/udp          name            # IEN 116
> whois           43/tcp          nicname         # usually to sri-nic
> re-mail-ck      50/tcp          mailcheck       # rfc1339
> re-mail-ck      50/udp          mailcheck       #
> 
> Anybody have any ideas on where this is coming from and how to make it 
> go away?
> 
> Thanks, Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: Nick Puz <npuz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: using snprintf
Date: Mon, 16 Jan 2006 18:41:59 -0800
Lines: 74
Distribution: su
Message-ID: <dqhlhk$ga9$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601141138060.23768-100000@elaine24.Stanford.EDU> <dqbo59$hba$1@news.Stanford.EDU> <dqfg50$6l9$1@news.Stanford.EDU> <dqgm44$fcp$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqgm44$fcp$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9506

I do not need to use them, I actually am not using stdbool but just put 
it as an example (and added a bool local variable for kicks to see if it 
would compile).

Thank you for the clarification,
-Nick

Matt Falkenhagen wrote:
> No, please don't include header files that were introduced in C99 and 
> not available before.
> 
> The reasons for disallowing C99 are:
> 
> 1. To ensure compatibility with the grading scripts and later 
> assignments, which have only been tested with C89.
> 2. To help TA's grade.  I don't know about Ari, but I'm not greatly 
> familiar with all the new C99 features...
> 
> I find it surprising that stdbool.h works under -ansi, because it relies 
> on the new C99 type _Bool, but I guess it does.
> 
> Anyway, it should be easy to define your own bool type:
> 
> typedef enum { FALSE, TRUE } bool;
> 
> or something like that.  Were there any other C99 libraries you were 
> planning on using?
> 
> -Matt
> 
> Nick Puz wrote:
> 
>> Hi Matt,
>> So just to clarify, is it ok to use other C99 features (such as 
>> stdbool.h) that compile with -ansi ?
>> -nick
>>
>> Matt Falkenhagen wrote:
>>
>>> snprintf is a C99 function.  We require your code to compile with the 
>>> gcc -ansi flag (old C89).  That's probably what you're doing and why 
>>> you're getting that warning: -ansi won't include the declaration of 
>>> snprintf.
>>>
>>> In general, you can't use C99 features, but functions like snprintf 
>>> that were widely available before C99 are fine.  Basically, if your 
>>> code compiles under -ansi, you should be ok.
>>>
>>> In this case, to fix the warning, just add a prototype for snprintf:
>>>
>>> extern int snprintf(char *s, size_t n, const char *fmt, ...);
>>>
>>> -Matt
>>>
>>> Roy Mehdi Zeighami wrote:
>>>
>>>> Hello...
>>>>
>>>> Is anyone else using snprintf?  gcc compiles with warnings when I 
>>>> use it.
>>>> It says:
>>>>
>>>> warning: implicit declaration of function 'snprintf'
>>>>
>>>> but seems to work fine.  The man page says I need to include stdio.h 
>>>> but
>>>> that doesn't seem to shut it up.
>>>>
>>>> Any suggestions?
>>>>
>>>> Thanks,
>>>>
>>>> Roy
>>>>
.

Path: shelby.stanford.edu!saga7.Stanford.EDU!vijayk
From: Vijay K Kulkarni <vijayk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: files with no extensions
Date: Mon, 16 Jan 2006 19:07:18 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0601161904180.15048-100000@saga7.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9507

Hi,
I am sure this must have been mentioned earlier, how does one pass the
'no extension' as a parameter to ftpcopy i.e say I want to retrieve  files
like  'README', 'notes' etc.
thanks,
Vijay.

.

Path: shelby.stanford.edu!not-for-mail
From: Jens Pillgram-Larsen <jenspl@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Stray output
Date: Mon, 16 Jan 2006 19:14:18 -0800
Lines: 62
Distribution: su
Message-ID: <dqhnea$i5s$1@news.Stanford.EDU>
References: <dqhkbj$ff8$1@news.Stanford.EDU> <dqhl33$g21$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <dqhl33$g21$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9508

By debug info I just mean some printf's with debug information. I think 
I can track it down if it's in getservbyname. Probably not clearing a 
buffer or forgot a \0.

Jens.

Matt Falkenhagen wrote:
> I don't know what you mean by debug information, but your output looks 
> like part of /etc/services, which getservbyname reads.
> 
> Jens Pillgram-Larsen wrote:
>> Hi,
>>
>> When I'm displaying debug information I receive the following 
>> unexpected output.
>>
>> 99
>> #
>> # maintained by action@leland.stanford.edu
>> #
>> # Do not edit this file directly, as it will be overwritten by bundle.
>> #
>> # See rfc1700 for the official list of assigned services
>> #
>> #
>> # Network services, Internet style
>> #
>> tcpmux          1/tcp
>> echo            7/udp
>> echo            7/tcp
>> discard         9/udp           sink null
>> discard         9/tcp           sink null
>> systat          11/tcp          users
>> systat          11/udp          users
>> daytime         13/udp
>> daytime         13/tcp
>> netstat         15/tcp
>> qotd            17/tcp          quote
>> qotd            17/udp          quote
>> msp             18/tcp                          # message send protocol
>> msp             18/udp                          # message send protocol
>> chargen         19/tcp          ttytst source
>> chargen         19/udp          ttytst source
>> ftp-data        20/tcp
>> ftp             21/tcp
>> ssh             22/tcp                          # Secure Shell Login
>> ssh             22/udp
>> telnet          23/tcp
>> smtp            25/tcp          mail
>> time            37/tcp          timserver
>> time            37/udp          timserver
>> rlp             39/udp          resource        # resource location
>> nameserver      42/tcp          name            # IEN 116
>> nameserver      42/udp          name            # IEN 116
>> whois           43/tcp          nicname         # usually to sri-nic
>> re-mail-ck      50/tcp          mailcheck       # rfc1339
>> re-mail-ck      50/udp          mailcheck       #
>>
>> Anybody have any ideas on where this is coming from and how to make it 
>> go away?
>>
>> Thanks, Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Purify and the test script
Date: Mon, 16 Jan 2006 21:03:57 -0800
Lines: 34
Distribution: su
Message-ID: <dqhts3$nqu$1@news.Stanford.EDU>
References: <dqgrq7$ks4$1@news.Stanford.EDU> <dqgv32$o64$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqgv32$o64$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9509

Hmm..good point. I guess we better update the regex in the test script.

Ari



Steve Goldman wrote:
> The grading script output says:
> 
> purify.output did not match expected regexp:
> 
>   \* Purify 200\S+ Solaris 2 \(32-bit\) Copyright \(C\) 1992-200\d 
> Rational Software Corp\.\s+All rights reserved\.
> 
> The corresponding line in my purify.output is:
> 
>   * Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) 
> Copyright IBM Corp. 1992, 2005 All rights reserved.
> 
> If this is the only part of the file that doesn't match, then maybe it's 
> a problem with the script?  Maybe the Purify people changed the 
> copyright line in their output?
> 
> Steve Goldman wrote:
> 
>> My program is failing the last test in the script, the one that checks 
>> if we "actually used purify."  I have no memory leaks and no open file 
>> descriptors (except the .name_service_door, which we were instructed 
>> to ignore).  From what I can tell, I am error free.  Is there 
>> something I need to put in my .purify file (besides to two suggestions 
>> on the purify FAQ) to suppress whatever data is causing the failure?
>>
>> Thanks,
>> Steve
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problem set submission
Date: Mon, 16 Jan 2006 21:04:26 -0800
Lines: 10
Distribution: su
Message-ID: <dqhtt0$nqu$2@news.Stanford.EDU>
References: <43CC1B9D.2080209@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <43CC1B9D.2080209@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:9510

Hand-written or electronic, whatever works for you.

Ari

Sesha Narahari wrote:
> Should these be hand-written?
> 
> Thanks,
> Sesha
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: FTP: ftp protocol error handling
Date: Mon, 16 Jan 2006 23:30:29 -0800
Lines: 15
Distribution: su
Message-ID: <dqi6ep$3b7$1@news.Stanford.EDU>
References: <dqhave$5ld$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqhave$5ld$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9511

If the user specified remote directory does not exist, exit with ERROR 
and an appropriate message.
Similarly, if the ftp server rejects your attempted login, exit with 
ERROR and an appropriate message. Looking at the first digit of the FTP 
reply code should give you enough information to know what to do.

If a file is not accessible, skip it and move to the next file.

Ari

Hector Chan wrote:
> What are we going to do if the user specified a remote directory from the command line that does not exist?  Also, what about when the ftp server does not allow anonymous login?  Do we have to parse all the FTP reply codes, or just selectively or not at all, to check for errors?  Would there any file permission issues such as a file or directory can be listed but not accessible?  I am sorry I am just a little paranoid...
> 
> Thanks,
> Hector
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problem set 1, question 3
Date: Mon, 16 Jan 2006 23:39:40 -0800
Lines: 14
Distribution: su
Message-ID: <dqi704$3up$1@news.Stanford.EDU>
References: <dqhiku$d9q$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqhiku$d9q$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9512

You can think of it as the time from when the first bit of the packet 
reaches the buffer to the time that the first bit of the packet leaves 
the buffer is, on average, 10ms.

Ryan Matthew Smith wrote:
> problem set 1, question 3 says: 
> "a packet is buffered, on average, 10ms by the router" 
> 
> does this mean that the time from when the first bit of the packet
> reaches the buffer to the time that the last bit of the packet 
> leaves the buffer is, on average, 10ms? 
> 
> thanks, 
> ryan. 
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Allowing scripting wrappers
Date: Mon, 16 Jan 2006 23:42:51 -0800
Lines: 20
Distribution: su
Message-ID: <dqi760$43t$1@news.Stanford.EDU>
References: <dqf6l0$ra0$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqf6l0$ra0$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9513

Unfortunately, the grading scripts won't work correctly unless the 
entire program is written in ANSI C. We're working on improving the 
grading scripts to be more flexible, but that won't be ready until a 
future version of the class. I realize that the string parsing for this 
assignment can be annoying, but if you can just bear with it for this 
assignment, the next assignments have much less of it to deal with.

Ari

Jens Pillgram-Larsen wrote:
> I was just wondering if you guys would consider allowing us to write 
> wrappers for our programs in a scripting language. I find myself 
> spending most of my time doing string parsing, which I don't really 
> think is the point of this class. If I was allowed to write a Perl 
> wrapper I would be able to concentrate much more on the networking 
> programming.
> 
> Just my 2 cents.
> 
> Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: files with no extensions
Date: Mon, 16 Jan 2006 23:44:19 -0800
Lines: 13
Distribution: su
Message-ID: <dqi78n$43t$2@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601161904180.15048-100000@saga7.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601161904180.15048-100000@saga7.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9514

These files can be picked up if you pass the * extension. There is no 
way to specify just a null extension.

Ari

Vijay K Kulkarni wrote:
> Hi,
> I am sure this must have been mentioned earlier, how does one pass the
> 'no extension' as a parameter to ftpcopy i.e say I want to retrieve  files
> like  'README', 'notes' etc.
> thanks,
> Vijay.
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Drew Willcoxon <drew.willcoxon@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Hanging on Test L
Date: Tue, 17 Jan 2006 00:06:25 -0800
Lines: 15
Distribution: su
Message-ID: <dqi8hd$7jl$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9515

My ftpcopy times out on Tests L.1 through L.4.  So while it was hanging, 
I tried connecting (from a different machine/process) to the server and 
port that the test set up, and I found that the server never sends a 220 
(or at least my ftpcopy hangs while trying to read any reply at all from 
the server).  So then I tried connecting to the server using the ftp 
Unix program, and it appears to be the same thing -- at the prompt I get 
"Connected to saga7.stanford.edu." and then it just sits there.

I have no problem if I set up a server with ftpd myself and then connect 
to it.  It's just with the test script, and it's definitely hanging 
trying to read.  Anyone else have similar results, or any kind person 
have any insight?

Thanks,
Drew
.

Path: shelby.stanford.edu!not-for-mail
From: "Kevin Hart" <kevin.hart@hp.com>
Newsgroups: su.class.cs244a
Subject: ftp.microsoft.com
Date: Tue, 17 Jan 2006 01:10:19 -0700
Lines: 7
Distribution: su
Message-ID: <dqi8pg$83e$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9516

My calls to read() seem to hang when trying to connect to the 
ftp.microsoft.com sever, but they work fine when dealing with all of the 
other ftp servers.  When I try connecting to the microsoft server using a 
commercial ftp client from a non-Stanford IP address, it seems to work fine. 
Has anyone else seen this? 


.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: files with no extensions
Date: Tue, 17 Jan 2006 01:03:25 -0800
Lines: 25
Distribution: su
Message-ID: <dqibt3$b9u$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601161904180.15048-100000@saga7.Stanford.EDU> <dqi78n$43t$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <dqi78n$43t$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9517

Do we have to support wildcard expressions passed in as the file 
extension argument to the program? For exmaple:

../ftpcopy *k 1 ftp . .

Should this to download files with extensions that end with k? There is 
no mention of having to support wildcards in the assignment. Or have I 
missed something?


Ari Greenberg wrote:
> These files can be picked up if you pass the * extension. There is no 
> way to specify just a null extension.
> 
> Ari
> 
> Vijay K Kulkarni wrote:
>> Hi,
>> I am sure this must have been mentioned earlier, how does one pass the
>> 'no extension' as a parameter to ftpcopy i.e say I want to retrieve  
>> files
>> like  'README', 'notes' etc.
>> thanks,
>> Vijay.
>>
.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: files with no extensions
Date: Tue, 17 Jan 2006 01:04:38 -0800
Lines: 23
Distribution: su
Message-ID: <dqibv3$bb9$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601161904180.15048-100000@saga7.Stanford.EDU> <dqi78n$43t$2@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:9518

Oh, do we have to handle wildcards for extensions?

Thanks,
Waynn

"Ari Greenberg" <arigreen@cs.stanford.edu> wrote in message
news:dqi78n$43t$2@news.Stanford.EDU...
> These files can be picked up if you pass the * extension. There is no
> way to specify just a null extension.
>
> Ari
>
> Vijay K Kulkarni wrote:
> > Hi,
> > I am sure this must have been mentioned earlier, how does one pass the
> > 'no extension' as a parameter to ftpcopy i.e say I want to retrieve
files
> > like  'README', 'notes' etc.
> > thanks,
> > Vijay.
> >


.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: files with no extensions
Date: Tue, 17 Jan 2006 02:55:49 -0800
Lines: 22
Distribution: su
Message-ID: <dqiifj$gd2$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601161904180.15048-100000@saga7.Stanford.EDU> <dqi78n$43t$2@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:9519

Are we expected to parse wildcards?

Waynn

"Ari Greenberg" <arigreen@cs.stanford.edu> wrote in message
news:dqi78n$43t$2@news.Stanford.EDU...
> These files can be picked up if you pass the * extension. There is no
> way to specify just a null extension.
>
> Ari
>
> Vijay K Kulkarni wrote:
> > Hi,
> > I am sure this must have been mentioned earlier, how does one pass the
> > 'no extension' as a parameter to ftpcopy i.e say I want to retrieve
files
> > like  'README', 'notes' etc.
> > thanks,
> > Vijay.
> >


.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp.microsoft.com
Date: Tue, 17 Jan 2006 03:39:12 -0800
Organization: Stanford University
Lines: 14
Distribution: su
Message-ID: <20060117033912.773cda3a@ballpoint>
References: <dqi8pg$83e$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9520

I had trouble connecting to Microsoft when using the normal command line
FTP client (make sure it is in non-passive mode), so I figured it wasn't
my program's fault.

On Tue, 17 Jan 2006 01:10:19 -0700
"Kevin Hart" <kevin.hart@hp.com> wrote:

> My calls to read() seem to hang when trying to connect to the 
> ftp.microsoft.com sever, but they work fine when dealing with all of the 
> other ftp servers.  When I try connecting to the microsoft server using a 
> commercial ftp client from a non-Stanford IP address, it seems to work fine. 
> Has anyone else seen this? 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: fdopen
Date: Tue, 17 Jan 2006 03:41:39 -0800
Organization: Stanford University
Lines: 4
Distribution: su
Message-ID: <20060117034139.27eeec82@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9521

Are we allowed to use fdopen on the control connection and LIST output? 
Are there any known pitfalls with this approach?

Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp.microsoft.com
Date: Tue, 17 Jan 2006 08:33:26 -0800
Lines: 18
Distribution: su
Message-ID: <dqj68v$6ov$1@news.Stanford.EDU>
References: <dqi8pg$83e$1@news.Stanford.EDU> <20060117033912.773cda3a@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060117033912.773cda3a@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9522

They may have been down before, but appear to be up now.

David Reiss wrote:
> I had trouble connecting to Microsoft when using the normal command line
> FTP client (make sure it is in non-passive mode), so I figured it wasn't
> my program's fault.
> 
> On Tue, 17 Jan 2006 01:10:19 -0700
> "Kevin Hart" <kevin.hart@hp.com> wrote:
> 
> 
>>My calls to read() seem to hang when trying to connect to the 
>>ftp.microsoft.com sever, but they work fine when dealing with all of the 
>>other ftp servers.  When I try connecting to the microsoft server using a 
>>commercial ftp client from a non-Stanford IP address, it seems to work fine. 
>>Has anyone else seen this? 
>>
>>
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Hanging on Test L
Date: Tue, 17 Jan 2006 08:35:02 -0800
Lines: 19
Distribution: su
Message-ID: <dqj6bu$6ov$2@news.Stanford.EDU>
References: <dqi8hd$7jl$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqi8hd$7jl$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9523

Are you still seeing this?  It works for me.  Perhaps try on a different 
machine?

Drew Willcoxon wrote:
> My ftpcopy times out on Tests L.1 through L.4.  So while it was hanging, 
> I tried connecting (from a different machine/process) to the server and 
> port that the test set up, and I found that the server never sends a 220 
> (or at least my ftpcopy hangs while trying to read any reply at all from 
> the server).  So then I tried connecting to the server using the ftp 
> Unix program, and it appears to be the same thing -- at the prompt I get 
> "Connected to saga7.stanford.edu." and then it just sits there.
> 
> I have no problem if I set up a server with ftpd myself and then connect 
> to it.  It's just with the test script, and it's definitely hanging 
> trying to read.  Anyone else have similar results, or any kind person 
> have any insight?
> 
> Thanks,
> Drew
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: fdopen
Date: Tue, 17 Jan 2006 08:46:28 -0800
Lines: 14
Distribution: su
Message-ID: <dqj71c$7lb$1@news.Stanford.EDU>
References: <20060117034139.27eeec82@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060117034139.27eeec82@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9524

You're certainly allowed to, but I can't say I've tried it.  This thread:

http://groups.google.com/group/comp.unix.programmer/browse_frm/thread/89b20770265d387f/

makes it sound like it's ok, as long as you don't mix syscalls with 
stdio functions.

-Matt

David Reiss wrote:
> Are we allowed to use fdopen on the control connection and LIST output? 
> Are there any known pitfalls with this approach?
> 
> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: "Frans Effendi" <franse@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test G and H
Date: Tue, 17 Jan 2006 09:04:38 -0800
Lines: 11
Distribution: su
Message-ID: <dqj83t$8k9$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9525

I notice that these tests G and H are not included in the testing script.
(at least it is what I saw in the test summary result)
Are these tests have been dropped from the grading criteria or is there
something wrong with my program that prevents these tests from running?
Just want to make sure.

Thanks,

Frans 


.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: files with no extensions
Date: Tue, 17 Jan 2006 09:07:15 -0800
Lines: 36
Distribution: su
Message-ID: <dqj889$8jp$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601161904180.15048-100000@saga7.Stanford.EDU> <dqi78n$43t$2@news.Stanford.EDU> <dqiifj$gd2$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqiifj$gd2$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9526

Sorry, I don't know what I was thinking. I thought I had seen the 
wildcard requirement in the assignment but after rereading it clearly 
there is no mention of any wildcard extension. Don't worry about it, and 
don't worry about files with no extensions either.

Sorry about the confusion.
Ari

Waynn Lue wrote:
> Are we expected to parse wildcards?
> 
> Waynn
> 
> "Ari Greenberg" <arigreen@cs.stanford.edu> wrote in message
> news:dqi78n$43t$2@news.Stanford.EDU...
> 
>>These files can be picked up if you pass the * extension. There is no
>>way to specify just a null extension.
>>
>>Ari
>>
>>Vijay K Kulkarni wrote:
>>
>>>Hi,
>>>I am sure this must have been mentioned earlier, how does one pass the
>>>'no extension' as a parameter to ftpcopy i.e say I want to retrieve
> 
> files
> 
>>>like  'README', 'notes' etc.
>>>thanks,
>>>Vijay.
>>>
> 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PORT command on ftp.cs.stanford.edu
Date: Tue, 17 Jan 2006 09:08:51 -0800
Lines: 27
Distribution: su
Message-ID: <dqj8bb$8qp$1@news.Stanford.EDU>
References: <dqgjbt$d3k$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqgjbt$d3k$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9527

It sounds like there's two issues raised in this thread.

First, how to get your local IP.  As the FAQ Q21 says, "There are a few 
ways to do this."  Both methods mentioned in this thread: using 
gethostbyname on $HOST and using getsockname on the established control 
socket, should work fine.  To debug, you can print out the IP you get 
and compare against the output of "ifconfig -a".

Second, even if you have correct IP, PORT isn't responding.  Using 
TCP_NODELAY seems like a hack to me, but if it works for you, it works. 
  The other suggestion, using one write() per request, is a good idea 
anyway for efficiency because you're sending only a small request over. 
  Just make sure you check the return value of write; you can't assume 
it actually sends everything requested.

-Matt

Michi Mutsuzaki wrote:
> Hello,
> 
> I'm having a problem with the PORT command. The server 
> ftp.cs.stanford.edu doesn't respond to the command. I've
> tried different servers (ftp.microsoft.com, ftp.stanford.edu,
> etc...), and it works fine. Any idea why this is happening?
> 
> Thank you,
> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Sesha Narahari <narahari@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Problem Set#1. Question 7 missing?
Date: Tue, 17 Jan 2006 11:36:53 -0800
Lines: 6
Distribution: su
Message-ID: <43CD4755.7070708@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9528

The numbering seems to jump from 6 to 8. I have 3 pages. Am I missing 
anything?

Thanks,
Sesha

.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem Set#1. Question 7 missing?
Date: Tue, 17 Jan 2006 12:41:39 -0800
Lines: 9
Distribution: su
Message-ID: <dqjkqc$mu2$1@news.Stanford.EDU>
References: <43CD4755.7070708@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <43CD4755.7070708@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:9529

Question 7 doesn't exist.

Sesha Narahari wrote:
> The numbering seems to jump from 6 to 8. I have 3 pages. Am I missing 
> anything?
> 
> Thanks,
> Sesha
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Drew Willcoxon <drew.willcoxon@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Hanging on Test L
Date: Tue, 17 Jan 2006 15:59:19 -0800
Lines: 15
Distribution: su
Message-ID: <dqk0c2$6h4$1@news.Stanford.EDU>
References: <dqi8hd$7jl$1@news.Stanford.EDU> <dqj6bu$6ov$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <dqj6bu$6ov$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9530

My problem was different from what I thought.  I wasn't checking the 
server's reply from RETR before trying to read on the data connection, 
so when the server sent a 500-something because I didn't have 
permission, I tried to read, instead of skipping the file.  I was thrown 
a little off guard because while I would expect this behavior for test 
L.3 ("Checks that ftpcopy does not create inaccessible file."), I didn't 
realize this was also causing L.1 ("Checks that ftpcopy transfers zero 
byte file correctly.") to timeout.

Thanks,
Drew

Matt Falkenhagen wrote:
> Are you still seeing this?  It works for me.  Perhaps try on a different 
> machine?
.

Path: shelby.stanford.edu!saga17.Stanford.EDU!wachs
From: Megan Anneke Wachs <wachs@stanford.edu>
Newsgroups: su.class.cs244a
Subject: test script format?
Date: Tue, 17 Jan 2006 18:49:00 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.GSO.4.44.0601171846240.3941-100000@saga17.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9531

I'm having trouble submitting my code to the test script...

I'm using the command line:

/usr/class/cs244a/bin/test_code.pl hw1 Makefile ftpcopy.c ftpparse.c
purify.output ftpcopy.purify

but I get the error

"File missing in submission: No file matching "purify.output" even though
I generated that file with purify. What am I missing here?

Thanks!
Megan

.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re-using Listening Socket
Date: Tue, 17 Jan 2006 19:15:28 -0800
Organization: Stanford University
Lines: 8
Distribution: su
Message-ID: <20060117191528.68f30d4b@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9532

Should I re-bind the listening socket to a new port for every download
request?  I've just been using one listening socket the whole time, and
it has been working fine, but I'm afraid that if an FTP server used the
same outgoing port for each connection, packets from the two connections
could get crossed.  If I do rebind it, do I need to close the socket
first and create a new one, or can I just call bind and listen again?

--David
.

Path: shelby.stanford.edu!elaine24.Stanford.EDU!zeighami
From: Roy Mehdi Zeighami <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PORT command on ftp.cs.stanford.edu
Date: Tue, 17 Jan 2006 20:24:40 -0800
Lines: 48
Distribution: su
Message-ID: <Pine.GSO.4.44.0601172020270.29002-100000@elaine24.Stanford.EDU>
References: <dqgjbt$d3k$1@news.Stanford.EDU> <dqj8bb$8qp$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <dqj8bb$8qp$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9533

Hello...

I am seeing the same issue on ftp.cs.stanford.edu, when I issue the PORT
command I never get a response on the control socket and my program
blocks.  I tried command line ftp and it seems to work just fine.

Is anyone else still seeing this?

I tried the setsockopt call but
I couldn't get it to compile.  It doesn't seems that TCP_NODELAY is
defined in sys/socket.h

Have any of the other folks figured out how to work around this?  Thanks
for all the help.

Roy

On Tue, 17 Jan 2006, Matt Falkenhagen wrote:

> It sounds like there's two issues raised in this thread.
>
> First, how to get your local IP.  As the FAQ Q21 says, "There are a few
> ways to do this."  Both methods mentioned in this thread: using
> gethostbyname on $HOST and using getsockname on the established control
> socket, should work fine.  To debug, you can print out the IP you get
> and compare against the output of "ifconfig -a".
>
> Second, even if you have correct IP, PORT isn't responding.  Using
> TCP_NODELAY seems like a hack to me, but if it works for you, it works.
>   The other suggestion, using one write() per request, is a good idea
> anyway for efficiency because you're sending only a small request over.
>   Just make sure you check the return value of write; you can't assume
> it actually sends everything requested.
>
> -Matt
>
> Michi Mutsuzaki wrote:
> > Hello,
> >
> > I'm having a problem with the PORT command. The server
> > ftp.cs.stanford.edu doesn't respond to the command. I've
> > tried different servers (ftp.microsoft.com, ftp.stanford.edu,
> > etc...), and it works fine. Any idea why this is happening?
> >
> > Thank you,
> > --Michi
>

.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PORT command on ftp.cs.stanford.edu
Date: Tue, 17 Jan 2006 20:46:53 -0800
Lines: 58
Distribution: su
Message-ID: <dqkh86$qp5$1@news.Stanford.EDU>
References: <dqgjbt$d3k$1@news.Stanford.EDU> <dqj8bb$8qp$1@news.Stanford.EDU> <Pine.GSO.4.44.0601172020270.29002-100000@elaine24.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601172020270.29002-100000@elaine24.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9534

Check that you end your request with \r\n.

Otherwise, it sounds like people have better success when sending the 
request all in one write(), are you doing that?

-Matt

Roy Mehdi Zeighami wrote:
> Hello...
> 
> I am seeing the same issue on ftp.cs.stanford.edu, when I issue the PORT
> command I never get a response on the control socket and my program
> blocks.  I tried command line ftp and it seems to work just fine.
> 
> Is anyone else still seeing this?
> 
> I tried the setsockopt call but
> I couldn't get it to compile.  It doesn't seems that TCP_NODELAY is
> defined in sys/socket.h
> 
> Have any of the other folks figured out how to work around this?  Thanks
> for all the help.
> 
> Roy
> 
> On Tue, 17 Jan 2006, Matt Falkenhagen wrote:
> 
> 
>>It sounds like there's two issues raised in this thread.
>>
>>First, how to get your local IP.  As the FAQ Q21 says, "There are a few
>>ways to do this."  Both methods mentioned in this thread: using
>>gethostbyname on $HOST and using getsockname on the established control
>>socket, should work fine.  To debug, you can print out the IP you get
>>and compare against the output of "ifconfig -a".
>>
>>Second, even if you have correct IP, PORT isn't responding.  Using
>>TCP_NODELAY seems like a hack to me, but if it works for you, it works.
>>  The other suggestion, using one write() per request, is a good idea
>>anyway for efficiency because you're sending only a small request over.
>>  Just make sure you check the return value of write; you can't assume
>>it actually sends everything requested.
>>
>>-Matt
>>
>>Michi Mutsuzaki wrote:
>>
>>>Hello,
>>>
>>>I'm having a problem with the PORT command. The server
>>>ftp.cs.stanford.edu doesn't respond to the command. I've
>>>tried different servers (ftp.microsoft.com, ftp.stanford.edu,
>>>etc...), and it works fine. Any idea why this is happening?
>>>
>>>Thank you,
>>>--Michi
>>
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test G and H
Date: Tue, 17 Jan 2006 20:54:08 -0800
Lines: 20
Distribution: su
Message-ID: <dqkhlq$rjv$1@news.Stanford.EDU>
References: <dqj83t$8k9$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqj83t$8k9$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9535

Tests G and H aren't in the testing script we give you.  The script will 
tell you if there's something wrong with your program, it won't just 
silently skip tests.

It is possible they're still in the grading criteria, see FAQ Q17.

-Matt

Frans Effendi wrote:
> I notice that these tests G and H are not included in the testing script.
> (at least it is what I saw in the test summary result)
> Are these tests have been dropped from the grading criteria or is there
> something wrong with my program that prevents these tests from running?
> Just want to make sure.
> 
> Thanks,
> 
> Frans 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: test script format?
Date: Tue, 17 Jan 2006 21:02:08 -0800
Lines: 26
Distribution: su
Message-ID: <dqki4q$s20$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601171846240.3941-100000@saga17.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601171846240.3941-100000@saga17.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9536

Strange... are you sure "purify.output" actually exists in your 
directory?  I don't know what to say... it should work.

Also, you shouldn't submit "ftpcopy.purify", and you should include your 
headers and a ".purify" file.  I usually submit with args:

Makefile *.c *.h purify.output .purify

-Matt

Megan Anneke Wachs wrote:
> I'm having trouble submitting my code to the test script...
> 
> I'm using the command line:
> 
> /usr/class/cs244a/bin/test_code.pl hw1 Makefile ftpcopy.c ftpparse.c
> purify.output ftpcopy.purify
> 
> but I get the error
> 
> "File missing in submission: No file matching "purify.output" even though
> I generated that file with purify. What am I missing here?
> 
> Thanks!
> Megan
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Re-using Listening Socket
Date: Tue, 17 Jan 2006 21:25:32 -0800
Lines: 24
Distribution: su
Message-ID: <dqkjgm$4j$1@news.Stanford.EDU>
References: <20060117191528.68f30d4b@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060117191528.68f30d4b@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9537

You should bind to a new port each time a data connection is opened. 
You aren't supposed to reuse the same port, as the RFC states:

       Reuse of the Data Connection:  When using the stream mode of data
       transfer the end of the file must be indicated by closing the
       connection.  This causes a problem if multiple files are to be
       transfered in the session, due to need for TCP to hold the
       connection record for a time out period to guarantee the reliable
       communication.  Thus the connection can not be reopened at once.

I believe the only clean way to do this is to close and create a new one.

-Matt


David Reiss wrote:
> Should I re-bind the listening socket to a new port for every download
> request?  I've just been using one listening socket the whole time, and
> it has been working fine, but I'm afraid that if an FTP server used the
> same outgoing port for each connection, packets from the two connections
> could get crossed.  If I do rebind it, do I need to close the socket
> first and create a new one, or can I just call bind and listen again?
> 
> --David
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Sample Exams
Date: Tue, 17 Jan 2006 22:03:22 -0800
Lines: 7
Distribution: su
Message-ID: <dqklnc$29k$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9538

Hi,

The links to the past years' midterms and finals on the webpage are 
dead.  Any idea if we can get a look at those?

Thanks,
Steve
.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: accept blocks on reading files with no read permission
Date: Tue, 17 Jan 2006 22:06:26 -0800
Lines: 13
Distribution: su
Message-ID: <dqklt2$2ds$3@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9540

Here is what I'm doing to retrieve files:

1. create a new data connection.
2. send retr command.
3. accept a connection from the server.
4. read data from the data connection.
5. check the control connection for reply.

It works fine as long as I have a read permission. When I don't, the 
accept blocks. How can I get around this?

Thanks,
--Michi
.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Directory Exists?
Date: Tue, 17 Jan 2006 22:13:51 -0800
Organization: Stanford University
Lines: 3
Distribution: su
Message-ID: <20060117221351.3ca56b27@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9541

I understand the correct behavior when a local file already exists, but
what about when a local directory already exists.  How about a local
file with the same name as a directory that we are supposed to create?
.

Path: shelby.stanford.edu!not-for-mail
From: Drew Willcoxon <drew.willcoxon@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: accept blocks on reading files with no read permission
Date: Tue, 17 Jan 2006 22:20:56 -0800
Lines: 23
Distribution: su
Message-ID: <dqkmne$3f9$1@news.Stanford.EDU>
References: <dqklt2$2ds$3@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <dqklt2$2ds$3@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9542

I ran into this, too, and I fixed it when I realized that after sending 
RETR, I should immediately read one reply from the control connection 
before trying to read data.  The server sends back a 500-series reply if 
you don't have permission.  (It sends a 100-series if you should begin 
transfer.)  After you finish reading the data, it'll send a 200-series.

Hope that helps,
Drew

Michi Mutsuzaki wrote:
> Here is what I'm doing to retrieve files:
> 
> 1. create a new data connection.
> 2. send retr command.
> 3. accept a connection from the server.
> 4. read data from the data connection.
> 5. check the control connection for reply.
> 
> It works fine as long as I have a read permission. When I don't, the 
> accept blocks. How can I get around this?
> 
> Thanks,
> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: accept blocks on reading files with no read permission
Date: Tue, 17 Jan 2006 22:21:15 -0800
Lines: 16
Distribution: su
Message-ID: <dqkmp5$3mm$1@news.Stanford.EDU>
References: <dqklt2$2ds$3@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqklt2$2ds$3@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9543

Check the reply code before accept().

Michi Mutsuzaki wrote:
> Here is what I'm doing to retrieve files:
> 
> 1. create a new data connection.
> 2. send retr command.
> 3. accept a connection from the server.
> 4. read data from the data connection.
> 5. check the control connection for reply.
> 
> It works fine as long as I have a read permission. When I don't, the 
> accept blocks. How can I get around this?
> 
> Thanks,
> --Michi
.

Path: shelby.stanford.edu!saga17.Stanford.EDU!wachs
From: Megan Anneke Wachs <wachs@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: test script format?
Date: Tue, 17 Jan 2006 22:24:59 -0800
Lines: 37
Distribution: su
Message-ID: <Pine.GSO.4.44.0601172223070.7453-100000@saga17.Stanford.EDU>
References: <Pine.GSO.4.44.0601171846240.3941-100000@saga17.Stanford.EDU>
 <dqki4q$s20$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <dqki4q$s20$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9544

The problem was solved when I used ./test_script instead of just
test_script.

Thanks,
Megan


On Tue, 17 Jan 2006, Matt Falkenhagen wrote:

> Strange... are you sure "purify.output" actually exists in your
> directory?  I don't know what to say... it should work.
>
> Also, you shouldn't submit "ftpcopy.purify", and you should include your
> headers and a ".purify" file.  I usually submit with args:
>
> Makefile *.c *.h purify.output .purify
>
> -Matt
>
> Megan Anneke Wachs wrote:
> > I'm having trouble submitting my code to the test script...
> >
> > I'm using the command line:
> >
> > /usr/class/cs244a/bin/test_code.pl hw1 Makefile ftpcopy.c ftpparse.c
> > purify.output ftpcopy.purify
> >
> > but I get the error
> >
> > "File missing in submission: No file matching "purify.output" even though
> > I generated that file with purify. What am I missing here?
> >
> > Thanks!
> > Megan
> >
>

.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: accept blocks on reading files with no read permission
Date: Tue, 17 Jan 2006 22:33:24 -0800
Lines: 24
Distribution: su
Message-ID: <dqknfk$409$1@news.Stanford.EDU>
References: <dqklt2$2ds$3@news.Stanford.EDU> <dqkmp5$3mm$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
In-Reply-To: <dqkmp5$3mm$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9545

Hi Matt,

If I do that, the read blocks for files that I do have a read 
permission. Am I missing something?

--Michi

Matt Falkenhagen wrote:
> Check the reply code before accept().
> 
> Michi Mutsuzaki wrote:
>> Here is what I'm doing to retrieve files:
>>
>> 1. create a new data connection.
>> 2. send retr command.
>> 3. accept a connection from the server.
>> 4. read data from the data connection.
>> 5. check the control connection for reply.
>>
>> It works fine as long as I have a read permission. When I don't, the 
>> accept blocks. How can I get around this?
>>
>> Thanks,
>> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Directory Exists?
Date: Tue, 17 Jan 2006 22:45:55 -0800
Lines: 16
Distribution: su
Message-ID: <dqko7d$557$1@news.Stanford.EDU>
References: <20060117221351.3ca56b27@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060117221351.3ca56b27@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9546

If a local dir already exists, just go ahead and use it, you assume it 
exists at the first depth anyway.

If a file exists and you want to make a directory of that name, I think 
the best thing would be to try to remove the file with unlink and then 
create the dir, since you're smashing files anyway.  However, we won't 
be testing this case, so just make a design decision and document it.

-Matt



David Reiss wrote:
> I understand the correct behavior when a local file already exists, but
> what about when a local directory already exists.  How about a local
> file with the same name as a directory that we are supposed to create?
.

Path: shelby.stanford.edu!not-for-mail
From: Hau Jia Chew <haujia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftp.stanford.edu
Date: Tue, 17 Jan 2006 22:55:12 -0800
Lines: 2
Distribution: su
Message-ID: <dqkooh$5ii$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9547

ftp.stanford.edu seems to be down, causing some of the test cases to 
fail. I wonder if it is just me or if everyone is seeing this also.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: accept blocks on reading files with no read permission
Date: Tue, 17 Jan 2006 22:55:59 -0800
Lines: 34
Distribution: su
Message-ID: <dqkoq9$5ja$1@news.Stanford.EDU>
References: <dqklt2$2ds$3@news.Stanford.EDU> <dqkmp5$3mm$1@news.Stanford.EDU> <dqknfk$409$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqknfk$409$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9548

The read shouldn't block.  Check out the RFC, in particular the 
command-reply sequences in Section 5.4 and state diagrams in Section 6. 
  Basically, you should get a 1xx from RETR if server wants to send the 
file over, and a 2xx after the transfer completed.

-Matt

Michi Mutsuzaki wrote:
> Hi Matt,
> 
> If I do that, the read blocks for files that I do have a read 
> permission. Am I missing something?
> 
> --Michi
> 
> Matt Falkenhagen wrote:
> 
>> Check the reply code before accept().
>>
>> Michi Mutsuzaki wrote:
>>
>>> Here is what I'm doing to retrieve files:
>>>
>>> 1. create a new data connection.
>>> 2. send retr command.
>>> 3. accept a connection from the server.
>>> 4. read data from the data connection.
>>> 5. check the control connection for reply.
>>>
>>> It works fine as long as I have a read permission. When I don't, the 
>>> accept blocks. How can I get around this?
>>>
>>> Thanks,
>>> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp.stanford.edu
Date: Tue, 17 Jan 2006 22:57:17 -0800
Lines: 5
Distribution: su
Message-ID: <dqkosm$5ja$2@news.Stanford.EDU>
References: <dqkooh$5ii$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqkooh$5ii$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9549

Yeah, it's been down all day, it's not just you.

Hau Jia Chew wrote:
> ftp.stanford.edu seems to be down, causing some of the test cases to 
> fail. I wonder if it is just me or if everyone is seeing this also.
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problem set submission
Date: Tue, 17 Jan 2006 23:11:41 -0800
Lines: 17
Distribution: su
Message-ID: <dqkpnn$6cu$1@news.Stanford.EDU>
References: <43CC1B9D.2080209@stanford.edu> <dqhtt0$nqu$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqhtt0$nqu$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9550

Correction: By electronic, I meant "typed". We still need you to hand in 
  a hard copy.

Ari

Ari Greenberg wrote:
> Hand-written or electronic, whatever works for you.
> 
> Ari
> 
> Sesha Narahari wrote:
> 
>> Should these be hand-written?
>>
>> Thanks,
>> Sesha
>>
.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: accept blocks on reading files with no read permission
Date: Tue, 17 Jan 2006 23:12:51 -0800
Lines: 41
Distribution: su
Message-ID: <dqkppk$6es$1@news.Stanford.EDU>
References: <dqklt2$2ds$3@news.Stanford.EDU> <dqkmp5$3mm$1@news.Stanford.EDU> <dqknfk$409$1@news.Stanford.EDU> <dqkoq9$5ja$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
In-Reply-To: <dqkoq9$5ja$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9551

Hi Matt,

I got it working now. Thanks for your help.

--Michi

Matt Falkenhagen wrote:
> The read shouldn't block.  Check out the RFC, in particular the 
> command-reply sequences in Section 5.4 and state diagrams in Section 6. 
>  Basically, you should get a 1xx from RETR if server wants to send the 
> file over, and a 2xx after the transfer completed.
> 
> -Matt
> 
> Michi Mutsuzaki wrote:
>> Hi Matt,
>>
>> If I do that, the read blocks for files that I do have a read 
>> permission. Am I missing something?
>>
>> --Michi
>>
>> Matt Falkenhagen wrote:
>>
>>> Check the reply code before accept().
>>>
>>> Michi Mutsuzaki wrote:
>>>
>>>> Here is what I'm doing to retrieve files:
>>>>
>>>> 1. create a new data connection.
>>>> 2. send retr command.
>>>> 3. accept a connection from the server.
>>>> 4. read data from the data connection.
>>>> 5. check the control connection for reply.
>>>>
>>>> It works fine as long as I have a read permission. When I don't, the 
>>>> accept blocks. How can I get around this?
>>>>
>>>> Thanks,
>>>> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp.stanford.edu
Date: Wed, 18 Jan 2006 00:58:57 -0800
Organization: Stanford University
Lines: 12
Distribution: su
Message-ID: <20060118005857.494e9f4a@ballpoint>
References: <dqkooh$5ii$1@news.Stanford.EDU>
	<dqkosm$5ja$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9552

If it is not back up by the morning, is there some way that the test
script can be updated so that we can get a clear idea of how correct
our programs are?

On Tue, 17 Jan 2006 22:57:17 -0800
Matt Falkenhagen <mjf@stanford.edu> wrote:

> Yeah, it's been down all day, it's not just you.
> 
> Hau Jia Chew wrote:
> > ftp.stanford.edu seems to be down, causing some of the test cases to 
> > fail. I wonder if it is just me or if everyone is seeing this also.
.

Path: shelby.stanford.edu!elaine24.Stanford.EDU!zeighami
From: Roy Mehdi Zeighami <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PORT command on ftp.cs.stanford.edu
Date: Wed, 18 Jan 2006 08:47:46 -0800
Lines: 74
Distribution: su
Message-ID: <Pine.GSO.4.44.0601180846230.21285-100000@elaine24.Stanford.EDU>
References: <dqgjbt$d3k$1@news.Stanford.EDU> <dqj8bb$8qp$1@news.Stanford.EDU>
 <Pine.GSO.4.44.0601172020270.29002-100000@elaine24.Stanford.EDU>
 <dqkh86$qp5$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <dqkh86$qp5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9553

That was it, sorry.  Forget that I wrote the command and the \r\n.

I do wonder why this matters, though.  How could the server be written so
that it depends on us doing a single write?  We can't really guarantee
that a buffer is sent in a single write anyway, right?

Just trying to take something away from this.

Thanks,

Roy

On Tue, 17 Jan 2006, Matt Falkenhagen wrote:

> Check that you end your request with \r\n.
>
> Otherwise, it sounds like people have better success when sending the
> request all in one write(), are you doing that?
>
> -Matt
>
> Roy Mehdi Zeighami wrote:
> > Hello...
> >
> > I am seeing the same issue on ftp.cs.stanford.edu, when I issue the PORT
> > command I never get a response on the control socket and my program
> > blocks.  I tried command line ftp and it seems to work just fine.
> >
> > Is anyone else still seeing this?
> >
> > I tried the setsockopt call but
> > I couldn't get it to compile.  It doesn't seems that TCP_NODELAY is
> > defined in sys/socket.h
> >
> > Have any of the other folks figured out how to work around this?  Thanks
> > for all the help.
> >
> > Roy
> >
> > On Tue, 17 Jan 2006, Matt Falkenhagen wrote:
> >
> >
> >>It sounds like there's two issues raised in this thread.
> >>
> >>First, how to get your local IP.  As the FAQ Q21 says, "There are a few
> >>ways to do this."  Both methods mentioned in this thread: using
> >>gethostbyname on $HOST and using getsockname on the established control
> >>socket, should work fine.  To debug, you can print out the IP you get
> >>and compare against the output of "ifconfig -a".
> >>
> >>Second, even if you have correct IP, PORT isn't responding.  Using
> >>TCP_NODELAY seems like a hack to me, but if it works for you, it works.
> >>  The other suggestion, using one write() per request, is a good idea
> >>anyway for efficiency because you're sending only a small request over.
> >>  Just make sure you check the return value of write; you can't assume
> >>it actually sends everything requested.
> >>
> >>-Matt
> >>
> >>Michi Mutsuzaki wrote:
> >>
> >>>Hello,
> >>>
> >>>I'm having a problem with the PORT command. The server
> >>>ftp.cs.stanford.edu doesn't respond to the command. I've
> >>>tried different servers (ftp.microsoft.com, ftp.stanford.edu,
> >>>etc...), and it works fine. Any idea why this is happening?
> >>>
> >>>Thank you,
> >>>--Michi
> >>
> >
>

.

Path: shelby.stanford.edu!saga16.Stanford.EDU!lamskm
From: lamskm@Stanford.EDU (Michael Lam)
Newsgroups: su.class.cs244a
Subject: problems submission for scpd students
Date: Wed, 18 Jan 2006 16:54:29 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <dqlrs5$dec$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
Summary: problems submission for scpd students
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:9554

Pardon my question for the non scpd students.
From the scpd students orientation, we were told that when submitting
assignments, send one to the scpd dept, and one to the normal class
channel (which would be Judy).  However, since the instruction for
going to Judy is to leave it under the door, can we submit via email?

Matt is my assigned TA.  Does it mean he will grade my problem set?
Is it possible that I email my problem set solution to the TA?

I am just trying to find a way of submitting without coming to campus.

Thanks.

-Michael
.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!wkso
From: Wai Kei So <wkso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS#1 Q6
Date: Wed, 18 Jan 2006 08:55:58 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0601180854020.6165-100000@elaine3.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9555

Hello,

How do we calculate the d(t) for discrete arrival and service processes?
Is d(t) in terms of the first bit or the last bit of the packet?  Thanks
very much in advance.

-Wai Kei

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!ptrlee
From: Peter In Lee <ptrlee@elaine1.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: using cs140 list code
Date: Wed, 18 Jan 2006 09:49:14 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.GSO.4.44.0601180946510.13232-100000@elaine1.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9556

I'd like to reuse the linked list code from the cs140 pintos project.
Would this be alright, or do I need to write my own?

-- Peter

.

Path: shelby.stanford.edu!not-for-mail
From: Daniel Holbert <dholbert@NOSPAM.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Freeing memory when exiting with an error condition
Date: Wed, 18 Jan 2006 10:26:43 -0800
Lines: 9
Distribution: su
Message-ID: <dqm19g$il8$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9557

Do we need to free in-use memory when we exit?

In particular, suppose I'm about to exit with an error condition.  Do I 
need to go through and free all of my malloc'd memory before exiting, or 
am I ok to just exit?  (since the memory is automatically freed when the 
program exits, anyway)

Thanks,
~Daniel
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Freeing memory when exiting with an error condition
Date: Wed, 18 Jan 2006 10:32:20 -0800
Lines: 15
Distribution: su
Message-ID: <dqm1ju$ion$1@news.Stanford.EDU>
References: <dqm19g$il8$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqm19g$il8$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9558

See thread "purify errors" started on 1/14/2006 2:04 PM.

You DO have to free memory, close file descriptors, close sockets, etc 
when exiting with status OK though.

Daniel Holbert wrote:
> Do we need to free in-use memory when we exit?
> 
> In particular, suppose I'm about to exit with an error condition.  Do I 
> need to go through and free all of my malloc'd memory before exiting, or 
> am I ok to just exit?  (since the memory is automatically freed when the 
> program exits, anyway)
> 
> Thanks,
> ~Daniel
.

Path: shelby.stanford.edu!not-for-mail
From: "Robbie Yan" <xyan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS#1 Q6
Date: Wed, 18 Jan 2006 12:30:22 -0800
Lines: 15
Distribution: su
Message-ID: <dqm8gn$r9a$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601180854020.6165-100000@elaine3.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Xref: shelby.stanford.edu su.class.cs244a:9559

I think the interpretation of d(t) is as follows: if a bit arrives at time
t, the time it has to wait before being sent out of the router is d(t).

"Wai Kei So" <wkso@stanford.edu> wrote in message
news:Pine.GSO.4.44.0601180854020.6165-100000@elaine3.Stanford.EDU...
> Hello,
>
> How do we calculate the d(t) for discrete arrival and service processes?
> Is d(t) in terms of the first bit or the last bit of the packet?  Thanks
> very much in advance.
>
> -Wai Kei
>


.

Path: shelby.stanford.edu!not-for-mail
From: Sesha Narahari <narahari@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftpd problem
Date: Wed, 18 Jan 2006 12:37:39 -0800
Lines: 26
Distribution: su
Message-ID: <43CEA713.60809@stanford.edu>
References: <43CAB6BB.4090709@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9560

I am trying to test with the supplied ftpd. I am unable to connect using 
a stock FTP client:

ftp 39952@elaine1

fails.

This is not using my ftpcopy code.

Any pointers?

Thanks,
Sesha


Sesha Narahari wrote:
> When I try to connect to my instance of ftpd, I see this:
> 
> 62461@elaine1: unknown host or invalid literal address
> 
> Using elaine1.stanford.edu or elaine doesnt seem to help.
> 
> Thanks,
> Sesha
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftpd problem
Date: Wed, 18 Jan 2006 12:40:00 -0800
Lines: 32
Distribution: su
Message-ID: <dqm93b$rn7$1@news.Stanford.EDU>
References: <43CAB6BB.4090709@stanford.edu> <43CEA713.60809@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <43CEA713.60809@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:9561

Try

$ ftp elaine1 39952

Sesha Narahari wrote:
> I am trying to test with the supplied ftpd. I am unable to connect using 
> a stock FTP client:
> 
> ftp 39952@elaine1
> 
> fails.
> 
> This is not using my ftpcopy code.
> 
> Any pointers?
> 
> Thanks,
> Sesha
> 
> 
> Sesha Narahari wrote:
> 
>> When I try to connect to my instance of ftpd, I see this:
>>
>> 62461@elaine1: unknown host or invalid literal address
>>
>> Using elaine1.stanford.edu or elaine doesnt seem to help.
>>
>> Thanks,
>> Sesha
>>
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Jens Pillgram-Larsen <jenspl@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Time-average queue occupancy X bar
Date: Wed, 18 Jan 2006 16:02:05 -0800
Lines: 5
Distribution: su
Message-ID: <dqmktv$fb5$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9562

I can't find the notation Xbar or the term time-average queue occupancy 
in the slides about queuing in routers. What does this correspond to in 
our notes.

Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: using cs140 list code
Date: Wed, 18 Jan 2006 17:23:41 -0800
Lines: 15
Distribution: su
Message-ID: <dqmpnc$l0l$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601180946510.13232-100000@elaine1.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601180946510.13232-100000@elaine1.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9563

Hey Peter,

Did you write the linked list code for your cs140 project? If so, by all 
means use it. If not, I'm reluctant to say that you can use it since 
that would give you an unfair advantage over students who didn't take 
that class/don't have access to that code.

Ari

Peter In Lee wrote:
> I'd like to reuse the linked list code from the cs140 pintos project.
> Would this be alright, or do I need to write my own?
> 
> -- Peter
> 
.

Path: shelby.stanford.edu!myth9.Stanford.EDU!wachs
From: Megan Anneke Wachs <wachs@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Problem set 1, #8
Date: Wed, 18 Jan 2006 17:41:34 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.LNX.4.44.0601181739110.19526-100000@myth9.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9564

The formulation of the problem doesn't quite make sense to me...

if for any process t2-t1, sigma bits can arrive, this seems that the
arrival rate
could be infinite as tau gets really small (<<1). Is tau constrained to be
an increment of 1 second?

Thanks,
Megan

.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS#1 Q6
Date: Wed, 18 Jan 2006 18:07:19 -0800
Lines: 20
Distribution: su
Message-ID: <dqms96$o26$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601180854020.6165-100000@elaine3.Stanford.EDU> <dqm8gn$r9a$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqm8gn$r9a$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9565

Yes, this is the correct interpretation.

Robbie Yan wrote:
> I think the interpretation of d(t) is as follows: if a bit arrives at time
> t, the time it has to wait before being sent out of the router is d(t).
> 
> "Wai Kei So" <wkso@stanford.edu> wrote in message
> news:Pine.GSO.4.44.0601180854020.6165-100000@elaine3.Stanford.EDU...
> 
>>Hello,
>>
>>How do we calculate the d(t) for discrete arrival and service processes?
>>Is d(t) in terms of the first bit or the last bit of the packet?  Thanks
>>very much in advance.
>>
>>-Wai Kei
>>
> 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Time-average queue occupancy X bar
Date: Wed, 18 Jan 2006 18:08:20 -0800
Lines: 11
Distribution: su
Message-ID: <dqmsb3$o26$2@news.Stanford.EDU>
References: <dqmktv$fb5$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqmktv$fb5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9566

Xbar is the average queue occupancy over an arbitrarily long interval of 
time.

Ari

Jens Pillgram-Larsen wrote:
> I can't find the notation Xbar or the term time-average queue occupancy 
> in the slides about queuing in routers. What does this correspond to in 
> our notes.
> 
> Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: "Robbie Yan" <xyan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Max length of server response to LIST
Date: Wed, 18 Jan 2006 18:53:09 -0800
Lines: 4
Distribution: su
Message-ID: <dqmuud$r8c$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Xref: shelby.stanford.edu su.class.cs244a:9567

Can we assume that the server's response to LIST command never exceeds a
particular length, say, 1024 bytes?


.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!olegs
From: olegs@Stanford.EDU (Oleg Slezberg)
Newsgroups: su.class.cs244a
Subject: Re: Max length of server response to LIST
Date: Thu, 19 Jan 2006 03:02:37 +0000 (UTC)
Organization: Stanford University, CA 94305, USA
Lines: 12
Distribution: su
Message-ID: <dqmvgd$ron$1@news.Stanford.EDU>
References: <dqmuud$r8c$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9568

I think FAQ #22 says we can't...

Oleg.

In article <dqmuud$r8c$1@news.Stanford.EDU>,
Robbie Yan <xyan@stanford.edu> wrote:
>Can we assume that the server's response to LIST command never exceeds a
>particular length, say, 1024 bytes?
>
>


.

Path: shelby.stanford.edu!saga12.Stanford.EDU!lamskm
From: lamskm@Stanford.EDU (Michael Lam)
Newsgroups: su.class.cs244a
Subject: Problem set 1, #6
Date: Thu, 19 Jan 2006 07:03:22 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <dqndjq$dq6$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
Summary: Problem set 1, #6
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:9569

The original definition of A(t) is the number of arrivals in interval [0,t].
So A(t) = t means there are t arrivals in interval[0,t].

Can we assume the units of arrivals as bits, and units of time as seconds?

Then A(t) = t means 1 bit / sec ?
.

Path: shelby.stanford.edu!saga4.Stanford.EDU!vijayk
From: Vijay K Kulkarni <vijayk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: average Q occupancy, slide 11, handout 3
Date: Wed, 18 Jan 2006 23:30:35 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0601182327270.23098-100000@saga4.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9570


can somebody please help me understand how we arrived at average Q
occupancy when the q is non empty to be 0.5*(0.1*500)?

thanks,
Vijay.

.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: average Q occupancy, slide 11, handout 3
Date: Wed, 18 Jan 2006 23:51:03 -0800
Lines: 17
Distribution: su
Message-ID: <dqngdl$i4u$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601182327270.23098-100000@saga4.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <Pine.GSO.4.44.0601182327270.23098-100000@saga4.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9571

Qbar(t) is the average A(t) - D(t). For time 0 to 0.2s, Qbar(t) is the 
area of the triangle formed between A(t) and D(t) divided time, i.e. an 
integral divided by time.

Area of triangle = 0.5 * 0.1 * 100
Qbar(t) = Area of triangle / time where time = 0.2s
=> Qbar(t) = 0.5 * 0.1 * 100 / 0.2 = 0.5 * (0.1 * 500)

-Naeim

Vijay K Kulkarni wrote:
> can somebody please help me understand how we arrived at average Q
> occupancy when the q is non empty to be 0.5*(0.1*500)?
> 
> thanks,
> Vijay.
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Sunny Balwani <sunnybalwani@hotmail.com>
Newsgroups: su.class.cs244a
Subject: Is bit shifting Endian-Proof?
Date: Wed, 18 Jan 2006 23:56:34 -0800
Lines: 16
Distribution: su
Message-ID: <BFF48632.2BEF%sunnybalwani@hotmail.com>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.2.1.051004
Thread-Topic: Is bit shifting Endian-Proof?
Thread-Index: AcYczd2yHGfnAIjBEdqPqwARJHuZqg==
Xref: shelby.stanford.edu su.class.cs244a:9572

Hi.

If I use bit shifting to get the h1,h2,h3,h4 8-bit fields of an IP address,
is that Endian-proof?

So, for example, I want to get the h2 8 bits of ipaddr. Then will the
following work safely on both little-Endian and big-Endian machines?

A = ipaddr <<8;
A= A>>24;


Thanks in advance.

Sunny.

.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem set 1, #8
Date: Thu, 19 Jan 2006 00:20:03 -0800
Lines: 17
Distribution: su
Message-ID: <dqni46$lc2$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0601181739110.19526-100000@myth9.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.LNX.4.44.0601181739110.19526-100000@myth9.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9573

It's true, the instantaneous arrival rate could be infinitely large. 
However, the question asks about the average arrival rate (as the 
interval tau gets large).

Ari

Megan Anneke Wachs wrote:
> The formulation of the problem doesn't quite make sense to me...
> 
> if for any process t2-t1, sigma bits can arrive, this seems that the
> arrival rate
> could be infinite as tau gets really small (<<1). Is tau constrained to be
> an increment of 1 second?
> 
> Thanks,
> Megan
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Max length of server response to LIST
Date: Thu, 19 Jan 2006 00:20:37 -0800
Lines: 7
Distribution: su
Message-ID: <dqni56$lc2$2@news.Stanford.EDU>
References: <dqmuud$r8c$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqmuud$r8c$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9574

No, you can't.

Robbie Yan wrote:
> Can we assume that the server's response to LIST command never exceeds a
> particular length, say, 1024 bytes?
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem set 1, #6
Date: Thu, 19 Jan 2006 00:21:51 -0800
Lines: 9
Distribution: su
Message-ID: <dqni7h$lc2$3@news.Stanford.EDU>
References: <dqndjq$dq6$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqndjq$dq6$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9575

Sure.

Michael Lam wrote:
> The original definition of A(t) is the number of arrivals in interval [0,t].
> So A(t) = t means there are t arrivals in interval[0,t].
> 
> Can we assume the units of arrivals as bits, and units of time as seconds?
> 
> Then A(t) = t means 1 bit / sec ?
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW 1 prob 5
Date: Thu, 19 Jan 2006 00:41:31 -0800
Lines: 15
Distribution: su
Message-ID: <dqnjc7$m9g$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0601111625270.29375-100000@myth29.Stanford.EDU> <dq49bq$6gc$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <dq49bq$6gc$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9576

In the problem statement, 64kb/s, is that kilobytes/s or kilobits/s ?

Thanks.
-Naeim

Matt Falkenhagen wrote:
> Yep.
> 
> Megan Anneke Wachs wrote:
>> In a  store-and-forward router, is the packet completely stored before
>> forwarding begins, even if the buffer is empty?
>>
>> Thanks,
>> Megan
>>
.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: test script errors on first try
Date: Thu, 19 Jan 2006 00:47:22 -0800
Lines: 23
Distribution: su
Message-ID: <dqnjml$mna$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:9577

When I run the testscript for the first time after changing the code, it
seems to complete all the operations, and then I get these errors, and no
output about any of the tests:

/usr/pubsw/bin/cat: grading_src/build/.purify: No such file or directory
/usr/pubsw/bin/cat: grading_src/build/Makefile: No such file or directory
/usr/pubsw/bin/cat: grading_src/build/echodemo.c: No such file or directory
/usr/pubsw/bin/cat: grading_src/build/errors.c: No such file or directory
/usr/pubsw/bin/cat: grading_src/build/ftpcopy.c: No such file or directory
/usr/pubsw/bin/cat: grading_src/build/ftpparse.c: No such file or directory
/usr/pubsw/bin/cat: grading_src/build/ftpparse.h: No such file or directory
/usr/pubsw/bin/cat: grading_src/build/purify.output: No such file or
directory
Could not open submitted file!
couldn't submit code for testing

When I run it again right afterwards, it works perfectly fine and gives me
output on each of the tests.  Is it not correctly copying the files over, or
am I screwing something up?

Waynn


.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Is bit shifting Endian-Proof?
Date: Thu, 19 Jan 2006 00:54:51 -0800
Lines: 28
Distribution: su
Message-ID: <dqnk5d$n6f$1@news.Stanford.EDU>
References: <BFF48632.2BEF%sunnybalwani@hotmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <BFF48632.2BEF%sunnybalwani@hotmail.com>
Xref: shelby.stanford.edu su.class.cs244a:9578

My first inclination was to say that the behavior would be different 
depending upon the endian-ness of your machine, but I've run some tests 
and it seems that the left-shift and right-shift operators when applied 
to an int always treat the integer as if the most significant bits are 
on the left side, regardless of the endian-ness of your machine. So yes, 
it seems that the code snippet you provided can be used to reliably 
extract h2 regardless of whether or not the machine is little-endian or 
big-endian. Has anyone else experienced anything different?

Ari

Sunny Balwani wrote:
> Hi.
> 
> If I use bit shifting to get the h1,h2,h3,h4 8-bit fields of an IP address,
> is that Endian-proof?
> 
> So, for example, I want to get the h2 8 bits of ipaddr. Then will the
> following work safely on both little-Endian and big-Endian machines?
> 
> A = ipaddr <<8;
> A= A>>24;
> 
> 
> Thanks in advance.
> 
> Sunny.
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Sunny Balwani <sunnybalwani@hotmail.com>
Newsgroups: su.class.cs244a
Subject: Port command
Date: Thu, 19 Jan 2006 01:23:17 -0800
Lines: 18
Distribution: su
Message-ID: <BFF49A85.2BF9%sunnybalwani@hotmail.com>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.2.1.051004
Thread-Topic: Port command
Thread-Index: AcYc2frtOT+oZojNEdqPqwARJHuZqg==
Xref: shelby.stanford.edu su.class.cs244a:9579

Hi.

I want to confirm the format for the 16 bit port in the PORT
h1,h2,h3,h4,p1,p2 command.

So, for example, the following address and port number

Address: 171.64.15.109
port: 58009

would yield something like this.
PORT 171,64,15,109,226,153

Right?

Thanks in advance.
Sunny.

.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Is bit shifting Endian-Proof?
Date: Thu, 19 Jan 2006 03:24:02 -0800
Organization: Stanford University
Lines: 35
Distribution: su
Message-ID: <20060119032402.11aa6112@ballpoint>
References: <BFF48632.2BEF%sunnybalwani@hotmail.com>
	<dqnk5d$n6f$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9580

The C standard defines the bit-shift operators in terms of multiplying
or dividing by powers of 2.  As long as you are operating on unsigned
numbers, it should be endian-neutral.

On Thu, 19 Jan 2006 00:54:51 -0800
Ari Greenberg <arigreen@cs.stanford.edu> wrote:

> My first inclination was to say that the behavior would be different 
> depending upon the endian-ness of your machine, but I've run some tests 
> and it seems that the left-shift and right-shift operators when applied 
> to an int always treat the integer as if the most significant bits are 
> on the left side, regardless of the endian-ness of your machine. So yes, 
> it seems that the code snippet you provided can be used to reliably 
> extract h2 regardless of whether or not the machine is little-endian or 
> big-endian. Has anyone else experienced anything different?
> 
> Ari
> 
> Sunny Balwani wrote:
> > Hi.
> > 
> > If I use bit shifting to get the h1,h2,h3,h4 8-bit fields of an IP address,
> > is that Endian-proof?
> > 
> > So, for example, I want to get the h2 8 bits of ipaddr. Then will the
> > following work safely on both little-Endian and big-Endian machines?
> > 
> > A = ipaddr <<8;
> > A= A>>24;
> > 
> > 
> > Thanks in advance.
> > 
> > Sunny.
> > 
.

Path: shelby.stanford.edu!saga7.Stanford.EDU!wachs
From: Megan Anneke Wachs <wachs@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Port command
Date: Thu, 19 Jan 2006 07:58:22 -0800
Lines: 26
Distribution: su
Message-ID: <Pine.GSO.4.44.0601190757360.9650-100000@saga7.Stanford.EDU>
References: <BFF49A85.2BF9%sunnybalwani@hotmail.com>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <BFF49A85.2BF9%sunnybalwani@hotmail.com>
Xref: shelby.stanford.edu su.class.cs244a:9581

That worked for me,

-Megan

On Thu, 19 Jan 2006, Sunny Balwani wrote:

> Hi.
>
> I want to confirm the format for the 16 bit port in the PORT
> h1,h2,h3,h4,p1,p2 command.
>
> So, for example, the following address and port number
>
> Address: 171.64.15.109
> port: 58009
>
> would yield something like this.
> PORT 171,64,15,109,226,153
>
> Right?
>
> Thanks in advance.
> Sunny.
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Sunny Balwani <sunnybalwani@hotmail.com>
Newsgroups: su.class.cs244a
Subject: Server cant open data connection to my port
Date: Thu, 19 Jan 2006 08:08:28 -0800
Lines: 22
Distribution: su
Message-ID: <BFF4F97C.2BFE%sunnybalwani@hotmail.com>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.2.1.051004
Thread-Topic: Server cant open data connection to my port
Thread-Index: AcYdEpVp08KY6okFEdq3WAARJHuZqg==
Xref: shelby.stanford.edu su.class.cs244a:9582

Hi.  After issuing the PORT command, the server cant connect to my data
port.  Here is the output from printf statement right before I issue LIST
command. All of my bind and listen calls are setup properly and return
properly. Would appreciate any pointers to what am I doing wrong.


Address of ftp server is : 10.0.1.5
port of ftp server is 21

Address on dataSocket is : 10.0.1.2
port on dataSocket is 53340

PORT 10,0,1,2,208,92
200 PORT command successful.

LIST
150 Opening ASCII mode data connection for /bin/ls.
425 Can't open data connection.

Thanks in advance.
Sunny.

.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW 1 prob 5
Date: Thu, 19 Jan 2006 08:13:36 -0800
Lines: 22
Distribution: su
Message-ID: <dqodrs$i9t$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0601111625270.29375-100000@myth29.Stanford.EDU> <dq49bq$6gc$1@news.Stanford.EDU> <dqnjc7$m9g$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqnjc7$m9g$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9583

kilobits/s

-Matt

Naeim Semsarilar wrote:
> In the problem statement, 64kb/s, is that kilobytes/s or kilobits/s ?
> 
> Thanks.
> -Naeim
> 
> Matt Falkenhagen wrote:
> 
>> Yep.
>>
>> Megan Anneke Wachs wrote:
>>
>>> In a  store-and-forward router, is the packet completely stored before
>>> forwarding begins, even if the buffer is empty?
>>>
>>> Thanks,
>>> Megan
>>>
.

Path: shelby.stanford.edu!saga22.Stanford.EDU!vijayk
From: Vijay K Kulkarni <vijayk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: average Q occupancy, slide 11, handout 3
Date: Thu, 19 Jan 2006 08:21:02 -0800
Lines: 25
Distribution: su
Message-ID: <Pine.GSO.4.44.0601190820390.18711-100000@saga22.Stanford.EDU>
References: <Pine.GSO.4.44.0601182327270.23098-100000@saga4.Stanford.EDU>
 <dqngdl$i4u$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <dqngdl$i4u$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9584

thanks.

Vijay.

On Wed, 18 Jan 2006, Naeim Semsarilar wrote:

> Qbar(t) is the average A(t) - D(t). For time 0 to 0.2s, Qbar(t) is the
> area of the triangle formed between A(t) and D(t) divided time, i.e. an
> integral divided by time.
>
> Area of triangle = 0.5 * 0.1 * 100
> Qbar(t) = Area of triangle / time where time = 0.2s
> => Qbar(t) = 0.5 * 0.1 * 100 / 0.2 = 0.5 * (0.1 * 500)
>
> -Naeim
>
> Vijay K Kulkarni wrote:
> > can somebody please help me understand how we arrived at average Q
> > occupancy when the q is non empty to be 0.5*(0.1*500)?
> >
> > thanks,
> > Vijay.
> >
>

.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problems submission for scpd students
Date: Thu, 19 Jan 2006 10:17:38 -0800
Lines: 17
Distribution: su
Message-ID: <dqol4e$q97$1@news.Stanford.EDU>
References: <dqlrs5$dec$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqlrs5$dec$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9585

No, for problem sets, you only need to submit to SCPD.

Michael Lam wrote:
> Pardon my question for the non scpd students.
> From the scpd students orientation, we were told that when submitting
> assignments, send one to the scpd dept, and one to the normal class
> channel (which would be Judy).  However, since the instruction for
> going to Judy is to leave it under the door, can we submit via email?
> 
> Matt is my assigned TA.  Does it mean he will grade my problem set?
> Is it possible that I email my problem set solution to the TA?
> 
> I am just trying to find a way of submitting without coming to campus.
> 
> Thanks.
> 
> -Michael
.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftp.stanford.edu Revisited
Date: Thu, 19 Jan 2006 15:13:02 -0800
Organization: Stanford University
Lines: 6
Distribution: su
Message-ID: <20060119151302.7d6b1b51@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9586

As far as I can tell, ftp.stanford.edu has been unavailable for two full
days now.  In my case, that is five tests that I have been unable to
use.  Is it possible to get a modified test script that uses some other
test case in place of ftp.stanford.edu?  Thanks.

--David
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Server cant open data connection to my port
Date: Thu, 19 Jan 2006 15:53:02 -0800
Lines: 30
Distribution: su
Message-ID: <dqp8pb$kq9$1@news.Stanford.EDU>
References: <BFF4F97C.2BFE%sunnybalwani@hotmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <BFF4F97C.2BFE%sunnybalwani@hotmail.com>
Xref: shelby.stanford.edu su.class.cs244a:9587

I'm guessing you have some sort of firewall preventing an incoming 
connection from the server.  Have you tried running your code on the 
leland machines?

-Matt

It looks like you're running this on
Sunny Balwani wrote:
> Hi.  After issuing the PORT command, the server cant connect to my data
> port.  Here is the output from printf statement right before I issue LIST
> command. All of my bind and listen calls are setup properly and return
> properly. Would appreciate any pointers to what am I doing wrong.
> 
> 
> Address of ftp server is : 10.0.1.5
> port of ftp server is 21
> 
> Address on dataSocket is : 10.0.1.2
> port on dataSocket is 53340
> 
> PORT 10,0,1,2,208,92
> 200 PORT command successful.
> 
> LIST
> 150 Opening ASCII mode data connection for /bin/ls.
> 425 Can't open data connection.
> 
> Thanks in advance.
> Sunny.
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp.stanford.edu Revisited
Date: Thu, 19 Jan 2006 16:25:05 -0800
Lines: 23
Distribution: su
Message-ID: <dqpale$n1b$1@news.Stanford.EDU>
References: <20060119151302.7d6b1b51@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060119151302.7d6b1b51@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9588

Sorry, yes it's been down for some time.  Unfortunately, modifying the 
test scripts has proven to be a non-trivial problem, and we will not be 
able to do it for this assignment.

We've alerted ITSS about the problem and hopefully they will have 
ftp.stanford.edu up soon.

In the meantime, you can still run tests, just ignore errors caused by 
ftp.stanford.edu.   The only tests that will fail because of 
ftp.stanford.edu alone are C, D, E, and F.2 and each will say "(passed 
only 4 out of 5 subtests)" with a note about ftp.stanford.edu failing. 
If you didn't pass 4/5 subtests, something else is wrong.

-Matt


David Reiss wrote:
> As far as I can tell, ftp.stanford.edu has been unavailable for two full
> days now.  In my case, that is five tests that I have been unable to
> use.  Is it possible to get a modified test script that uses some other
> test case in place of ftp.stanford.edu?  Thanks.
> 
> --David
.

Path: shelby.stanford.edu!not-for-mail
From: Drew Willcoxon <drew.willcoxon@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp.stanford.edu Revisited
Date: Thu, 19 Jan 2006 16:48:51 -0800
Lines: 24
Distribution: su
Message-ID: <dqpc0v$oet$1@news.Stanford.EDU>
References: <20060119151302.7d6b1b51@ballpoint> <dqpale$n1b$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <dqpale$n1b$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9589

As a side note, what should a correct ftpcopy do when it tries to 
connect to ftp.stanford?  Mine times out (making the test take a long 
time), waiting for a server response.  Is that the proper behavior?  I 
notice that running ftp says "421 Service not available, remote server 
has closed connection," and sftp says "Connection refused."

Thanks,
Drew

Matt Falkenhagen wrote:
> Sorry, yes it's been down for some time.  Unfortunately, modifying the 
> test scripts has proven to be a non-trivial problem, and we will not be 
> able to do it for this assignment.
> 
> We've alerted ITSS about the problem and hopefully they will have 
> ftp.stanford.edu up soon.
> 
> In the meantime, you can still run tests, just ignore errors caused by 
> ftp.stanford.edu.   The only tests that will fail because of 
> ftp.stanford.edu alone are C, D, E, and F.2 and each will say "(passed 
> only 4 out of 5 subtests)" with a note about ftp.stanford.edu failing. 
> If you didn't pass 4/5 subtests, something else is wrong.
> 
> -Matt
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ps1 q3
Date: Thu, 19 Jan 2006 17:02:03 -0800
Lines: 7
Distribution: su
Message-ID: <dqpcqf$pal$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9590

This is more of an office-hour type question.

I fail to see how the average size of the queue (512 kbytes) is relevant 
to this question. Is there a way someone can explain it to me without 
giving away too much?

Thanks.
.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!sanchezm
From: Miguel Sanchez <sanchezm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Problem Set 1 -  submission time
Date: Thu, 19 Jan 2006 17:03:39 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0601191700120.20732-100000@elaine3.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9591

	can the submission time of Friday's first problem set  be
pushed up a couple of hours to be at the time of the TA session.
	This could save some a trip to campus before noon, and then
another at 2:15 for the TA session,

- Miguel


.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ps1 q3
Date: Thu, 19 Jan 2006 17:11:33 -0800
Organization: Stanford University
Lines: 12
Distribution: su
Message-ID: <20060119171133.155d3352@ballpoint>
References: <dqpcqf$pal$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9592

Really?  I thought that the packet size was irrelevant.

On Thu, 19 Jan 2006 17:02:03 -0800
Naeim Semsarilar <naeim@stanford.edu> wrote:

> This is more of an office-hour type question.
> 
> I fail to see how the average size of the queue (512 kbytes) is relevant 
> to this question. Is there a way someone can explain it to me without 
> giving away too much?
> 
> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp.stanford.edu Revisited
Date: Thu, 19 Jan 2006 17:17:11 -0800
Lines: 34
Distribution: su
Message-ID: <dqpdmi$qfc$1@news.Stanford.EDU>
References: <20060119151302.7d6b1b51@ballpoint> <dqpale$n1b$1@news.Stanford.EDU> <dqpc0v$oet$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqpc0v$oet$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9593

It looks like ftp.stanford.edu is accepting the connection and then 
immediately closing it.  So when you do a read() expecting a reply, it 
should return 0 immediately, indicating that the connection closed.  I'm 
not sure why you're having a timeout... where is it waiting?

In any case, we won't be testing this (ftp server that immediately 
closes), so don't worry about it unless you want to.

Drew Willcoxon wrote:
> As a side note, what should a correct ftpcopy do when it tries to 
> connect to ftp.stanford?  Mine times out (making the test take a long 
> time), waiting for a server response.  Is that the proper behavior?  I 
> notice that running ftp says "421 Service not available, remote server 
> has closed connection," and sftp says "Connection refused."
> 
> Thanks,
> Drew
> 
> Matt Falkenhagen wrote:
> 
>> Sorry, yes it's been down for some time.  Unfortunately, modifying the 
>> test scripts has proven to be a non-trivial problem, and we will not 
>> be able to do it for this assignment.
>>
>> We've alerted ITSS about the problem and hopefully they will have 
>> ftp.stanford.edu up soon.
>>
>> In the meantime, you can still run tests, just ignore errors caused by 
>> ftp.stanford.edu.   The only tests that will fail because of 
>> ftp.stanford.edu alone are C, D, E, and F.2 and each will say "(passed 
>> only 4 out of 5 subtests)" with a note about ftp.stanford.edu failing. 
>> If you didn't pass 4/5 subtests, something else is wrong.
>>
>> -Matt
.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1, Q3b
Date: Thu, 19 Jan 2006 17:19:38 -0800
Organization: Stanford University
Lines: 3
Distribution: su
Message-ID: <20060119171938.4d942243@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9594

Should we assume that the buffer is still averaging 512 kbytes, or
should we assume that the router still has the same output rate as part
a?  Or am I totally missing the idea?
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ps1 q3
Date: Thu, 19 Jan 2006 17:26:14 -0800
Lines: 11
Distribution: su
Message-ID: <dqpe7f$r3h$1@news.Stanford.EDU>
References: <dqpcqf$pal$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqpcqf$pal$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9595

Why would it be irrelevant?  The average arrival rate and average buffer 
size would seem to be related in some way...

Naeim Semsarilar wrote:
> This is more of an office-hour type question.
> 
> I fail to see how the average size of the queue (512 kbytes) is relevant 
> to this question. Is there a way someone can explain it to me without 
> giving away too much?
> 
> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1, Q3b
Date: Thu, 19 Jan 2006 17:28:07 -0800
Lines: 6
Distribution: su
Message-ID: <dqpeb0$r3h$2@news.Stanford.EDU>
References: <20060119171938.4d942243@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060119171938.4d942243@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9596

Yep, you can assume it's still averaging 512 kbytes.

David Reiss wrote:
> Should we assume that the buffer is still averaging 512 kbytes, or
> should we assume that the router still has the same output rate as part
> a?  Or am I totally missing the idea?
.

Path: shelby.stanford.edu!not-for-mail
From: Alex Li <alexli@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Testing Script Error
Date: Thu, 19 Jan 2006 17:28:23 -0800
Lines: 7
Distribution: su
Message-ID: <dqpebp$r6o$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9597

Test record directory /afs/ir/class/cs244a/grading_script/student/alexli 
does not exist!

How do I get a directory created?

Thanks,
Alex
.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1, Q4
Date: Thu, 19 Jan 2006 17:31:30 -0800
Organization: Stanford University
Lines: 11
Distribution: su
Message-ID: <20060119173130.448ff442@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9598

Three questions about number 4:

1) Is it okay to assume that the data, header, and checksum can share
packet space (i.e.: the first packet might contain both the header and
some file data, and the last packet might contain both file data and the
checksum)?

2) If not, is it okay to assume that H <= P and C <= P?

3) Is G the gap between the end of one packet and the start of the next,
or the minimum gap between the start of one packet and the next?
.

Path: shelby.stanford.edu!elaine33.Stanford.EDU!sunnyb
From: Ramesh Balwani <sunnyb@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Server cant open data connection to my port
Date: Thu, 19 Jan 2006 17:35:06 -0800
Lines: 49
Distribution: su
Message-ID: <Pine.GSO.4.44.0601191732120.8407-100000@elaine33.Stanford.EDU>
References: <BFF4F97C.2BFE%sunnybalwani@hotmail.com> <dqp8pb$kq9$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <dqp8pb$kq9$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9599

I get the same message when executing the code on leland machines.

Address on controlSocket is : 171.64.15.85
port on controlSocket is 41272
Address on dataSocket is : 171.64.15.85
port on dataSocket is 41277
PORT 171,64,15,85,161,61
200 PORT command successful.

LIST
425 Can't build data connection: Connection refused.

would appreciate any help.
thanks.

On Thu, 19 Jan 2006, Matt Falkenhagen wrote:

> I'm guessing you have some sort of firewall preventing an incoming
> connection from the server.  Have you tried running your code on the
> leland machines?
>
> -Matt
>
> It looks like you're running this on
> Sunny Balwani wrote:
> > Hi.  After issuing the PORT command, the server cant connect to my data
> > port.  Here is the output from printf statement right before I issue LIST
> > command. All of my bind and listen calls are setup properly and return
> > properly. Would appreciate any pointers to what am I doing wrong.
> >
> >
> > Address of ftp server is : 10.0.1.5
> > port of ftp server is 21
> >
> > Address on dataSocket is : 10.0.1.2
> > port on dataSocket is 53340
> >
> > PORT 10,0,1,2,208,92
> > 200 PORT command successful.
> >
> > LIST
> > 150 Opening ASCII mode data connection for /bin/ls.
> > 425 Can't open data connection.
> >
> > Thanks in advance.
> > Sunny.
> >
>

.

Path: shelby.stanford.edu!not-for-mail
From: G Corrado<gcorrado@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1, Q3b
Date: Fri, 20 Jan 2006 01:40:35 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <dqpf2j$rol$1@news.Stanford.EDU>
References: <20060119171938.4d942243@ballpoint>
Content-Type: text/plain
X-Complaints-To: news@news.stanford.edu
 
User-Agent: OSXnews 2.07
Xref: shelby.stanford.edu su.class.cs244a:9600


I also assumed that the average amount of data in the router was still
512 kbytes in order to know what to do for 3B...  but the more I think
about it I wonder if that's really what they intended.

David Reiss <dreiss@stanford.edu> wrote:
>Should we assume that the buffer is still averaging 512 kbytes, or
>should we assume that the router still has the same output rate as part
>a?  Or am I totally missing the idea?



-- 


.

Path: shelby.stanford.edu!not-for-mail
From: G Corrado<gcorrado@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1, Q3b
Date: Fri, 20 Jan 2006 01:41:32 +0000 (UTC)
Lines: 3
Distribution: su
Message-ID: <dqpf4c$rol$2@news.Stanford.EDU>
References: <20060119171938.4d942243@ballpoint> <dqpf2j$rol$1@news.Stanford.EDU>
Content-Type: text/plain
X-Complaints-To: news@news.stanford.edu
 
User-Agent: OSXnews 2.07
Xref: shelby.stanford.edu su.class.cs244a:9601


nevermind...

.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ps1 q3
Date: Thu, 19 Jan 2006 17:54:33 -0800
Lines: 18
Distribution: su
Message-ID: <dqpfst$t2t$1@news.Stanford.EDU>
References: <dqpcqf$pal$1@news.Stanford.EDU> <dqpe7f$r3h$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <dqpe7f$r3h$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9602

Is the buffer FCFS?
Am I correct to say that when a packet comes in, it must wait, on 
average, 10 ms for the average 512kbytes of data in front of it in the 
queue to be sent out on the outlink?


Matt Falkenhagen wrote:
> Why would it be irrelevant?  The average arrival rate and average buffer 
> size would seem to be related in some way...
> 
> Naeim Semsarilar wrote:
>> This is more of an office-hour type question.
>>
>> I fail to see how the average size of the queue (512 kbytes) is 
>> relevant to this question. Is there a way someone can explain it to me 
>> without giving away too much?
>>
>> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: G Corrado<gcorrado@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1, Q4
Date: Fri, 20 Jan 2006 01:58:42 +0000 (UTC)
Lines: 24
Distribution: su
Message-ID: <dqpg4i$t6m$1@news.Stanford.EDU>
References: <20060119173130.448ff442@ballpoint>
Content-Type: text/plain
X-Complaints-To: news@news.stanford.edu
 
User-Agent: OSXnews 2.07
Xref: shelby.stanford.edu su.class.cs244a:9603


(1) and (2):  i think it says EACH packet contains the header and the
checksum, which implies (H+C) < P.
(3) good question.  i assumed the later, but i'm interested in seeing
what the TAs have to say.

David Reiss <dreiss@stanford.edu> wrote:
>Three questions about number 4:
>
>1) Is it okay to assume that the data, header, and checksum can share
>packet space (i.e.: the first packet might contain both the header and
>some file data, and the last packet might contain both file data and the
>checksum)?
>
>2) If not, is it okay to assume that H <= P and C <= P?
>
>3) Is G the gap between the end of one packet and the start of the next,
>or the minimum gap between the start of one packet and the next?



-- 


.

Path: shelby.stanford.edu!not-for-mail
From: G Corrado<gcorrado@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1, Q4
Date: Fri, 20 Jan 2006 02:01:28 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <dqpg9n$t6m$2@news.Stanford.EDU>
References: <20060119173130.448ff442@ballpoint> <dqpg4i$t6m$1@news.Stanford.EDU>
Content-Type: text/plain
X-Complaints-To: news@news.stanford.edu
 
User-Agent: OSXnews 2.07
Xref: shelby.stanford.edu su.class.cs244a:9604


>(1) and (2):  i think it says EACH packet contains the header and the
>checksum, which implies (H+C) < P.

on second thought, it looks more like each packet has H + C + P bits.


.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Testing Script Error
Date: Thu, 19 Jan 2006 18:02:18 -0800
Lines: 11
Distribution: su
Message-ID: <dqpgat$1f$1@news.Stanford.EDU>
References: <dqpebp$r6o$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqpebp$r6o$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9605

Haha, you probably didn't sign up for a TA or just did recently.  It 
should work now.

Alex Li wrote:
> Test record directory /afs/ir/class/cs244a/grading_script/student/alexli 
> does not exist!
> 
> How do I get a directory created?
> 
> Thanks,
> Alex
.

Path: shelby.stanford.edu!not-for-mail
From: "Nick Cooper" <nacooper@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem set 1, #8
Date: Thu, 19 Jan 2006 18:08:24 -0800
Lines: 21
Distribution: su
Message-ID: <dqpgn3$pl$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0601181739110.19526-100000@myth9.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9606

Are there any contraints on the constants? For example, can we have p = 0? 
Or are the constants constrained to values that would result in a stable 
queue?

Thanks,
Nick

"Megan Anneke Wachs" <wachs@stanford.edu> wrote in message 
news:Pine.LNX.4.44.0601181739110.19526-100000@myth9.Stanford.EDU...
> The formulation of the problem doesn't quite make sense to me...
>
> if for any process t2-t1, sigma bits can arrive, this seems that the
> arrival rate
> could be infinite as tau gets really small (<<1). Is tau constrained to be
> an increment of 1 second?
>
> Thanks,
> Megan
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Jens Pillgram-Larsen <jenspl@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Silly error
Date: Thu, 19 Jan 2006 18:16:14 -0800
Lines: 15
Distribution: su
Message-ID: <dqph5e$16b$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9607

I get the following compiler error when compiling the line:

FILE *fd = fopen( info.name, "wb" );

ftpretrieve.c: In function `copy_file':
ftpretrieve.c:121: error: `fd' undeclared (first use in this function)
ftpretrieve.c:121: error: (Each undeclared identifier is reported only once
ftpretrieve.c:121: error: for each function it appears in.)
make: *** [ftpretrieve.o] Error 1

I'm quite sure that <stdio.h> is included, because I'm using fprintf's 
and printf's among other things. Anyone have any ideas as to what could 
be causing this error?

Thanks, Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Problem Set #1, Q4
Date: Thu, 19 Jan 2006 18:24:01 -0800
Lines: 5
Distribution: su
Message-ID: <dqphk1$1b4$3@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9609

Do we need to consider a case when L is divisible by P? In that case, 
we don't have any leftover bits.

Thank you,
--Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Jens Pillgram-Larsen <jenspl@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Silly error
Date: Thu, 19 Jan 2006 19:00:46 -0800
Lines: 20
Distribution: su
Message-ID: <dqpjou$5km$1@news.Stanford.EDU>
References: <dqph5e$16b$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <dqph5e$16b$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9610

nm, I knew it was silly.

Jens

Jens Pillgram-Larsen wrote:
> I get the following compiler error when compiling the line:
> 
> FILE *fd = fopen( info.name, "wb" );
> 
> ftpretrieve.c: In function `copy_file':
> ftpretrieve.c:121: error: `fd' undeclared (first use in this function)
> ftpretrieve.c:121: error: (Each undeclared identifier is reported only once
> ftpretrieve.c:121: error: for each function it appears in.)
> make: *** [ftpretrieve.o] Error 1
> 
> I'm quite sure that <stdio.h> is included, because I'm using fprintf's 
> and printf's among other things. Anyone have any ideas as to what could 
> be causing this error?
> 
> Thanks, Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Q5b
Date: Thu, 19 Jan 2006 19:09:16 -0800
Organization: Stanford University
Lines: 4
Distribution: su
Message-ID: <20060119190916.487cbf70@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9611

For question 5b, should we assume that there are 5 packets ahead of it
when the first bit arrives, or when the last bit arrives?

Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1, Q4
Date: Thu, 19 Jan 2006 20:04:29 -0800
Lines: 20
Distribution: su
Message-ID: <dqpnfe$9p7$1@news.Stanford.EDU>
References: <20060119173130.448ff442@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060119173130.448ff442@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9612

David Reiss wrote:
> Three questions about number 4:
> 
> 1) Is it okay to assume that the data, header, and checksum can share
> packet space (i.e.: the first packet might contain both the header and
> some file data, and the last packet might contain both file data and the
> checksum)?

EVERY packet you send has a header and checksum added to it before 
transmission.  I.e., each packet (but the last) has P bits of the file, 
H bits of header, and C bits of checksum.

> 
> 2) If not, is it okay to assume that H <= P and C <= P?
> 
> 3) Is G the gap between the end of one packet and the start of the next,
> or the minimum gap between the start of one packet and the next?


G is the between end of one and start of the next.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem Set #1, Q4
Date: Thu, 19 Jan 2006 20:07:16 -0800
Lines: 9
Distribution: su
Message-ID: <dqpnkl$9p7$2@news.Stanford.EDU>
References: <dqphk1$1b4$3@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqphk1$1b4$3@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9613

It is certainly possible, but I don't see why you'd need to consider the 
case separately... you can derive one expression that works for both cases.

Michi Mutsuzaki wrote:
> Do we need to consider a case when L is divisible by P? In that case, we 
> don't have any leftover bits.
> 
> Thank you,
> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q5b
Date: Thu, 19 Jan 2006 20:12:42 -0800
Lines: 8
Distribution: su
Message-ID: <dqpnuq$abp$1@news.Stanford.EDU>
References: <20060119190916.487cbf70@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060119190916.487cbf70@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9614

Go ahead and do when the last bit arrives, but if you've already done it 
the other way just state your assumption.

David Reiss wrote:
> For question 5b, should we assume that there are 5 packets ahead of it
> when the first bit arrives, or when the last bit arrives?
> 
> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Drew Willcoxon <drew.willcoxon@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp.stanford.edu Revisited
Date: Thu, 19 Jan 2006 20:12:52 -0800
Lines: 12
Distribution: su
Message-ID: <dqpnvb$aau$1@news.Stanford.EDU>
References: <20060119151302.7d6b1b51@ballpoint> <dqpale$n1b$1@news.Stanford.EDU> <dqpc0v$oet$1@news.Stanford.EDU> <dqpdmi$qfc$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <dqpdmi$qfc$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9615

Oops, I was only checking if read() < 0, not <= 0.  Duh.  Thanks!

Drew

Matt Falkenhagen wrote:
> It looks like ftp.stanford.edu is accepting the connection and then 
> immediately closing it.  So when you do a read() expecting a reply, it 
> should return 0 immediately, indicating that the connection closed.  I'm 
> not sure why you're having a timeout... where is it waiting?
> 
> In any case, we won't be testing this (ftp server that immediately 
> closes), so don't worry about it unless you want to.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ps1 q3
Date: Thu, 19 Jan 2006 20:16:08 -0800
Lines: 23
Distribution: su
Message-ID: <dqpo58$aj9$1@news.Stanford.EDU>
References: <dqpcqf$pal$1@news.Stanford.EDU> <dqpe7f$r3h$1@news.Stanford.EDU> <dqpfst$t2t$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqpfst$t2t$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9616

Yes, it's FIFO.  Your statement looks correct.

Naeim Semsarilar wrote:
> Is the buffer FCFS?
> Am I correct to say that when a packet comes in, it must wait, on 
> average, 10 ms for the average 512kbytes of data in front of it in the 
> queue to be sent out on the outlink?
> 
> 
> Matt Falkenhagen wrote:
> 
>> Why would it be irrelevant?  The average arrival rate and average 
>> buffer size would seem to be related in some way...
>>
>> Naeim Semsarilar wrote:
>>
>>> This is more of an office-hour type question.
>>>
>>> I fail to see how the average size of the queue (512 kbytes) is 
>>> relevant to this question. Is there a way someone can explain it to 
>>> me without giving away too much?
>>>
>>> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Nick Puz <npuz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problems submission for scpd students
Date: Thu, 19 Jan 2006 20:24:13 -0800
Lines: 50
Distribution: su
Message-ID: <dqpola$b91$1@news.Stanford.EDU>
References: <dqlrs5$dec$1@news.Stanford.EDU> <dqol4e$q97$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqol4e$q97$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9617

I am a scpd student also. I called Frank Maldonado (Distribution 
Supervisor) earlier today and he said that we could either:
- fax the assignments to scpd.
- email the assignments in pdf format to scpd.

The pdf forms are at: http://scpd.stanford.edu/scpd/support/
He said to use either route form but i'm going to use the remote on: 
http://scpd.stanford.edu/scpd/downloads/remoteRouteForm.pdf

The fax number and email address (to email to or to ask for 
confirmation) is on the bottom of that form.

This page has the official info: 
http://scpd.stanford.edu/scpd/students/courseMater.htm

The most important thing to note is that we have to do it by noon for it 
to count as being recieved on that date:

> Submitting Homework: *
> Local and Remote students should fax homework to (650) 736-1266 or (650) 725-4138. If you are unable to fax because of color, graphs, etc., please mail to:
> SCPD
> 496 Lomita Mall
> Durand Bldg. 4th floor, room 410
> Stanford, CA. 94305
> or email homework to scpd-distribution@lists.stanford.edu
> 
> SCPD will date-stamp and log all incoming homework. Homework will be delivered to the departments between 1:00 pm and 2:00 pm daily. Faxed homework received after 12:00 noon will be delivered the next business day.


hope this help,
-nick
Matt Falkenhagen wrote:
> No, for problem sets, you only need to submit to SCPD.
> 
> Michael Lam wrote:
> 
>> Pardon my question for the non scpd students.
>> From the scpd students orientation, we were told that when submitting
>> assignments, send one to the scpd dept, and one to the normal class
>> channel (which would be Judy).  However, since the instruction for
>> going to Judy is to leave it under the door, can we submit via email?
>>
>> Matt is my assigned TA.  Does it mean he will grade my problem set?
>> Is it possible that I email my problem set solution to the TA?
>>
>> I am just trying to find a way of submitting without coming to campus.
>>
>> Thanks.
>>
>> -Michael
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem set 1, #8
Date: Thu, 19 Jan 2006 20:28:29 -0800
Lines: 28
Distribution: su
Message-ID: <dqpoth$bcs$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0601181739110.19526-100000@myth9.Stanford.EDU> <dqpgn3$pl$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqpgn3$pl$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9618

You can assume that p > 0.

Ari

Nick Cooper wrote:
> Are there any contraints on the constants? For example, can we have p = 0? 
> Or are the constants constrained to values that would result in a stable 
> queue?
> 
> Thanks,
> Nick
> 
> "Megan Anneke Wachs" <wachs@stanford.edu> wrote in message 
> news:Pine.LNX.4.44.0601181739110.19526-100000@myth9.Stanford.EDU...
> 
>>The formulation of the problem doesn't quite make sense to me...
>>
>>if for any process t2-t1, sigma bits can arrive, this seems that the
>>arrival rate
>>could be infinite as tau gets really small (<<1). Is tau constrained to be
>>an increment of 1 second?
>>
>>Thanks,
>>Megan
>>
> 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: John Pau <jpau@stanford.edu>
Newsgroups: su.class.cs244a
Subject: memory mapped files
Date: Thu, 19 Jan 2006 20:31:44 -0800
Lines: 6
Distribution: su
Message-ID: <dqpp3h$ba1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9619

Hi,

Is it okay to use memory mapped files in assignment 1?

Thanks,
John
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Server cant open data connection to my port
Date: Thu, 19 Jan 2006 20:37:56 -0800
Lines: 67
Distribution: su
Message-ID: <dqppe0$btg$1@news.Stanford.EDU>
References: <BFF4F97C.2BFE%sunnybalwani@hotmail.com> <dqp8pb$kq9$1@news.Stanford.EDU> <Pine.GSO.4.44.0601191732120.8407-100000@elaine33.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601191732120.8407-100000@elaine33.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9620

Hrm, it's a mystery then.

What have you done to try to debug this?  Have you tried with, say, 
ftp.cs.stanford.edu or have you just been testing with your own ftpd? 
It looked like before you were running ftpcopy and the ftp server on 
your own network; try using ethereal or tcpdump to examine network 
traffic if you can.

See if you can manually connect to the port you're listening on.  I.e., 
after setting up the listening socket and sending the PORT commamd, 
instead of sending LIST, just have ftpcopy sleep for several seconds, 
while you open a new terminal and try to telnet to that port.  If all is 
set up correctly, it should say "Connected to blah blah blah". 
Otherwise, you know something's wrong with your socket code...

Ramesh Balwani wrote:
> I get the same message when executing the code on leland machines.
> 
> Address on controlSocket is : 171.64.15.85
> port on controlSocket is 41272
> Address on dataSocket is : 171.64.15.85
> port on dataSocket is 41277
> PORT 171,64,15,85,161,61
> 200 PORT command successful.
> 
> LIST
> 425 Can't build data connection: Connection refused.
> 
> would appreciate any help.
> thanks.
> 
> On Thu, 19 Jan 2006, Matt Falkenhagen wrote:
> 
> 
>>I'm guessing you have some sort of firewall preventing an incoming
>>connection from the server.  Have you tried running your code on the
>>leland machines?
>>
>>-Matt
>>
>>It looks like you're running this on
>>Sunny Balwani wrote:
>>
>>>Hi.  After issuing the PORT command, the server cant connect to my data
>>>port.  Here is the output from printf statement right before I issue LIST
>>>command. All of my bind and listen calls are setup properly and return
>>>properly. Would appreciate any pointers to what am I doing wrong.
>>>
>>>
>>>Address of ftp server is : 10.0.1.5
>>>port of ftp server is 21
>>>
>>>Address on dataSocket is : 10.0.1.2
>>>port on dataSocket is 53340
>>>
>>>PORT 10,0,1,2,208,92
>>>200 PORT command successful.
>>>
>>>LIST
>>>150 Opening ASCII mode data connection for /bin/ls.
>>>425 Can't open data connection.
>>>
>>>Thanks in advance.
>>>Sunny.
>>>
>>
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: memory mapped files
Date: Thu, 19 Jan 2006 20:39:08 -0800
Lines: 9
Distribution: su
Message-ID: <dqppg8$btj$1@news.Stanford.EDU>
References: <dqpp3h$ba1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqpp3h$ba1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9621

Sure.

John Pau wrote:
> Hi,
> 
> Is it okay to use memory mapped files in assignment 1?
> 
> Thanks,
> John
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem Set 1 -  submission time
Date: Thu, 19 Jan 2006 20:48:49 -0800
Lines: 25
Distribution: su
Message-ID: <dqpq2c$d1e$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601191700120.20732-100000@elaine3.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601191700120.20732-100000@elaine3.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9622

In case anyone missed Prof McKeown's email, this request has been granted:

Folks,

Someone asked if - since he will be coming to Gates for 2.15pm for the 
discussion section - he can turn in PS#1 at 2pm instead. This seems 
quite reasonable to me. So....
           The deadline for PS#1 is 2pm Friday, instead of 12noon.

Remember to deliver it to Judy Polenta's office in Gates 351 (just down 
the corridor from my office).

Thanks,
- Nick


Miguel Sanchez wrote:
> 	can the submission time of Friday's first problem set  be
> pushed up a couple of hours to be at the time of the TA session.
> 	This could save some a trip to campus before noon, and then
> another at 2:15 for the TA session,
> 
> - Miguel
> 
> 
.

Path: shelby.stanford.edu!elaine40.Stanford.EDU!wkso
From: Wai Kei So <wkso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp.stanford.edu Revisited
Date: Thu, 19 Jan 2006 20:50:14 -0800
Lines: 40
Distribution: su
Message-ID: <Pine.GSO.4.44.0601192049260.29100-100000@elaine40.Stanford.EDU>
References: <20060119151302.7d6b1b51@ballpoint> <dqpale$n1b$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <dqpale$n1b$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9623

What about test I?  My output was:

Test I [out of 0.5]
Checks that ftpcopy matches required UI specification.

Results:  SOMEWHAT OK (passed only 4 out of 5 subtests)

Program output (ftp.stanford.edu, expected "OK: 61734 bytes copied":
***Timeout expired during grading


-Wai Kei

On Thu, 19 Jan 2006, Matt Falkenhagen wrote:

> Sorry, yes it's been down for some time.  Unfortunately, modifying the
> test scripts has proven to be a non-trivial problem, and we will not be
> able to do it for this assignment.
>
> We've alerted ITSS about the problem and hopefully they will have
> ftp.stanford.edu up soon.
>
> In the meantime, you can still run tests, just ignore errors caused by
> ftp.stanford.edu.   The only tests that will fail because of
> ftp.stanford.edu alone are C, D, E, and F.2 and each will say "(passed
> only 4 out of 5 subtests)" with a note about ftp.stanford.edu failing.
> If you didn't pass 4/5 subtests, something else is wrong.
>
> -Matt
>
>
> David Reiss wrote:
> > As far as I can tell, ftp.stanford.edu has been unavailable for two full
> > days now.  In my case, that is five tests that I have been unable to
> > use.  Is it possible to get a modified test script that uses some other
> > test case in place of ftp.stanford.edu?  Thanks.
> >
> > --David
>

.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp.stanford.edu Revisited
Date: Thu, 19 Jan 2006 21:17:46 -0800
Lines: 46
Distribution: su
Message-ID: <dqprog$efp$1@news.Stanford.EDU>
References: <20060119151302.7d6b1b51@ballpoint> <dqpale$n1b$1@news.Stanford.EDU> <Pine.GSO.4.44.0601192049260.29100-100000@elaine40.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601192049260.29100-100000@elaine40.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9624

That looks fine.  Probably anything involving passing 4/5 subtests and 
ftp.stanford.edu is not your fault.

Wai Kei So wrote:
> What about test I?  My output was:
> 
> Test I [out of 0.5]
> Checks that ftpcopy matches required UI specification.
> 
> Results:  SOMEWHAT OK (passed only 4 out of 5 subtests)
> 
> Program output (ftp.stanford.edu, expected "OK: 61734 bytes copied":
> ***Timeout expired during grading
> 
> 
> -Wai Kei
> 
> On Thu, 19 Jan 2006, Matt Falkenhagen wrote:
> 
> 
>>Sorry, yes it's been down for some time.  Unfortunately, modifying the
>>test scripts has proven to be a non-trivial problem, and we will not be
>>able to do it for this assignment.
>>
>>We've alerted ITSS about the problem and hopefully they will have
>>ftp.stanford.edu up soon.
>>
>>In the meantime, you can still run tests, just ignore errors caused by
>>ftp.stanford.edu.   The only tests that will fail because of
>>ftp.stanford.edu alone are C, D, E, and F.2 and each will say "(passed
>>only 4 out of 5 subtests)" with a note about ftp.stanford.edu failing.
>>If you didn't pass 4/5 subtests, something else is wrong.
>>
>>-Matt
>>
>>
>>David Reiss wrote:
>>
>>>As far as I can tell, ftp.stanford.edu has been unavailable for two full
>>>days now.  In my case, that is five tests that I have been unable to
>>>use.  Is it possible to get a modified test script that uses some other
>>>test case in place of ftp.stanford.edu?  Thanks.
>>>
>>>--David
>>
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Sunny Balwani <sunnybalwani@hotmail.com>
Newsgroups: su.class.cs244a
Subject: Bind()
Date: Thu, 19 Jan 2006 22:54:20 -0800
Lines: 9
Distribution: su
Message-ID: <BFF5C91C.2C4D%sunnybalwani@hotmail.com>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.2.1.051004
Thread-Topic: Bind()
Thread-Index: AcYdjlZ5lRkLjImBEdqKxAARJHuZqg==
Xref: shelby.stanford.edu su.class.cs244a:9625

Hi.

When we call the Bind for a data connection socket (after socket() and
before listen()) , do we need to specify the server IP address in sin_addr
or do we just leave it zeros. (sin_port is 0).

Thanks in advance for help.
Sunny.

.

Path: shelby.stanford.edu!not-for-mail
From: Hau Jia Chew <haujia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp.stanford.edu Revisited
Date: Thu, 19 Jan 2006 22:54:15 -0800
Lines: 30
Distribution: su
Message-ID: <dqq1en$ker$1@news.Stanford.EDU>
References: <20060119151302.7d6b1b51@ballpoint> <dqpale$n1b$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: en-us, en
In-Reply-To: <dqpale$n1b$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9626

Matt Falkenhagen wrote:
> Sorry, yes it's been down for some time.  Unfortunately, modifying the 
> test scripts has proven to be a non-trivial problem, and we will not be 
> able to do it for this assignment.
> 
> We've alerted ITSS about the problem and hopefully they will have 
> ftp.stanford.edu up soon.
> 
> In the meantime, you can still run tests, just ignore errors caused by 
> ftp.stanford.edu.   The only tests that will fail because of 
> ftp.stanford.edu alone are C, D, E, and F.2 and each will say "(passed 
> only 4 out of 5 subtests)" with a note about ftp.stanford.edu failing. 
> If you didn't pass 4/5 subtests, something else is wrong.

Won't all 3 of the purify tests (the last 3 tests) give "NOT TESTED" as 
well? Since the test script is calling ftpcopy.purify against 
ftp.stanford.edu also.

> 
> -Matt
> 
> 
> David Reiss wrote:
> 
>> As far as I can tell, ftp.stanford.edu has been unavailable for two full
>> days now.  In my case, that is five tests that I have been unable to
>> use.  Is it possible to get a modified test script that uses some other
>> test case in place of ftp.stanford.edu?  Thanks.
>>
>> --David
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Bind()
Date: Fri, 20 Jan 2006 00:13:14 -0800
Lines: 71
Distribution: su
Message-ID: <dqq62v$rmo$1@news.Stanford.EDU>
References: <BFF5C91C.2C4D%sunnybalwani@hotmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <BFF5C91C.2C4D%sunnybalwani@hotmail.com>
Xref: shelby.stanford.edu su.class.cs244a:9627

You should specify the server IP address. This is the same IP address as 
the local address of the control connection, so you can use getsockname 
to get the ip address. There's a post from the 2004 newsgroup that has 
sample code to do this:

  /* -------------------------------------------------------- */

     struct  sockaddr_in ctrl_addr; /* connected to server */
     struct  sockaddr_in data_addr; /* used to get local IP */
     int     datas, ctrls;  /* couple' o file descriptors */
     int     one = 1; /* the number one ... don't ask */
     int     len = 0;

     /* -- connect to server ... ftp.microsoft.com in this case -- */
       ctrls = socket(AF_INET, SOCK_STREAM, 0);

       memset((char *)&ctrl_addr, 0, sizeof (ctrl_addr));
       ctrl_addr.sin_addr.s_addr = inet_addr("207.46.133.140");
       ctrl_addr.sin_family = AF_INET;
       ctrl_addr.sin_port = htons(21);

       if (connect(ctrls, (struct sockaddr *)&ctrl_addr, sizeof 
(ctrl_addr)) ==
               -1)
       { perror("connect"); return -1; }
     /* -- done connecting to ftp.microsoft.com                 -- */

     memset((char *)&data_addr, 0, sizeof(struct sockaddr_in));

     /* -- get local socket info on connected socket -- */
     len = sizeof(data_addr);
     if( getsockname(ctrls, (struct sockaddr *)&data_addr, &len) == -1)
     { perror("getsockname"); return -1; }

     /* -- now we create a new socket to bind and read the addr from -- */
      datas = socket(AF_INET, SOCK_STREAM, 0);

      if( setsockopt(datas, SOL_SOCKET, SO_REUSEADDR, (char *)&one, 
sizeof (one))
              == -1)
      { perror("setsockupt"); return -1; }

      data_addr.sin_port = 0;
      if ( bind(datas, (struct sockaddr *)&data_addr, sizeof 
(data_addr)) == -1)
      { perror("bind"); return -1; }
     /* -- done binding local socket -- */

     len = sizeof (data_addr);
     if ( getsockname(datas, (struct sockaddr *)&data_addr, &len) == -1 )
     { perror("getsockname"); return -1; }

     printf(" Address: %s\n", inet_ntoa(data_addr.sin_addr));
     /* -- TADA! -- */


The important thing to note is that the IP address for data_addr (the 
second argument to bind) is populated by the call to getsockname.

Ari

Sunny Balwani wrote:
> Hi.
> 
> When we call the Bind for a data connection socket (after socket() and
> before listen()) , do we need to specify the server IP address in sin_addr
> or do we just leave it zeros. (sin_port is 0).
> 
> Thanks in advance for help.
> Sunny.
> 
.

Path: shelby.stanford.edu!elaine13.Stanford.EDU!ptarjan
From: Paul Nicholas George Tarjan <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem set 1, #8
Date: Fri, 20 Jan 2006 00:28:02 -0800
Lines: 48
Distribution: su
Message-ID: <Pine.GSO.4.44.0601200025340.8163-100000@elaine13.Stanford.EDU>
References: <Pine.LNX.4.44.0601181739110.19526-100000@myth9.Stanford.EDU>
 <dqpgn3$pl$1@news.Stanford.EDU> <dqpoth$bcs$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <dqpoth$bcs$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9628

I'm still lost on this.

If the constants are arbitrary, then you can pick 10000000000000000000000
for each of them and get any arrival rate you want, but if we must have a
stable router, then the answer is just input rate = output rate, which
seems way too easy.

Similarly for the other parts, with arbitrary constants the questions can
be any arbitrary answer, and with a stable router seems way too easy.

Any constraints would be nice.

Thanks

Paul

On Thu, 19 Jan 2006, Ari Greenberg wrote:

> You can assume that p > 0.
>
> Ari
>
> Nick Cooper wrote:
> > Are there any contraints on the constants? For example, can we have p = 0?
> > Or are the constants constrained to values that would result in a stable
> > queue?
> >
> > Thanks,
> > Nick
> >
> > "Megan Anneke Wachs" <wachs@stanford.edu> wrote in message
> > news:Pine.LNX.4.44.0601181739110.19526-100000@myth9.Stanford.EDU...
> >
> >>The formulation of the problem doesn't quite make sense to me...
> >>
> >>if for any process t2-t1, sigma bits can arrive, this seems that the
> >>arrival rate
> >>could be infinite as tau gets really small (<<1). Is tau constrained to be
> >>an increment of 1 second?
> >>
> >>Thanks,
> >>Megan
> >>
> >
> >
> >
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: test script errors on first try
Date: Fri, 20 Jan 2006 02:02:52 -0800
Lines: 33
Distribution: su
Message-ID: <dqqcg6$4sm$1@news.Stanford.EDU>
References: <dqnjml$mna$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:9629

nm, i had a wrapper around it.  thx matt!

"Waynn Lue" <wlue@stanford.edu> wrote in message
news:dqnjml$mna$1@news.Stanford.EDU...
> When I run the testscript for the first time after changing the code, it
> seems to complete all the operations, and then I get these errors, and no
> output about any of the tests:
>
> /usr/pubsw/bin/cat: grading_src/build/.purify: No such file or directory
> /usr/pubsw/bin/cat: grading_src/build/Makefile: No such file or directory
> /usr/pubsw/bin/cat: grading_src/build/echodemo.c: No such file or
directory
> /usr/pubsw/bin/cat: grading_src/build/errors.c: No such file or directory
> /usr/pubsw/bin/cat: grading_src/build/ftpcopy.c: No such file or directory
> /usr/pubsw/bin/cat: grading_src/build/ftpparse.c: No such file or
directory
> /usr/pubsw/bin/cat: grading_src/build/ftpparse.h: No such file or
directory
> /usr/pubsw/bin/cat: grading_src/build/purify.output: No such file or
> directory
> Could not open submitted file!
> couldn't submit code for testing
>
> When I run it again right afterwards, it works perfectly fine and gives me
> output on each of the tests.  Is it not correctly copying the files over,
or
> am I screwing something up?
>
> Waynn
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Brent Ellwein" <baellwe@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: non-existant local directories
Date: Fri, 20 Jan 2006 02:33:47 -0800
Lines: 18
Distribution: su
Message-ID: <dqqebh$69v$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Xref: shelby.stanford.edu su.class.cs244a:9630

In the problem statement it says:

" You may assume that the local directory already exists; exit with an error 
if it does not. "

However, in the grading script, this case seems to come up often where the 
initial local directory doesn't exist.  Wouldn't it be better to attempt to 
create the user-specified local directory if it doesn't exist and error if 
the creation isn't possible?

If instead, we error if the local directory doesn't exist, then the script 
prints out the following warning:

warning:  ftpcopy failed with exit code 1 (waitpid status 256)

What would you have us do? 


.

Path: shelby.stanford.edu!not-for-mail
From: "Forum Mangal Parmar" <forumm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: server replies with 500
Date: Fri, 20 Jan 2006 09:17:05 -0800
Lines: 27
Distribution: su
Message-ID: <dqr5ub$io$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9631

Hi
when I try to login and send commands to the server, it works fine with 
ftp.cs.stanford.edu but when I send them to ftp.microsoft.com I get the 
following repiles:

220 Microsoft FTP Service

sending USER anonymous

 500 '': command not understood

sending PASS forumm@elaine13.Stanford.EDU

500 '': command not understood

sending PORT 171,64,15,78,168,49

500 '': command not understood



can anybody tell me the reason for such behavior..

thanks
Forum 


.

Path: shelby.stanford.edu!not-for-mail
From: Sesha Narahari <narahari@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: server replies with 500
Date: Fri, 20 Jan 2006 09:23:26 -0800
Lines: 34
Distribution: su
Message-ID: <43D11C8E.8050800@stanford.edu>
References: <dqr5ub$io$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9632

I had some of these when my command was incopmlete or wasnt followed by 
a CRLF

Sesha

Forum Mangal Parmar wrote:
> Hi
> when I try to login and send commands to the server, it works fine with 
> ftp.cs.stanford.edu but when I send them to ftp.microsoft.com I get the 
> following repiles:
> 
> 220 Microsoft FTP Service
> 
> sending USER anonymous
> 
>  500 '': command not understood
> 
> sending PASS forumm@elaine13.Stanford.EDU
> 
> 500 '': command not understood
> 
> sending PORT 171,64,15,78,168,49
> 
> 500 '': command not understood
> 
> 
> 
> can anybody tell me the reason for such behavior..
> 
> thanks
> Forum 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Daniel Holbert <dholbert@NOSPAM.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Does NVT max len (1024 bytes) include '\0' char?
Date: Fri, 20 Jan 2006 10:52:56 -0800
Lines: 11
Distribution: su
Message-ID: <dqrbif$7bc$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9633

 From the assignment:

" In this assignment you can assume that no NVT string will be longer 
than 1024 bytes. "

Does that maximum length include a spot for a null terminus?  I.e. would 
a "maximal" NVT String be 1023 bytes of text/whitespace, leaving one 
spot for the null char, or would it be 1024 bytes of non-null characters?

Thanks,
~Daniel
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Does NVT max len (1024 bytes) include '\0' char?
Date: Fri, 20 Jan 2006 11:23:41 -0800
Lines: 16
Distribution: su
Message-ID: <dqrdbv$9hd$1@news.Stanford.EDU>
References: <dqrbif$7bc$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqrbif$7bc$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9634

Well, strictly speaking an NVT line is (typically) not null-terminated, 
it just ends with \r\n.  So I'd say the null-terminator isn't included 
in the 1024.

Daniel Holbert wrote:
>  From the assignment:
> 
> " In this assignment you can assume that no NVT string will be longer 
> than 1024 bytes. "
> 
> Does that maximum length include a spot for a null terminus?  I.e. would 
> a "maximal" NVT String be 1023 bytes of text/whitespace, leaving one 
> spot for the null char, or would it be 1024 bytes of non-null characters?
> 
> Thanks,
> ~Daniel
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem set 1, #8
Date: Fri, 20 Jan 2006 11:44:30 -0800
Lines: 57
Distribution: su
Message-ID: <dqrej1$ak5$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0601181739110.19526-100000@myth9.Stanford.EDU> <dqpgn3$pl$1@news.Stanford.EDU> <dqpoth$bcs$1@news.Stanford.EDU> <Pine.GSO.4.44.0601200025340.8163-100000@elaine13.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601200025340.8163-100000@elaine13.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9635

Well, the answer should be given in terms of sigma and rou (p).

Ari



Paul Nicholas George Tarjan wrote:
> I'm still lost on this.
> 
> If the constants are arbitrary, then you can pick 10000000000000000000000
> for each of them and get any arrival rate you want, but if we must have a
> stable router, then the answer is just input rate = output rate, which
> seems way too easy.
> 
> Similarly for the other parts, with arbitrary constants the questions can
> be any arbitrary answer, and with a stable router seems way too easy.
> 
> Any constraints would be nice.
> 
> Thanks
> 
> Paul
> 
> On Thu, 19 Jan 2006, Ari Greenberg wrote:
> 
> 
>>You can assume that p > 0.
>>
>>Ari
>>
>>Nick Cooper wrote:
>>
>>>Are there any contraints on the constants? For example, can we have p = 0?
>>>Or are the constants constrained to values that would result in a stable
>>>queue?
>>>
>>>Thanks,
>>>Nick
>>>
>>>"Megan Anneke Wachs" <wachs@stanford.edu> wrote in message
>>>news:Pine.LNX.4.44.0601181739110.19526-100000@myth9.Stanford.EDU...
>>>
>>>
>>>>The formulation of the problem doesn't quite make sense to me...
>>>>
>>>>if for any process t2-t1, sigma bits can arrive, this seems that the
>>>>arrival rate
>>>>could be infinite as tau gets really small (<<1). Is tau constrained to be
>>>>an increment of 1 second?
>>>>
>>>>Thanks,
>>>>Megan
>>>>
>>>
>>>
>>>
> 
.

Path: shelby.stanford.edu!saga16.Stanford.EDU!wachs
From: Megan Anneke Wachs <wachs@stanford.edu>
Newsgroups: su.class.cs244a
Subject: hanging on login
Date: Fri, 20 Jan 2006 12:04:09 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.GSO.4.44.0601201159410.7031-100000@saga16.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9636

Has anyone else had this problem? I can connect fine to ftp.microsoft.com,
but for any other server (ftp.cs.stanford.edu, ftp.slac.stanford.edu,
ftp.cs.brown.edu) I either hang or am rejected when asked for password.
For example,

331 Anonymous login ok, send your complete email address as your password.

writing PASS wachs@saga16.Stanford.EDU

wrote.
reading...

this hangs on read(),

but for ftp.cs.brown.edu I get:

331 Guest login ok, send your complete e-mail address as password.

writing PASS wachs@saga16.Stanford.EDU
wrote.
reading...

530 Please login with USER and PASS.


Any ideas?
Thanks!

Megan

.

Path: shelby.stanford.edu!not-for-mail
From: Sunny Balwani <sunnybalwani@hotmail.com>
Newsgroups: su.class.cs244a
Subject: 550 Permission denied error
Date: Fri, 20 Jan 2006 13:47:39 -0800
Lines: 12
Distribution: su
Message-ID: <BFF69A7B.2C74%sunnybalwani@hotmail.com>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.2.1.051004
Thread-Topic: 550 Permission denied error
Thread-Index: AcYeCyH3YGzjDon+EdqeOQARJHuZqg==
Xref: shelby.stanford.edu su.class.cs244a:9637

Hi.

When I try to ftp a file that I don't have permissions to, I get an 550
error such as the following from ftp.intel.com

550 README.intel: Permission denied.

However, after this error, it also closes my socket.  Is that expected
behavior or am I doing something wrong.

Thanks in advance.

.

Path: shelby.stanford.edu!not-for-mail
From: Sesha Narahari <narahari@stanford.edu>
Newsgroups: su.class.cs244a
Subject: warning: implicit declearation of function strdup
Date: Fri, 20 Jan 2006 14:50:42 -0800
Lines: 5
Distribution: su
Message-ID: <43D16942.8050005@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9638

How can I suppress this? I have both <string.h> and <strings.h> included.

Thanks,
Sesha

.

Path: shelby.stanford.edu!not-for-mail
From: Daniel Holbert <dholbert@NOSPAM.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Retrying after a 4xx reply
Date: Fri, 20 Jan 2006 15:25:04 -0800
Lines: 15
Distribution: su
Message-ID: <dqrrgp$p5q$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9639

How should we deal with 4xx replies ("The command failed and should be 
retried later")?   I see two possible reactions to 4xx reply messages:

Option 1. immediately retry the preceding command, repeating it up to N 
times if you continue getting 4xx replies, and then quit w/ error 
condition if it never succeeds

Option 2. Immediately quit w/ error condition after the first time you 
get a 4xx reply

Am I safe to stick with option 2, or do you require that we retry the 
command?

Thanks,
~Daniel
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp.stanford.edu Revisited
Date: Fri, 20 Jan 2006 17:30:49 -0800
Lines: 43
Distribution: su
Message-ID: <dqs2sc$42t$1@news.Stanford.EDU>
References: <20060119151302.7d6b1b51@ballpoint> <dqpale$n1b$1@news.Stanford.EDU> <dqq1en$ker$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqq1en$ker$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9640

Yes, you're right.

I've taken ftp.stanford.edu out of the other tests (everything but the 
last three tests: M, N, O) so that shouldn't give problems anymore.

As for the last three, they will say NOT TESTED.  This probably won't be 
fixed in time, but this is something you should be testing manually 
anyway.  Run your ftpcopy.purify and have it actually transfer files and 
see purify catches any errors.

Hau Jia Chew wrote:
> Matt Falkenhagen wrote:
> 
>> Sorry, yes it's been down for some time.  Unfortunately, modifying the 
>> test scripts has proven to be a non-trivial problem, and we will not 
>> be able to do it for this assignment.
>>
>> We've alerted ITSS about the problem and hopefully they will have 
>> ftp.stanford.edu up soon.
>>
>> In the meantime, you can still run tests, just ignore errors caused by 
>> ftp.stanford.edu.   The only tests that will fail because of 
>> ftp.stanford.edu alone are C, D, E, and F.2 and each will say "(passed 
>> only 4 out of 5 subtests)" with a note about ftp.stanford.edu failing. 
>> If you didn't pass 4/5 subtests, something else is wrong.
> 
> 
> Won't all 3 of the purify tests (the last 3 tests) give "NOT TESTED" as 
> well? Since the test script is calling ftpcopy.purify against 
> ftp.stanford.edu also.
> 
>>
>> -Matt
>>
>>
>> David Reiss wrote:
>>
>>> As far as I can tell, ftp.stanford.edu has been unavailable for two full
>>> days now.  In my case, that is five tests that I have been unable to
>>> use.  Is it possible to get a modified test script that uses some other
>>> test case in place of ftp.stanford.edu?  Thanks.
>>>
>>> --David
.

Path: shelby.stanford.edu!not-for-mail
From: "Forum Mangal Parmar" <forumm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftpparse reply
Date: Fri, 20 Jan 2006 18:17:03 -0800
Lines: 9
Distribution: su
Message-ID: <dqs5io$6pj$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9641

For ['flagtrycwd', 'flagtryretr'] = [1, 1]: most likely a link (could be 
either a file or a directory)

how do we know if its a link/file/directory?

thanks
Forum 


.

Path: shelby.stanford.edu!not-for-mail
From: "Ram" <ramananr@stanford.edu>
Newsgroups: su.class.cs244a
Subject: README format
Date: Fri, 20 Jan 2006 20:01:16 -0800
Lines: 8
Distribution: su
Message-ID: <dqsbmc$c73$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9642

Hi,

Is there any specific requirements for the contents of the writeup like what 
exactly we should discuss, or the max/min length etc? Thanks.

Ram 


.

Path: shelby.stanford.edu!myth7.Stanford.EDU!lerhaupt
From: Gary Scott Lerhaupt <lerhaupt@stanford.edu>
Newsgroups: su.class.cs244a
Subject: accepting data connection from 0.0.0.0
Date: Fri, 20 Jan 2006 20:11:11 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0601202007080.12836-100000@myth7.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9643

I'm a bit baffled here.  I successfully bind(), listen(), send a PORT,
send a LIST and accept() but then when I try to read from the data
connection I get ENOTCONN (134).

What is strange to me is that accept() succeeds but examining the ip of
the connecting system it says its 0.0.0.0

PORT STRING 171,64,15,107,184,79
200 PORT command successful
150 Opening ASCII mode data connection for file list
server: got connection from 0.0.0.0

Thoughts?

Gary

.

Path: shelby.stanford.edu!not-for-mail
From: alex qi <alexqi@stanford.edu>
Newsgroups: su.class.cs244a
Subject: About local directory
Date: Fri, 20 Jan 2006 21:48:33 -0800
Lines: 7
Distribution: su
Message-ID: <dqshvf$hmq$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9644

 From the assignment, it said "You may assume that the local directory 
already exists; exit with an error if it does not." Does that mean if we 
want to copy "/D1/D2/f.gz" from ftp server, we can assume we already 
have "/D1/D2" on our local server? in another word, we don't need to 
create directory at all?

thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: "Robbie Yan" <xyan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test on little-endian machines
Date: Fri, 20 Jan 2006 22:44:50 -0800
Lines: 15
Distribution: su
Message-ID: <dqsl91$knp$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Xref: shelby.stanford.edu su.class.cs244a:9645

Will our code be tested on little-endian machines (e.g. Linux boxes like
Raptor)?

I tried compiling my code on Raptor and got the following error messages:

'S_IREAD' undeclared (first use in this function)
`S_IWRITE' undeclared (first use in this function)
`S_IEXEC' undeclared (first use in this function)

I recall that these errors were resolved once I #include'ed <sys/stats.h>
before compiling on Solaris machines. Do you know how I can resolve these
errors on Raptors? Or should I not care about running my code on Linux
altogether?


.

Path: shelby.stanford.edu!not-for-mail
From: "Robbie Yan" <xyan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Edge cases
Date: Fri, 20 Jan 2006 22:54:36 -0800
Lines: 5
Distribution: su
Message-ID: <dqslra$ld1$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Xref: shelby.stanford.edu su.class.cs244a:9646

Will the following cases be tested while grading?
- Unresponsive server forces socket connection to time out
- Server unable to process FTP requests (i.e. server is down)


.

Path: shelby.stanford.edu!not-for-mail
From: "Robbie Yan" <xyan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Response code
Date: Fri, 20 Jan 2006 23:04:17 -0800
Lines: 11
Distribution: su
Message-ID: <dqsmdf$lpd$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Xref: shelby.stanford.edu su.class.cs244a:9647

Is it fair to interpret the assignment's requirement regarding response
codes as follows?

- If response code is 1xx or 2xx or 3xx, then proceed with operations
- If response code is 4xx, simply quit the program
- If response code is 5xx but not 550, quit the program
- If response code is 550 (which means permission to access file is denied),
silently ignore this response and proceed with the immediately following
operations


.

Path: shelby.stanford.edu!not-for-mail
From: "Jesse Young" <jesse.young@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test on little-endian machines
Date: Fri, 20 Jan 2006 23:09:53 -0800
Lines: 33
Distribution: su
Message-ID: <dqsmo2$lvt$1@news.Stanford.EDU>
References: <dqsl91$knp$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9648

You could manually define synonyms:

#ifndef S_IREAD
#define S_IREAD S_IRUSR
#endif

#ifndef S_IWRITE
#define S_IWRITE S_IWUSR
#endif

#ifndef S_IEXEC
#define S_IEXEC S_IXUSR
#endif

"Robbie Yan" <xyan@stanford.edu> wrote in message 
news:dqsl91$knp$1@news.Stanford.EDU...
> Will our code be tested on little-endian machines (e.g. Linux boxes like
> Raptor)?
>
> I tried compiling my code on Raptor and got the following error messages:
>
> 'S_IREAD' undeclared (first use in this function)
> `S_IWRITE' undeclared (first use in this function)
> `S_IEXEC' undeclared (first use in this function)
>
> I recall that these errors were resolved once I #include'ed <sys/stats.h>
> before compiling on Solaris machines. Do you know how I can resolve these
> errors on Raptors? Or should I not care about running my code on Linux
> altogether?
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Jesse Young" <jesse.young@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: About local directory
Date: Fri, 20 Jan 2006 23:11:18 -0800
Lines: 14
Distribution: su
Message-ID: <dqsmqn$m3d$1@news.Stanford.EDU>
References: <dqshvf$hmq$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:9649

I think they are talking about the initial local directory, i.e. argv[4]. 
You still have to create subdirectories as necessary.

"alex qi" <alexqi@stanford.edu> wrote in message 
news:dqshvf$hmq$1@news.Stanford.EDU...
> From the assignment, it said "You may assume that the local directory 
> already exists; exit with an error if it does not." Does that mean if we 
> want to copy "/D1/D2/f.gz" from ftp server, we can assume we already have 
> "/D1/D2" on our local server? in another word, we don't need to create 
> directory at all?
>
> thanks. 


.

Path: shelby.stanford.edu!not-for-mail
From: "Jesse Young" <jesse.young@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: accepting data connection from 0.0.0.0
Date: Fri, 20 Jan 2006 23:15:47 -0800
Lines: 29
Distribution: su
Message-ID: <dqsn34$md3$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0601202007080.12836-100000@myth7.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9650

Are you using the return value from accept() to when you are trying to read 
from the data connection? e.g.:

int dataConn = accept(dataSock, ...);
read(dataConn, ...);

if you try to read from dataSock instead of dataConn, I think you would get 
ENOTCONN.

"Gary Scott Lerhaupt" <lerhaupt@stanford.edu> wrote in message 
news:Pine.LNX.4.44.0601202007080.12836-100000@myth7.Stanford.EDU...
> I'm a bit baffled here.  I successfully bind(), listen(), send a PORT,
> send a LIST and accept() but then when I try to read from the data
> connection I get ENOTCONN (134).
>
> What is strange to me is that accept() succeeds but examining the ip of
> the connecting system it says its 0.0.0.0
>
> PORT STRING 171,64,15,107,184,79
> 200 PORT command successful
> 150 Opening ASCII mode data connection for file list
> server: got connection from 0.0.0.0
>
> Thoughts?
>
> Gary
> 


.

Path: shelby.stanford.edu!elaine13.Stanford.EDU!ptrlee
From: Peter In Lee <ptrlee@elaine13.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: 501 Illegal PORT command
Date: Fri, 20 Jan 2006 23:51:39 -0800
Lines: 51
Distribution: su
Message-ID: <Pine.GSO.4.44.0601202341220.16739-100000@elaine13.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9651

Hi Guys,

As my friend Gary so eloquently puts it, I'm having a case of the 501
blues.

I can connect fine to ftp.microsoft.com:

bash-2.04$ ./ftpcopy txt 1 ftp.microsoft.com
220 Microsoft FTP Service
--- USER anonymous
331 Anonymous access allowed, send identity (e-mail name) as password.
--- PASS ptrlee@stanford.edu
230-Welcome to ftp.microsoft.com.  Please also visit
http://www.microsoft.com/downloads.
230 Anonymous user logged in.
--- TYPE A N
200 Type set to A.
--- PORT 171,64,15,78,203,52008
200 PORT command successful.
--- LIST .
150 Opening ASCII mode data connection for /bin/ls.
226 Transfer complete.
OK: 0 bytes copied

But when I try ftp.slac.stanford.edu, it rejects my PORT command:

230-Please read the file README.outgoing
230-   it was last modified on Mon Mar 10 12:52:44 2003 - 1048
230-Please read the file README.tip_inbox
230    it was last modified on Fri Jul  6 15:09:28 2001 - 1660
--- TYPE A N
200 Type set to A
--- PORT 171,64,15,78,203,52011
501 Illegal PORT command


I've tried to consider several possibilities, including setting the
TCP_NODELAY flag or seeing if somehow the string is malformed.  It
seems like I'm sending the correct number of bytes, and the command is
terminated with "\r\n", which were several possibilities mentioned on the
newsgroup.

One thing I've been thinking is that maybe there's an endian issue in how
I print the address and port to the string.

Well, if anybody has any insight / help / suggestions, I would really
appreciate it.

Thanks,
Peter

.

Path: shelby.stanford.edu!not-for-mail
From: "Sutthipong Thavisomboon" <sthavis@stanford.edu>
Newsgroups: su.class.cs244a
Subject: contorl socket dies?
Date: Fri, 20 Jan 2006 23:59:55 -0800
Lines: 22
Distribution: su
Message-ID: <dqspp6$qks$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9652

Hi,

I have been testing my code on ftp.fedworld.gov and got no problem. However,
once I ran my code on ftp.cs.stanford.edu I have a problem with not getting
226 reply code in control socket once I finished reading the list.

my steps are:

1) submit LIST command
2) read reply (got replycode 150)
3) accept()
4) read data from data socket
5) read reply

at the last step, my code just blocks. It stops at command read() from the
control socket? does anyone has any idea? or did I perform any wrong step? I 
think my control socket probably died. is there any missing step I need to 
know about opening a data socket?

Thanks very much 


.

Path: shelby.stanford.edu!elaine13.Stanford.EDU!ptrlee
From: Peter In Lee <ptrlee@elaine13.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: 501 Illegal PORT command
Date: Sat, 21 Jan 2006 00:12:31 -0800
Lines: 65
Distribution: su
Message-ID: <Pine.GSO.4.44.0601210008410.17705-100000@elaine13.Stanford.EDU>
References: <Pine.GSO.4.44.0601202341220.16739-100000@elaine13.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0601202341220.16739-100000@elaine13.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9653


So I found my problem:  I was saving the port num as an unsigned short and
had a bug in the bit shifting to get the bytes back out.  In hindsight,
the 10^4 value for the last byte of the port num should have tipped me off
that something was wrong.

-- Peter

(I wonder why it worked for ftp.microsoft.com?)

On Fri, 20 Jan 2006, Peter In Lee wrote:

> Hi Guys,
>
> As my friend Gary so eloquently puts it, I'm having a case of the 501
> blues.
>
> I can connect fine to ftp.microsoft.com:
>
> bash-2.04$ ./ftpcopy txt 1 ftp.microsoft.com
> 220 Microsoft FTP Service
> --- USER anonymous
> 331 Anonymous access allowed, send identity (e-mail name) as password.
> --- PASS ptrlee@stanford.edu
> 230-Welcome to ftp.microsoft.com.  Please also visit
> http://www.microsoft.com/downloads.
> 230 Anonymous user logged in.
> --- TYPE A N
> 200 Type set to A.
> --- PORT 171,64,15,78,203,52008
> 200 PORT command successful.
> --- LIST .
> 150 Opening ASCII mode data connection for /bin/ls.
> 226 Transfer complete.
> OK: 0 bytes copied
>
> But when I try ftp.slac.stanford.edu, it rejects my PORT command:
>
> 230-Please read the file README.outgoing
> 230-   it was last modified on Mon Mar 10 12:52:44 2003 - 1048
> 230-Please read the file README.tip_inbox
> 230    it was last modified on Fri Jul  6 15:09:28 2001 - 1660
> --- TYPE A N
> 200 Type set to A
> --- PORT 171,64,15,78,203,52011
> 501 Illegal PORT command
>
>
> I've tried to consider several possibilities, including setting the
> TCP_NODELAY flag or seeing if somehow the string is malformed.  It
> seems like I'm sending the correct number of bytes, and the command is
> terminated with "\r\n", which were several possibilities mentioned on the
> newsgroup.
>
> One thing I've been thinking is that maybe there's an endian issue in how
> I print the address and port to the string.
>
> Well, if anybody has any insight / help / suggestions, I would really
> appreciate it.
>
> Thanks,
> Peter
>
>

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!qli1
From: Qing Li <qli1@stanford.edu>
Newsgroups: su.class.cs244a
Subject: purify link error and exe warning
Date: Sat, 21 Jan 2006 00:18:02 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.GSO.4.44.0601210005370.24-100000@elaine41.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9654

Hi,
When I built by make ftpcopy.purify, I got the error:
"Instrumenting: Purify engine: Error: Tried to link with directory
(/usr/lib): skipping"
and when I run test script, Test M N O purify related test case could not
get passed. I got the
error message: "Could not run purify'e exe: Purify engine: Warning:
Cannot find a file which matches the DT_SONAME field ... Using
/usr/lib/nss_files.so.1 instead."

I really get confused with the message. Can sb help me to figure out
what's wrong with this?
Thanks,
Qing


.

Path: shelby.stanford.edu!myth7.Stanford.EDU!lerhaupt
From: Gary Scott Lerhaupt <lerhaupt@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: accepting data connection from 0.0.0.0
Date: Sat, 21 Jan 2006 02:01:10 -0800
Lines: 35
Distribution: su
Message-ID: <Pine.LNX.4.44.0601210200590.12836-100000@myth7.Stanford.EDU>
References: <Pine.LNX.4.44.0601202007080.12836-100000@myth7.Stanford.EDU>
 <dqsn34$md3$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <dqsn34$md3$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9655

thanks!

On Fri, 20 Jan 2006, Jesse Young wrote:

> Are you using the return value from accept() to when you are trying to read
> from the data connection? e.g.:
>
> int dataConn = accept(dataSock, ...);
> read(dataConn, ...);
>
> if you try to read from dataSock instead of dataConn, I think you would get
> ENOTCONN.
>
> "Gary Scott Lerhaupt" <lerhaupt@stanford.edu> wrote in message
> news:Pine.LNX.4.44.0601202007080.12836-100000@myth7.Stanford.EDU...
> > I'm a bit baffled here.  I successfully bind(), listen(), send a PORT,
> > send a LIST and accept() but then when I try to read from the data
> > connection I get ENOTCONN (134).
> >
> > What is strange to me is that accept() succeeds but examining the ip of
> > the connecting system it says its 0.0.0.0
> >
> > PORT STRING 171,64,15,107,184,79
> > 200 PORT command successful
> > 150 Opening ASCII mode data connection for file list
> > server: got connection from 0.0.0.0
> >
> > Thoughts?
> >
> > Gary
> >
>
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Ram" <ramananr@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: contorl socket dies?
Date: Sat, 21 Jan 2006 04:07:21 -0800
Lines: 33
Distribution: su
Message-ID: <dqt85t$c2h$1@news.Stanford.EDU>
References: <dqspp6$qks$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:9656

Between steps 4 and 5, you should close your data connection. For some 
strange reason, ftp.cs.stanford.edu only sends a reply after you close your 
data connection.

Ram

"Sutthipong Thavisomboon" <sthavis@stanford.edu> wrote in message 
news:dqspp6$qks$1@news.Stanford.EDU...
> Hi,
>
> I have been testing my code on ftp.fedworld.gov and got no problem. 
> However,
> once I ran my code on ftp.cs.stanford.edu I have a problem with not 
> getting
> 226 reply code in control socket once I finished reading the list.
>
> my steps are:
>
> 1) submit LIST command
> 2) read reply (got replycode 150)
> 3) accept()
> 4) read data from data socket
> 5) read reply
>
> at the last step, my code just blocks. It stops at command read() from the
> control socket? does anyone has any idea? or did I perform any wrong step? 
> I think my control socket probably died. is there any missing step I need 
> to know about opening a data socket?
>
> Thanks very much
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Roy Zeighami" <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Reading from the control socket byte by byte
Date: Sat, 21 Jan 2006 07:57:39 -0600
Lines: 25
Distribution: su
Message-ID: <dqtekk$il1$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9657

This years faq has an entry that says:
Q4. I'm having trouble while read()ing from a socket. My program just hangs.

A. Read on a blocking socket will block when there is no data left to read. 
You should read the FTP RFC for a method to deal with this situation. The 
shutdown() method used in the example is not the right way to handle this 
problem, you can not shutdown a socket then reopen it. Possible solutions 
would be, (1) you can use non-blocking sockets (which we have not discussed) 
or (2) use blocking sockets but send one command at a time, and read the 
reply character by character while parsing it to know when the reply is 
complete. If you are using a blocking socket and you read the full reply 
then try to read again, your program will hang indefinitly since the server 
will not send you more characters until you send it a new command.

By the Powerpoint slides lists, under "Even more ways to lose points", 
reading byte by byte as overly inefficient and hacky.  Given that a 
relatively small amount of data is coming out of the control port, can we 
justify doing byte-wise reads?  Obviously, this make no sense for the data 
port.

Thanks,

Roy


.

Path: shelby.stanford.edu!saga16.Stanford.EDU!wachs
From: Megan Anneke Wachs <wachs@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: contorl socket dies?
Date: Sat, 21 Jan 2006 06:52:05 -0800
Lines: 41
Distribution: su
Message-ID: <Pine.GSO.4.44.0601210651590.20440-100000@saga16.Stanford.EDU>
References: <dqspp6$qks$1@news.Stanford.EDU> <dqt85t$c2h$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <dqt85t$c2h$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9658

ram, you are my hero.

-Megan

On Sat, 21 Jan 2006, Ram wrote:

> Between steps 4 and 5, you should close your data connection. For some
> strange reason, ftp.cs.stanford.edu only sends a reply after you close your
> data connection.
>
> Ram
>
> "Sutthipong Thavisomboon" <sthavis@stanford.edu> wrote in message
> news:dqspp6$qks$1@news.Stanford.EDU...
> > Hi,
> >
> > I have been testing my code on ftp.fedworld.gov and got no problem.
> > However,
> > once I ran my code on ftp.cs.stanford.edu I have a problem with not
> > getting
> > 226 reply code in control socket once I finished reading the list.
> >
> > my steps are:
> >
> > 1) submit LIST command
> > 2) read reply (got replycode 150)
> > 3) accept()
> > 4) read data from data socket
> > 5) read reply
> >
> > at the last step, my code just blocks. It stops at command read() from the
> > control socket? does anyone has any idea? or did I perform any wrong step?
> > I think my control socket probably died. is there any missing step I need
> > to know about opening a data socket?
> >
> > Thanks very much
> >
>
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: non-existant local directories
Date: Sat, 21 Jan 2006 10:05:09 -0800
Lines: 25
Distribution: su
Message-ID: <dqtt4o$1ri$1@news.Stanford.EDU>
References: <dqqebh$69v$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqqebh$69v$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9659

I don't think this comes up in the grading script.  The warning was 
probably because of the ftp.stanford.edu mess.  Do you still see it?

In any case, the handout is pretty clear that you should exit with 
error, so if you do that you won't get penalized.

Brent Ellwein wrote:
> In the problem statement it says:
> 
> " You may assume that the local directory already exists; exit with an error 
> if it does not. "
> 
> However, in the grading script, this case seems to come up often where the 
> initial local directory doesn't exist.  Wouldn't it be better to attempt to 
> create the user-specified local directory if it doesn't exist and error if 
> the creation isn't possible?
> 
> If instead, we error if the local directory doesn't exist, then the script 
> prints out the following warning:
> 
> warning:  ftpcopy failed with exit code 1 (waitpid status 256)
> 
> What would you have us do? 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Sutthipong Thavisomboon" <sthavis@stanford.edu>
Newsgroups: su.class.cs244a
Subject: File Permission
Date: Sat, 21 Jan 2006 09:57:18 -0800
Lines: 19
Distribution: su
Message-ID: <dqtt6r$20p$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9660

Hi,

In the assignment page, I see "If you encounter a file which you cannot 
access due to permissions, you should skip over it without creating it 
locally or producing any error message. Do not create a null-size file with 
the same name. " I'm not sure what it really means. What does it exactly 
mean?

1. Are we getting wrong file permission from the server? (meaning we can't 
retrieve it from the server due to permission)

OR

2. We can't overwrite the file locally due to permissions?

Thanks
Sutthipong 


.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: hanging on login
Date: Sat, 21 Jan 2006 10:07:22 -0800
Lines: 33
Distribution: su
Message-ID: <dqtt8u$1ri$2@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601201159410.7031-100000@saga16.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601201159410.7031-100000@saga16.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9661

I'm guessing this is a \r\n problem?

Megan Anneke Wachs wrote:
> Has anyone else had this problem? I can connect fine to ftp.microsoft.com,
> but for any other server (ftp.cs.stanford.edu, ftp.slac.stanford.edu,
> ftp.cs.brown.edu) I either hang or am rejected when asked for password.
> For example,
> 
> 331 Anonymous login ok, send your complete email address as your password.
> 
> writing PASS wachs@saga16.Stanford.EDU
> 
> wrote.
> reading...
> 
> this hangs on read(),
> 
> but for ftp.cs.brown.edu I get:
> 
> 331 Guest login ok, send your complete e-mail address as password.
> 
> writing PASS wachs@saga16.Stanford.EDU
> wrote.
> reading...
> 
> 530 Please login with USER and PASS.
> 
> 
> Any ideas?
> Thanks!
> 
> Megan
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: 550 Permission denied error
Date: Sat, 21 Jan 2006 10:09:59 -0800
Lines: 27
Distribution: su
Message-ID: <dqttdr$1ri$3@news.Stanford.EDU>
References: <BFF69A7B.2C74%sunnybalwani@hotmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <BFF69A7B.2C74%sunnybalwani@hotmail.com>
Xref: shelby.stanford.edu su.class.cs244a:9662

I've never heard of an ftp server doing this.  When I try with the Unix 
ftp client it doesn't happen:

ftp> get README.intel
200 PORT command successful.
550 README.intel: Permission denied.
ftp>
ftp> get README.intel
200 PORT command successful.
550 README.intel: Permission denied.

Are you talking about the control or data socket?  What makes you think 
it is being closed?

Sunny Balwani wrote:
> Hi.
> 
> When I try to ftp a file that I don't have permissions to, I get an 550
> error such as the following from ftp.intel.com
> 
> 550 README.intel: Permission denied.
> 
> However, after this error, it also closes my socket.  Is that expected
> behavior or am I doing something wrong.
> 
> Thanks in advance.
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: warning: implicit declearation of function strdup
Date: Sat, 21 Jan 2006 10:13:15 -0800
Lines: 13
Distribution: su
Message-ID: <dqttjv$1ri$4@news.Stanford.EDU>
References: <43D16942.8050005@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <43D16942.8050005@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:9663

strdup although in string.h is not an ANSI C function so it won't be 
included with -ansi (see thread "using snprintf" 1/14/2006 11:40 AM).

Again to fix make your own prototype for strdup:

extern char *strdup(const char *s1);

Sesha Narahari wrote:
> How can I suppress this? I have both <string.h> and <strings.h> included.
> 
> Thanks,
> Sesha
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Retrying after a 4xx reply
Date: Sat, 21 Jan 2006 10:19:01 -0800
Lines: 18
Distribution: su
Message-ID: <dqttup$1ri$5@news.Stanford.EDU>
References: <dqrrgp$p5q$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqrrgp$p5q$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9664

We don't expect you to retry, option 2 is fine.

Daniel Holbert wrote:
> How should we deal with 4xx replies ("The command failed and should be 
> retried later")?   I see two possible reactions to 4xx reply messages:
> 
> Option 1. immediately retry the preceding command, repeating it up to N 
> times if you continue getting 4xx replies, and then quit w/ error 
> condition if it never succeeds
> 
> Option 2. Immediately quit w/ error condition after the first time you 
> get a 4xx reply
> 
> Am I safe to stick with option 2, or do you require that we retry the 
> command?
> 
> Thanks,
> ~Daniel
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftpparse reply
Date: Sat, 21 Jan 2006 10:19:47 -0800
Lines: 14
Distribution: su
Message-ID: <dqtu06$1ri$6@news.Stanford.EDU>
References: <dqs5io$6pj$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqs5io$6pj$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9665

Please see thread "ftpparse() determining symlinks?" started 1/15/2006 
4:40 PM.


Forum Mangal Parmar wrote:
> For ['flagtrycwd', 'flagtryretr'] = [1, 1]: most likely a link (could be 
> either a file or a directory)
> 
> how do we know if its a link/file/directory?
> 
> thanks
> Forum 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: README format
Date: Sat, 21 Jan 2006 10:21:26 -0800
Lines: 13
Distribution: su
Message-ID: <dqtu39$1ri$7@news.Stanford.EDU>
References: <dqsbmc$c73$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqsbmc$c73$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9666

See "CS244a Programming Assignment Rules and Guidelines" 
(http://www.stanford.edu/class/cs244a/project_guidelines.html) for more 
information about this.  There are no specific requirements for length.

Ram wrote:
> Hi,
> 
> Is there any specific requirements for the contents of the writeup like what 
> exactly we should discuss, or the max/min length etc? Thanks.
> 
> Ram 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: About local directory
Date: Sat, 21 Jan 2006 10:22:23 -0800
Lines: 19
Distribution: su
Message-ID: <dqtu53$1ri$8@news.Stanford.EDU>
References: <dqshvf$hmq$1@news.Stanford.EDU> <dqsmqn$m3d$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqsmqn$m3d$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9667

Yes, that's correct.

Jesse Young wrote:
> I think they are talking about the initial local directory, i.e. argv[4]. 
> You still have to create subdirectories as necessary.
> 
> "alex qi" <alexqi@stanford.edu> wrote in message 
> news:dqshvf$hmq$1@news.Stanford.EDU...
> 
>>From the assignment, it said "You may assume that the local directory 
>>already exists; exit with an error if it does not." Does that mean if we 
>>want to copy "/D1/D2/f.gz" from ftp server, we can assume we already have 
>>"/D1/D2" on our local server? in another word, we don't need to create 
>>directory at all?
>>
>>thanks. 
> 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test on little-endian machines
Date: Sat, 21 Jan 2006 10:28:14 -0800
Lines: 20
Distribution: su
Message-ID: <dqtug2$391$1@news.Stanford.EDU>
References: <dqsl91$knp$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqsl91$knp$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9668

We don't require your code to compile on Linux because of things like this.

However your code shouldn't assume an endianness.

Robbie Yan wrote:
> Will our code be tested on little-endian machines (e.g. Linux boxes like
> Raptor)?
> 
> I tried compiling my code on Raptor and got the following error messages:
> 
> 'S_IREAD' undeclared (first use in this function)
> `S_IWRITE' undeclared (first use in this function)
> `S_IEXEC' undeclared (first use in this function)
> 
> I recall that these errors were resolved once I #include'ed <sys/stats.h>
> before compiling on Solaris machines. Do you know how I can resolve these
> errors on Raptors? Or should I not care about running my code on Linux
> altogether?
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Response code
Date: Sat, 21 Jan 2006 10:32:58 -0800
Lines: 16
Distribution: su
Message-ID: <dqtuou$3fr$1@news.Stanford.EDU>
References: <dqsmdf$lpd$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqsmdf$lpd$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9669

Not really.  How to deal with responses depends on the request sent. 
See the RFC sections 5.4.  SEQUENCING OF COMMANDS AND REPLIES and 6. 
STATE DIAGRAMS.

Robbie Yan wrote:
> Is it fair to interpret the assignment's requirement regarding response
> codes as follows?
> 
> - If response code is 1xx or 2xx or 3xx, then proceed with operations
> - If response code is 4xx, simply quit the program
> - If response code is 5xx but not 550, quit the program
> - If response code is 550 (which means permission to access file is denied),
> silently ignore this response and proceed with the immediately following
> operations
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: purify link error and exe warning
Date: Sat, 21 Jan 2006 10:37:54 -0800
Lines: 21
Distribution: su
Message-ID: <dqtv26$3jk$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601210005370.24-100000@elaine41.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601210005370.24-100000@elaine41.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9670

This is all expected, see posts under "Purify" on 1/12/2006 9:08 AM and 
under "ftp.stanford.edu Revisited" on 1/20/2006 5:30 PM for more 
information.  Also I get that DT_SONAME message too, doesn't seem to matter.

Qing Li wrote:
> Hi,
> When I built by make ftpcopy.purify, I got the error:
> "Instrumenting: Purify engine: Error: Tried to link with directory
> (/usr/lib): skipping"
> and when I run test script, Test M N O purify related test case could not
> get passed. I got the
> error message: "Could not run purify'e exe: Purify engine: Warning:
> Cannot find a file which matches the DT_SONAME field ... Using
> /usr/lib/nss_files.so.1 instead."
> 
> I really get confused with the message. Can sb help me to figure out
> what's wrong with this?
> Thanks,
> Qing
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: File Permission
Date: Sat, 21 Jan 2006 10:41:39 -0800
Lines: 22
Distribution: su
Message-ID: <dqtv96$3jk$2@news.Stanford.EDU>
References: <dqtt6r$20p$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqtt6r$20p$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9671

The first one.

Sutthipong Thavisomboon wrote:
> Hi,
> 
> In the assignment page, I see "If you encounter a file which you cannot 
> access due to permissions, you should skip over it without creating it 
> locally or producing any error message. Do not create a null-size file with 
> the same name. " I'm not sure what it really means. What does it exactly 
> mean?
> 
> 1. Are we getting wrong file permission from the server? (meaning we can't 
> retrieve it from the server due to permission)
> 
> OR
> 
> 2. We can't overwrite the file locally due to permissions?
> 
> Thanks
> Sutthipong 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Edge cases
Date: Sat, 21 Jan 2006 11:05:43 -0800
Lines: 13
Distribution: su
Message-ID: <dqu0mb$560$1@news.Stanford.EDU>
References: <dqslra$ld1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqslra$ld1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9672

You definately need to check the return values of all calls, so e.g., if 
connect() times out you will catch the error.

However in the case of a server just not responding to a request you 
send, we don't expect you to handle it.  AFAIK if you're using blocking 
sockets you will just hang in read() indefinately.

Robbie Yan wrote:
> Will the following cases be tested while grading?
> - Unresponsive server forces socket connection to time out
> - Server unable to process FTP requests (i.e. server is down)
> 
> 
.

Path: shelby.stanford.edu!saga16.Stanford.EDU!wachs
From: Megan Anneke Wachs <wachs@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: hanging on login
Date: Sat, 21 Jan 2006 11:44:35 -0800
Lines: 41
Distribution: su
Message-ID: <Pine.GSO.4.44.0601211144150.26844-100000@saga16.Stanford.EDU>
References: <Pine.GSO.4.44.0601201159410.7031-100000@saga16.Stanford.EDU>
 <dqtt8u$1ri$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <dqtt8u$1ri$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9673

It was actually because I was null terminating the strings after \r\n.
Thanks,
Megan
On
Sat, 21 Jan 2006, Matt Falkenhagen wrote:

> I'm guessing this is a \r\n problem?
>
> Megan Anneke Wachs wrote:
> > Has anyone else had this problem? I can connect fine to ftp.microsoft.com,
> > but for any other server (ftp.cs.stanford.edu, ftp.slac.stanford.edu,
> > ftp.cs.brown.edu) I either hang or am rejected when asked for password.
> > For example,
> >
> > 331 Anonymous login ok, send your complete email address as your password.
> >
> > writing PASS wachs@saga16.Stanford.EDU
> >
> > wrote.
> > reading...
> >
> > this hangs on read(),
> >
> > but for ftp.cs.brown.edu I get:
> >
> > 331 Guest login ok, send your complete e-mail address as password.
> >
> > writing PASS wachs@saga16.Stanford.EDU
> > wrote.
> > reading...
> >
> > 530 Please login with USER and PASS.
> >
> >
> > Any ideas?
> > Thanks!
> >
> > Megan
> >
>

.

Path: shelby.stanford.edu!not-for-mail
From: Sesha Narahari <narahari@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: warning: implicit declearation of function strdup
Date: Sat, 21 Jan 2006 11:54:26 -0800
Lines: 18
Distribution: su
Message-ID: <43D29172.9080305@stanford.edu>
References: <43D16942.8050005@stanford.edu> <dqttjv$1ri$4@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9674

Thanks, Matt. That did it .

Matt Falkenhagen wrote:
> strdup although in string.h is not an ANSI C function so it won't be 
> included with -ansi (see thread "using snprintf" 1/14/2006 11:40 AM).
> 
> Again to fix make your own prototype for strdup:
> 
> extern char *strdup(const char *s1);
> 
> Sesha Narahari wrote:
> 
>> How can I suppress this? I have both <string.h> and <strings.h> included.
>>
>> Thanks,
>> Sesha
>>

.

Path: shelby.stanford.edu!not-for-mail
From: Jens Pillgram-Larsen <jenspl@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Using code from 2004 newsgroup
Date: Sat, 21 Jan 2006 15:53:41 -0800
Lines: 7
Distribution: su
Message-ID: <dquhi6$jat$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9675

TA's,

Are we allowed to use the code published in the 2004 newsgroup. There 
are several snippets of code there that could be useful. And if it is 
ok, should I indicate this in my README and commments?

Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Reading from the control socket byte by byte
Date: Sat, 21 Jan 2006 16:26:09 -0800
Lines: 32
Distribution: su
Message-ID: <dqujf5$kul$1@news.Stanford.EDU>
References: <dqtekk$il1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqtekk$il1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9676

Yeah, since the FAQ suggests it, we won't penalize you for byte-by-byte 
reads on the control connection.

However there are more elegant ways to do it (copying into a buffer or 
recv with MSG_PEEK).

Roy Zeighami wrote:
> This years faq has an entry that says:
> Q4. I'm having trouble while read()ing from a socket. My program just hangs.
> 
> A. Read on a blocking socket will block when there is no data left to read. 
> You should read the FTP RFC for a method to deal with this situation. The 
> shutdown() method used in the example is not the right way to handle this 
> problem, you can not shutdown a socket then reopen it. Possible solutions 
> would be, (1) you can use non-blocking sockets (which we have not discussed) 
> or (2) use blocking sockets but send one command at a time, and read the 
> reply character by character while parsing it to know when the reply is 
> complete. If you are using a blocking socket and you read the full reply 
> then try to read again, your program will hang indefinitly since the server 
> will not send you more characters until you send it a new command.
> 
> By the Powerpoint slides lists, under "Even more ways to lose points", 
> reading byte by byte as overly inefficient and hacky.  Given that a 
> relatively small amount of data is coming out of the control port, can we 
> justify doing byte-wise reads?  Obviously, this make no sense for the data 
> port.
> 
> Thanks,
> 
> Roy
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Jens Pillgram-Larsen <jenspl@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Reading from the control socket byte by byte
Date: Sat, 21 Jan 2006 16:29:16 -0800
Lines: 40
Distribution: su
Message-ID: <dqujkt$l4s$1@news.Stanford.EDU>
References: <dqtekk$il1$1@news.Stanford.EDU> <dqujf5$kul$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <dqujf5$kul$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9677

Does this mean that you will punish is for byte-by-byte reads on the 
data connection?

Jens.

Matt Falkenhagen wrote:
> Yeah, since the FAQ suggests it, we won't penalize you for byte-by-byte 
> reads on the control connection.
> 
> However there are more elegant ways to do it (copying into a buffer or 
> recv with MSG_PEEK).
> 
> Roy Zeighami wrote:
>> This years faq has an entry that says:
>> Q4. I'm having trouble while read()ing from a socket. My program just 
>> hangs.
>>
>> A. Read on a blocking socket will block when there is no data left to 
>> read. You should read the FTP RFC for a method to deal with this 
>> situation. The shutdown() method used in the example is not the right 
>> way to handle this problem, you can not shutdown a socket then reopen 
>> it. Possible solutions would be, (1) you can use non-blocking sockets 
>> (which we have not discussed) or (2) use blocking sockets but send one 
>> command at a time, and read the reply character by character while 
>> parsing it to know when the reply is complete. If you are using a 
>> blocking socket and you read the full reply then try to read again, 
>> your program will hang indefinitly since the server will not send you 
>> more characters until you send it a new command.
>>
>> By the Powerpoint slides lists, under "Even more ways to lose points", 
>> reading byte by byte as overly inefficient and hacky.  Given that a 
>> relatively small amount of data is coming out of the control port, can 
>> we justify doing byte-wise reads?  Obviously, this make no sense for 
>> the data port.
>>
>> Thanks,
>>
>> Roy
>>
>>
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Using code from 2004 newsgroup
Date: Sat, 21 Jan 2006 16:29:19 -0800
Lines: 13
Distribution: su
Message-ID: <dqujl4$kul$2@news.Stanford.EDU>
References: <dquhi6$jat$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dquhi6$jat$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9678

Snippets from previous years newsgroups are fine (assuming no one posted 
a solution to the "core" of the project).  Indicate clearly in your 
comments and README.  In fact you should do this for any code not 
written by you, or even written by you for another class/project.

Jens Pillgram-Larsen wrote:
> TA's,
> 
> Are we allowed to use the code published in the 2004 newsgroup. There 
> are several snippets of code there that could be useful. And if it is 
> ok, should I indicate this in my README and commments?
> 
> Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: Jens Pillgram-Larsen <jenspl@stanford.edu>
Newsgroups: su.class.cs244a
Subject: .purify
Date: Sat, 21 Jan 2006 16:31:54 -0800
Lines: 4
Distribution: su
Message-ID: <dqujpq$l4s$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9679

I don't need any suppressions for my program. What should I put in the 
..purify file if that is the case?

Jens
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: .purify
Date: Sat, 21 Jan 2006 16:36:21 -0800
Lines: 7
Distribution: su
Message-ID: <dquk29$lje$1@news.Stanford.EDU>
References: <dqujpq$l4s$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqujpq$l4s$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9680

Just "touch .purify" to make an empty .purify file.

Jens Pillgram-Larsen wrote:
> I don't need any suppressions for my program. What should I put in the 
> .purify file if that is the case?
> 
> Jens
.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Acceptable Global?
Date: Sat, 21 Jan 2006 16:39:07 -0800
Organization: Stanford University
Lines: 5
Distribution: su
Message-ID: <20060121163907.12bd2cc5@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9681

I have a macro that automatically checks return values from system
calls.  Because I sometimes also want to keep the return value (as in
"socket = CHECK_RET(sock, (args))").  It uses a variable to temporarily
store the return value.  For simplicity, I have made it a global.  Is
that okay, or do I need to restructure how that macro works?
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Reading from the control socket byte by byte
Date: Sat, 21 Jan 2006 16:38:06 -0800
Lines: 45
Distribution: su
Message-ID: <dquk5i$lje$2@news.Stanford.EDU>
References: <dqtekk$il1$1@news.Stanford.EDU> <dqujf5$kul$1@news.Stanford.EDU> <dqujkt$l4s$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqujkt$l4s$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9682

Yes, we reserve the right to punish for byte-by-byte on the data connection.

Jens Pillgram-Larsen wrote:
> Does this mean that you will punish is for byte-by-byte reads on the 
> data connection?
> 
> Jens.
> 
> Matt Falkenhagen wrote:
> 
>> Yeah, since the FAQ suggests it, we won't penalize you for 
>> byte-by-byte reads on the control connection.
>>
>> However there are more elegant ways to do it (copying into a buffer or 
>> recv with MSG_PEEK).
>>
>> Roy Zeighami wrote:
>>
>>> This years faq has an entry that says:
>>> Q4. I'm having trouble while read()ing from a socket. My program just 
>>> hangs.
>>>
>>> A. Read on a blocking socket will block when there is no data left to 
>>> read. You should read the FTP RFC for a method to deal with this 
>>> situation. The shutdown() method used in the example is not the right 
>>> way to handle this problem, you can not shutdown a socket then reopen 
>>> it. Possible solutions would be, (1) you can use non-blocking sockets 
>>> (which we have not discussed) or (2) use blocking sockets but send 
>>> one command at a time, and read the reply character by character 
>>> while parsing it to know when the reply is complete. If you are using 
>>> a blocking socket and you read the full reply then try to read again, 
>>> your program will hang indefinitly since the server will not send you 
>>> more characters until you send it a new command.
>>>
>>> By the Powerpoint slides lists, under "Even more ways to lose 
>>> points", reading byte by byte as overly inefficient and hacky.  Given 
>>> that a relatively small amount of data is coming out of the control 
>>> port, can we justify doing byte-wise reads?  Obviously, this make no 
>>> sense for the data port.
>>>
>>> Thanks,
>>>
>>> Roy
>>>
>>>
.

Path: shelby.stanford.edu!not-for-mail
From: Jens Pillgram-Larsen <jenspl@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: .purify
Date: Sat, 21 Jan 2006 16:57:11 -0800
Lines: 13
Distribution: su
Message-ID: <dqul98$mmp$1@news.Stanford.EDU>
References: <dqujpq$l4s$2@news.Stanford.EDU> <dquk29$lje$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <dquk29$lje$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9683

That's what I tried. The grading script returned an error saying that 
the .purify file was not a text file.

Jens

Matt Falkenhagen wrote:
> Just "touch .purify" to make an empty .purify file.
> 
> Jens Pillgram-Larsen wrote:
>> I don't need any suppressions for my program. What should I put in the 
>> .purify file if that is the case?
>>
>> Jens
.

Path: shelby.stanford.edu!not-for-mail
From: "Robbie Yan" <xyan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Question about wrapper around write()
Date: Sat, 21 Jan 2006 17:13:30 -0800
Lines: 13
Distribution: su
Message-ID: <dqum7n$nev$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Xref: shelby.stanford.edu su.class.cs244a:9684

Is it necessary to implement a wrapper around the socket write() function
that ensures that all bytes fed into the socket are actually written on to
the wire? Review session last week mentioned that we should consider
implementing one. But since in assignment 1, strings that we write to the
FTP server are short, can we simply assume that any request to the server
can be written to the socket with one write() call? And if the number of
bytes written (returned from write()) mismatches the number of bytes we pass
into write(), can we assume that the system call has somehow malfunctioned
and immediately fault?

Thank you very much!


.

Path: shelby.stanford.edu!not-for-mail
From: "Sutthipong Thavisomboon" <sthavis@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Question on empty file
Date: Sat, 21 Jan 2006 18:06:54 -0800
Lines: 7
Distribution: su
Message-ID: <dqupbv$q3f$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9685

When we see an empty file, are we supposed to skip it? or copy it with the 
zero length?

Thanks,
Sutthipong 


.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: .purify
Date: Sat, 21 Jan 2006 18:39:27 -0800
Lines: 23
Distribution: su
Message-ID: <dqur94$rqc$1@news.Stanford.EDU>
References: <dqujpq$l4s$2@news.Stanford.EDU> <dquk29$lje$1@news.Stanford.EDU> <dqul98$mmp$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqul98$mmp$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9686

Really weird, it works for me.  On the other hand, that's the error 
message I get when .purify doesn't exist...

If it still doesn't work, just make a .purify and put in some 
supressions to make the script happy.  You can take the ones from the 
Purify FAQ Q4.

Jens Pillgram-Larsen wrote:
> That's what I tried. The grading script returned an error saying that 
> the .purify file was not a text file.
> 
> Jens
> 
> Matt Falkenhagen wrote:
> 
>> Just "touch .purify" to make an empty .purify file.
>>
>> Jens Pillgram-Larsen wrote:
>>
>>> I don't need any suppressions for my program. What should I put in 
>>> the .purify file if that is the case?
>>>
>>> Jens
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question about wrapper around write()
Date: Sat, 21 Jan 2006 18:43:58 -0800
Lines: 17
Distribution: su
Message-ID: <dqurhj$s0l$1@news.Stanford.EDU>
References: <dqum7n$nev$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqum7n$nev$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9687

No, you can't assume any of that.  Keep calling write until all the data 
you wanted to send was written or an error occurs.

Robbie Yan wrote:
> Is it necessary to implement a wrapper around the socket write() function
> that ensures that all bytes fed into the socket are actually written on to
> the wire? Review session last week mentioned that we should consider
> implementing one. But since in assignment 1, strings that we write to the
> FTP server are short, can we simply assume that any request to the server
> can be written to the socket with one write() call? And if the number of
> bytes written (returned from write()) mismatches the number of bytes we pass
> into write(), can we assume that the system call has somehow malfunctioned
> and immediately fault?
> 
> Thank you very much!
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on empty file
Date: Sat, 21 Jan 2006 18:45:10 -0800
Lines: 10
Distribution: su
Message-ID: <dqurjq$s0l$2@news.Stanford.EDU>
References: <dqupbv$q3f$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqupbv$q3f$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9688

Copy it with zero len.

Sutthipong Thavisomboon wrote:
> When we see an empty file, are we supposed to skip it? or copy it with the 
> zero length?
> 
> Thanks,
> Sutthipong 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Acceptable Global?
Date: Sat, 21 Jan 2006 18:58:57 -0800
Lines: 10
Distribution: su
Message-ID: <dqusdm$ss8$1@news.Stanford.EDU>
References: <20060121163907.12bd2cc5@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060121163907.12bd2cc5@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9689

I can't say for sure without looking at the code, it sounds pretty 
borderline.  To be safe, restructure the macro, or at least provide 
justification in the comments for the global.

David Reiss wrote:
> I have a macro that automatically checks return values from system
> calls.  Because I sometimes also want to keep the return value (as in
> "socket = CHECK_RET(sock, (args))").  It uses a variable to temporarily
> store the return value.  For simplicity, I have made it a global.  Is
> that okay, or do I need to restructure how that macro works?
.

Path: shelby.stanford.edu!not-for-mail
From: "Andrew Sakai" <asakai@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test E Not TESTED
Date: Sat, 21 Jan 2006 19:11:46 -0800
Lines: 8
Distribution: su
Message-ID: <dqut5j$65$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9690

I've been running the test script and everything seems to be working fine. 
However, it reports that Test E was NOT TESTED without giving any further 
information.  Does anyone have any idea why this could be?

    Thanks,
    Andrew 


.

Path: shelby.stanford.edu!not-for-mail
From: Nick Puz <npuz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: file w/ no name besides extension
Date: Sat, 21 Jan 2006 19:43:15 -0800
Lines: 5
Distribution: su
Message-ID: <dquv0h$1il$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9691

ex: for extension txt, should a file with just the name .txt be 
transferred?

thanks,
-nick
.

Path: shelby.stanford.edu!not-for-mail
From: "Ramanan" <ramananr@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Permission for LIST in a directory
Date: Sat, 21 Jan 2006 20:21:28 -0800
Lines: 9
Distribution: su
Message-ID: <dqv18a$3mo$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9693

Hi Matt/Ari

    I know we're supposed to skip over files if we don't have read 
permission, but what should we do if we encounter a directory for which we 
don't have read permission (i.e., LIST returns a 550 reply). Should we exit 
the program, or silently skip over it, or does it fall under the realm of 
"design decisions" that we need to make? 


.

Path: shelby.stanford.edu!not-for-mail
From: Will Palmeri <wjp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Permission for LIST in a directory
Date: Sat, 21 Jan 2006 21:06:17 -0800
Lines: 12
Distribution: su
Message-ID: <dqv3s7$5jr$1@news.Stanford.EDU>
References: <dqv18a$3mo$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
In-Reply-To: <dqv18a$3mo$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9694

I've been wondering about this too...

Ramanan wrote:
> Hi Matt/Ari
> 
>     I know we're supposed to skip over files if we don't have read 
> permission, but what should we do if we encounter a directory for which we 
> don't have read permission (i.e., LIST returns a 550 reply). Should we exit 
> the program, or silently skip over it, or does it fall under the realm of 
> "design decisions" that we need to make? 
> 
> 
.

Path: shelby.stanford.edu!myth16.Stanford.EDU!ptrlee
From: Peter In Lee <ptrlee@myth16.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: 451: Transfer aborted.  Broken pipe
Date: Sat, 21 Jan 2006 21:24:12 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0601212122010.13408-100000@myth16.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9695

When I run the following command:

../ftpcopy ext 1 ftp.cs.stanford.edu output pub/mirrors/gnu

I get a:

451 Transfer aborted. Broken pipe

The weird thing is, when I step through in gdb slowly, the error
goes away.  (And if I just let it run in gdb, the error comes back)

-- Peter

.

Path: shelby.stanford.edu!not-for-mail
From: "Sutthipong Thavisomboon" <sthavis@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Error Message
Date: Sat, 21 Jan 2006 21:43:56 -0800
Lines: 8
Distribution: su
Message-ID: <dqv62t$7ea$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9696

Hi Matt/Ari,

I have a question regarding the error output. Is it enough to put just the 
3-digit reply code for the error messages?

Sutthipong 


.

Path: shelby.stanford.edu!not-for-mail
From: Stefan Thomas Mohler <smohler@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Question on empty file
Date: Sun, 22 Jan 2006 06:10:52 +0000 (UTC)
Lines: 41
Distribution: su
Message-ID: <dqv7lc$8e2$1@news.Stanford.EDU>
References: <dqupbv$q3f$1@news.Stanford.EDU> <dqurjq$s0l$2@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:9697

Matt Falkenhagen <mjf@stanford.edu> wrote:
> Copy it with zero len.

Matt, when I try to RETR an empty file with the command line ftp I get a 550
as follows :

elaine43:~/work/cs244a/hw1> ftp ftp.cs.stanford.edu
Connected to cs.stanford.edu.
220 FTP Server ready.
Name (ftp.cs.stanford.edu:smohler): anonymous
331 Anonymous login ok, send your complete email address as your password.
Password:
230-
    Crud not printed to save space...
230 Anonymous login ok, restrictions apply.
ftp> cd /uploads
250 CWD command successful
ftp> cd aiken
250 CWD command successful
ftp> ls
200 PORT command successful
150 Opening ASCII mode data connection for file list
..
...
empty_file.ext
226 Transfer complete.
23 bytes received in 0.01 seconds (2.15 Kbytes/s)
ftp> get empty_file.ext
200 PORT command successful
550 empty_file.ext: Permission denied
ftp>

(I know the file is empty because I put it there)

When I try to get the file with PASV or PORT I still get the same 550
error I get here.  If I just skip the file like the assignment requires
for normal permission-denied files then it _passes_ the "copy empty file"
sub-test of the grading script which is different from what has been 
said in this thread. Help :/

Stefan
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: file w/ no name besides extension
Date: Sat, 21 Jan 2006 22:14:02 -0800
Lines: 8
Distribution: su
Message-ID: <dqv7rf$8to$1@news.Stanford.EDU>
References: <dquv0h$1il$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dquv0h$1il$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9698

Yep.

Nick Puz wrote:
> ex: for extension txt, should a file with just the name .txt be 
> transferred?
> 
> thanks,
> -nick
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Permission for LIST in a directory
Date: Sat, 21 Jan 2006 22:18:13 -0800
Lines: 14
Distribution: su
Message-ID: <dqv83a$9b8$1@news.Stanford.EDU>
References: <dqv18a$3mo$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqv18a$3mo$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9699

The assignment leaves this unspecified, so, yeah, make a decision 
decision.  (Interestingly, according to the RFC, 550 is not an allowable 
response to LIST, but it is to CWD.)

Ramanan wrote:
> Hi Matt/Ari
> 
>     I know we're supposed to skip over files if we don't have read 
> permission, but what should we do if we encounter a directory for which we 
> don't have read permission (i.e., LIST returns a 550 reply). Should we exit 
> the program, or silently skip over it, or does it fall under the realm of 
> "design decisions" that we need to make? 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on empty file
Date: Sat, 21 Jan 2006 22:21:54 -0800
Lines: 50
Distribution: su
Message-ID: <dqv8a7$9gs$1@news.Stanford.EDU>
References: <dqupbv$q3f$1@news.Stanford.EDU> <dqurjq$s0l$2@news.Stanford.EDU> <dqv7lc$8e2$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqv7lc$8e2$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9700

I really doubt you get a 550 because the file is empty, it's probably 
because you don't have permissions.

The grading script expects you to have a copy of the zero-byte file when 
your ftpcopy finishes.

Stefan Thomas Mohler wrote:
> Matt Falkenhagen <mjf@stanford.edu> wrote:
> 
>>Copy it with zero len.
> 
> 
> Matt, when I try to RETR an empty file with the command line ftp I get a 550
> as follows :
> 
> elaine43:~/work/cs244a/hw1> ftp ftp.cs.stanford.edu
> Connected to cs.stanford.edu.
> 220 FTP Server ready.
> Name (ftp.cs.stanford.edu:smohler): anonymous
> 331 Anonymous login ok, send your complete email address as your password.
> Password:
> 230-
>     Crud not printed to save space...
> 230 Anonymous login ok, restrictions apply.
> ftp> cd /uploads
> 250 CWD command successful
> ftp> cd aiken
> 250 CWD command successful
> ftp> ls
> 200 PORT command successful
> 150 Opening ASCII mode data connection for file list
> .
> ..
> empty_file.ext
> 226 Transfer complete.
> 23 bytes received in 0.01 seconds (2.15 Kbytes/s)
> ftp> get empty_file.ext
> 200 PORT command successful
> 550 empty_file.ext: Permission denied
> ftp>
> 
> (I know the file is empty because I put it there)
> 
> When I try to get the file with PASV or PORT I still get the same 550
> error I get here.  If I just skip the file like the assignment requires
> for normal permission-denied files then it _passes_ the "copy empty file"
> sub-test of the grading script which is different from what has been 
> said in this thread. Help :/
> 
> Stefan
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Error Message
Date: Sat, 21 Jan 2006 22:24:54 -0800
Lines: 29
Distribution: su
Message-ID: <dqv8fr$9iv$1@news.Stanford.EDU>
References: <dqv62t$7ea$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqv62t$7ea$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9701

See the PA #1 handout, section "The Problem", #9:

9. Your program should print nothing but a one-line status report at 
termination. This report should be written to stderr, and should contain:

    1. The message: "OK: xxxxxxxxx bytes copied" on success (where 
xxxxxxxxx is the total of all bytes copied, without leading zeros or spaces)
    2. The message: "ERROR: " followed by some meaningful error message 
on any error. If you received an error response across the FTP control 
connection, using that message is acceptable. If you are terminating for 
any other reason, you should write a meaningful error message. (Hint: 
look at the perror system call, the errno variable, and the sys_errlist 
variable).

For example:
OK: 45614 bytes copied
ERROR: 530 Login incorrect.
ERROR: write: Disk full.


Sutthipong Thavisomboon wrote:
> Hi Matt/Ari,
> 
> I have a question regarding the error output. Is it enough to put just the 
> 3-digit reply code for the error messages?
> 
> Sutthipong 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test E Not TESTED
Date: Sat, 21 Jan 2006 22:42:07 -0800
Lines: 12
Distribution: su
Message-ID: <dqv9g3$a1n$1@news.Stanford.EDU>
References: <dqut5j$65$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqut5j$65$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9702

Are there other Tests reporting OK or are there errors?  It's possible a 
test won't run if previous tests are failing.

Andrew Sakai wrote:
> I've been running the test script and everything seems to be working fine. 
> However, it reports that Test E was NOT TESTED without giving any further 
> information.  Does anyone have any idea why this could be?
> 
>     Thanks,
>     Andrew 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Daniel Holbert <dholbert@NOSPAM.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: .purify
Date: Sat, 21 Jan 2006 23:41:03 -0800
Lines: 29
Distribution: su
Message-ID: <dqvcv6$d4o$1@news.Stanford.EDU>
References: <dqujpq$l4s$2@news.Stanford.EDU> <dquk29$lje$1@news.Stanford.EDU> <dqul98$mmp$1@news.Stanford.EDU> <dqur94$rqc$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <dqur94$rqc$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9703

I had the same problem as Jens, but I fixed it by putting a single blank 
line in the .purify file.

~Daniel

Matt Falkenhagen wrote:
> Really weird, it works for me.  On the other hand, that's the error 
> message I get when .purify doesn't exist...
> 
> If it still doesn't work, just make a .purify and put in some 
> supressions to make the script happy.  You can take the ones from the 
> Purify FAQ Q4.
> 
> Jens Pillgram-Larsen wrote:
>> That's what I tried. The grading script returned an error saying that 
>> the .purify file was not a text file.
>>
>> Jens
>>
>> Matt Falkenhagen wrote:
>>
>>> Just "touch .purify" to make an empty .purify file.
>>>
>>> Jens Pillgram-Larsen wrote:
>>>
>>>> I don't need any suppressions for my program. What should I put in 
>>>> the .purify file if that is the case?
>>>>
>>>> Jens
.

Path: shelby.stanford.edu!not-for-mail
From: "Sutthipong Thavisomboon" <sthavis@stanford.edu>
Newsgroups: su.class.cs244a
Subject: File Permission
Date: Sun, 22 Jan 2006 01:37:54 -0800
Lines: 8
Distribution: su
Message-ID: <dqvjpk$lgq$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9704

Hi,
Is it ok to use fopen with w+ (allow read/write) instead of the example in 
FAQ (open(....))

Thanks,
Sutthipong 


.

Path: shelby.stanford.edu!not-for-mail
From: "Nazia Zaman" <nazia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftpcopy.purify error
Date: Sun, 22 Jan 2006 03:10:38 -0800
Lines: 10
Distribution: su
Message-ID: <dqvp7k$ptp$2@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9705

Suddenly running ftpcopy.purify is giving me this error, any ideas?

ld.so.1: ftpcopy.purify: fatal: libsocket.so.1_pure_p3_c0_101102117_58_32:
open failed: No such file or directory
Killed

Nazia



.

Path: shelby.stanford.edu!not-for-mail
From: "Andrew Sakai" <asakai@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test E Not TESTED
Date: Sun, 22 Jan 2006 04:59:19 -0800
Lines: 18
Distribution: su
Message-ID: <dqvvja$3q6$1@news.Stanford.EDU>
References: <dqut5j$65$1@news.Stanford.EDU> <dqv9g3$a1n$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:9706

All other tests (except the purify tests which are also not being tested) 
are passing.


"Matt Falkenhagen" <mjf@stanford.edu> wrote in message 
news:dqv9g3$a1n$1@news.Stanford.EDU...
> Are there other Tests reporting OK or are there errors?  It's possible a 
> test won't run if previous tests are failing.
>
> Andrew Sakai wrote:
>> I've been running the test script and everything seems to be working 
>> fine. However, it reports that Test E was NOT TESTED without giving any 
>> further information.  Does anyone have any idea why this could be?
>>
>>     Thanks,
>>     Andrew 


.

Path: shelby.stanford.edu!not-for-mail
From: Hector Chan <chanhp@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Can I use strfind
Date: Sun, 22 Jan 2006 13:23:09 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <dr00vt$52b$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:9707

Hi,

I would like to ask if I can use the strfind function that comes with the 
Solaris OS, which can be used for string matching.  I have also
implemented my own version, but, of course, the performance of my version
is far inferior compare to its Solaris counterpart.

Thank you,

Hector
.

Path: shelby.stanford.edu!not-for-mail
From: alex qi <alexqi@stanford.edu>
Newsgroups: su.class.cs244a
Subject: The test script
Date: Sun, 22 Jan 2006 06:51:33 -0800
Lines: 18
Distribution: su
Message-ID: <dr065i$961$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9708

Matt/Ari:
So how's the test script intercept the output? when i run it, the 
results said my outputs were different, but it looks the same to me 
except i add a prefix to it.

" ----------- script results
  > forms/ppars98
 > forms/ppars98/pparbu.mif
 > forms/ppars98/pparnbu.mif
"


--------- my results
"< doc/forms/ppars98
< doc/forms/ppars98/pparbu.mif
< doc/forms/ppars98/pparnbu.mif
"
thanks.
.

Path: shelby.stanford.edu!saga2.Stanford.EDU!lamskm
From: lamskm@Stanford.EDU (Michael Lam)
Newsgroups: su.class.cs244a
Subject: can we do any removal/renaming of files
Date: Sun, 22 Jan 2006 16:56:29 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <dr0dft$enm$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
Summary: can we do any removal/renaming of files
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:9709

For files that are of questioned permission,
if I retr it to determine that I have no access to it,
its containing directory would be created already.

Now this containing directory may become empty because of the failure
to retr its contained file.  Can I remove the empty directory?

For other matters such as directory level, or extension matching,
I can pre-determine, but not for permission.

-Michael
.

Path: shelby.stanford.edu!not-for-mail
From: "Sutthipong Thavisomboon" <sthavis@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Directory at the local site
Date: Sun, 22 Jan 2006 09:27:19 -0800
Lines: 10
Distribution: su
Message-ID: <dr0f9q$g5l$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9710

Hi,

Apart from the assumption that the root directory exists, what about the 
permission? What are we supposed to do in case we don't have the right 
permission for the given directory?

Thanks,
Sutthipong 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <justin-p@sbcglobal.net>
Newsgroups: su.class.cs244a
Subject: Re: ftpcopy.purify error
Date: Sun, 22 Jan 2006 10:29:57 -0800
Lines: 28
Distribution: su
Message-ID: <BFF90F25.2558%justin-p@sbcglobal.net>
References: <dqvp7k$ptp$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.2.1.051004
Thread-Topic: ftpcopy.purify error
Thread-Index: AcYfgdh9Fv15Iot1Edqe+gARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:9711

I had the same problem last night.  Check out the last question in the
Purify FAQ:

    http://www.stanford.edu/class/cs244a/purify_faq.html

I was working remotely, so each of my sessions is on a different elaine and
the instrumented libraries were going into different /tmp directories.  Once
I ran the executable on the same machine that built it, the problem went
away.

--Justin


On 1/22/06 3:10 AM, in article dqvp7k$ptp$2@news.Stanford.EDU, "Nazia Zaman"
<nazia@stanford.edu> wrote:

> Suddenly running ftpcopy.purify is giving me this error, any ideas?
> 
> ld.so.1: ftpcopy.purify: fatal: libsocket.so.1_pure_p3_c0_101102117_58_32:
> open failed: No such file or directory
> Killed
> 
> Nazia
> 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Sesha Narahari <narahari@stanford.edu>
Newsgroups: su.class.cs244a
Subject: EEXIST: undefined?
Date: Sun, 22 Jan 2006 11:57:08 -0800
Lines: 9
Distribution: su
Message-ID: <43D3E394.8030704@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9712

mkdir can return EEXIST if the argument directory exists. My code wont 
compile when I try to use this value for comparision. I have 
<sys/types.h> and <sys/stat.h> included.

What am I missing?

Thanks,
Sesha

.

Path: shelby.stanford.edu!not-for-mail
From: Sesha Narahari <narahari@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: EEXIST: undefined?
Date: Sun, 22 Jan 2006 11:58:24 -0800
Lines: 14
Distribution: su
Message-ID: <43D3E3E0.1040301@stanford.edu>
References: <43D3E394.8030704@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9713

Looks like I need to test against the errno, but I still need this value 
to be defined somehow.

Sesha Narahari wrote:
> mkdir can return EEXIST if the argument directory exists. My code wont 
> compile when I try to use this value for comparision. I have 
> <sys/types.h> and <sys/stat.h> included.
> 
> What am I missing?
> 
> Thanks,
> Sesha
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Sesha Narahari <narahari@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: EEXIST: undefined?
Date: Sun, 22 Jan 2006 12:00:07 -0800
Lines: 22
Distribution: su
Message-ID: <43D3E447.4080905@stanford.edu>
References: <43D3E394.8030704@stanford.edu> <43D3E3E0.1040301@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9714

#include <errno.h> fixed it.

Thanks,
Sesha

Sesha Narahari wrote:
> Looks like I need to test against the errno, but I still need this value 
> to be defined somehow.
> 
> Sesha Narahari wrote:
> 
>> mkdir can return EEXIST if the argument directory exists. My code wont 
>> compile when I try to use this value for comparision. I have 
>> <sys/types.h> and <sys/stat.h> included.
>>
>> What am I missing?
>>
>> Thanks,
>> Sesha
>>
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Can I use strfind
Date: Sun, 22 Jan 2006 12:21:14 -0800
Lines: 13
Distribution: su
Message-ID: <dr0pfv$oo0$1@news.Stanford.EDU>
References: <dr00vt$52b$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dr00vt$52b$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9715

Sure, go ahead.

Hector Chan wrote:
> Hi,
> 
> I would like to ask if I can use the strfind function that comes with the 
> Solaris OS, which can be used for string matching.  I have also
> implemented my own version, but, of course, the performance of my version
> is far inferior compare to its Solaris counterpart.
> 
> Thank you,
> 
> Hector
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: The test script
Date: Sun, 22 Jan 2006 12:32:57 -0800
Lines: 24
Distribution: su
Message-ID: <dr0q5v$pqp$1@news.Stanford.EDU>
References: <dr065i$961$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dr065i$961$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9716

Look at the handout for an example, "ftpcopy dstdir srcdir" should end 
up with the remote "srcdir" except it's renamed "dstdir".  It looks like 
you're creating dstdir and copying srcdir into it.


alex qi wrote:
> Matt/Ari:
> So how's the test script intercept the output? when i run it, the 
> results said my outputs were different, but it looks the same to me 
> except i add a prefix to it.
> 
> " ----------- script results
>  > forms/ppars98
>  > forms/ppars98/pparbu.mif
>  > forms/ppars98/pparnbu.mif
> "
> 
> 
> --------- my results
> "< doc/forms/ppars98
> < doc/forms/ppars98/pparbu.mif
> < doc/forms/ppars98/pparnbu.mif
> "
> thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: can we do any removal/renaming of files
Date: Sun, 22 Jan 2006 12:37:34 -0800
Lines: 15
Distribution: su
Message-ID: <dr0qej$puv$1@news.Stanford.EDU>
References: <dr0dft$enm$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dr0dft$enm$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9717

You should be able to pre-determine.  Don't create the dir until you are 
sure a file will be downloaded in it.

Michael Lam wrote:
> For files that are of questioned permission,
> if I retr it to determine that I have no access to it,
> its containing directory would be created already.
> 
> Now this containing directory may become empty because of the failure
> to retr its contained file.  Can I remove the empty directory?
> 
> For other matters such as directory level, or extension matching,
> I can pre-determine, but not for permission.
> 
> -Michael
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Directory at the local site
Date: Sun, 22 Jan 2006 12:43:08 -0800
Lines: 16
Distribution: su
Message-ID: <dr0qp2$q90$1@news.Stanford.EDU>
References: <dr0f9q$g5l$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dr0f9q$g5l$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9718

This is left unspecified, do what's easiest for you.  I think the two 
reasonable actions are to exit with error immediately or first attempt 
to remove the dir and recreate (although since you don't have perms 
that's probably not possible).

Sutthipong Thavisomboon wrote:
> Hi,
> 
> Apart from the assumption that the root directory exists, what about the 
> permission? What are we supposed to do in case we don't have the right 
> permission for the given directory?
> 
> Thanks,
> Sutthipong 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Richards <mattrich@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Sample ftp sites not RFC-compliant?
Date: Sun, 22 Jan 2006 13:22:24 -0800
Lines: 11
Distribution: su
Message-ID: <dr0t2h$sn1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9719

It seems ftp.microsoft.com and ftp.cs.stanford.edu put a dash after the 
230 reply code, even though the response is a single line.

Does this mean we don't have to support these sites, since to properly 
handle multiple reads, we need to assume that if there is a dash after 
the first reply code, we must keep reading until we hit a line with a 
space following the reply code?

Also, ftp.fedworld.gov's greeting is longer 1024.

Matt R.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Richards <mattrich@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Sample ftp sites not RFC-compliant?
Date: Sun, 22 Jan 2006 13:49:44 -0800
Lines: 16
Distribution: su
Message-ID: <dr0ulp$ih$1@news.Stanford.EDU>
References: <dr0t2h$sn1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <dr0t2h$sn1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9720

Nevermind, I spoke too soon.



Matt Richards wrote:
> It seems ftp.microsoft.com and ftp.cs.stanford.edu put a dash after the 
> 230 reply code, even though the response is a single line.
> 
> Does this mean we don't have to support these sites, since to properly 
> handle multiple reads, we need to assume that if there is a dash after 
> the first reply code, we must keep reading until we hit a line with a 
> space following the reply code?
> 
> Also, ftp.fedworld.gov's greeting is longer 1024.
> 
> Matt R.
.

Path: shelby.stanford.edu!not-for-mail
From: Will Palmeri <wjp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: submitting hw1
Date: Sun, 22 Jan 2006 14:54:17 -0800
Lines: 14
Distribution: su
Message-ID: <dr12en$3v2$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9721

This is my first programming class at Stanford and am unfamiliar with 
the submit script.

Does the script submit *.c, *.h, Makefile, README, purify.output, and 
..purify in the current directory automatically?

So:
/usr/class/cs244a/bin/submit.pl hw1 mjf   <--- that does everything??

It's not clear to me that everything was submitted from the submit output.

Anyone?
Thanks,
Will
.

Path: shelby.stanford.edu!not-for-mail
From: "Forum Mangal Parmar" <forumm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: testing script hangs and time out
Date: Sun, 22 Jan 2006 15:15:42 -0800
Lines: 26
Distribution: su
Message-ID: <dr13mv$532$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9722

while testing it stops on :

Test M, using current source tree and build
make ftpcopy.purify
purify -cache-dir=/tmp/forumm -best-effort -linker=/usr/pubsw/bin/ld -demangle-program=/usr/pubsw/bin/c++filt 
gcc -g -O0 -ansi -Wall -DSOLARIS  -o ftpcopy.purify  ftpcopy.o 
ftpparse.o -lsocket -lnsl
Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) Copyright IBM 
Corp. 1992, 2005 All rights reserved.
Instrumenting:
Purify engine: Error: Tried to link with directory (/usr/lib): skipping.
ftpcopy.o ftpparse.o  Linking

Running purify'ed executable:  ./ftpcopy.purify gz 2 ftp.stanford.edu . 
/pub/packages



and then exits because of time out

wht shd I do abt it?

thanks
Forum 


.

Path: shelby.stanford.edu!not-for-mail
From: "Forum Mangal Parmar" <forumm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: testing script hangs and time out
Date: Sun, 22 Jan 2006 15:19:06 -0800
Lines: 43
Distribution: su
Message-ID: <dr13td$5ae$1@news.Stanford.EDU>
References: <dr13mv$532$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:9723

this is wht follows after some time:

Could not run purify'ed exe: ***Timeout expired during grading
Program output:

Purify engine: Warning: Cannot find a file which matches the DT_SONAME field 
(libnss_files.so.1) of the file (/usr/lib/nss_files.so.1).
Using /usr/lib/nss_files.so.1 instead.

couldn't submit code for testing




"Forum Mangal Parmar" <forumm@stanford.edu> wrote in message 
news:dr13mv$532$1@news.Stanford.EDU...
> while testing it stops on :
>
> Test M, using current source tree and build
> make ftpcopy.purify
> purify -cache-dir=/tmp/forumm -best-effort -linker=/usr/pubsw/bin/ld -demangle-program=/usr/pubsw/bin/c++filt 
> gcc -g -O0 -ansi -Wall -DSOLARIS  -o ftpcopy.purify  ftpcopy.o 
> ftpparse.o -lsocket -lnsl
> Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) Copyright 
> IBM Corp. 1992, 2005 All rights reserved.
> Instrumenting:
> Purify engine: Error: Tried to link with directory (/usr/lib): skipping.
> ftpcopy.o ftpparse.o  Linking
>
> Running purify'ed executable:  ./ftpcopy.purify gz 2 ftp.stanford.edu . 
> /pub/packages
>
>
>
> and then exits because of time out
>
> wht shd I do abt it?
>
> thanks
> Forum
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Eric B Friedman <eric06@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test script bailed... (not timeout)
Date: Sun, 22 Jan 2006 15:29:38 -0800
Lines: 165
Distribution: su
Message-ID: <dr14h3$5ns$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: multipart/mixed;
 boundary="------------090403080009030201030708"
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.1) Gecko/20020827
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9724

This is a multi-part message in MIME format.
--------------090403080009030201030708
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

As the subject indicates, the test script bailed on me. I've attached 
the full output.

The end of the output I've pasted below; from inspection, I don't think 
the error has to do with my code; my program does not print in the 
format seen below.

I tried resubmitting, but the error didn't recur. (Instead, it 
identified a bug in my code.) However, I did just burn one of my three 
test runs before the deadline. Any idea what happened here?

Thanks,

Eric

---

[elided for clarity]

Test F.1, using current source tree and build
make
make: Nothing to be done for `all'.

readdir(./../../../../../../../../..): Connection timed out at
cs244a/FTPCopyTestCase.pm line 247
Downloading files:  ./ftpcopy   mif 5 ftp.slac.stanford.edu
/ftp.slac.stanford.edu_mif_5_1 /doc
can't create local directory /ftp.slac.stanford.edu_mif_5_1 (No such file or
directory)
couldn't submit code for testing
elaine7:~/cs244a/hw1>

--------------090403080009030201030708
Content-Type: text/plain;
 name="testscript.out"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="testscript.out"

elaine7:~/cs244a/hw1> /afs/ir/class/cs244a/bin/test_code.pl hw1 Makefile *.c *.h 
purify.output .purify
Creating submission tarball...
..purify
Makefile
ftp.c
ftp.h
ftpcopy.c
ftpparse.c
ftpparse.h
purify.output
util.c
util.h
..purify
Makefile
ftp.c
ftp.h
ftpcopy.c
ftpparse.c
ftpparse.h
purify.output
util.c
util.h
Checking to make sure target all compiles before testing... OK
Checking to make sure target ftpcopy.purify compiles before testing... OK

Starting...
Test B, new source tree required, extracting into grading_src/build...
..purify
Makefile
ftp.c
ftp.h
ftpcopy.c
ftpparse.c
ftpparse.h
purify.output
util.c
util.h

Can't find a matching key for this test run.
Would you like to generate a new one?  (y/n):  y
Daily quota of 3 test attempts applies (from Jan 19 onwards).
You've used 1 test attempt(s) so far today.
make 
gcc -g -O0 -ansi -Wall -DSOLARIS  -c ftpcopy.c
gcc -g -O0 -ansi -Wall -DSOLARIS  -c ftpparse.c
gcc -g -O0 -ansi -Wall -DSOLARIS  -c ftp.c
gcc -g -O0 -ansi -Wall -DSOLARIS  -c util.c
gcc -g -O0 -ansi -Wall -DSOLARIS  -o ftpcopy  ftpcopy.o ftpparse.o ftp.o util.o 
-lsocket -lnsl 

Downloading files:  ./ftpcopy   mif 5 ftp.slac.stanford.edu 
/afs/ir.stanford.edu/users/e/r/eric06/cs244a/hw1/grading_src/build/ftp.slac.stanford.edu_mif_5_1 
/doc
Downloading files:  ./ftpcopy   mif 5 ftp.slac.stanford.edu 
ftp.slac.stanford.edu_mif_5_0 /doc
Downloading files:  ./ftpcopy   ch 1 ftp.cs.stanford.edu 
/afs/ir.stanford.edu/users/e/r/eric06/cs244a/hw1/grading_src/build/ftp.cs.stanford.edu_ch_1_1 
/pub/cweb
Downloading files:  ./ftpcopy   txt 0 134.79.18.30 134.79.18.30_txt_0_0 .
Checking host ftp.slac.stanford.edu
Checking host ftp.slac.stanford.edu
Checking host ftp.cs.stanford.edu
Checking host 134.79.18.30

Test C, using current source tree and build
make 
make: Nothing to be done for `all'.

Using cached results from previous run
Using cached results from previous run
Using cached results from previous run
Using cached results from previous run
Checking host ftp.slac.stanford.edu
Checking host ftp.slac.stanford.edu
Checking host ftp.cs.stanford.edu
Checking host 134.79.18.30

Test D, using current source tree and build
make 
make: Nothing to be done for `all'.

Using cached results from previous run
Using cached results from previous run
Using cached results from previous run
Using cached results from previous run
Checking host ftp.slac.stanford.edu
Checking host ftp.slac.stanford.edu
Checking host ftp.cs.stanford.edu
Checking host 134.79.18.30

Test E, using current source tree and build
make 
make: Nothing to be done for `all'.

Using cached results from previous run
Using cached results from previous run
Using cached results from previous run
Using cached results from previous run
Checking host ftp.slac.stanford.edu
Checking host ftp.slac.stanford.edu
Checking host ftp.cs.stanford.edu
Checking host 134.79.18.30

Test F.1, using current source tree and build
make 
make: Nothing to be done for `all'.

readdir(./../../../../../../../../..): Connection timed out at 
cs244a/FTPCopyTestCase.pm line 247
Downloading files:  ./ftpcopy   mif 5 ftp.slac.stanford.edu 
/ftp.slac.stanford.edu_mif_5_1 /doc
can't create local directory /ftp.slac.stanford.edu_mif_5_1 (No such file or 
directory)
couldn't submit code for testing
elaine7:~/cs244a/hw1>

--------------090403080009030201030708--

.

Path: shelby.stanford.edu!not-for-mail
From: "Forum Mangal Parmar" <forumm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: testing script hangs and time out
Date: Sun, 22 Jan 2006 15:41:08 -0800
Lines: 54
Distribution: su
Message-ID: <dr156k$681$1@news.Stanford.EDU>
References: <dr13mv$532$1@news.Stanford.EDU> <dr13td$5ae$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:9725

I tried to run the test again but it tells me I hv used up quota of 
submitting for today. but I did not get to see the result so not much use 
really of the test

cah u fix this for me asap


"Forum Mangal Parmar" <forumm@stanford.edu> wrote in message 
news:dr13td$5ae$1@news.Stanford.EDU...
> this is wht follows after some time:
>
> Could not run purify'ed exe: ***Timeout expired during grading
> Program output:
>
> Purify engine: Warning: Cannot find a file which matches the DT_SONAME 
> field (libnss_files.so.1) of the file (/usr/lib/nss_files.so.1).
> Using /usr/lib/nss_files.so.1 instead.
>
> couldn't submit code for testing
>
>
>
>
> "Forum Mangal Parmar" <forumm@stanford.edu> wrote in message 
> news:dr13mv$532$1@news.Stanford.EDU...
>> while testing it stops on :
>>
>> Test M, using current source tree and build
>> make ftpcopy.purify
>> purify -cache-dir=/tmp/forumm -best-effort -linker=/usr/pubsw/bin/ld -demangle-program=/usr/pubsw/bin/c++filt 
>> gcc -g -O0 -ansi -Wall -DSOLARIS  -o ftpcopy.purify  ftpcopy.o 
>> ftpparse.o -lsocket -lnsl
>> Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) Copyright 
>> IBM Corp. 1992, 2005 All rights reserved.
>> Instrumenting:
>> Purify engine: Error: Tried to link with directory (/usr/lib): skipping.
>> ftpcopy.o ftpparse.o  Linking
>>
>> Running purify'ed executable:  ./ftpcopy.purify gz 2 ftp.stanford.edu . 
>> /pub/packages
>>
>>
>>
>> and then exits because of time out
>>
>> wht shd I do abt it?
>>
>> thanks
>> Forum
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: submitting hw1
Date: Sun, 22 Jan 2006 15:47:42 -0800
Lines: 17
Distribution: su
Message-ID: <dr15j4$69h$1@news.Stanford.EDU>
References: <dr12en$3v2$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dr12en$3v2$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9726

Yep.

Will Palmeri wrote:
> This is my first programming class at Stanford and am unfamiliar with 
> the submit script.
> 
> Does the script submit *.c, *.h, Makefile, README, purify.output, and 
> .purify in the current directory automatically?
> 
> So:
> /usr/class/cs244a/bin/submit.pl hw1 mjf   <--- that does everything??
> 
> It's not clear to me that everything was submitted from the submit output.
> 
> Anyone?
> Thanks,
> Will
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: testing script hangs and time out
Date: Sun, 22 Jan 2006 15:50:47 -0800
Lines: 62
Distribution: su
Message-ID: <dr15ot$69h$2@news.Stanford.EDU>
References: <dr13mv$532$1@news.Stanford.EDU> <dr13td$5ae$1@news.Stanford.EDU> <dr156k$681$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dr156k$681$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9727

Test M unfortunately tries to connect to ftp.stanford.edu, which is no 
longer in service.  You are probably hanging in some read() loop and 
your program isn't terminating.  You should abort if read() returns 0 
which indicates the connection closed.

Forum Mangal Parmar wrote:
> I tried to run the test again but it tells me I hv used up quota of 
> submitting for today. but I did not get to see the result so not much use 
> really of the test
> 
> cah u fix this for me asap
> 
> 
> "Forum Mangal Parmar" <forumm@stanford.edu> wrote in message 
> news:dr13td$5ae$1@news.Stanford.EDU...
> 
>>this is wht follows after some time:
>>
>>Could not run purify'ed exe: ***Timeout expired during grading
>>Program output:
>>
>>Purify engine: Warning: Cannot find a file which matches the DT_SONAME 
>>field (libnss_files.so.1) of the file (/usr/lib/nss_files.so.1).
>>Using /usr/lib/nss_files.so.1 instead.
>>
>>couldn't submit code for testing
>>
>>
>>
>>
>>"Forum Mangal Parmar" <forumm@stanford.edu> wrote in message 
>>news:dr13mv$532$1@news.Stanford.EDU...
>>
>>>while testing it stops on :
>>>
>>>Test M, using current source tree and build
>>>make ftpcopy.purify
>>>purify -cache-dir=/tmp/forumm -best-effort -linker=/usr/pubsw/bin/ld -demangle-program=/usr/pubsw/bin/c++filt 
>>>gcc -g -O0 -ansi -Wall -DSOLARIS  -o ftpcopy.purify  ftpcopy.o 
>>>ftpparse.o -lsocket -lnsl
>>>Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) Copyright 
>>>IBM Corp. 1992, 2005 All rights reserved.
>>>Instrumenting:
>>>Purify engine: Error: Tried to link with directory (/usr/lib): skipping.
>>>ftpcopy.o ftpparse.o  Linking
>>>
>>>Running purify'ed executable:  ./ftpcopy.purify gz 2 ftp.stanford.edu . 
>>>/pub/packages
>>>
>>>
>>>
>>>and then exits because of time out
>>>
>>>wht shd I do abt it?
>>>
>>>thanks
>>>Forum
>>>
>>
>>
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: testing script hangs and time out
Date: Sun, 22 Jan 2006 15:53:51 -0800
Lines: 67
Distribution: su
Message-ID: <dr15um$6vg$1@news.Stanford.EDU>
References: <dr13mv$532$1@news.Stanford.EDU> <dr13td$5ae$1@news.Stanford.EDU> <dr156k$681$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dr156k$681$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9728

By the way as long as you don't change the code, you can keep submitting 
as much as you want without taking up quota.  The quota counts unique 
submissions (it saves a hash of your code and compares your submissions 
against the saved hash).

I'll make an exception in this case and free up one of your quotas.  I'd 
recommend testing your ftpcopy yourself against ftp.stanford.edu and 
then, if it aborts cleanly, running the testing script.


Forum Mangal Parmar wrote:
> I tried to run the test again but it tells me I hv used up quota of 
> submitting for today. but I did not get to see the result so not much use 
> really of the test
> 
> cah u fix this for me asap
> 
> 
> "Forum Mangal Parmar" <forumm@stanford.edu> wrote in message 
> news:dr13td$5ae$1@news.Stanford.EDU...
> 
>>this is wht follows after some time:
>>
>>Could not run purify'ed exe: ***Timeout expired during grading
>>Program output:
>>
>>Purify engine: Warning: Cannot find a file which matches the DT_SONAME 
>>field (libnss_files.so.1) of the file (/usr/lib/nss_files.so.1).
>>Using /usr/lib/nss_files.so.1 instead.
>>
>>couldn't submit code for testing
>>
>>
>>
>>
>>"Forum Mangal Parmar" <forumm@stanford.edu> wrote in message 
>>news:dr13mv$532$1@news.Stanford.EDU...
>>
>>>while testing it stops on :
>>>
>>>Test M, using current source tree and build
>>>make ftpcopy.purify
>>>purify -cache-dir=/tmp/forumm -best-effort -linker=/usr/pubsw/bin/ld -demangle-program=/usr/pubsw/bin/c++filt 
>>>gcc -g -O0 -ansi -Wall -DSOLARIS  -o ftpcopy.purify  ftpcopy.o 
>>>ftpparse.o -lsocket -lnsl
>>>Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) Copyright 
>>>IBM Corp. 1992, 2005 All rights reserved.
>>>Instrumenting:
>>>Purify engine: Error: Tried to link with directory (/usr/lib): skipping.
>>>ftpcopy.o ftpparse.o  Linking
>>>
>>>Running purify'ed executable:  ./ftpcopy.purify gz 2 ftp.stanford.edu . 
>>>/pub/packages
>>>
>>>
>>>
>>>and then exits because of time out
>>>
>>>wht shd I do abt it?
>>>
>>>thanks
>>>Forum
>>>
>>
>>
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test script bailed... (not timeout)
Date: Sun, 22 Jan 2006 16:02:31 -0800
Lines: 163
Distribution: su
Message-ID: <dr16et$7bj$1@news.Stanford.EDU>
References: <dr14h3$5ns$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dr14h3$5ns$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9729

No idea, it of course looks like it coudn't mkdir 
ftp.slac.stanford.edu_mif_5_1, but I don't know why.

Note that you can always resubmit immediately if some odd thing happened 
in the test script to see if it recurs.  The test script only takes away 
quota if you've changed your code (it will ask if you want to generate a 
new key, which means use up a quota).

Eric B Friedman wrote:
> Hi,
> 
> As the subject indicates, the test script bailed on me. I've attached 
> the full output.
> 
> The end of the output I've pasted below; from inspection, I don't think 
> the error has to do with my code; my program does not print in the 
> format seen below.
> 
> I tried resubmitting, but the error didn't recur. (Instead, it 
> identified a bug in my code.) However, I did just burn one of my three 
> test runs before the deadline. Any idea what happened here?
> 
> Thanks,
> 
> Eric
> 
> ---
> 
> [elided for clarity]
> 
> Test F.1, using current source tree and build
> make
> make: Nothing to be done for `all'.
> 
> readdir(./../../../../../../../../..): Connection timed out at
> cs244a/FTPCopyTestCase.pm line 247
> Downloading files:  ./ftpcopy   mif 5 ftp.slac.stanford.edu
> /ftp.slac.stanford.edu_mif_5_1 /doc
> can't create local directory /ftp.slac.stanford.edu_mif_5_1 (No such 
> file or
> directory)
> couldn't submit code for testing
> elaine7:~/cs244a/hw1>
> 
> 
> ------------------------------------------------------------------------
> 
> elaine7:~/cs244a/hw1> /afs/ir/class/cs244a/bin/test_code.pl hw1 Makefile *.c *.h 
> purify.output .purify
> Creating submission tarball...
> .purify
> Makefile
> ftp.c
> ftp.h
> ftpcopy.c
> ftpparse.c
> ftpparse.h
> purify.output
> util.c
> util.h
> .purify
> Makefile
> ftp.c
> ftp.h
> ftpcopy.c
> ftpparse.c
> ftpparse.h
> purify.output
> util.c
> util.h
> Checking to make sure target all compiles before testing... OK
> Checking to make sure target ftpcopy.purify compiles before testing... OK
> 
> Starting...
> Test B, new source tree required, extracting into grading_src/build...
> .purify
> Makefile
> ftp.c
> ftp.h
> ftpcopy.c
> ftpparse.c
> ftpparse.h
> purify.output
> util.c
> util.h
> 
> Can't find a matching key for this test run.
> Would you like to generate a new one?  (y/n):  y
> Daily quota of 3 test attempts applies (from Jan 19 onwards).
> You've used 1 test attempt(s) so far today.
> make 
> gcc -g -O0 -ansi -Wall -DSOLARIS  -c ftpcopy.c
> gcc -g -O0 -ansi -Wall -DSOLARIS  -c ftpparse.c
> gcc -g -O0 -ansi -Wall -DSOLARIS  -c ftp.c
> gcc -g -O0 -ansi -Wall -DSOLARIS  -c util.c
> gcc -g -O0 -ansi -Wall -DSOLARIS  -o ftpcopy  ftpcopy.o ftpparse.o ftp.o util.o 
> -lsocket -lnsl 
> 
> Downloading files:  ./ftpcopy   mif 5 ftp.slac.stanford.edu 
> /afs/ir.stanford.edu/users/e/r/eric06/cs244a/hw1/grading_src/build/ftp.slac.stanford.edu_mif_5_1 
> /doc
> Downloading files:  ./ftpcopy   mif 5 ftp.slac.stanford.edu 
> ftp.slac.stanford.edu_mif_5_0 /doc
> Downloading files:  ./ftpcopy   ch 1 ftp.cs.stanford.edu 
> /afs/ir.stanford.edu/users/e/r/eric06/cs244a/hw1/grading_src/build/ftp.cs.stanford.edu_ch_1_1 
> /pub/cweb
> Downloading files:  ./ftpcopy   txt 0 134.79.18.30 134.79.18.30_txt_0_0 .
> Checking host ftp.slac.stanford.edu
> Checking host ftp.slac.stanford.edu
> Checking host ftp.cs.stanford.edu
> Checking host 134.79.18.30
> 
> Test C, using current source tree and build
> make 
> make: Nothing to be done for `all'.
> 
> Using cached results from previous run
> Using cached results from previous run
> Using cached results from previous run
> Using cached results from previous run
> Checking host ftp.slac.stanford.edu
> Checking host ftp.slac.stanford.edu
> Checking host ftp.cs.stanford.edu
> Checking host 134.79.18.30
> 
> Test D, using current source tree and build
> make 
> make: Nothing to be done for `all'.
> 
> Using cached results from previous run
> Using cached results from previous run
> Using cached results from previous run
> Using cached results from previous run
> Checking host ftp.slac.stanford.edu
> Checking host ftp.slac.stanford.edu
> Checking host ftp.cs.stanford.edu
> Checking host 134.79.18.30
> 
> Test E, using current source tree and build
> make 
> make: Nothing to be done for `all'.
> 
> Using cached results from previous run
> Using cached results from previous run
> Using cached results from previous run
> Using cached results from previous run
> Checking host ftp.slac.stanford.edu
> Checking host ftp.slac.stanford.edu
> Checking host ftp.cs.stanford.edu
> Checking host 134.79.18.30
> 
> Test F.1, using current source tree and build
> make 
> make: Nothing to be done for `all'.
> 
> readdir(./../../../../../../../../..): Connection timed out at 
> cs244a/FTPCopyTestCase.pm line 247
> Downloading files:  ./ftpcopy   mif 5 ftp.slac.stanford.edu 
> /ftp.slac.stanford.edu_mif_5_1 /doc
> can't create local directory /ftp.slac.stanford.edu_mif_5_1 (No such file or 
> directory)
> couldn't submit code for testing
> elaine7:~/cs244a/hw1>
.

Path: shelby.stanford.edu!not-for-mail
From: "Forum Mangal Parmar" <forumm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: testing script hangs and time out
Date: Sun, 22 Jan 2006 16:13:32 -0800
Lines: 72
Distribution: su
Message-ID: <dr173f$7o7$1@news.Stanford.EDU>
References: <dr13mv$532$1@news.Stanford.EDU> <dr13td$5ae$1@news.Stanford.EDU> <dr156k$681$1@news.Stanford.EDU> <dr15um$6vg$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:9730

thanks a lot.. but tht happend coz I tried to run the file tht worked 
yesterday just to see if there was a problem with the script

"Matt Falkenhagen" <mjf@stanford.edu> wrote in message 
news:dr15um$6vg$1@news.Stanford.EDU...
> By the way as long as you don't change the code, you can keep submitting 
> as much as you want without taking up quota.  The quota counts unique 
> submissions (it saves a hash of your code and compares your submissions 
> against the saved hash).
>
> I'll make an exception in this case and free up one of your quotas.  I'd 
> recommend testing your ftpcopy yourself against ftp.stanford.edu and then, 
> if it aborts cleanly, running the testing script.
>
>
> Forum Mangal Parmar wrote:
>> I tried to run the test again but it tells me I hv used up quota of 
>> submitting for today. but I did not get to see the result so not much use 
>> really of the test
>>
>> cah u fix this for me asap
>>
>>
>> "Forum Mangal Parmar" <forumm@stanford.edu> wrote in message 
>> news:dr13td$5ae$1@news.Stanford.EDU...
>>
>>>this is wht follows after some time:
>>>
>>>Could not run purify'ed exe: ***Timeout expired during grading
>>>Program output:
>>>
>>>Purify engine: Warning: Cannot find a file which matches the DT_SONAME 
>>>field (libnss_files.so.1) of the file (/usr/lib/nss_files.so.1).
>>>Using /usr/lib/nss_files.so.1 instead.
>>>
>>>couldn't submit code for testing
>>>
>>>
>>>
>>>
>>>"Forum Mangal Parmar" <forumm@stanford.edu> wrote in message 
>>>news:dr13mv$532$1@news.Stanford.EDU...
>>>
>>>>while testing it stops on :
>>>>
>>>>Test M, using current source tree and build
>>>>make ftpcopy.purify
>>>>purify -cache-dir=/tmp/forumm -best-effort -linker=/usr/pubsw/bin/ld -demangle-program=/usr/pubsw/bin/c++filt 
>>>>gcc -g -O0 -ansi -Wall -DSOLARIS  -o ftpcopy.purify  ftpcopy.o 
>>>>ftpparse.o -lsocket -lnsl
>>>>Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) Copyright 
>>>>IBM Corp. 1992, 2005 All rights reserved.
>>>>Instrumenting:
>>>>Purify engine: Error: Tried to link with directory (/usr/lib): skipping.
>>>>ftpcopy.o ftpparse.o  Linking
>>>>
>>>>Running purify'ed executable:  ./ftpcopy.purify gz 2 ftp.stanford.edu . 
>>>>/pub/packages
>>>>
>>>>
>>>>
>>>>and then exits because of time out
>>>>
>>>>wht shd I do abt it?
>>>>
>>>>thanks
>>>>Forum
>>>>
>>>
>>>
>> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Forum Mangal Parmar" <forumm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: testing script hangs and time out
Date: Sun, 22 Jan 2006 16:20:45 -0800
Lines: 81
Distribution: su
Message-ID: <dr17gt$8b7$1@news.Stanford.EDU>
References: <dr13mv$532$1@news.Stanford.EDU> <dr13td$5ae$1@news.Stanford.EDU> <dr156k$681$1@news.Stanford.EDU> <dr15ot$69h$2@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:9731

it still doesnt work..

Running purify'ed executable:  ./ftpcopy.purify gz 2 ftp.stanford.edu . 
/pub/packages
Could not run purify'ed exe:
Purify engine: Warning: Cannot find a file which matches the DT_SONAME field 
(libnss_files.so.1) of the file (/usr/lib/nss_files.so.1).
Using /usr/lib/nss_files.so.1 instead.
ERROR: Connection closed by server

couldn't submit code for testing

the program exits if its not able to connect to the server.. am I doing the 
right thing?  and how will I be able to ckh the test script  result now?

thanks

"Matt Falkenhagen" <mjf@stanford.edu> wrote in message 
news:dr15ot$69h$2@news.Stanford.EDU...
> Test M unfortunately tries to connect to ftp.stanford.edu, which is no 
> longer in service.  You are probably hanging in some read() loop and your 
> program isn't terminating.  You should abort if read() returns 0 which 
> indicates the connection closed.
>
> Forum Mangal Parmar wrote:
>> I tried to run the test again but it tells me I hv used up quota of 
>> submitting for today. but I did not get to see the result so not much use 
>> really of the test
>>
>> cah u fix this for me asap
>>
>>
>> "Forum Mangal Parmar" <forumm@stanford.edu> wrote in message 
>> news:dr13td$5ae$1@news.Stanford.EDU...
>>
>>>this is wht follows after some time:
>>>
>>>Could not run purify'ed exe: ***Timeout expired during grading
>>>Program output:
>>>
>>>Purify engine: Warning: Cannot find a file which matches the DT_SONAME 
>>>field (libnss_files.so.1) of the file (/usr/lib/nss_files.so.1).
>>>Using /usr/lib/nss_files.so.1 instead.
>>>
>>>couldn't submit code for testing
>>>
>>>
>>>
>>>
>>>"Forum Mangal Parmar" <forumm@stanford.edu> wrote in message 
>>>news:dr13mv$532$1@news.Stanford.EDU...
>>>
>>>>while testing it stops on :
>>>>
>>>>Test M, using current source tree and build
>>>>make ftpcopy.purify
>>>>purify -cache-dir=/tmp/forumm -best-effort -linker=/usr/pubsw/bin/ld -demangle-program=/usr/pubsw/bin/c++filt 
>>>>gcc -g -O0 -ansi -Wall -DSOLARIS  -o ftpcopy.purify  ftpcopy.o 
>>>>ftpparse.o -lsocket -lnsl
>>>>Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) Copyright 
>>>>IBM Corp. 1992, 2005 All rights reserved.
>>>>Instrumenting:
>>>>Purify engine: Error: Tried to link with directory (/usr/lib): skipping.
>>>>ftpcopy.o ftpparse.o  Linking
>>>>
>>>>Running purify'ed executable:  ./ftpcopy.purify gz 2 ftp.stanford.edu . 
>>>>/pub/packages
>>>>
>>>>
>>>>
>>>>and then exits because of time out
>>>>
>>>>wht shd I do abt it?
>>>>
>>>>thanks
>>>>Forum
>>>>
>>>
>>>
>> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Forum Mangal Parmar" <forumm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: submit error
Date: Sun, 22 Jan 2006 16:31:36 -0800
Lines: 26
Distribution: su
Message-ID: <dr1857$8q3$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9732

I did the following:

elaine34:~/submit> /usr/class/cs244a/bin/submit.pl hw1 mjf
SubmitBase: /afs/ir/class/cs244a/submissions
Debug Level = 0
could not find any file matching .purify in 
/afs/ir.stanford.edu/users/f/o/forumm/submit!!
======================================================================
Your code could not be sumitted because of some error.
If you think there is a mistake, please send an email to your TA
(mjf; <mjf@stanford.edu >) with the relevant information.
======================================================================


Died at /usr/class/cs244a/bin/submit.pl line 194.
elaine34:~/submit> ls
Makefile  ftpcopy.c  ftpcopy.purify  ftpparse.c  ftpparse.h  purify.output 
readme.txt



pls can u tell me wht to do abt this
thanks
Forum 


.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: submit error
Date: Sun, 22 Jan 2006 16:36:35 -0800
Lines: 31
Distribution: su
Message-ID: <dr18ej$8tu$1@news.Stanford.EDU>
References: <dr1857$8q3$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
In-Reply-To: <dr1857$8q3$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9733

Do you have .purify in the directory?

--Michi

Forum Mangal Parmar wrote:
> I did the following:
> 
> elaine34:~/submit> /usr/class/cs244a/bin/submit.pl hw1 mjf
> SubmitBase: /afs/ir/class/cs244a/submissions
> Debug Level = 0
> could not find any file matching .purify in 
> /afs/ir.stanford.edu/users/f/o/forumm/submit!!
> ======================================================================
> Your code could not be sumitted because of some error.
> If you think there is a mistake, please send an email to your TA
> (mjf; <mjf@stanford.edu >) with the relevant information.
> ======================================================================
> 
> 
> Died at /usr/class/cs244a/bin/submit.pl line 194.
> elaine34:~/submit> ls
> Makefile  ftpcopy.c  ftpcopy.purify  ftpparse.c  ftpparse.h  purify.output 
> readme.txt
> 
> 
> 
> pls can u tell me wht to do abt this
> thanks
> Forum 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: submit error
Date: Sun, 22 Jan 2006 16:36:39 -0800
Lines: 31
Distribution: su
Message-ID: <dr18es$8hh$1@news.Stanford.EDU>
References: <dr1857$8q3$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dr1857$8q3$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9734

You need a file named ".purify".  See PA #1 handout under section 
"Deliverables" and the Purify FAQ.  If you don't need to suppress any 
purify errors, see thread ".purify" 1/21/2006 4:31 PM.

Forum Mangal Parmar wrote:
> I did the following:
> 
> elaine34:~/submit> /usr/class/cs244a/bin/submit.pl hw1 mjf
> SubmitBase: /afs/ir/class/cs244a/submissions
> Debug Level = 0
> could not find any file matching .purify in 
> /afs/ir.stanford.edu/users/f/o/forumm/submit!!
> ======================================================================
> Your code could not be sumitted because of some error.
> If you think there is a mistake, please send an email to your TA
> (mjf; <mjf@stanford.edu >) with the relevant information.
> ======================================================================
> 
> 
> Died at /usr/class/cs244a/bin/submit.pl line 194.
> elaine34:~/submit> ls
> Makefile  ftpcopy.c  ftpcopy.purify  ftpparse.c  ftpparse.h  purify.output 
> readme.txt
> 
> 
> 
> pls can u tell me wht to do abt this
> thanks
> Forum 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Forum Mangal Parmar" <forumm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: submit error
Date: Sun, 22 Jan 2006 16:37:18 -0800
Lines: 36
Distribution: su
Message-ID: <dr18fv$8vq$1@news.Stanford.EDU>
References: <dr1857$8q3$1@news.Stanford.EDU> <dr18ej$8tu$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:9735

yes.. Iv shown the ls too.. its there but still not working!!


"Michi Mutsuzaki" <michi2@stanford.edu> wrote in message 
news:dr18ej$8tu$1@news.Stanford.EDU...
> Do you have .purify in the directory?
>
> --Michi
>
> Forum Mangal Parmar wrote:
>> I did the following:
>>
>> elaine34:~/submit> /usr/class/cs244a/bin/submit.pl hw1 mjf
>> SubmitBase: /afs/ir/class/cs244a/submissions
>> Debug Level = 0
>> could not find any file matching .purify in 
>> /afs/ir.stanford.edu/users/f/o/forumm/submit!!
>> ======================================================================
>> Your code could not be sumitted because of some error.
>> If you think there is a mistake, please send an email to your TA
>> (mjf; <mjf@stanford.edu >) with the relevant information.
>> ======================================================================
>>
>>
>> Died at /usr/class/cs244a/bin/submit.pl line 194.
>> elaine34:~/submit> ls
>> Makefile  ftpcopy.c  ftpcopy.purify  ftpparse.c  ftpparse.h 
>> purify.output readme.txt
>>
>>
>>
>> pls can u tell me wht to do abt this
>> thanks
>> Forum 


.

Path: shelby.stanford.edu!not-for-mail
From: "Forum Mangal Parmar" <forumm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: submit error
Date: Sun, 22 Jan 2006 16:48:58 -0800
Lines: 37
Distribution: su
Message-ID: <dr195r$9k6$1@news.Stanford.EDU>
References: <dr1857$8q3$1@news.Stanford.EDU> <dr18es$8hh$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:9736

thanks tht works but the test script still dint work.. my program exits on 
reading 0 and so does the test script!!


"Matt Falkenhagen" <mjf@stanford.edu> wrote in message 
news:dr18es$8hh$1@news.Stanford.EDU...
> You need a file named ".purify".  See PA #1 handout under section 
> "Deliverables" and the Purify FAQ.  If you don't need to suppress any 
> purify errors, see thread ".purify" 1/21/2006 4:31 PM.
>
> Forum Mangal Parmar wrote:
>> I did the following:
>>
>> elaine34:~/submit> /usr/class/cs244a/bin/submit.pl hw1 mjf
>> SubmitBase: /afs/ir/class/cs244a/submissions
>> Debug Level = 0
>> could not find any file matching .purify in 
>> /afs/ir.stanford.edu/users/f/o/forumm/submit!!
>> ======================================================================
>> Your code could not be sumitted because of some error.
>> If you think there is a mistake, please send an email to your TA
>> (mjf; <mjf@stanford.edu >) with the relevant information.
>> ======================================================================
>>
>>
>> Died at /usr/class/cs244a/bin/submit.pl line 194.
>> elaine34:~/submit> ls
>> Makefile  ftpcopy.c  ftpcopy.purify  ftpparse.c  ftpparse.h 
>> purify.output readme.txt
>>
>>
>>
>> pls can u tell me wht to do abt this
>> thanks
>> Forum 


.

Path: shelby.stanford.edu!not-for-mail
From: "Krishna Monian" <kmonian@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: submit error
Date: Sun, 22 Jan 2006 18:51:15 -0800
Lines: 44
Distribution: su
Message-ID: <dr1gd0$g5i$1@news.Stanford.EDU>
References: <dr1857$8q3$1@news.Stanford.EDU> <dr18es$8hh$1@news.Stanford.EDU> <dr195r$9k6$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
x-mimeole: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:9737

Your readme file needs to be named README instead of readme.txt.


"Forum Mangal Parmar" <forumm@stanford.edu> wrote in message 
news:dr195r$9k6$1@news.Stanford.EDU...
> thanks tht works but the test script still dint work.. my program exits on 
> reading 0 and so does the test script!!
>
>
> "Matt Falkenhagen" <mjf@stanford.edu> wrote in message 
> news:dr18es$8hh$1@news.Stanford.EDU...
>> You need a file named ".purify".  See PA #1 handout under section 
>> "Deliverables" and the Purify FAQ.  If you don't need to suppress any 
>> purify errors, see thread ".purify" 1/21/2006 4:31 PM.
>>
>> Forum Mangal Parmar wrote:
>>> I did the following:
>>>
>>> elaine34:~/submit> /usr/class/cs244a/bin/submit.pl hw1 mjf
>>> SubmitBase: /afs/ir/class/cs244a/submissions
>>> Debug Level = 0
>>> could not find any file matching .purify in 
>>> /afs/ir.stanford.edu/users/f/o/forumm/submit!!
>>> ======================================================================
>>> Your code could not be sumitted because of some error.
>>> If you think there is a mistake, please send an email to your TA
>>> (mjf; <mjf@stanford.edu >) with the relevant information.
>>> ======================================================================
>>>
>>>
>>> Died at /usr/class/cs244a/bin/submit.pl line 194.
>>> elaine34:~/submit> ls
>>> Makefile  ftpcopy.c  ftpcopy.purify  ftpparse.c  ftpparse.h 
>>> purify.output readme.txt
>>>
>>>
>>>
>>> pls can u tell me wht to do abt this
>>> thanks
>>> Forum
>
> 


.

Path: shelby.stanford.edu!saga16.Stanford.EDU!lamskm
From: lamskm@Stanford.EDU (Michael Lam)
Newsgroups: su.class.cs244a
Subject: my ftpcopy timedout with ftp.slac.stanford.edu at level 5
Date: Mon, 23 Jan 2006 03:36:01 +0000 (UTC)
Lines: 30
Distribution: su
Message-ID: <dr1iv1$i34$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
Summary: my ftpcopy timedout with ftp.slac.stanford.edu at level 5
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:9738

My ftpcopy always timedout with ftp.slac.stanford.edu at level 5.

If I lower the level to 4, it returns.

I thought I must be shuting down/closing the sockets right in order to
get to level 4.  And my ftpcopy has been working on sites like
gatekeeper.dec.com with not too many levels.

Here is the code that I have had working for less than 4 levels of
traversal:

  s2 = mkdataport(s,sin_addr);

  strcpy(cmd,"list\r\n");
  if( strlen(cmd) != write( s, cmd, strlen(cmd)) ) {
    fprintf(stderr, "ERROR: failed while writing to server\n");
    close( s );
    exit( FAILURE );
  }

  if( (s3=accept(s2, (struct sockaddr *) &servAddr, &namelen)) < 0 ) {
    fprintf(stderr, "ERROR: failed to getsockname to server\n");
    close( s2 );
    exit( FAILURE );
  }

Thanks in advance for any comment.  I submitted it anyway.

-Michael

.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <justin-p@sbcglobal.net>
Newsgroups: su.class.cs244a
Subject: Re: my ftpcopy timedout with ftp.slac.stanford.edu at level 5
Date: Sun, 22 Jan 2006 20:14:41 -0800
Lines: 42
Distribution: su
Message-ID: <BFF99831.2580%justin-p@sbcglobal.net>
References: <dr1iv1$i34$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.2.1.051004
Thread-Topic: my ftpcopy timedout with ftp.slac.stanford.edu at level 5
Thread-Index: AcYf04gvxwPmNYvGEdq6YwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:9739

It's probably not the cause of your timeout, but your write call is
potentially an issue.  It's not guaranteed that your write will complete in
one call, which it is assuming right now.  Otherwise, I don't see any issues
with the snippet you've provided.

--Justin


On 1/22/06 7:36 PM, in article dr1iv1$i34$1@news.Stanford.EDU, "Michael Lam"
<lamskm@Stanford.EDU> wrote:

> My ftpcopy always timedout with ftp.slac.stanford.edu at level 5.
> 
> If I lower the level to 4, it returns.
> 
> I thought I must be shuting down/closing the sockets right in order to
> get to level 4.  And my ftpcopy has been working on sites like
> gatekeeper.dec.com with not too many levels.
> 
> Here is the code that I have had working for less than 4 levels of
> traversal:
> 
>   s2 = mkdataport(s,sin_addr);
> 
>   strcpy(cmd,"list\r\n");
>   if( strlen(cmd) != write( s, cmd, strlen(cmd)) ) {
>     fprintf(stderr, "ERROR: failed while writing to server\n");
>     close( s );
>     exit( FAILURE );
>   }
> 
>   if( (s3=accept(s2, (struct sockaddr *) &servAddr, &namelen)) < 0 ) {
>     fprintf(stderr, "ERROR: failed to getsockname to server\n");
>     close( s2 );
>     exit( FAILURE );
>   }
> 
> Thanks in advance for any comment.  I submitted it anyway.
> 
> -Michael
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: my ftpcopy timedout with ftp.slac.stanford.edu at level 5
Date: Mon, 23 Jan 2006 00:26:19 -0800
Lines: 34
Distribution: su
Message-ID: <dr23vi$63u$1@news.Stanford.EDU>
References: <dr1iv1$i34$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dr1iv1$i34$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9740

What have you done to debug this?  Can you figure out in which function 
the timeout occurs?

Michael Lam wrote:
> My ftpcopy always timedout with ftp.slac.stanford.edu at level 5.
> 
> If I lower the level to 4, it returns.
> 
> I thought I must be shuting down/closing the sockets right in order to
> get to level 4.  And my ftpcopy has been working on sites like
> gatekeeper.dec.com with not too many levels.
> 
> Here is the code that I have had working for less than 4 levels of
> traversal:
> 
>   s2 = mkdataport(s,sin_addr);
> 
>   strcpy(cmd,"list\r\n");
>   if( strlen(cmd) != write( s, cmd, strlen(cmd)) ) {
>     fprintf(stderr, "ERROR: failed while writing to server\n");
>     close( s );
>     exit( FAILURE );
>   }
> 
>   if( (s3=accept(s2, (struct sockaddr *) &servAddr, &namelen)) < 0 ) {
>     fprintf(stderr, "ERROR: failed to getsockname to server\n");
>     close( s2 );
>     exit( FAILURE );
>   }
> 
> Thanks in advance for any comment.  I submitted it anyway.
> 
> -Michael
> 
.

Path: shelby.stanford.edu!saga4.Stanford.EDU!lamskm
From: lamskm@Stanford.EDU (Michael Lam)
Newsgroups: su.class.cs244a
Subject: Re: my ftpcopy timedout with ftp.slac.stanford.edu at level 5
Date: Mon, 23 Jan 2006 16:39:26 +0000 (UTC)
Lines: 52
Distribution: su
Message-ID: <dr30ru$2rf$1@news.Stanford.EDU>
References: <dr1iv1$i34$1@news.Stanford.EDU> <dr23vi$63u$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:9741

I used gdb and the hang was at the accept call below:

   if( (s3=accept(s2, (struct sockaddr *) &servAddr, &namelen)) < 0 ) {

The call was made in a recursive call with 6 stack frames because 
of level 5.  But I shutdown and closed the data sockets before the
recursive call.

Because the call worked for cases with fewer dir levels,
I have a feeling that if I can increase the socket layer resources,
I may be able to get around.  I tried to increase the 2nd parameter of
the listen (for s2) with a higher backlog value.  And I think that
got ftpcopy to traverse longer (but still hangs).

-Michael

Matt Falkenhagen <mjf@stanford.edu> writes:

>What have you done to debug this?  Can you figure out in which function 
>the timeout occurs?

>Michael Lam wrote:
>> My ftpcopy always timedout with ftp.slac.stanford.edu at level 5.
>> 
>> If I lower the level to 4, it returns.
>> 
>> I thought I must be shuting down/closing the sockets right in order to
>> get to level 4.  And my ftpcopy has been working on sites like
>> gatekeeper.dec.com with not too many levels.
>> 
>> Here is the code that I have had working for less than 4 levels of
>> traversal:
>> 
>>   s2 = mkdataport(s,sin_addr);
>> 
>>   strcpy(cmd,"list\r\n");
>>   if( strlen(cmd) != write( s, cmd, strlen(cmd)) ) {
>>     fprintf(stderr, "ERROR: failed while writing to server\n");
>>     close( s );
>>     exit( FAILURE );
>>   }
>> 
>>   if( (s3=accept(s2, (struct sockaddr *) &servAddr, &namelen)) < 0 ) {
>>     fprintf(stderr, "ERROR: failed to getsockname to server\n");
>>     close( s2 );
>>     exit( FAILURE );
>>   }
>> 
>> Thanks in advance for any comment.  I submitted it anyway.
>> 
>> -Michael
>> 
.

Path: shelby.stanford.edu!saga14.Stanford.EDU!vijayk
From: Vijay K Kulkarni <vijayk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: hw2, toplogy assignments
Date: Mon, 23 Jan 2006 23:11:07 -0800
Lines: 6
Distribution: su
Message-ID: <Pine.GSO.4.44.0601232309430.6539-100000@saga14.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9742

Hi,
   did I miss any mails on topology assigments for hw2?
thanks,
Vijay.


.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: hw2, toplogy assignments
Date: Tue, 24 Jan 2006 00:17:26 -0800
Lines: 9
Distribution: su
Message-ID: <dr4nqv$722$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601232309430.6539-100000@saga14.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601232309430.6539-100000@saga14.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9743

Nope, these haven't gone out yet.  We'll send them asap.

Vijay K Kulkarni wrote:
> Hi,
>    did I miss any mails on topology assigments for hw2?
> thanks,
> Vijay.
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: grades?
Date: Tue, 24 Jan 2006 16:22:04 -0800
Lines: 4
Distribution: su
Message-ID: <dr6gbf$5tj$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9744

Was it mentioned today in class that grades for A1 are posted? If they 
are, where are they posted?

Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Jens Pillgram-Larsen <jenspl@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: grades?
Date: Tue, 24 Jan 2006 16:36:13 -0800
Lines: 10
Distribution: su
Message-ID: <dr6h5t$6il$1@news.Stanford.EDU>
References: <dr6gbf$5tj$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <dr6gbf$5tj$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9745

I don't think grades are posted. But when they are I believe they will 
be posted under eeclass. There's a tab labeled grades there.

Jens.

Naeim Semsarilar wrote:
> Was it mentioned today in class that grades for A1 are posted? If they 
> are, where are they posted?
> 
> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: grades?
Date: Tue, 24 Jan 2006 16:37:11 -0800
Lines: 9
Distribution: su
Message-ID: <dr6h80$6l2$1@news.Stanford.EDU>
References: <dr6gbf$5tj$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dr6gbf$5tj$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9746

No, they haven't been graded yet.  The professor just said we did some 
quick tests and the submissions look good.  The grades will be posted on 
EEclass when ready.

Naeim Semsarilar wrote:
> Was it mentioned today in class that grades for A1 are posted? If they 
> are, where are they posted?
> 
> Thanks.
.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!zeighami
From: Roy Mehdi Zeighami <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sr_send_packet, partial write?
Date: Wed, 25 Jan 2006 11:18:10 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0601251115070.8440-100000@elaine43.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9747

I was browsing the source for the simple router and ran across a bit of
code in the function sr_send_packet like this:

if( write(sr->sockfd, sr_pkt, total_len) < total_len )
    {
        fprintf(stderr, "Error writing packet\n");
        free(sr_pkt);
        return -1;
    }

It looks like this code assumes that the whole buffer is written in a
single write.  Is that a bug,  it seems like those buffers could be large,
right?

Thanks,

Roy

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan Matthew Smith <rysmi@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: rfc 1812 missing?
Date: Wed, 25 Jan 2006 21:36:00 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <dr8r00$qdu$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.6.12.6smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:9748

the link at the top of assignment 2 to rfc 1812 does not work for
me. 

it points to
http://www.stanford.edu/class/cs244a/homeworks/hw2/rfc1812.txt
which doesn't seem to exist. 

also, trying to construct my own path to it based off the other
rfc paths doesn't seem to work either: 

http://www.stanford.edu/class/cs244a/rfc/rfc1812.txt

is this rfc missing from the tree, or am i just missing something 
on my own? 

thanks, 
ryan. 

.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: rfc 1812 missing?
Date: Wed, 25 Jan 2006 15:33:39 -0800
Lines: 27
Distribution: su
Message-ID: <dr91sf$5sr$1@news.Stanford.EDU>
References: <dr8r00$qdu$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:9749

You can just google for the RFC, they're all over the web (I'm using the one
at faqs.org, I think).

Waynn

"Ryan Matthew Smith" <rysmi@Stanford.EDU> wrote in message
news:dr8r00$qdu$1@news.Stanford.EDU...
> the link at the top of assignment 2 to rfc 1812 does not work for
> me.
>
> it points to
> http://www.stanford.edu/class/cs244a/homeworks/hw2/rfc1812.txt
> which doesn't seem to exist.
>
> also, trying to construct my own path to it based off the other
> rfc paths doesn't seem to work either:
>
> http://www.stanford.edu/class/cs244a/rfc/rfc1812.txt
>
> is this rfc missing from the tree, or am i just missing something
> on my own?
>
> thanks,
> ryan.
>


.

Path: shelby.stanford.edu!saga22.Stanford.EDU!wachs
From: Megan Anneke Wachs <wachs@stanford.edu>
Newsgroups: su.class.cs244a
Subject: purify for hw2
Date: Wed, 25 Jan 2006 16:51:18 -0800
Lines: 41
Distribution: su
Message-ID: <Pine.GSO.4.44.0601251647320.9335-100000@saga22.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9750

Hi,

 I get errors when trying to do 'make sr.purify' for hw2:
---------------------------------------------------------
Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) Copyright
IBM Corp. 1992, 2005 All rights reserved.
Instrumenting:
Purify engine: Error: Tried to link with directory (/usr/lib): skipping.

Purify engine: Error: Errors detected while instrumenting files.
Linking suppressed.
(To force continuation, use "purify -best-effort $(CC) ...".)
make: *** [sr.purify] Error 1


---------------------------------------------------

I tried adding the -best-effort flag, but it doesn't like whatever I'm
doing:

------------------------------------------------------------
Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) Copyright
IBM Corp. 1992, 2005 All rights reserved.
Instrumenting:
Purify engine: Error: Tried to link with directory (/usr/lib): skipping.
 Linking
ld: fatal: option -dn and -P are incompatible
ld: fatal: Flags processing errors

Purify engine: Error: The linker returned error code: 1

make: *** [sr.purify] Error 1

-------------------------------------------------------------

Anyone gotten it to work?

Thanks,
Megan


.

Path: shelby.stanford.edu!elaine27.Stanford.EDU!wkso
From: Wai Kei So <wkso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ARP Request/Reply
Date: Wed, 25 Jan 2006 16:52:57 -0800
Lines: 90
Distribution: su
Message-ID: <Pine.GSO.4.44.0601251648180.696-101000@elaine27.Stanford.EDU>
Mime-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-851401618-1138236777=:696"
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9751

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---559023410-851401618-1138236777=:696
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hello,

When we send ARP requests, do we send to all interfaces?  I tried to do
this, and it seems like I'm doing it correctly where my source mac addr
for the arp requests are mac addresses of my 3 different interfaces, (debug
output below), but ethereal says it's always from eth0.  And also
etherreal sees a response, but seems like sr_handlepacket is not called to
process it.  I'm confused...attaching my logfile as well.  Thanks in
advance.

Sending ARP Request to: eth0
Printing packet-----------------806
ff ff ff ff ff ff 70 00 00 50 00 01 08 06 00 01
08 00 06 04 00 01 70 00 00 50 00 01 c0 a8 83 31
00 00 00 00 00 00 c0 a8 83 31 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 02 c4 a8
-----------------
Sending ARP request to following interface
:Interface: eth1
  hardware address 70:00:00:50:00:02
  ip address 192.168.131.50
--------
Sending ARP Request to: eth1
Printing packet-----------------806
ff ff ff ff ff ff 70 00 00 50 00 02 08 06 00 01
08 00 06 04 00 01 70 00 00 50 00 02 c0 a8 83 32
00 00 00 00 00 00 c0 a8 83 32 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 02 c4 a8
-----------------
Sending ARP request to following interface
:Interface: eth2
  hardware address 70:00:00:50:00:06
  ip address 192.168.131.52
--------
Sending ARP Request to: eth2
Printing packet-----------------806
ff ff ff ff ff ff 70 00 00 50 00 06 08 06 00 01
08 00 06 04 00 01 70 00 00 50 00 06 c0 a8 83 34
00 00 00 00 00 00 c0 a8 83 34 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 02 c4 a8
-----------------

-Wai Kei

---559023410-851401618-1138236777=:696
Content-Type: APPLICATION/octet-stream; name=logfile
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.4.44.0601251652570.696@elaine27.Stanford.EDU>
Content-Description: 
Content-Disposition: attachment; filename=logfile

obLD1AACAAQAAAAAAAAAAAAABAAAAAABQ9gbNQAMLbkAAAA8AAAAPP//////
/wDggQQm2QgGAAEIAAYEAAEA4IEEJtmsGEoRAAAAAAAAwKiDMQAAAAAAAAAA
AAAAAAAAAAAAAEPYGzUADDGuAAAAOwAAADsA4IEEJtlwAABQAAEIBgABCAAG
BAACcAAAUAABwKiDMQDggQQm2awYShEtCnRjcCAgICAgICAgdHBpX0PYGzYA
DL28AAAAPgAAAD5wAABQAAEA4IEEJtkIAEUAADCyg0AAPQaMwqtAD2bAqIMz
6KMAFdfEhkYAAAAAcAJg9NzkAAABAQQCAgQFtEPYGzYADNokAAAAOwAAADv/
//////9wAABQAAEIBgABCAAGBAABcAAAUAABwKiDMQAAAAAAAMCogzEAAAAA
AAAAAAAAAAAAAAAAAEPYGzYADN3PAAAAOwAAADv///////9wAABQAAIIBgAB
CAAGBAABcAAAUAACwKiDMgAAAAAAAMCogzIAAAAAAAAAAAAAAAAAAAAAAEPY
GzYADN+cAAAAOwAAADv///////9wAABQAAYIBgABCAAGBAABcAAAUAAGwKiD
NAAAAAAAAMCogzQAAAAAAAAAAAAAAAAAAAAAAEPYGzoAAw44AAAAPgAAAD5w
AABQAAEA4IEEJtkIAEUAADCyhEAAPQaMwatAD2bAqIMz6KMAFdfEhkYAAAAA
cAJg9NzkAAABAQQCAgQFtEPYGzoAAxVBAAAAOwAAADv///////9wAABQAAEI
BgABCAAGBAABcAAAUAABwKiDMQAAAAAAAMCogzEAAAAAAAAAAAAAAAAAAAAC
xEPYGzoAAxekAAAAOwAAADv///////9wAABQAAIIBgABCAAGBAABcAAAUAAC
wKiDMgAAAAAAAMCogzIAAAAAAAAAAAAAAAAAAAACxEPYGzoAAxnwAAAAOwAA
ADv///////9wAABQAAYIBgABCAAGBAABcAAAUAAGwKiDNAAAAAAAAMCogzQA
AAAAAAAAAAAAAAAAAAACxEPYG0AADoBvAAAAPgAAAD5wAABQAAEA4IEEJtkI
AEUAADCyhUAAPQaMwKtAD2bAqIMz6KMAFdfEhkYAAAAAcAJg9NzkAAABAQQC
AgQFtEPYG0AADodQAAAAOwAAADv///////9wAABQAAEIBgABCAAGBAABcAAA
UAABwKiDMQAAAAAAAMCogzEAAAAAAAAAAAAAAAAAAAACxEPYG0AADomtAAAA
OwAAADv///////9wAABQAAIIBgABCAAGBAABcAAAUAACwKiDMgAAAAAAAMCo
gzIAAAAAAAAAAAAAAAAAAAACxEPYG0AADov7AAAAOwAAADv///////9wAABQ
AAYIBgABCAAGBAABcAAAUAAGwKiDNAAAAAAAAMCogzQAAAAAAAAAAAAAAAAA
AAACxEPYG0kAAloaAAAAPAAAADxwAABQAAEA4IEEJtkIAEUAACiyhkAAPQaM
x6tAD2bAqIMz6KMAFdfEhkcAAAAAUARg9AmlAAAAAAAAAABD2BtJAAJhUAAA
ADsAAAA7////////cAAAUAABCAYAAQgABgQAAXAAAFAAAcCogzEAAAAAAADA
qIMxAAAAAAAAAAAAAAAAAAAAAsRD2BtJAAJjwQAAADsAAAA7////////cAAA
UAACCAYAAQgABgQAAXAAAFAAAsCogzIAAAAAAADAqIMyAAAAAAAAAAAAAAAA
AAAAAsRD2BtJAAJl6QAAADsAAAA7////////cAAAUAAGCAYAAQgABgQAAXAA
AFAABsCogzQAAAAAAADAqIM0AAAAAAAAAAAAAAAAAAAAAsQ=
---559023410-851401618-1138236777=:696--
.

Path: shelby.stanford.edu!saga22.Stanford.EDU!wachs
From: Megan Anneke Wachs <wachs@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: purify for hw2
Date: Wed, 25 Jan 2006 16:53:43 -0800
Lines: 51
Distribution: su
Message-ID: <Pine.GSO.4.44.0601251653130.9474-100000@saga22.Stanford.EDU>
References: <Pine.GSO.4.44.0601251647320.9335-100000@saga22.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0601251647320.9335-100000@saga22.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9752

Never mind, I just copied the flags from the last Makefile... but still
maybe the tar file could be updated...

-Megan

On Wed, 25 Jan 2006, Megan Anneke
Wachs wrote:

> Hi,
>
>  I get errors when trying to do 'make sr.purify' for hw2:
> ---------------------------------------------------------
> Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) Copyright
> IBM Corp. 1992, 2005 All rights reserved.
> Instrumenting:
> Purify engine: Error: Tried to link with directory (/usr/lib): skipping.
>
> Purify engine: Error: Errors detected while instrumenting files.
> Linking suppressed.
> (To force continuation, use "purify -best-effort $(CC) ...".)
> make: *** [sr.purify] Error 1
>
>
> ---------------------------------------------------
>
> I tried adding the -best-effort flag, but it doesn't like whatever I'm
> doing:
>
> ------------------------------------------------------------
> Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) Copyright
> IBM Corp. 1992, 2005 All rights reserved.
> Instrumenting:
> Purify engine: Error: Tried to link with directory (/usr/lib): skipping.
>  Linking
> ld: fatal: option -dn and -P are incompatible
> ld: fatal: Flags processing errors
>
> Purify engine: Error: The linker returned error code: 1
>
> make: *** [sr.purify] Error 1
>
> -------------------------------------------------------------
>
> Anyone gotten it to work?
>
> Thanks,
> Megan
>
>
>

.

Path: shelby.stanford.edu!elaine40.Stanford.EDU!wkso
From: Wai Kei So <wkso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: rtable
Date: Wed, 25 Jan 2006 22:08:54 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.GSO.4.44.0601252157100.22473-100000@elaine40.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9753

Hello,

Please disregard my previous post.  I drove home and everything worked.
I'm guessing it's cause I was using a different version of ethereal at
work or something to that effect...

Just wanted to make sure, do we statically put in entries for the rtable
file?  None of the distance vector stuff right?

Also, what's the point of queueing packets waiting for arp replies?  Why
not just wait for retransmit of the same packet from the source?  It seems
like the source will re-send the same packet anyway while the router waits
for and processes the ARP response.

As always, thanks very much in advance.

-Wai Kei

p.s. congrats.jpg cracked me up

.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: rfc 1812 missing?
Date: Wed, 25 Jan 2006 23:12:36 -0800
Lines: 23
Distribution: su
Message-ID: <dr9sun$3di$1@news.Stanford.EDU>
References: <dr8r00$qdu$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.9 (X11/20041124)
X-Accept-Language: en-us, en
In-Reply-To: <dr8r00$qdu$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9754

Thanks for the notice. I fixed the link.

Ari

Ryan Matthew Smith wrote:
> the link at the top of assignment 2 to rfc 1812 does not work for
> me. 
> 
> it points to
> http://www.stanford.edu/class/cs244a/homeworks/hw2/rfc1812.txt
> which doesn't seem to exist. 
> 
> also, trying to construct my own path to it based off the other
> rfc paths doesn't seem to work either: 
> 
> http://www.stanford.edu/class/cs244a/rfc/rfc1812.txt
> 
> is this rfc missing from the tree, or am i just missing something 
> on my own? 
> 
> thanks, 
> ryan. 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sr_send_packet, partial write?
Date: Thu, 26 Jan 2006 01:25:26 -0800
Lines: 23
Distribution: su
Message-ID: <dra4ii$duf$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601251115070.8440-100000@elaine43.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601251115070.8440-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9755

Haha, yeah it probably could be better written.  As far as I can tell, 
it's just a programmer being fast/lazy.  Although it does check if 
everything was written.

Roy Mehdi Zeighami wrote:
> I was browsing the source for the simple router and ran across a bit of
> code in the function sr_send_packet like this:
> 
> if( write(sr->sockfd, sr_pkt, total_len) < total_len )
>     {
>         fprintf(stderr, "Error writing packet\n");
>         free(sr_pkt);
>         return -1;
>     }
> 
> It looks like this code assumes that the whole buffer is written in a
> single write.  Is that a bug,  it seems like those buffers could be large,
> right?
> 
> Thanks,
> 
> Roy
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: purify for hw2
Date: Thu, 26 Jan 2006 01:39:08 -0800
Lines: 56
Distribution: su
Message-ID: <dra5c8$eh7$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601251647320.9335-100000@saga22.Stanford.EDU> <Pine.GSO.4.44.0601251653130.9474-100000@saga22.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601251653130.9474-100000@saga22.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9756

Good point, I've updated the Makefile.

Megan Anneke Wachs wrote:
> Never mind, I just copied the flags from the last Makefile... but still
> maybe the tar file could be updated...
> 
> -Megan
> 
> On Wed, 25 Jan 2006, Megan Anneke
> Wachs wrote:
> 
> 
>>Hi,
>>
>> I get errors when trying to do 'make sr.purify' for hw2:
>>---------------------------------------------------------
>>Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) Copyright
>>IBM Corp. 1992, 2005 All rights reserved.
>>Instrumenting:
>>Purify engine: Error: Tried to link with directory (/usr/lib): skipping.
>>
>>Purify engine: Error: Errors detected while instrumenting files.
>>Linking suppressed.
>>(To force continuation, use "purify -best-effort $(CC) ...".)
>>make: *** [sr.purify] Error 1
>>
>>
>>---------------------------------------------------
>>
>>I tried adding the -best-effort flag, but it doesn't like whatever I'm
>>doing:
>>
>>------------------------------------------------------------
>>Purify 2003a.06.13 FixPack 0172 050110 Solaris 2 (32-bit) (c) Copyright
>>IBM Corp. 1992, 2005 All rights reserved.
>>Instrumenting:
>>Purify engine: Error: Tried to link with directory (/usr/lib): skipping.
>> Linking
>>ld: fatal: option -dn and -P are incompatible
>>ld: fatal: Flags processing errors
>>
>>Purify engine: Error: The linker returned error code: 1
>>
>>make: *** [sr.purify] Error 1
>>
>>-------------------------------------------------------------
>>
>>Anyone gotten it to work?
>>
>>Thanks,
>>Megan
>>
>>
>>
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: rtable
Date: Thu, 26 Jan 2006 01:44:02 -0800
Lines: 30
Distribution: su
Message-ID: <dra5le$eps$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601252157100.22473-100000@elaine40.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601252157100.22473-100000@elaine40.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9757

Wai Kei So wrote:
> Hello,
> 
> Please disregard my previous post.  I drove home and everything worked.
> I'm guessing it's cause I was using a different version of ethereal at
> work or something to that effect...
> 
> Just wanted to make sure, do we statically put in entries for the rtable
> file?  None of the distance vector stuff right?

Yep just statically add the routes to rtable.
> 
> Also, what's the point of queueing packets waiting for arp replies?  Why
> not just wait for retransmit of the same packet from the source?  It seems
> like the source will re-send the same packet anyway while the router waits
> for and processes the ARP response.

The source might not retransmit the packet.  It will if it's using, say, 
TCP but you can't assume it will.  Your router is supposed to make a 
"best-effort" attempt to forward the packet.

> 
> As always, thanks very much in advance.
> 
> -Wai Kei
> 
> p.s. congrats.jpg cracked me up
> 

Me too.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Sample Exams
Date: Thu, 26 Jan 2006 12:40:12 -0800
Lines: 10
Distribution: su
Message-ID: <drbc3o$pj4$1@news.Stanford.EDU>
References: <dqklnc$29k$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dqklnc$29k$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9758

They are up now.  Enjoy ^_^

Steve Goldman wrote:
> Hi,
> 
> The links to the past years' midterms and finals on the webpage are 
> dead.  Any idea if we can get a look at those?
> 
> Thanks,
> Steve
.

Path: shelby.stanford.edu!elaine32.Stanford.EDU!vijayk
From: Vijay K Kulkarni <vijayk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ARP retries and timeouts
Date: Thu, 26 Jan 2006 14:44:00 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.GSO.4.44.0601261430280.12310-100000@elaine32.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9759

Hi,

   say I receive a packet for which nexthop IP's dmac is not
known. I initiate ARP request for this. From previous post on related
subject it seems we are required to queue this pkt and transmit the
original packet when we get reply for the ARP.
   now, how many pkts will I have to enqueue on to the list of pkts
waiting for ARP reply? do I need to throttle or enqueue every single
recieved pkt for that missing ARP entry?
   Is there a ARP timeout value after which all these queued packets will
be dropped if a reply is not received by then? And then initiate one more
ARP request on receiving pkts that require the missing ARP entry?


thanks,
Vijay.

.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP retries and timeouts
Date: Thu, 26 Jan 2006 16:20:41 -0800
Lines: 28
Distribution: su
Message-ID: <drbp16$an0$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601261430280.12310-100000@elaine32.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601261430280.12310-100000@elaine32.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9760

Vijay K Kulkarni wrote:
> Hi,
> 
>    say I receive a packet for which nexthop IP's dmac is not
> known. I initiate ARP request for this. From previous post on related
> subject it seems we are required to queue this pkt and transmit the
> original packet when we get reply for the ARP.
>    now, how many pkts will I have to enqueue on to the list of pkts
> waiting for ARP reply? do I need to throttle or enqueue every single
> recieved pkt for that missing ARP entry?
>    Is there a ARP timeout value after which all these queued packets will
> be dropped if a reply is not received by then? And then initiate one more
> ARP request on receiving pkts that require the missing ARP entry?

 From the handout:

"The router queues all packets waiting for outstanding ARP replies. If a 
host does not respond to 5 ARP requests, the queued packet is dropped 
and an ICMP host unreachable message is sent back to the source of the 
queued packet."

It's up to you to decide how far to space the ARP requests.

> 
> 
> thanks,
> Vijay.
> 
.

Path: shelby.stanford.edu!elaine27.Stanford.EDU!vijayk
From: Vijay K Kulkarni <vijayk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP retries and timeouts
Date: Thu, 26 Jan 2006 17:18:57 -0800
Lines: 40
Distribution: su
Message-ID: <Pine.GSO.4.44.0601261714220.15429-100000@elaine27.Stanford.EDU>
References: <Pine.GSO.4.44.0601261430280.12310-100000@elaine32.Stanford.EDU>
 <drbp16$an0$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
To: Matt Falkenhagen <mjf@stanford.edu>
In-Reply-To: <drbp16$an0$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9761

On Thu, 26 Jan 2006, Matt Falkenhagen wrote:

> Vijay K Kulkarni wrote:
> > Hi,
> >
> >    say I receive a packet for which nexthop IP's dmac is not
> > known. I initiate ARP request for this. From previous post on related
> > subject it seems we are required to queue this pkt and transmit the
> > original packet when we get reply for the ARP.
> >    now, how many pkts will I have to enqueue on to the list of pkts
> > waiting for ARP reply? do I need to throttle or enqueue every single
> > recieved pkt for that missing ARP entry?
> >    Is there a ARP timeout value after which all these queued packets will
> > be dropped if a reply is not received by then? And then initiate one more
> > ARP request on receiving pkts that require the missing ARP entry?
>
>  From the handout:
>
> "The router queues all packets waiting for outstanding ARP replies. If a
> host does not respond to 5 ARP requests, the queued packet is dropped
> and an ICMP host unreachable message is sent back to the source of the
> queued packet."

My question was more on say while we are waiting for the ARP reply/timeouts
what if 1000 pkts are received? we queue 1000 pkts? what if 100000 pkts
are recieved? any throttling needs to be done here? or taildrop after some
threshold value is reached?

thanks,
Vijay.
>
> It's up to you to decide how far to space the ARP requests.
>
> >
> >
> > thanks,
> > Vijay.
> >
>

.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP retries and timeouts
Date: Thu, 26 Jan 2006 17:55:50 -0800
Lines: 51
Distribution: su
Message-ID: <drbuov$gfg$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601261430280.12310-100000@elaine32.Stanford.EDU> <drbp16$an0$1@news.Stanford.EDU> <Pine.GSO.4.44.0601261714220.15429-100000@elaine27.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.9 (X11/20041124)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601261714220.15429-100000@elaine27.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9762

You are free to choose some threshold number of packets, so long as no 
packets are ever dropped under normal network conditions. Alternatively, 
you can queue packets without a threshold and simply abort the program 
if you ever run out of memory.

Ari

Vijay K Kulkarni wrote:
> On Thu, 26 Jan 2006, Matt Falkenhagen wrote:
> 
> 
>>Vijay K Kulkarni wrote:
>>
>>>Hi,
>>>
>>>   say I receive a packet for which nexthop IP's dmac is not
>>>known. I initiate ARP request for this. From previous post on related
>>>subject it seems we are required to queue this pkt and transmit the
>>>original packet when we get reply for the ARP.
>>>   now, how many pkts will I have to enqueue on to the list of pkts
>>>waiting for ARP reply? do I need to throttle or enqueue every single
>>>recieved pkt for that missing ARP entry?
>>>   Is there a ARP timeout value after which all these queued packets will
>>>be dropped if a reply is not received by then? And then initiate one more
>>>ARP request on receiving pkts that require the missing ARP entry?
>>
>> From the handout:
>>
>>"The router queues all packets waiting for outstanding ARP replies. If a
>>host does not respond to 5 ARP requests, the queued packet is dropped
>>and an ICMP host unreachable message is sent back to the source of the
>>queued packet."
> 
> 
> My question was more on say while we are waiting for the ARP reply/timeouts
> what if 1000 pkts are received? we queue 1000 pkts? what if 100000 pkts
> are recieved? any throttling needs to be done here? or taildrop after some
> threshold value is reached?
> 
> thanks,
> Vijay.
> 
>>It's up to you to decide how far to space the ARP requests.
>>
>>
>>>
>>>thanks,
>>>Vijay.
>>>
>>
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Sesha Narahari <narahari@stanford.edu>
Newsgroups: su.class.cs244a
Subject: approx effort for PA#2
Date: Thu, 26 Jan 2006 19:54:12 -0800
Lines: 6
Distribution: su
Message-ID: <43D99964.3050909@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9763

Any guidance on how much time and how many lines of code this should 
take? This was very useful in the FTP Copy assignment.

Thanks,
Sesha

.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: approx effort for PA#2
Date: Thu, 26 Jan 2006 22:56:06 -0800
Lines: 9
Distribution: su
Message-ID: <drcg67$3rp$1@news.Stanford.EDU>
References: <43D99964.3050909@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <43D99964.3050909@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:9764

It should be about the same as ftpcopy.

Sesha Narahari wrote:
> Any guidance on how much time and how many lines of code this should 
> take? This was very useful in the FTP Copy assignment.
> 
> Thanks,
> Sesha
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: hiccup
Date: Fri, 27 Jan 2006 22:43:33 -0800
Lines: 5
Distribution: su
Message-ID: <drf3qk$sci$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9766

fyi the server was rebooted.  This happens periodically to dislodge 
stuck clients (deficiency of the server). So don't worry too much if
your connection gets dropped once in awhile :)

..martin
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Timeout for host unreach
Date: Fri, 27 Jan 2006 23:20:57 -0800
Lines: 9
Distribution: su
Message-ID: <drf60o$169$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9767


There is some confusion (my fault) on what the timeout limit is
for host unreach.  Host unreach should be sent after 5 failed
ARP attempts.  Host unreaches should be sent back to the client
after 5-7 seconds of sending the first ARP.

The FAQ will be updated accordingly.

..martin
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sending ARP requests / rtable
Date: Fri, 27 Jan 2006 23:58:52 -0800
Lines: 17
Distribution: su
Message-ID: <drf885$59g$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9768

It's unclear to me how we should decide which interface to send an ARP 
request on. Let's say an IP packet destined for 192.168.130.12 arrives 
at the router and there are no entries for this address in the ARP 
cache. How should the router decide if the ARP request should be sent on 
eth0, eth1, or eth2?

I think it was mentioned in the problem session that we should look up 
the destination IP in rtable and make a decision, but what if rtable 
only has the default entry at that point? Do we send the ARP request on 
all 3 interfaces in that case?


My second question is about the rtable file. The stuff in rtable is 
loaded into the routing_table member of struct sr_instance. When we need 
to grow the table, do we actually need to dump an updated rtable file?

Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sending ARP requests / rtable
Date: Sat, 28 Jan 2006 00:31:51 -0800
Lines: 27
Distribution: su
Message-ID: <drfa5v$7ue$1@news.Stanford.EDU>
References: <drf885$59g$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <drf885$59g$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9769

OK I was under the impression that we are supposed to dynamically grow 
the rtable file and that was the source of my confusion. I will assume 
that it is acceptable to edit the rtable file manually *before* running 
the router and add static routes in. Please tell me if this is the wrong 
assumption.

Thanks.


Naeim Semsarilar wrote:
> It's unclear to me how we should decide which interface to send an ARP 
> request on. Let's say an IP packet destined for 192.168.130.12 arrives 
> at the router and there are no entries for this address in the ARP 
> cache. How should the router decide if the ARP request should be sent on 
> eth0, eth1, or eth2?
> 
> I think it was mentioned in the problem session that we should look up 
> the destination IP in rtable and make a decision, but what if rtable 
> only has the default entry at that point? Do we send the ARP request on 
> all 3 interfaces in that case?
> 
> 
> My second question is about the rtable file. The stuff in rtable is 
> loaded into the routing_table member of struct sr_instance. When we need 
> to grow the table, do we actually need to dump an updated rtable file?
> 
> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sending ARP requests / rtable
Date: Sat, 28 Jan 2006 00:43:38 -0800
Lines: 32
Distribution: su
Message-ID: <drfars$8aq$1@news.Stanford.EDU>
References: <drf885$59g$1@news.Stanford.EDU> <drfa5v$7ue$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drfa5v$7ue$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9770

Yep, manually edit the rtable file with the info from your topology e-mail.

Naeim Semsarilar wrote:
> OK I was under the impression that we are supposed to dynamically grow 
> the rtable file and that was the source of my confusion. I will assume 
> that it is acceptable to edit the rtable file manually *before* running 
> the router and add static routes in. Please tell me if this is the wrong 
> assumption.
> 
> Thanks.
> 
> 
> Naeim Semsarilar wrote:
> 
>> It's unclear to me how we should decide which interface to send an ARP 
>> request on. Let's say an IP packet destined for 192.168.130.12 arrives 
>> at the router and there are no entries for this address in the ARP 
>> cache. How should the router decide if the ARP request should be sent 
>> on eth0, eth1, or eth2?
>>
>> I think it was mentioned in the problem session that we should look up 
>> the destination IP in rtable and make a decision, but what if rtable 
>> only has the default entry at that point? Do we send the ARP request 
>> on all 3 interfaces in that case?
>>
>>
>> My second question is about the rtable file. The stuff in rtable is 
>> loaded into the routing_table member of struct sr_instance. When we 
>> need to grow the table, do we actually need to dump an updated rtable 
>> file?
>>
>> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Another ARP request question
Date: Sat, 28 Jan 2006 01:57:29 -0800
Lines: 4
Distribution: su
Message-ID: <drff6h$bf6$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9771

What is the router supposed to do with an ARP request for 192.168.130.11 
(which is the IP of eth1) received on eth0?

Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Another ARP request question
Date: Sat, 28 Jan 2006 02:39:14 -0800
Lines: 8
Distribution: su
Message-ID: <drfhkl$dk8$1@news.Stanford.EDU>
References: <drff6h$bf6$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drff6h$bf6$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9772

Drop the packet.  Only respond to an ARP request if was received on the 
interface it's asking about.

Naeim Semsarilar wrote:
> What is the router supposed to do with an ARP request for 192.168.130.11 
> (which is the IP of eth1) received on eth0?
> 
> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: "Roy Zeighami" <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Purify Question
Date: Sat, 28 Jan 2006 08:13:59 -0600
Lines: 11
Distribution: su
Message-ID: <drfu7d$qv1$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9773

Since sr never exits, how do we get purify info?  I am running purify 
remotely, so the output goes to a purify.output file.  Right now, the only 
way I can make the program exit is with a ctrl-C.  When I do that the output 
file has nothing interesting (just says it got a signal).  Has anyone 
figured a way to work around this?

Thanks,

Roy 


.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Another ARP request question
Date: Sat, 28 Jan 2006 11:06:19 -0800
Lines: 15
Distribution: su
Message-ID: <drgfbk$aih$1@news.Stanford.EDU>
References: <drff6h$bf6$1@news.Stanford.EDU> <drfhkl$dk8$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <drfhkl$dk8$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9774

OK. Does that mean I'll never be able to ping 192.168.130.11 from the 
Internet and get a reply? And how is it that I can get a reply pinging 
any interface of actual routers, like Gates-rtr?

Thanks.

Matt Falkenhagen wrote:
> Drop the packet.  Only respond to an ARP request if was received on the 
> interface it's asking about.
> 
> Naeim Semsarilar wrote:
>> What is the router supposed to do with an ARP request for 
>> 192.168.130.11 (which is the IP of eth1) received on eth0?
>>
>> Thanks.
.

Path: shelby.stanford.edu!elaine27.Stanford.EDU!wachs
From: Megan Anneke Wachs <wachs@stanford.edu>
Newsgroups: su.class.cs244a
Subject: tcpdump
Date: Sat, 28 Jan 2006 11:17:54 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.GSO.4.44.0601281116210.857-100000@elaine27.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9775

Has anyone gotten tcpdump to work? I keep getting permission denied (on
saga and elaine):

saga13:~/CS/244a/hw2/stub> /usr/class/cs244a/bin/tcpdump log
tcpdump: /dev/eri: Permission denied


Thanks in advance,
Megan

.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: tcpdump
Date: Sat, 28 Jan 2006 11:22:53 -0800
Lines: 12
Distribution: su
Message-ID: <drggac$big$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601281116210.857-100000@elaine27.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601281116210.857-100000@elaine27.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9776

-r log

> Has anyone gotten tcpdump to work? I keep getting permission denied (on
> saga and elaine):
> 
> saga13:~/CS/244a/hw2/stub> /usr/class/cs244a/bin/tcpdump log
> tcpdump: /dev/eri: Permission denied
> 
> 
> Thanks in advance,
> Megan
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Another ARP request question
Date: Sat, 28 Jan 2006 11:25:01 -0800
Lines: 29
Distribution: su
Message-ID: <drggec$big$2@news.Stanford.EDU>
References: <drff6h$bf6$1@news.Stanford.EDU> <drfhkl$dk8$1@news.Stanford.EDU> <drgfbk$aih$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drgfbk$aih$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9777


> OK. Does that mean I'll never be able to ping 192.168.130.11 from the 
> Internet and get a reply? 

no

And how is it that I can get a reply pinging
> any interface of actual routers, like Gates-rtr?

the ARP will be for the correct next-hop (the directly connected
interface)


>


> Thanks.
> 
> Matt Falkenhagen wrote:
> 
>> Drop the packet.  Only respond to an ARP request if was received on 
>> the interface it's asking about.
>>
>> Naeim Semsarilar wrote:
>>
>>> What is the router supposed to do with an ARP request for 
>>> 192.168.130.11 (which is the IP of eth1) received on eth0?
>>>
>>> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: byte ordering
Date: Sat, 28 Jan 2006 17:41:54 -0800
Lines: 3
Distribution: su
Message-ID: <drh6hb$2s$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9778

What is the byte ordering of field 'ip' in struct sr_if?

Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: "Nazia Zaman" <nazia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: icmp header struct
Date: Sat, 28 Jan 2006 22:04:02 -0800
Lines: 17
Distribution: su
Message-ID: <drhltd$bq6$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9779

So I include <netinet/ip_icmp.h> because I want to  use the defined icmp 
header,but I get these errors when I include the file:


In file included from sr_protocol.c:17:
/usr/include/netinet/ip_icmp.h:65: error: parse error before "n_short"
/usr/include/netinet/ip_icmp.h:72: error: parse error before "n_short"
/usr/include/netinet/ip_icmp.h:79: error: parse error before "n_short"
/usr/include/netinet/ip_icmp.h:81: error: parse error before '}' token
/usr/include/netinet/ip_icmp.h:91: error: parse error before "n_time"
/usr/include/netinet/ip_icmp.h:93: error: parse error before "its_ttime"
/usr/include/netinet/ip_icmp.h:101: error: parse error before '}' token
/usr/include/netinet/ip_icmp.h:108: error: parse error before '}' token

Any suggestions? 


.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: icmp header struct
Date: Sat, 28 Jan 2006 22:22:24 -0800
Lines: 23
Distribution: su
Message-ID: <drhmva$clk$1@news.Stanford.EDU>
References: <drhltd$bq6$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <drhltd$bq6$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9780

I made my own ICMP header struct. It's pretty straight forward. I used 
the provided structs as a template. Just don't forget the 'packed' 
attribute.


Nazia Zaman wrote:
> So I include <netinet/ip_icmp.h> because I want to  use the defined icmp 
> header,but I get these errors when I include the file:
> 
> 
> In file included from sr_protocol.c:17:
> /usr/include/netinet/ip_icmp.h:65: error: parse error before "n_short"
> /usr/include/netinet/ip_icmp.h:72: error: parse error before "n_short"
> /usr/include/netinet/ip_icmp.h:79: error: parse error before "n_short"
> /usr/include/netinet/ip_icmp.h:81: error: parse error before '}' token
> /usr/include/netinet/ip_icmp.h:91: error: parse error before "n_time"
> /usr/include/netinet/ip_icmp.h:93: error: parse error before "its_ttime"
> /usr/include/netinet/ip_icmp.h:101: error: parse error before '}' token
> /usr/include/netinet/ip_icmp.h:108: error: parse error before '}' token
> 
> Any suggestions? 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Sutthipong Thavisomboon" <sthavis@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Rtable file
Date: Sun, 29 Jan 2006 00:16:58 -0800
Lines: 9
Distribution: su
Message-ID: <drhtlp$l6n$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9781

Hi,

I read in the newsgroup that we should modify the rtable static file 
according to the assigned topology. I see the IP address in the email, 
however, I'm not sure what to put for mask?

Sutthipong 


.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!vijayk
From: Vijay K Kulkarni <vijayk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: grading script availale for hw2?
Date: Sun, 29 Jan 2006 01:09:33 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0601290107380.6844-100000@elaine4.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9782

Hi,

  is the grading script available for hw2 like it was for hw1? It did
really help that time in catching some silly errors.

thanks,
Vijay.

.

Path: shelby.stanford.edu!not-for-mail
From: Will Palmeri <wjp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: stanford routing
Date: Sun, 29 Jan 2006 01:10:33 -0800
Lines: 17
Distribution: su
Message-ID: <dri0pv$nf0$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9783

This was brought up in the discussion section, but I'd like to see it 
addressed.  I have an on-campus (Escondido Village) IP address that is 
in the 128.12 domain.  These IP's are treated as on-campus IP's for 
other Stanford services, however the EV router is NOT forwarding the 
192.168 packets to the rest of Stanford. This means that I cannot 
locally ping my sr router. I'm developing on my local machine, so this 
would be a big help for me.

Prof. McKeown skirted the issue of the 128.12 IP's in class...what's the 
  deal with them anyways?


Also, I found a great ARP FAQ online for anyone who is interested:
http://www.geocities.com/SiliconValley/Vista/8672/network/arp.html

Thanks for the help,
Will
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: icmp header struct
Date: Sun, 29 Jan 2006 01:32:19 -0800
Lines: 23
Distribution: su
Message-ID: <dri238$ogj$1@news.Stanford.EDU>
References: <drhltd$bq6$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drhltd$bq6$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9784

Try

#include <netinet/in_systm.h>
#include <netinet/ip_icmp.h>

Nazia Zaman wrote:
> So I include <netinet/ip_icmp.h> because I want to  use the defined icmp 
> header,but I get these errors when I include the file:
> 
> 
> In file included from sr_protocol.c:17:
> /usr/include/netinet/ip_icmp.h:65: error: parse error before "n_short"
> /usr/include/netinet/ip_icmp.h:72: error: parse error before "n_short"
> /usr/include/netinet/ip_icmp.h:79: error: parse error before "n_short"
> /usr/include/netinet/ip_icmp.h:81: error: parse error before '}' token
> /usr/include/netinet/ip_icmp.h:91: error: parse error before "n_time"
> /usr/include/netinet/ip_icmp.h:93: error: parse error before "its_ttime"
> /usr/include/netinet/ip_icmp.h:101: error: parse error before '}' token
> /usr/include/netinet/ip_icmp.h:108: error: parse error before '}' token
> 
> Any suggestions? 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: grading script availale for hw2?
Date: Sun, 29 Jan 2006 01:36:52 -0800
Lines: 11
Distribution: su
Message-ID: <dri2bo$oj6$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0601290107380.6844-100000@elaine4.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0601290107380.6844-100000@elaine4.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9785

nope, sorry.

Vijay K Kulkarni wrote:
> Hi,
> 
>   is the grading script available for hw2 like it was for hw1? It did
> really help that time in catching some silly errors.
> 
> thanks,
> Vijay.
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: byte ordering
Date: Sun, 29 Jan 2006 01:45:52 -0800
Lines: 6
Distribution: su
Message-ID: <dri2sm$p2m$1@news.Stanford.EDU>
References: <drh6hb$2s$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drh6hb$2s$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9786

network byte order

Naeim Semsarilar wrote:
> What is the byte ordering of field 'ip' in struct sr_if?
> 
> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Rtable file
Date: Sun, 29 Jan 2006 02:17:22 -0800
Lines: 22
Distribution: su
Message-ID: <dri4nn$r00$1@news.Stanford.EDU>
References: <drhtlp$l6n$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drhtlp$l6n$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9787

 From the way you phrased the question I'm not sure how to answer, but....

The rtable is just a list of rules for forwarding packets.  Your router 
reads in this list of rules.

Your toplogy email tells you how your router should forward packets to 
exactly two specific IP addresses (your app servers) and to the rest of 
the Internet.  Given that information, think about what rules you want 
in your rtable.

Ask again if it's not clear.

Sutthipong Thavisomboon wrote:
> Hi,
> 
> I read in the newsgroup that we should modify the rtable static file 
> according to the assigned topology. I see the IP address in the email, 
> however, I'm not sure what to put for mask?
> 
> Sutthipong 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Tahir Azim" <tazim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Queueing a requirement?
Date: Sun, 29 Jan 2006 02:22:30 -0800
Lines: 11
Distribution: su
Message-ID: <dri51b$r7g$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9788

Hi,

Just wanted to know... is it REQUIRED to store packets waiting for ARP 
responses in a queue (or queue-like data structure)? Can we maintain a 
handle to those packets some other way, such as in the arguments passed to 
the thread that is handling ARP responses for the packets?

Thanks
Tahir. 


.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Queueing a requirement?
Date: Sun, 29 Jan 2006 02:53:34 -0800
Lines: 15
Distribution: su
Message-ID: <dri6rj$sfj$1@news.Stanford.EDU>
References: <dri51b$r7g$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <dri51b$r7g$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9789

Nope, you can implement the queueing without a queue, but you need to 
perform all required functionality as described in the handout.

Tahir Azim wrote:
> Hi,
> 
> Just wanted to know... is it REQUIRED to store packets waiting for ARP 
> responses in a queue (or queue-like data structure)? Can we maintain a 
> handle to those packets some other way, such as in the arguments passed to 
> the thread that is handling ARP responses for the packets?
> 
> Thanks
> Tahir. 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Ramanan" <ramananr@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Padding ethernet frames
Date: Sun, 29 Jan 2006 03:55:07 -0800
Lines: 12
Distribution: su
Message-ID: <driaes$22b$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9790

Hi,

   When I send out ARP requests from my router and view the sent packet over 
ethereal, I see a 42-byte ethernet frame (14-bytes eth header + 28-byte arp 
message) without the extra padding. The FAQ says that we don't have to worry 
about adding the padding, so should I be worried that I'm sending out 
42-byte frames? Or is it just that the packets are written out to the 
log-file before the padding is added?

Ram 


.

Path: shelby.stanford.edu!not-for-mail
From: "Roy Zeighami" <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: IP packet, for me?
Date: Sun, 29 Jan 2006 10:42:55 -0600
Lines: 31
Distribution: su
Message-ID: <driraj$i9h$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9791

Hello...

I am trying to figure out how, when an IP datagram comes in, if its 
destination IP address is one of the routers IP addresses.  If I look in 
sr_if.h there is only one "get" function : Given an interface name get its 
struct sr_if.  This doesn't seem like what we need.  Am I missing something? 
Is there a way to ask "Do I have this IP address on any of my router 
interfaces"?

Also, I realize that we are given the interface name when an ethernet packet 
comes in, but this doesn't seem good enough.

By way of example, here is what I am getting at:

Say that, from elaine, we want to ping interface eth1 on the router.  At 
some point, eth0 (which is connected to the firewall) will get an ICMP 
packet destined for eth1.  Given that there isn't an entry in the routing 
table for eth1, the router could:

1) Drop the packet.
2) Handle it internally and respond out of interface eth0
3) Send it back out to the gateway

From the previous post, it seems like we should do number 2 but it seems 
like we need more information from the sr_if module.  Is that correct?

Thanks,

Roy 


.

Path: shelby.stanford.edu!not-for-mail
From: "Roy Zeighami" <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: IP packet, for me?
Date: Sun, 29 Jan 2006 11:09:56 -0600
Lines: 42
Distribution: su
Message-ID: <drist6$jfg$1@news.Stanford.EDU>
References: <driraj$i9h$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9792

I just wrote a function that walks the interface list.  I added to one of my 
files.

Thanks,

Roy


"Roy Zeighami" <zeighami@stanford.edu> wrote in message 
news:driraj$i9h$1@news.Stanford.EDU...
> Hello...
>
> I am trying to figure out how, when an IP datagram comes in, if its 
> destination IP address is one of the routers IP addresses.  If I look in 
> sr_if.h there is only one "get" function : Given an interface name get its 
> struct sr_if.  This doesn't seem like what we need.  Am I missing 
> something? Is there a way to ask "Do I have this IP address on any of my 
> router interfaces"?
>
> Also, I realize that we are given the interface name when an ethernet 
> packet comes in, but this doesn't seem good enough.
>
> By way of example, here is what I am getting at:
>
> Say that, from elaine, we want to ping interface eth1 on the router.  At 
> some point, eth0 (which is connected to the firewall) will get an ICMP 
> packet destined for eth1.  Given that there isn't an entry in the routing 
> table for eth1, the router could:
>
> 1) Drop the packet.
> 2) Handle it internally and respond out of interface eth0
> 3) Send it back out to the gateway
>
> From the previous post, it seems like we should do number 2 but it seems 
> like we need more information from the sr_if module.  Is that correct?
>
> Thanks,
>
> Roy
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Jens Pillgram-Larsen <jenspl@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Different routers coming in from going out
Date: Sun, 29 Jan 2006 13:32:42 -0800
Lines: 12
Distribution: su
Message-ID: <drjc9v$2tl$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9793

I'm seeing different routers coming in to going out from the elaine cluster.

Going out I'm seeing hpr1-rtr.stanford.edu, just as the slides from 
handout #3 say. When doing an incoming traceroute I see the router
16  dc-stan--svl-dc1-ge.cenic.net (137.164.23.38) as the router between 
Stanford and the outside network.

When doing host on this IP I only see one interface, so it is not a 
router. What is it, and how can I figure out the incoming IP for 
hpr1-rtr.stanford.edu?

Thanks, Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: "Nazia Zaman" <nazia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Ip check sum
Date: Sun, 29 Jan 2006 13:38:03 -0800
Lines: 11
Distribution: su
Message-ID: <drjcl2$31n$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9794

For sending an ICMP reply, I populate the ethernet header, and then the IP 
header, set the IP check sum to zero and then calculate the checksum for Ip 
using the algorithm given in Stevens, I pass it a pointer to the ip header 
and the ip_hdr->len field. However it calculates the wrong checksum, all the 
files are populated correctly when I check it in ethereal. After this I 
populate the ICMP fields, and calculate the ICMP checksum using the same 
method, and that gives the right check sum, what am I doing wrong?
Thanks,
Nazia 


.

Path: shelby.stanford.edu!not-for-mail
From: Sesha Narahari <narahari@stanford.edu>
Newsgroups: su.class.cs244a
Subject: vns connection problem
Date: Sun, 29 Jan 2006 15:15:17 -0800
Lines: 20
Distribution: su
Message-ID: <43DD4C85.7090905@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9795

I was able to connect a couple of times. After that, I get this error:

> elaine35:~/cs244a/hw2/stub> ./sr -t 73 -s vns1.stanford.edu
> Loading routing table
> ---------------------------------------------
> Destination     Gateway         Mask    Iface
> 0.0.0.0         172.24.74.17    0.0.0.0 eth0
> ---------------------------------------------
> Client narahari connecting to Server vns1.stanford.edu:12345
> Requesting topology 73
> gethostbyname:sr_client.c::sr_connect_to_server(..): Error 0


I lost my SSH session; could that be a reason? Can you help clear up my 
topology?

Thanks,
Sesha


.

Path: shelby.stanford.edu!not-for-mail
From: "Nazia Zaman" <nazia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Ip check sum
Date: Sun, 29 Jan 2006 15:39:32 -0800
Lines: 21
Distribution: su
Message-ID: <drjjou$90n$1@news.Stanford.EDU>
References: <drjcl2$31n$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:9796

Never mind, it is working now, but a weird thing that ethereal shows me is
that: there are 2 ping packets (when I ping my router on eth0), and the
router replies, so I get a ping reply, and then there is an ARP packet to
which the router replies fine, BUT there are no more ping packets, and there
are no more packets to and fro, even though the pinging should go on.

"Nazia Zaman" <nazia@stanford.edu> wrote in message 
news:drjcl2$31n$1@news.Stanford.EDU...
> For sending an ICMP reply, I populate the ethernet header, and then the IP 
> header, set the IP check sum to zero and then calculate the checksum for 
> Ip using the algorithm given in Stevens, I pass it a pointer to the ip 
> header and the ip_hdr->len field. However it calculates the wrong 
> checksum, all the files are populated correctly when I check it in 
> ethereal. After this I populate the ICMP fields, and calculate the ICMP 
> checksum using the same method, and that gives the right check sum, what 
> am I doing wrong?
> Thanks,
> Nazia
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Ramanan" <ramananr@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Ip check sum
Date: Sun, 29 Jan 2006 15:46:15 -0800
Lines: 24
Distribution: su
Message-ID: <drjk49$9a8$1@news.Stanford.EDU>
References: <drjcl2$31n$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:9797

Hi Nazia,

   The IP checksum should be calculated only for the header, not the entire 
IP packet. I think using ip_hdr->ip_hl (which gives the header length) 
instead of ip_hdr->ip_len might solve your problem

Ram


"Nazia Zaman" <nazia@stanford.edu> wrote in message 
news:drjcl2$31n$1@news.Stanford.EDU...
> For sending an ICMP reply, I populate the ethernet header, and then the IP 
> header, set the IP check sum to zero and then calculate the checksum for 
> Ip using the algorithm given in Stevens, I pass it a pointer to the ip 
> header and the ip_hdr->len field. However it calculates the wrong 
> checksum, all the files are populated correctly when I check it in 
> ethereal. After this I populate the ICMP fields, and calculate the ICMP 
> checksum using the same method, and that gives the right check sum, what 
> am I doing wrong?
> Thanks,
> Nazia
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Sesha Narahari <narahari@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: vns connection problem
Date: Sun, 29 Jan 2006 19:13:17 -0800
Lines: 28
Distribution: su
Message-ID: <43DD844D.4020508@stanford.edu>
References: <43DD4C85.7090905@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9798

Never mind. I was using vns1 instead of vns-1.

Thanks,
Sesha

Sesha Narahari wrote:
> I was able to connect a couple of times. After that, I get this error:
> 
>> elaine35:~/cs244a/hw2/stub> ./sr -t 73 -s vns1.stanford.edu
>> Loading routing table
>> ---------------------------------------------
>> Destination     Gateway         Mask    Iface
>> 0.0.0.0         172.24.74.17    0.0.0.0 eth0
>> ---------------------------------------------
>> Client narahari connecting to Server vns1.stanford.edu:12345
>> Requesting topology 73
>> gethostbyname:sr_client.c::sr_connect_to_server(..): Error 0
> 
> 
> 
> I lost my SSH session; could that be a reason? Can you help clear up my 
> topology?
> 
> Thanks,
> Sesha
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Nazia Zaman" <nazia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Arp cache
Date: Sun, 29 Jan 2006 19:28:38 -0800
Lines: 11
Distribution: su
Message-ID: <drk16i$jif$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9799

Just a few clarifications:
1) The arp cache should just contain IP to MAC mappings right? Or should we 
have things like subnet mask and interface too like Solaris does.

2) An entry should be added to the cache when
a ) an ARP request is received (a mapping from source ip to source MAC)
b )an ARP reply is received ( a mapping from source ip to source MAC)

Both a and b or just b, or am I missing the point completely. 


.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: slides from review section
Date: Sun, 29 Jan 2006 21:15:36 -0800
Lines: 3
Distribution: su
Message-ID: <drk7do$ou1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9800

Where can I find slides from review sessions?

--Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: slides from review section
Date: Sun, 29 Jan 2006 21:22:21 -0800
Lines: 6
Distribution: su
Message-ID: <drk7qj$pna$1@news.Stanford.EDU>
References: <drk7do$ou1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drk7do$ou1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9801

They are on the website, under Schedule, Handouts, & Homeworks.

Michi Mutsuzaki wrote:
> Where can I find slides from review sessions?
> 
> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Arp cache
Date: Sun, 29 Jan 2006 23:37:23 -0800
Lines: 19
Distribution: su
Message-ID: <drkftf$39c$1@news.Stanford.EDU>
References: <drk16i$jif$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.9 (X11/20041124)
X-Accept-Language: en-us, en
In-Reply-To: <drk16i$jif$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9802

The arp cache only needs to have IP to MAC mappings, since you can 
figure out the interface from the IP, but it doesn't hurt to store the 
interface there too. You definitely need to add an entry to the arp 
cache in case B, and you may optionally add an entry in case A as well.

Ari

Nazia Zaman wrote:
> Just a few clarifications:
> 1) The arp cache should just contain IP to MAC mappings right? Or should we 
> have things like subnet mask and interface too like Solaris does.
> 
> 2) An entry should be added to the cache when
> a ) an ARP request is received (a mapping from source ip to source MAC)
> b )an ARP reply is received ( a mapping from source ip to source MAC)
> 
> Both a and b or just b, or am I missing the point completely. 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Padding ethernet frames
Date: Sun, 29 Jan 2006 23:44:51 -0800
Lines: 18
Distribution: su
Message-ID: <drkgbg$49g$1@news.Stanford.EDU>
References: <driaes$22b$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.9 (X11/20041124)
X-Accept-Language: en-us, en
In-Reply-To: <driaes$22b$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9803

You don't have to worry about this. Your assumption that the packets are 
written to the log-file before padding occurs is correct.

Ari

Ramanan wrote:
> Hi,
> 
>    When I send out ARP requests from my router and view the sent packet over 
> ethereal, I see a 42-byte ethernet frame (14-bytes eth header + 28-byte arp 
> message) without the extra padding. The FAQ says that we don't have to worry 
> about adding the padding, so should I be worried that I'm sending out 
> 42-byte frames? Or is it just that the packets are written out to the 
> log-file before the padding is added?
> 
> Ram 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: stanford routing
Date: Mon, 30 Jan 2006 00:36:34 -0800
Lines: 15
Distribution: su
Message-ID: <43DDD012.7070708@cs.stanford.edu>
References: <dri0pv$nf0$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
To: Will Palmeri <wjp@stanford.edu>
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <dri0pv$nf0$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9804

Will Palmeri wrote:
> This was brought up in the discussion section, but I'd like to see it 
> addressed.  I have an on-campus (Escondido Village) IP address that is 
> in the 128.12 domain.  These IP's are treated as on-campus IP's for 
> other Stanford services, however the EV router is NOT forwarding the 
> 192.168 packets to the rest of Stanford. This means that I cannot 
> locally ping my sr router. I'm developing on my local machine, so this 
> would be a big help for me.
> 

We have little control over routes throughout campus.  You will need to
run your clients from one of the clusters.  That is ssh then ping, 
traceroute and wget to your hearts content.

..m
.

Path: shelby.stanford.edu!not-for-mail
From: Will Palmeri <wjp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ICMP protocol
Date: Mon, 30 Jan 2006 13:23:54 -0800
Lines: 11
Distribution: su
Message-ID: <drm04u$n8r$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9805

When our router receives an ICMP echo request, is it safe to assume we 
can just send the reply back out of the interface we received the 
request on to the previous hop?  Or should we consult the routing table 
for the correct hop, ARP'ing for the eth address if necessary?

Also, can we make the assumption that the routing table is sorted from 
most specific to least specific (e.g. if you use hierarchical masks in a 
more populated topology)?

Thanks,
Will
.

Path: shelby.stanford.edu!not-for-mail
From: "Nazia Zaman" <nazia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ICMP port unreachable
Date: Mon, 30 Jan 2006 16:02:09 -0800
Lines: 16
Distribution: su
Message-ID: <drm9ea$3p5$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9806

Hi,
Whenever I receive a TCP/UDP port and its destination address is the same as 
that of the ip address of my router, I send out an ICMP port unreachable 
packet. In that packet, I set the code and type equal to 3 as specified in 
the protocol and don't set any other parameters apart from the checksum. And 
I send it back from the interface it was received on (eth0 in this case 
because I am testing this by ftping to eth0 of the router) . The packet gets 
sent to the firewall correctly, however the firewall should send the ICMP 
host unreachable packet to the ftp client right? But the tcp packets keep 
coming in, and my router keeps sending port unreachable, what is going wrong 
here? Shouldn't the ftp client disconnect by saying no route to host or 
something? Why isn't it doing that! :(

Thanks, 


.

Path: shelby.stanford.edu!not-for-mail
From: "Sutthipong Thavisomboon" <sthavis@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: icmp header struct
Date: Mon, 30 Jan 2006 17:21:18 -0800
Lines: 37
Distribution: su
Message-ID: <drme2c$8jq$1@news.Stanford.EDU>
References: <drhltd$bq6$1@news.Stanford.EDU> <dri238$ogj$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9807

I tried to include both headers,
> #include <netinet/in_systm.h>
> #include <netinet/ip_icmp.h>

However, I got this error.

/usr/include/netinet/ip_icmp.h:96: error: field `idi_ip' has incomplete type

Anybody has any idea what I did wrong?

Sutthipong

"Matt Falkenhagen" <mjf@stanford.edu> wrote in message 
news:dri238$ogj$1@news.Stanford.EDU...
> Try
>
> #include <netinet/in_systm.h>
> #include <netinet/ip_icmp.h>
>
> Nazia Zaman wrote:
>> So I include <netinet/ip_icmp.h> because I want to  use the defined icmp 
>> header,but I get these errors when I include the file:
>>
>>
>> In file included from sr_protocol.c:17:
>> /usr/include/netinet/ip_icmp.h:65: error: parse error before "n_short"
>> /usr/include/netinet/ip_icmp.h:72: error: parse error before "n_short"
>> /usr/include/netinet/ip_icmp.h:79: error: parse error before "n_short"
>> /usr/include/netinet/ip_icmp.h:81: error: parse error before '}' token
>> /usr/include/netinet/ip_icmp.h:91: error: parse error before "n_time"
>> /usr/include/netinet/ip_icmp.h:93: error: parse error before "its_ttime"
>> /usr/include/netinet/ip_icmp.h:101: error: parse error before '}' token
>> /usr/include/netinet/ip_icmp.h:108: error: parse error before '}' token
>>
>> Any suggestions? 


.

Path: shelby.stanford.edu!not-for-mail
From: "Roy Zeighami" <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ICMP Destination Unreachable payload
Date: Mon, 30 Jan 2006 21:13:26 -0600
Lines: 10
Distribution: su
Message-ID: <drmkku$lh2$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9808

The RFC for ICMP says that, for a destination unreachable ICMP message, we 
should return the original IP header and the first 64 bits of the payload. 
Is an IP packet always guaranteed to have at least 64 bits of data in the 
payload?

Thanks,

Roy 


.

Path: shelby.stanford.edu!not-for-mail
From: "Ramanan" <ramananr@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Router dies on SIGALRM
Date: Mon, 30 Jan 2006 20:28:58 -0800
Lines: 16
Distribution: su
Message-ID: <drmp2d$he4$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9809

Hi TAs,

   I seem to have a strange problem with the router. When I'm attempting to 
route traffic, occassionally, my router prints out an 'Alarm clock' message 
and exits. Googling it I found that this is the default handler for the 
SIGALRM signal which is generated when a timer or alarm() is used. But I've 
not used timers or alarms in my code. The closest thing I have is usleep(), 
which I use to make the thread that sends a ARP request wait a while before 
checking if a reply was received. Is there any way I can find out why this 
is happening? Or is it something that's happening in the stub code? I found 
something about alarm() in the comments at the top of  sr_vns_comm.c, so I'm 
wondering if this has anything to do with that. Thanks in advance,

Ram 


.

Path: shelby.stanford.edu!not-for-mail
From: "Bruce Schechter" <bruceds@stanford.edu>
Newsgroups: su.class.cs244a
Subject: warning from gcc
Date: Mon, 30 Jan 2006 21:07:52 -0800
Lines: 51
Distribution: su
Message-ID: <drmrbc$q27$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9810


When I compile I get the following warning...



   elaine43:~/244/p2> make

   gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_router.c -o sr_router.o

   In file included from sr_if.h:20,

                 from sr_router.c:18:

   /usr/include/sys/int_types.h:9: warning: ignoring #pragma ident

   gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_main.c -o sr_main.o

   gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_if.c -o sr_if.o

   gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_rt.c -o sr_rt.o

   gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_vns_comm.c -o 
sr_vns_comm.o

   gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_dumper.c -o sr_dumper.o

   gcc -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ -o sr sr_router.o sr_main.o

   sr_if.o sr_rt.o  sr_vns_comm.o sr_dumper.o -lnsl -lsocket -lresolv -lm



Meanwhile, lines 19-21 of sr_if.h (the source of the warning) are...

#ifdef _SOLARIS_

#include </usr/include/sys/int_types.h>

#endif /* SOLARIS */



Any suggestions why I get this warning and how to eliminate it?



Thanks

-- Bruce


.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP protocol
Date: Mon, 30 Jan 2006 21:32:19 -0800
Lines: 21
Distribution: su
Message-ID: <drmslt$1c4$1@news.Stanford.EDU>
References: <drm04u$n8r$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <drm04u$n8r$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9811


> When our router receives an ICMP echo request, is it safe to assume we 
> can just send the reply back out of the interface we received the 
> request on to the previous hop?  Or should we consult the routing table 
> for the correct hop, ARP'ing for the eth address if necessary?
> 
the latter

> Also, can we make the assumption that the routing table is sorted from 
> most specific to least specific (e.g. if you use hierarchical masks in a 
> more populated topology)?
> 

You can assume that the default route is the last entry.  Don't worry
about longest prefix match, either it will match a routing entry or the
default.

..m

> Thanks,
> Will
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP port unreachable
Date: Mon, 30 Jan 2006 21:33:37 -0800
Lines: 27
Distribution: su
Message-ID: <drmsob$1c4$2@news.Stanford.EDU>
References: <drm9ea$3p5$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <drm9ea$3p5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9812


test with ping:

[casado@nity ~]$ ping 192.168.130.23
PING 192.168.130.23 (192.168.130.23) 56(84) bytes of data.
 From 172.24.74.11 icmp_seq=0 Destination Host Unreachable
 From 172.24.74.11 icmp_seq=1 Destination Host Unreachable
 From 172.24.74.11 icmp_seq=2 Destination Host Unreachable

..m

> Hi,
> Whenever I receive a TCP/UDP port and its destination address is the same as 
> that of the ip address of my router, I send out an ICMP port unreachable 
> packet. In that packet, I set the code and type equal to 3 as specified in 
> the protocol and don't set any other parameters apart from the checksum. And 
> I send it back from the interface it was received on (eth0 in this case 
> because I am testing this by ftping to eth0 of the router) . The packet gets 
> sent to the firewall correctly, however the firewall should send the ICMP 
> host unreachable packet to the ftp client right? But the tcp packets keep 
> coming in, and my router keeps sending port unreachable, what is going wrong 
> here? Shouldn't the ftp client disconnect by saying no route to host or 
> something? Why isn't it doing that! :(
> 
> Thanks, 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: warning from gcc
Date: Mon, 30 Jan 2006 21:35:36 -0800
Lines: 54
Distribution: su
Message-ID: <drmss2$1c4$3@news.Stanford.EDU>
References: <drmrbc$q27$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <drmrbc$q27$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9813


  Yeah .. that started popping up recently.  Feel free to ignore it


> When I compile I get the following warning...
> 
> 
> 
>    elaine43:~/244/p2> make
> 
>    gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_router.c -o sr_router.o
> 
>    In file included from sr_if.h:20,
> 
>                  from sr_router.c:18:
> 
>    /usr/include/sys/int_types.h:9: warning: ignoring #pragma ident
> 
>    gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_main.c -o sr_main.o
> 
>    gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_if.c -o sr_if.o
> 
>    gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_rt.c -o sr_rt.o
> 
>    gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_vns_comm.c -o 
> sr_vns_comm.o
> 
>    gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_dumper.c -o sr_dumper.o
> 
>    gcc -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ -o sr sr_router.o sr_main.o
> 
>    sr_if.o sr_rt.o  sr_vns_comm.o sr_dumper.o -lnsl -lsocket -lresolv -lm
> 
> 
> 
> Meanwhile, lines 19-21 of sr_if.h (the source of the warning) are...
> 
> #ifdef _SOLARIS_
> 
> #include </usr/include/sys/int_types.h>
> 
> #endif /* SOLARIS */
> 
> 
> 
> Any suggestions why I get this warning and how to eliminate it?
> 
> 
> 
> Thanks
> 
> -- Bruce
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Router dies on SIGALRM
Date: Mon, 30 Jan 2006 21:36:05 -0800
Lines: 19
Distribution: su
Message-ID: <drmssu$1c4$4@news.Stanford.EDU>
References: <drmp2d$he4$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <drmp2d$he4$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9814


No idea, is anyone else getting this?

> Hi TAs,
> 
>    I seem to have a strange problem with the router. When I'm attempting to 
> route traffic, occassionally, my router prints out an 'Alarm clock' message 
> and exits. Googling it I found that this is the default handler for the 
> SIGALRM signal which is generated when a timer or alarm() is used. But I've 
> not used timers or alarms in my code. The closest thing I have is usleep(), 
> which I use to make the thread that sends a ARP request wait a while before 
> checking if a reply was received. Is there any way I can find out why this 
> is happening? Or is it something that's happening in the stub code? I found 
> something about alarm() in the comments at the top of  sr_vns_comm.c, so I'm 
> wondering if this has anything to do with that. Thanks in advance,
> 
> Ram 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP Destination Unreachable payload
Date: Mon, 30 Jan 2006 21:44:23 -0800
Lines: 20
Distribution: su
Message-ID: <drmtcn$4eu$1@news.Stanford.EDU>
References: <drmkku$lh2$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <drmkku$lh2$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9815

Roy Zeighami wrote:
> The RFC for ICMP says that, for a destination unreachable ICMP message, we 
> should return the original IP header and the first 64 bits of the payload. 
> Is an IP packet always guaranteed to have at least 64 bits of data in the 
> payload?
>

I'm not sure, though it is hard to conceive of a smaller, non-malicious 
  packet.  The minimum ip fragment size is 8 bytes.  And UDP header (much
smaller than TCP) are 64 bits. Your packet shouldn't crash however if
it receives a malformed packet

..m


> Thanks,
> 
> Roy 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: warning from gcc
Date: Mon, 30 Jan 2006 22:33:53 -0800
Lines: 66
Distribution: su
Message-ID: <drn0cg$g0q$1@news.Stanford.EDU>
References: <drmrbc$q27$1@news.Stanford.EDU> <drmss2$1c4$3@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:9816

If you add -Wno-unknown-pragmas to your CFLAGS, the pragma warning should go
away.

Waynn

"Martin Casado" <casado@cs.stanford.edu> wrote in message
news:drmss2$1c4$3@news.Stanford.EDU...
>
>   Yeah .. that started popping up recently.  Feel free to ignore it
>
>
> > When I compile I get the following warning...
> >
> >
> >
> >    elaine43:~/244/p2> make
> >
> >    gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_router.c -o
sr_router.o
> >
> >    In file included from sr_if.h:20,
> >
> >                  from sr_router.c:18:
> >
> >    /usr/include/sys/int_types.h:9: warning: ignoring #pragma ident
> >
> >    gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_main.c -o sr_main.o
> >
> >    gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_if.c -o sr_if.o
> >
> >    gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_rt.c -o sr_rt.o
> >
> >    gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_vns_comm.c -o
> > sr_vns_comm.o
> >
> >    gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_dumper.c -o
sr_dumper.o
> >
> >    gcc -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ -o sr sr_router.o sr_main.o
> >
> >    sr_if.o sr_rt.o  sr_vns_comm.o
sr_dumper.o -lnsl -lsocket -lresolv -lm
> >
> >
> >
> > Meanwhile, lines 19-21 of sr_if.h (the source of the warning) are...
> >
> > #ifdef _SOLARIS_
> >
> > #include </usr/include/sys/int_types.h>
> >
> > #endif /* SOLARIS */
> >
> >
> >
> > Any suggestions why I get this warning and how to eliminate it?
> >
> >
> >
> > Thanks
> >
> > -- Bruce
> >
> >


.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ARP Request / Queue / Cache
Date: Mon, 30 Jan 2006 22:49:52 -0800
Lines: 36
Distribution: su
Message-ID: <drn1ai$jkm$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9817

I'm still having trouble seeing a big picture of ARP request/queue/
cache. Please tell me if I'm getting it right:

###
The router needs to know the hardware address of next hop.

The router looks up the cache.

If the hardware address is in the cache and is not expired:

    Use it.

else:

    Enqueue the original packet.

    Send ARP request to all the interfaces except the one
    that received the original packet.

    If it doesn't receive reply within certain amount of
    time, resend request (up to 5 times).

    When you receive reply, find the corresponding packet
    in the queue and send it. Update cache.

At the same time, periodically check for expired packet
in the queue.
###

So I'm thinking that sending (possibly up to) 6 ARP requests should be 
done in one thread, and there should be another thread for checking 
the queue for expired packet (maybe use timestamp to keep track of 
timeouts). Or is there a better way to implement it?

Any comment would be appreciated,
--Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: icmp header struct
Date: Mon, 30 Jan 2006 23:31:43 -0800
Lines: 52
Distribution: su
Message-ID: <drn3p8$m$1@news.Stanford.EDU>
References: <drhltd$bq6$1@news.Stanford.EDU> <dri238$ogj$1@news.Stanford.EDU> <drme2c$8jq$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drme2c$8jq$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9818

Yeah you sort of have to play around till you get it to work.

idi_ip has type struct ip which is defined in sr_protocol.h, so try moving

#include <netinet/in_systm.h>
#include <netinet/ip_icmp.h>

below the #include "sr_protocol.h"

Sutthipong Thavisomboon wrote:
> I tried to include both headers,
> 
>>#include <netinet/in_systm.h>
>>#include <netinet/ip_icmp.h>
> 
> 
> However, I got this error.
> 
> /usr/include/netinet/ip_icmp.h:96: error: field `idi_ip' has incomplete type
> 
> Anybody has any idea what I did wrong?
> 
> Sutthipong
> 
> "Matt Falkenhagen" <mjf@stanford.edu> wrote in message 
> news:dri238$ogj$1@news.Stanford.EDU...
> 
>>Try
>>
>>#include <netinet/in_systm.h>
>>#include <netinet/ip_icmp.h>
>>
>>Nazia Zaman wrote:
>>
>>>So I include <netinet/ip_icmp.h> because I want to  use the defined icmp 
>>>header,but I get these errors when I include the file:
>>>
>>>
>>>In file included from sr_protocol.c:17:
>>>/usr/include/netinet/ip_icmp.h:65: error: parse error before "n_short"
>>>/usr/include/netinet/ip_icmp.h:72: error: parse error before "n_short"
>>>/usr/include/netinet/ip_icmp.h:79: error: parse error before "n_short"
>>>/usr/include/netinet/ip_icmp.h:81: error: parse error before '}' token
>>>/usr/include/netinet/ip_icmp.h:91: error: parse error before "n_time"
>>>/usr/include/netinet/ip_icmp.h:93: error: parse error before "its_ttime"
>>>/usr/include/netinet/ip_icmp.h:101: error: parse error before '}' token
>>>/usr/include/netinet/ip_icmp.h:108: error: parse error before '}' token
>>>
>>>Any suggestions? 
> 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP Request / Queue / Cache
Date: Tue, 31 Jan 2006 00:09:10 -0800
Lines: 7
Distribution: su
Message-ID: <drn5v9$7rm$1@news.Stanford.EDU>
References: <drn1ai$jkm$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <drn1ai$jkm$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9819

Michi Mutsuzaki wrote:
>    Send ARP request to all the interfaces except the one
>    that received the original packet.

No, it should send an ARP request out *only* on the interface that the 
next hop is connected to, determined from the routing table.

.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP Request / Queue / Cache
Date: Tue, 31 Jan 2006 00:16:21 -0800
Lines: 53
Distribution: su
Message-ID: <drn6cq$ac0$1@news.Stanford.EDU>
References: <drn1ai$jkm$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <drn1ai$jkm$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9820

To elaborate, when an IP packet comes in, the router must look at the 
destination IP, determine the next hop IP and the outgoing interface 
from the routing table based on the destination IP, and look up the 
hardware address of the next hop in the ARP cache.

The outgoing packet must have the correct hardware address set in its 
ethernet header. If a cache entry doesn't exist, the router must send 
out an ARP request on the interface that the next hop is connected to 
and queue the packet. When the reply comes back, it caches the reply, 
sets the destination hardware address in the ethernet header of the 
packet, and sends the packet out. Meanwhile it must send ARPs five times 
within the time limit and send back ICMP host unreachable if necessary.

That's my understanding.


Michi Mutsuzaki wrote:
> I'm still having trouble seeing a big picture of ARP request/queue/
> cache. Please tell me if I'm getting it right:
> 
> ###
> The router needs to know the hardware address of next hop.
> 
> The router looks up the cache.
> 
> If the hardware address is in the cache and is not expired:
> 
>    Use it.
> 
> else:
> 
>    Enqueue the original packet.
> 
>    Send ARP request to all the interfaces except the one
>    that received the original packet.
> 
>    If it doesn't receive reply within certain amount of
>    time, resend request (up to 5 times).
> 
>    When you receive reply, find the corresponding packet
>    in the queue and send it. Update cache.
> 
> At the same time, periodically check for expired packet
> in the queue.
> ###
> 
> So I'm thinking that sending (possibly up to) 6 ARP requests should be 
> done in one thread, and there should be another thread for checking the 
> queue for expired packet (maybe use timestamp to keep track of 
> timeouts). Or is there a better way to implement it?
> 
> Any comment would be appreciated,
> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: alex qi <alexqi@stanford.edu>
Newsgroups: su.class.cs244a
Subject: No reply at first
Date: Tue, 31 Jan 2006 01:31:42 -0800
Lines: 2
Distribution: su
Message-ID: <drnapt$q1m$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9821

Is it normal when I try to ping router from another machine, it shows 
"no reply" for couple of times before receiving the ARP reply from router?
.

Path: shelby.stanford.edu!not-for-mail
From: "Tahir Azim" <tazim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Router dies on SIGALRM
Date: Tue, 31 Jan 2006 01:59:27 -0800
Lines: 31
Distribution: su
Message-ID: <drnce7$2rn$1@news.Stanford.EDU>
References: <drmp2d$he4$1@news.Stanford.EDU> <drmssu$1c4$4@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9822

I'm getting the exact same problem, although it only appears when the router 
is in the middle of handling a lot of traffic. It seems to disappear when I 
use sleep() instead of usleep(). The only problem, then, is that sleep() 
cannot 'sleep' for less than 1 second. Is 1 second a reasonable time to wait 
for an ARP response? If it is, a couple of pings get lost every 15 seconds, 
as ping expects to get a response in less than a second.

Tahir.

"Martin Casado" <casado@cs.stanford.edu> wrote in message 
news:drmssu$1c4$4@news.Stanford.EDU...
>
> No idea, is anyone else getting this?
>
>> Hi TAs,
>>
>>    I seem to have a strange problem with the router. When I'm attempting 
>> to route traffic, occassionally, my router prints out an 'Alarm clock' 
>> message and exits. Googling it I found that this is the default handler 
>> for the SIGALRM signal which is generated when a timer or alarm() is 
>> used. But I've not used timers or alarms in my code. The closest thing I 
>> have is usleep(), which I use to make the thread that sends a ARP request 
>> wait a while before checking if a reply was received. Is there any way I 
>> can find out why this is happening? Or is it something that's happening 
>> in the stub code? I found something about alarm() in the comments at the 
>> top of  sr_vns_comm.c, so I'm wondering if this has anything to do with 
>> that. Thanks in advance,
>>
>> Ram 


.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: No reply at first
Date: Tue, 31 Jan 2006 09:23:32 -0800
Lines: 5
Distribution: su
Message-ID: <dro6bb$heb$1@news.Stanford.EDU>
References: <drnapt$q1m$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <drnapt$q1m$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9823

alex qi wrote:
> Is it normal when I try to ping router from another machine, it shows 
> "no reply" for couple of times before receiving the ARP reply from router?

no, that's bad.  You shouldn't be dropping any packets on a normal ping
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Router dies on SIGALRM
Date: Tue, 31 Jan 2006 09:34:41 -0800
Lines: 45
Distribution: su
Message-ID: <43DF9FB1.5040903@cs.stanford.edu>
References: <drmp2d$he4$1@news.Stanford.EDU> <drmssu$1c4$4@news.Stanford.EDU> <drnce7$2rn$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
To: Tahir Azim <tazim@stanford.edu>
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <drnce7$2rn$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9824

Hmm. can you try something for me?  Replace usleep with this egregious 
hack and let me know if it works:

int my_usleep(long  usec )
{
     struct timeval delay;

     delay.tv_sec = usec / 1000000L;
     delay.tv_usec = usec % 1000000L;

     /* -- 0 if OK, else -1 */
     return select( 0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &delay );
}


> I'm getting the exact same problem, although it only appears when the router 
> is in the middle of handling a lot of traffic. It seems to disappear when I 
> use sleep() instead of usleep(). The only problem, then, is that sleep() 
> cannot 'sleep' for less than 1 second. Is 1 second a reasonable time to wait 
> for an ARP response? If it is, a couple of pings get lost every 15 seconds, 
> as ping expects to get a response in less than a second.
> 
> Tahir.
> 
> "Martin Casado" <casado@cs.stanford.edu> wrote in message 
> news:drmssu$1c4$4@news.Stanford.EDU...
>> No idea, is anyone else getting this?
>>
>>> Hi TAs,
>>>
>>>    I seem to have a strange problem with the router. When I'm attempting 
>>> to route traffic, occassionally, my router prints out an 'Alarm clock' 
>>> message and exits. Googling it I found that this is the default handler 
>>> for the SIGALRM signal which is generated when a timer or alarm() is 
>>> used. But I've not used timers or alarms in my code. The closest thing I 
>>> have is usleep(), which I use to make the thread that sends a ARP request 
>>> wait a while before checking if a reply was received. Is there any way I 
>>> can find out why this is happening? Or is it something that's happening 
>>> in the stub code? I found something about alarm() in the comments at the 
>>> top of  sr_vns_comm.c, so I'm wondering if this has anything to do with 
>>> that. Thanks in advance,
>>>
>>> Ram 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: TTL
Date: Tue, 31 Jan 2006 10:25:47 -0800
Lines: 5
Distribution: su
Message-ID: <droa3a$kv1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9825

The spec says that the router sends an ICMP timeout message if TTL of 
the arriving packet is one or zero. Why does the packet expire when 
TTL is one?

--Michi
.

Path: shelby.stanford.edu!not-for-mail
From: alex qi <alexqi@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test for arp request
Date: Tue, 31 Jan 2006 11:59:33 -0800
Lines: 6
Distribution: su
Message-ID: <drofj7$qkv$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9826

After router gets ping
How do we tell whether the router has sent a ARP reply package 
successfully back to the firewall? If router gets a IP package after 
sening a ARP reply package, does that mean ARP reply succeed?

thanks
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test for arp request
Date: Tue, 31 Jan 2006 12:18:17 -0800
Lines: 10
Distribution: su
Message-ID: <drogm8$s5n$1@news.Stanford.EDU>
References: <drofj7$qkv$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drofj7$qkv$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9827

alex qi wrote:
> After router gets ping
> How do we tell whether the router has sent a ARP reply package 
> successfully back to the firewall? If router gets a IP package after 
> sening a ARP reply package, does that mean ARP reply succeed?
> 

I'd say thats a pretty good indication

> thanks3
.

Path: shelby.stanford.edu!not-for-mail
From: "Nazia Zaman" <nazia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP port unreachable
Date: Tue, 31 Jan 2006 15:48:28 -0800
Lines: 37
Distribution: su
Message-ID: <drot0j$ctd$1@news.Stanford.EDU>
References: <drm9ea$3p5$1@news.Stanford.EDU> <drmsob$1c4$2@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:9828

But we are supposed to implement ICMP echo reply with our router so my 
router replies when I ping it. How do I check if my ICMP port not reachable 
message works, because FTP to my router's eth0 says no route to host only 
when TCP times out. (Which takes pretty long).
Thanks,
Nazia

"Martin Casado" <casado@cs.stanford.edu> wrote in message 
news:drmsob$1c4$2@news.Stanford.EDU...
>
> test with ping:
>
> [casado@nity ~]$ ping 192.168.130.23
> PING 192.168.130.23 (192.168.130.23) 56(84) bytes of data.
> From 172.24.74.11 icmp_seq=0 Destination Host Unreachable
> From 172.24.74.11 icmp_seq=1 Destination Host Unreachable
> From 172.24.74.11 icmp_seq=2 Destination Host Unreachable
>
> .m
>
>> Hi,
>> Whenever I receive a TCP/UDP port and its destination address is the same 
>> as that of the ip address of my router, I send out an ICMP port 
>> unreachable packet. In that packet, I set the code and type equal to 3 as 
>> specified in the protocol and don't set any other parameters apart from 
>> the checksum. And I send it back from the interface it was received on 
>> (eth0 in this case because I am testing this by ftping to eth0 of the 
>> router) . The packet gets sent to the firewall correctly, however the 
>> firewall should send the ICMP host unreachable packet to the ftp client 
>> right? But the tcp packets keep coming in, and my router keeps sending 
>> port unreachable, what is going wrong here? Shouldn't the ftp client 
>> disconnect by saying no route to host or something? Why isn't it doing 
>> that! :(
>>
>> Thanks, 


.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP port unreachable
Date: Tue, 31 Jan 2006 15:52:29 -0800
Lines: 43
Distribution: su
Message-ID: <drot7r$d21$1@news.Stanford.EDU>
References: <drm9ea$3p5$1@news.Stanford.EDU> <drmsob$1c4$2@news.Stanford.EDU> <drot0j$ctd$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drot0j$ctd$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9829

this should require a really minor modification to your router for
testing purposes (which you'll obviously remove when testing ICMP echo)


> But we are supposed to implement ICMP echo reply with our router so my 
> router replies when I ping it. How do I check if my ICMP port not reachable 
> message works, because FTP to my router's eth0 says no route to host only 
> when TCP times out. (Which takes pretty long).
> Thanks,
> Nazia
> 
> "Martin Casado" <casado@cs.stanford.edu> wrote in message 
> news:drmsob$1c4$2@news.Stanford.EDU...
> 
>>test with ping:
>>
>>[casado@nity ~]$ ping 192.168.130.23
>>PING 192.168.130.23 (192.168.130.23) 56(84) bytes of data.
>>From 172.24.74.11 icmp_seq=0 Destination Host Unreachable
>>From 172.24.74.11 icmp_seq=1 Destination Host Unreachable
>>From 172.24.74.11 icmp_seq=2 Destination Host Unreachable
>>
>>.m
>>
>>
>>>Hi,
>>>Whenever I receive a TCP/UDP port and its destination address is the same 
>>>as that of the ip address of my router, I send out an ICMP port 
>>>unreachable packet. In that packet, I set the code and type equal to 3 as 
>>>specified in the protocol and don't set any other parameters apart from 
>>>the checksum. And I send it back from the interface it was received on 
>>>(eth0 in this case because I am testing this by ftping to eth0 of the 
>>>router) . The packet gets sent to the firewall correctly, however the 
>>>firewall should send the ICMP host unreachable packet to the ftp client 
>>>right? But the tcp packets keep coming in, and my router keeps sending 
>>>port unreachable, what is going wrong here? Shouldn't the ftp client 
>>>disconnect by saying no route to host or something? Why isn't it doing 
>>>that! :(
>>>
>>>Thanks, 
> 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: TTL
Date: Tue, 31 Jan 2006 16:36:58 -0800
Lines: 13
Distribution: su
Message-ID: <drovrj$gdr$1@news.Stanford.EDU>
References: <droa3a$kv1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <droa3a$kv1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9830

It makes sense.  If a packet with TTL = 1 is forwarded to the next hop, 
it shouldn't get past that next hop.  So if you get a packet with TTL = 
1, don't forward it anymore.

So no one is really supposed to forward packets with TTL = 0, but if you 
get one, don't forward it anymore either.

Michi Mutsuzaki wrote:
> The spec says that the router sends an ICMP timeout message if TTL of 
> the arriving packet is one or zero. Why does the packet expire when TTL 
> is one?
> 
> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Will Palmeri <wjp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: icmp error messages
Date: Tue, 31 Jan 2006 17:43:51 -0800
Lines: 8
Distribution: su
Message-ID: <drp3ob$m0k$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9831

ICMP error messages contain the header (code,type,and checksum) plus an 
un-used byte and then the original IP header and first 8 bytes of payload.

Is the checksum computed over just the header or the entire ICMP packet? 
  Some online resources are giving conflicting answers.

Thanks,
Will
.

Path: shelby.stanford.edu!not-for-mail
From: Will Palmeri <wjp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: icmp error messages
Date: Tue, 31 Jan 2006 17:45:03 -0800
Lines: 11
Distribution: su
Message-ID: <drp3qi$m0k$2@news.Stanford.EDU>
References: <drp3ob$m0k$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
In-Reply-To: <drp3ob$m0k$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9832

(i mean an unused/zero'd word)

Will Palmeri wrote:
> ICMP error messages contain the header (code,type,and checksum) plus an 
> un-used byte and then the original IP header and first 8 bytes of payload.
> 
> Is the checksum computed over just the header or the entire ICMP packet? 
>  Some online resources are giving conflicting answers.
> 
> Thanks,
> Will
.

Path: shelby.stanford.edu!not-for-mail
From: "Tahir Azim" <tazim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Router dies on SIGALRM
Date: Tue, 31 Jan 2006 19:33:32 -0800
Lines: 57
Distribution: su
Message-ID: <drpa6k$s57$1@news.Stanford.EDU>
References: <drmp2d$he4$1@news.Stanford.EDU> <drmssu$1c4$4@news.Stanford.EDU> <drnce7$2rn$1@news.Stanford.EDU> <43DF9FB1.5040903@cs.stanford.edu>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:9833

Yes, it does get rid of the SIGALRM problem. But its not clear that the 
system really does sleep for the right amount of time or if it sleeps for a 
longer period of time. Maybe its just that my design is a little 
inefficient.

Thanks,
Tahir.


"Martin Casado" <casado@cs.stanford.edu> wrote in message 
news:43DF9FB1.5040903@cs.stanford.edu...
> Hmm. can you try something for me?  Replace usleep with this egregious 
> hack and let me know if it works:
>
> int my_usleep(long  usec )
> {
>     struct timeval delay;
>
>     delay.tv_sec = usec / 1000000L;
>     delay.tv_usec = usec % 1000000L;
>
>     /* -- 0 if OK, else -1 */
>     return select( 0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &delay );
> }
>
>
>> I'm getting the exact same problem, although it only appears when the 
>> router is in the middle of handling a lot of traffic. It seems to 
>> disappear when I use sleep() instead of usleep(). The only problem, then, 
>> is that sleep() cannot 'sleep' for less than 1 second. Is 1 second a 
>> reasonable time to wait for an ARP response? If it is, a couple of pings 
>> get lost every 15 seconds, as ping expects to get a response in less than 
>> a second.
>>
>> Tahir.
>>
>> "Martin Casado" <casado@cs.stanford.edu> wrote in message 
>> news:drmssu$1c4$4@news.Stanford.EDU...
>>> No idea, is anyone else getting this?
>>>
>>>> Hi TAs,
>>>>
>>>>    I seem to have a strange problem with the router. When I'm 
>>>> attempting to route traffic, occassionally, my router prints out an 
>>>> 'Alarm clock' message and exits. Googling it I found that this is the 
>>>> default handler for the SIGALRM signal which is generated when a timer 
>>>> or alarm() is used. But I've not used timers or alarms in my code. The 
>>>> closest thing I have is usleep(), which I use to make the thread that 
>>>> sends a ARP request wait a while before checking if a reply was 
>>>> received. Is there any way I can find out why this is happening? Or is 
>>>> it something that's happening in the stub code? I found something about 
>>>> alarm() in the comments at the top of  sr_vns_comm.c, so I'm wondering 
>>>> if this has anything to do with that. Thanks in advance,
>>>>
>>>> Ram
>> 

.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ARP Poisoning Defense
Date: Tue, 31 Jan 2006 20:05:47 -0800
Organization: Stanford University
Lines: 6
Distribution: su
Message-ID: <20060131200547.0d6bb682@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9834

It is my understanding that most host operating systems will accept an
ARP reply even if no ARP request has been sent out for that address. 
This requires less state to be kept, which make implementation simpler. 
Is it okay for us to use this same strategy, or must we only accept ARP
replies that correspond to requests that we have made (thereby defending
against the "ARP Poisoning" attack)?
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP Poisoning Defense
Date: Tue, 31 Jan 2006 20:48:24 -0800
Lines: 11
Distribution: su
Message-ID: <drpein$36k$1@news.Stanford.EDU>
References: <20060131200547.0d6bb682@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060131200547.0d6bb682@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9835

No need to keep track of pending ARP requests. Your router,
along with pretty much every other operating system will be
vulnerable to poisening via gratuitous arps, and thats ok with me ;-)


> It is my understanding that most host operating systems will accept an
> ARP reply even if no ARP request has been sent out for that address. 
> This requires less state to be kept, which make implementation simpler. 
> Is it okay for us to use this same strategy, or must we only accept ARP
> replies that correspond to requests that we have made (thereby defending
> against the "ARP Poisoning" attack)?
.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Spoofed IPs?  Spoofed MACs?
Date: Tue, 31 Jan 2006 20:50:50 -0800
Organization: Stanford University
Lines: 12
Distribution: su
Message-ID: <20060131205050.14ef1742@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9836

How should we respond to IP packets whose source address does not appear
to match the interface that it arrives on?  For example, if we get a
packet that claims to be from an application server, but arrives on the
firewall interface.

When receiving an ARP request, should we assume (without checking) that
the source IP address and source MAC are correct?  And should we assume
that the computer waiting for a response is on the same interface that
ARP request was received from?

Finally, for non-ARP frames, should we bother checking the MAC address
to make sure it is legitimate, or just ignore it?
.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Thread Synchronization and Thread Safety
Date: Tue, 31 Jan 2006 20:56:56 -0800
Organization: Stanford University
Lines: 9
Distribution: su
Message-ID: <20060131205656.05add102@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9837

If we implement timeouts with threads, is it okay to use mutexes to
synchronize all of our operations?  Can you provide any references for
pthreads programming on Solaris (especially Solaris-specific pitfalls)?

How thread-safe are sr_send_packet and the loop that calls
sr_handlepacket?  Can I simultaneously receive from one thread and send
from another?  How about sending simultaneously from two threads?

And how come there is no second underscore in sr_handlepacket?
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Spoofed IPs?  Spoofed MACs?
Date: Tue, 31 Jan 2006 21:04:14 -0800
Lines: 20
Distribution: su
Message-ID: <drpfgd$42h$1@news.Stanford.EDU>
References: <20060131205050.14ef1742@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060131205050.14ef1742@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9838


> How should we respond to IP packets whose source address does not appear
> to match the interface that it arrives on?  For example, if we get a
> packet that claims to be from an application server, but arrives on the
> firewall interface.

forward it as normal, you should never check source address


> When receiving an ARP request, should we assume (without checking) that
> the source IP address and source MAC are correct?  And should we assume
> that the computer waiting for a response is on the same interface that
> ARP request was received from?

yup and yup

> Finally, for non-ARP frames, should we bother checking the MAC address
> to make sure it is legitimate, or just ignore it?

you don't have to check
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Thread Synchronization and Thread Safety
Date: Tue, 31 Jan 2006 21:09:28 -0800
Lines: 19
Distribution: su
Message-ID: <drpfq7$4ep$1@news.Stanford.EDU>
References: <20060131205656.05add102@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060131205656.05add102@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9839


> If we implement timeouts with threads, is it okay to use mutexes to
> synchronize all of our operations?  Can you provide any references for
> pthreads programming on Solaris (especially Solaris-specific pitfalls)?

mutex are fine
pthreads -> man pthread_create(..) ?
I don't think there should be any pitfals

> How thread-safe are sr_send_packet and the loop that calls
> sr_handlepacket?  Can I simultaneously receive from one thread and send
> from another?  How about sending simultaneously from two threads?

both should be fine, most importantly, the sending function is thread safe


> And how come there is no second underscore in sr_handlepacket?

:-P
.

Path: shelby.stanford.edu!not-for-mail
From: "Ramanan" <ramananr@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Router dies on SIGALRM
Date: Tue, 31 Jan 2006 22:34:54 -0800
Lines: 53
Distribution: su
Message-ID: <drpkqi$9od$1@news.Stanford.EDU>
References: <drmp2d$he4$1@news.Stanford.EDU> <drmssu$1c4$4@news.Stanford.EDU> <drnce7$2rn$1@news.Stanford.EDU> <43DF9FB1.5040903@cs.stanford.edu>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9840

The problem seems to have been solved by using your code. Thanks a lot :)

Ram


"Martin Casado" <casado@cs.stanford.edu> wrote in message 
news:43DF9FB1.5040903@cs.stanford.edu...
> Hmm. can you try something for me?  Replace usleep with this egregious 
> hack and let me know if it works:
>
> int my_usleep(long  usec )
> {
>     struct timeval delay;
>
>     delay.tv_sec = usec / 1000000L;
>     delay.tv_usec = usec % 1000000L;
>
>     /* -- 0 if OK, else -1 */
>     return select( 0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &delay );
> }
>
>
>> I'm getting the exact same problem, although it only appears when the 
>> router is in the middle of handling a lot of traffic. It seems to 
>> disappear when I use sleep() instead of usleep(). The only problem, then, 
>> is that sleep() cannot 'sleep' for less than 1 second. Is 1 second a 
>> reasonable time to wait for an ARP response? If it is, a couple of pings 
>> get lost every 15 seconds, as ping expects to get a response in less than 
>> a second.
>>
>> Tahir.
>>
>> "Martin Casado" <casado@cs.stanford.edu> wrote in message 
>> news:drmssu$1c4$4@news.Stanford.EDU...
>>> No idea, is anyone else getting this?
>>>
>>>> Hi TAs,
>>>>
>>>>    I seem to have a strange problem with the router. When I'm 
>>>> attempting to route traffic, occassionally, my router prints out an 
>>>> 'Alarm clock' message and exits. Googling it I found that this is the 
>>>> default handler for the SIGALRM signal which is generated when a timer 
>>>> or alarm() is used. But I've not used timers or alarms in my code. The 
>>>> closest thing I have is usleep(), which I use to make the thread that 
>>>> sends a ARP request wait a while before checking if a reply was 
>>>> received. Is there any way I can find out why this is happening? Or is 
>>>> it something that's happening in the stub code? I found something about 
>>>> alarm() in the comments at the top of  sr_vns_comm.c, so I'm wondering 
>>>> if this has anything to do with that. Thanks in advance,
>>>>
>>>> Ram
>> 

.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: File and Function Naming
Date: Tue, 31 Jan 2006 22:40:07 -0800
Organization: Stanford University
Lines: 3
Distribution: su
Message-ID: <20060131224007.1b2bd198@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9841

For the "style" part of the grade, do you want us to name all of our
files and functions starting with "sr_"?  Is there some other prefix you
would rather have us use?  I was considering "mr_" for "My Router".
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: File and Function Naming
Date: Tue, 31 Jan 2006 22:43:20 -0800
Lines: 10
Distribution: su
Message-ID: <drpla6$a0j$1@news.Stanford.EDU>
References: <20060131224007.1b2bd198@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060131224007.1b2bd198@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9842


> For the "style" part of the grade, do you want us to name all of our
> files and functions starting with "sr_"?  

nope

Is there some other prefix you
> would rather have us use?  I was considering "mr_" for "My Router".

sounds good
.

Path: shelby.stanford.edu!not-for-mail
From: Will Palmeri <wjp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: thread library?
Date: Wed, 01 Feb 2006 00:58:30 -0800
Lines: 7
Distribution: su
Message-ID: <drpt7a$lbp$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9843

What threading library can we use and still comply to ANSI C?  I was 
under the impression that pthread (as some others have mentioned) is 
POSIX. Or is there a solaris-specific library we should use? (Which 
would be unfortunate for those of us developing on other flavors of *nix)

Thanks,
Will
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: thread library?
Date: Wed, 01 Feb 2006 02:07:26 -0800
Lines: 13
Distribution: su
Message-ID: <drq198$pak$1@news.Stanford.EDU>
References: <drpt7a$lbp$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drpt7a$lbp$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9844

Strictly speaking, there is no ANSI C threading library :-P

Yes, pthreads is POSIX (where the p comes from).  You should use 
pthreads for maximum portability.

Will Palmeri wrote:
> What threading library can we use and still comply to ANSI C?  I was 
> under the impression that pthread (as some others have mentioned) is 
> POSIX. Or is there a solaris-specific library we should use? (Which 
> would be unfortunate for those of us developing on other flavors of *nix)
> 
> Thanks,
> Will
.

Path: shelby.stanford.edu!not-for-mail
From: "Bruce Schechter" <bruceds@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sr_router.h
Date: Wed, 1 Feb 2006 09:55:09 -0800
Lines: 6
Distribution: su
Message-ID: <drqslu$ll3$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Xref: shelby.stanford.edu su.class.cs244a:9845

The assignment page says "We ask that you do not modify any of the provided 
files, except for sr_router.c."  I just want to be clear...  we cannot 
modify sr_router.h ?
cheers, Bruce 


.

Path: shelby.stanford.edu!not-for-mail
From: Will Palmeri <wjp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: queued packets
Date: Wed, 01 Feb 2006 14:02:01 -0800
Lines: 12
Distribution: su
Message-ID: <drrb4d$894$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9846

If we have multiple packets queued for the same destination (which would 
probably happen if the host goes down), should we send out 5 ARP 
requests for each packet before dropping?  Or should all the packets be 
dropped after 5 total ARP requests?  This would seem to make sense and 
create less "noise" on the network, but would violate the spirit of 
independence of packets.

Similarly, if we decide a host is unreachable, should we send 1 ICMP 
unreachable msg, or 1 for each queued packet?

Thanks,
Will
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sr_router.h
Date: Wed, 01 Feb 2006 14:13:45 -0800
Lines: 11
Distribution: su
Message-ID: <drrbqo$8sr$1@news.Stanford.EDU>
References: <drqslu$ll3$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drqslu$ll3$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9847

This is something you'll want to clear with us before doing.  It makes 
grading harder and if you are not careful can break grading and test.

Generally the rule is don't muck with files other than sr_router.c

> The assignment page says "We ask that you do not modify any of the provided 
> files, except for sr_router.c."  I just want to be clear...  we cannot 
> modify sr_router.h ?
> cheers, Bruce 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: queued packets
Date: Wed, 01 Feb 2006 14:16:04 -0800
Lines: 18
Distribution: su
Message-ID: <drrbv3$8sr$2@news.Stanford.EDU>
References: <drrb4d$894$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drrb4d$894$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9848


> If we have multiple packets queued for the same destination (which would 
> probably happen if the host goes down), should we send out 5 ARP 
> requests for each packet before dropping?  Or should all the packets be 
> dropped after 5 total ARP requests?  This would seem to make sense and 
> create less "noise" on the network, but would violate the spirit of 
> independence of packets.

your choice, either is OK from a functionality standpoint.  Be sure to
justify your decision in the README

> Similarly, if we decide a host is unreachable, should we send 1 ICMP 
> unreachable msg, or 1 for each queued packet?

Send one per packet

> Thanks,
> Will
.

Path: shelby.stanford.edu!not-for-mail
From: "Bruce Schechter" <bruceds@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sr_router.h
Date: Wed, 1 Feb 2006 14:28:47 -0800
Lines: 15
Distribution: su
Message-ID: <drrcn1$a8n$1@news.Stanford.EDU>
References: <drqslu$ll3$1@news.Stanford.EDU> <drrbqo$8sr$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Xref: shelby.stanford.edu su.class.cs244a:9849

That's fine.   Just wanted to be clear.  Thanks, Bruce

"Martin Casado" <casado@cs.stanford.edu> wrote in message 
news:drrbqo$8sr$1@news.Stanford.EDU...
> This is something you'll want to clear with us before doing.  It makes 
> grading harder and if you are not careful can break grading and test.
>
> Generally the rule is don't muck with files other than sr_router.c
>
>> The assignment page says "We ask that you do not modify any of the 
>> provided files, except for sr_router.c."  I just want to be clear...  we 
>> cannot modify sr_router.h ?
>> cheers, Bruce 


.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sr_router.h
Date: Wed, 1 Feb 2006 14:50:14 -0800
Organization: Stanford University
Lines: 26
Distribution: su
Message-ID: <20060201145014.69b33f8b@ballpoint>
References: <drqslu$ll3$1@news.Stanford.EDU>
	<drrbqo$8sr$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9850

You might want to change the FAQ then:

  Which files in the stub code can I modify?

  The only files in the provided source that you may modify are
  sr_router.h and sr_router.c (this does not include bugfixes). You may,
  however, add your own files and update the Makefile to support them.

I am adding prototypes for all of my funcions to sr_router.h, and I was
going to put a pointer to my ARP cache in sr_instance.  Are those okay?


On Wed, 01 Feb 2006 14:13:45 -0800
Martin Casado <casado@cs.stanford.edu> wrote:

> This is something you'll want to clear with us before doing.  It makes 
> grading harder and if you are not careful can break grading and test.
> 
> Generally the rule is don't muck with files other than sr_router.c
> 
> > The assignment page says "We ask that you do not modify any of the provided 
> > files, except for sr_router.c."  I just want to be clear...  we cannot 
> > modify sr_router.h ?
> > cheers, Bruce 
> > 
> > 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sr_router.h
Date: Wed, 01 Feb 2006 16:24:13 -0800
Lines: 43
Distribution: su
Message-ID: <drrjfc$ica$1@news.Stanford.EDU>
References: <drqslu$ll3$1@news.Stanford.EDU>	<drrbqo$8sr$1@news.Stanford.EDU> <20060201145014.69b33f8b@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060201145014.69b33f8b@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9851

Perhaps I wasn't clear:

We want to actively discourage students from modifying the
provided source files.  It makes grading difficult.  Unless
there is a functional change you require (e.g. signal handlin
or bug fixes), don't change them.

Adding to sr_instance is OK, this is a defficiency in our design.
You are right, we should update the FAQ to say "only add changes to 
sr_router.[c,h]".

thanks :)
..martin


> You might want to change the FAQ then:
> 
>   Which files in the stub code can I modify?
> 
>   The only files in the provided source that you may modify are
>   sr_router.h and sr_router.c (this does not include bugfixes). You may,
>   however, add your own files and update the Makefile to support them.
> 
> I am adding prototypes for all of my funcions to sr_router.h, and I was
> going to put a pointer to my ARP cache in sr_instance.  Are those okay?
> 
> 
> On Wed, 01 Feb 2006 14:13:45 -0800
> Martin Casado <casado@cs.stanford.edu> wrote:
> 
> 
>>This is something you'll want to clear with us before doing.  It makes 
>>grading harder and if you are not careful can break grading and test.
>>
>>Generally the rule is don't muck with files other than sr_router.c
>>
>>
>>>The assignment page says "We ask that you do not modify any of the provided 
>>>files, except for sr_router.c."  I just want to be clear...  we cannot 
>>>modify sr_router.h ?
>>>cheers, Bruce 
>>>
>>>
.

Path: shelby.stanford.edu!not-for-mail
From: Jens Pillgram-Larsen <jenspl@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Modifying structures in sr_protocol.h
Date: Wed, 01 Feb 2006 18:09:06 -0800
Lines: 42
Distribution: su
Message-ID: <drrpk2$og4$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9852

TA's,

I really want to add a field to each of your structures in 
sr_protocol.h. This field would be a data field, to easily retrieve the 
encapsulated data from each packet.

I.e. for the IP struct:

struct ip
   {
#if __BYTE_ORDER == __LITTLE_ENDIAN
     unsigned int ip_hl:4;		/* header length */
     unsigned int ip_v:4;		/* version */
#elif __BYTE_ORDER == __BIG_ENDIAN
     unsigned int ip_v:4;		/* version */
     unsigned int ip_hl:4;		/* header length */
#else
#error "Byte ordering not specified "
#endif
     uint8_t ip_tos;			/* type of service */
     uint16_t ip_len;			/* total length */
     uint16_t ip_id;			/* identification */
     uint16_t ip_off;			/* fragment offset field */
#define	IP_RF 0x8000			/* reserved fragment flag */
#define	IP_DF 0x4000			/* dont fragment flag */
#define	IP_MF 0x2000			/* more fragments flag */
#define	IP_OFFMASK 0x1fff		/* mask for fragmenting bits */
     uint8_t ip_ttl;			/* time to live */
     uint8_t ip_p;			/* protocol */
     uint16_t ip_sum;			/* checksum */
     struct in_addr ip_src, ip_dst;	/* source and dest address */
     uint8_t data;			/* Encapsulated data */
   } __attribute__ ((packed)) ;

Now to get at the data ( e.g. an icmp header ) all you would have to do is:

icmp_hdr = ( struct sr_icmphdr * )&(ip_hdr->data);

This is much easier than mucking around with pointer arithmetic. Is it 
ok to do this for the 3 structs in sr_protocol.h?

Thanks, Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: Jens Pillgram-Larsen <jenspl@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Inconsistency with ip addresses in the stub code
Date: Wed, 01 Feb 2006 18:24:58 -0800
Lines: 8
Distribution: su
Message-ID: <drrqhr$pk5$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9853

In sr_arphdr in sr_protocol.h the IP addresses are represented as 
uint32_t's. In the struct ip in the same file IP addresses are 
represented as struct in_addr, which is just a struct with a single 
Uint32. Which of these should we use when representing IP addresses in 
the code? Is it possible to get these consistent so that we know what 
format an IP address is in when we are writing the code?

Thanks, Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: Ryan Matthew Smith <rysmi@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ICMP port unreachable
Date: Thu, 2 Feb 2006 02:26:16 +0000 (UTC)
Lines: 43
Distribution: su
Message-ID: <drrqk8$p6o$1@news.Stanford.EDU>
References: <drm9ea$3p5$1@news.Stanford.EDU> <drmsob$1c4$2@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.6.12.6smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:9854

hi -- 

if i try what you suggest on my os x laptop, ping just sits quietly. 

if i try what you suggest on one of the elaine machines, ping displays
the "Destination Host Unreachable" message you show here. 

i think this is just a difference in the way the ping program is
written, since (for example) ftp from laptop to to my router will return 
"connection refused" immediately. 

thanks, 
ryan. 


Martin Casado <casado@cs.stanford.edu> wrote:

> test with ping:

> [casado@nity ~]$ ping 192.168.130.23
> PING 192.168.130.23 (192.168.130.23) 56(84) bytes of data.
>  From 172.24.74.11 icmp_seq=0 Destination Host Unreachable
>  From 172.24.74.11 icmp_seq=1 Destination Host Unreachable
>  From 172.24.74.11 icmp_seq=2 Destination Host Unreachable

> .m

>> Hi,
>> Whenever I receive a TCP/UDP port and its destination address is the same as 
>> that of the ip address of my router, I send out an ICMP port unreachable 
>> packet. In that packet, I set the code and type equal to 3 as specified in 
>> the protocol and don't set any other parameters apart from the checksum. And 
>> I send it back from the interface it was received on (eth0 in this case 
>> because I am testing this by ftping to eth0 of the router) . The packet gets 
>> sent to the firewall correctly, however the firewall should send the ICMP 
>> host unreachable packet to the ftp client right? But the tcp packets keep 
>> coming in, and my router keeps sending port unreachable, what is going wrong 
>> here? Shouldn't the ftp client disconnect by saying no route to host or 
>> something? Why isn't it doing that! :(
>> 
>> Thanks, 
>> 
>> 
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sr_router.h
Date: Wed, 01 Feb 2006 19:02:37 -0800
Lines: 53
Distribution: su
Message-ID: <drrsof$rrm$1@news.Stanford.EDU>
References: <drqslu$ll3$1@news.Stanford.EDU>	<drrbqo$8sr$1@news.Stanford.EDU> <20060201145014.69b33f8b@ballpoint> <drrjfc$ica$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <drrjfc$ica$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9855

I was going to add a struct for ICMP headers in sr_protocol.h and some 
helper functions in sr_rt.c/h and sr_if.c/h. Is this not acceptable?

I can throw these additions in a separate file that I create I guess, 
but I think style-wise they belong in sr_rt and sr_if.

Thanks.


Martin Casado wrote:
> Perhaps I wasn't clear:
> 
> We want to actively discourage students from modifying the
> provided source files.  It makes grading difficult.  Unless
> there is a functional change you require (e.g. signal handlin
> or bug fixes), don't change them.
> 
> Adding to sr_instance is OK, this is a defficiency in our design.
> You are right, we should update the FAQ to say "only add changes to 
> sr_router.[c,h]".
> 
> thanks :)
> .martin
> 
> 
>> You might want to change the FAQ then:
>>
>>   Which files in the stub code can I modify?
>>
>>   The only files in the provided source that you may modify are
>>   sr_router.h and sr_router.c (this does not include bugfixes). You may,
>>   however, add your own files and update the Makefile to support them.
>>
>> I am adding prototypes for all of my funcions to sr_router.h, and I was
>> going to put a pointer to my ARP cache in sr_instance.  Are those okay?
>>
>>
>> On Wed, 01 Feb 2006 14:13:45 -0800
>> Martin Casado <casado@cs.stanford.edu> wrote:
>>
>>
>>> This is something you'll want to clear with us before doing.  It 
>>> makes grading harder and if you are not careful can break grading and 
>>> test.
>>>
>>> Generally the rule is don't muck with files other than sr_router.c
>>>
>>>
>>>> The assignment page says "We ask that you do not modify any of the 
>>>> provided files, except for sr_router.c."  I just want to be 
>>>> clear...  we cannot modify sr_router.h ?
>>>> cheers, Bruce
>>>>
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Byte ordering
Date: Wed, 01 Feb 2006 19:06:38 -0800
Lines: 8
Distribution: su
Message-ID: <drrt01$s1v$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9856

Hi,

Just to clarify, what is the byte-ordering of the fields in the packet 
buffer passed in sr_handlepacket, and what byte-ordering should the 
packet that we pass to sr_send_packet be? I'm thinking the answer to 
both is network order, but please clarify.

Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sr_router.h
Date: Wed, 01 Feb 2006 20:15:18 -0800
Lines: 57
Distribution: su
Message-ID: <drs10l$2ld$1@news.Stanford.EDU>
References: <drqslu$ll3$1@news.Stanford.EDU>	<drrbqo$8sr$1@news.Stanford.EDU> <20060201145014.69b33f8b@ballpoint> <drrjfc$ica$1@news.Stanford.EDU> <drrsof$rrm$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drrsof$rrm$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9857

Put them in a different file plz


> I was going to add a struct for ICMP headers in sr_protocol.h and some 
> helper functions in sr_rt.c/h and sr_if.c/h. Is this not acceptable?
> 
> I can throw these additions in a separate file that I create I guess, 
> but I think style-wise they belong in sr_rt and sr_if.
> 
> Thanks.
> 
> 
> Martin Casado wrote:
> 
>> Perhaps I wasn't clear:
>>
>> We want to actively discourage students from modifying the
>> provided source files.  It makes grading difficult.  Unless
>> there is a functional change you require (e.g. signal handlin
>> or bug fixes), don't change them.
>>
>> Adding to sr_instance is OK, this is a defficiency in our design.
>> You are right, we should update the FAQ to say "only add changes to 
>> sr_router.[c,h]".
>>
>> thanks :)
>> .martin
>>
>>
>>> You might want to change the FAQ then:
>>>
>>>   Which files in the stub code can I modify?
>>>
>>>   The only files in the provided source that you may modify are
>>>   sr_router.h and sr_router.c (this does not include bugfixes). You may,
>>>   however, add your own files and update the Makefile to support them.
>>>
>>> I am adding prototypes for all of my funcions to sr_router.h, and I was
>>> going to put a pointer to my ARP cache in sr_instance.  Are those okay?
>>>
>>>
>>> On Wed, 01 Feb 2006 14:13:45 -0800
>>> Martin Casado <casado@cs.stanford.edu> wrote:
>>>
>>>
>>>> This is something you'll want to clear with us before doing.  It 
>>>> makes grading harder and if you are not careful can break grading 
>>>> and test.
>>>>
>>>> Generally the rule is don't muck with files other than sr_router.c
>>>>
>>>>
>>>>> The assignment page says "We ask that you do not modify any of the 
>>>>> provided files, except for sr_router.c."  I just want to be 
>>>>> clear...  we cannot modify sr_router.h ?
>>>>> cheers, Bruce
>>>>>
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Modifying structures in sr_protocol.h
Date: Wed, 01 Feb 2006 20:15:45 -0800
Lines: 44
Distribution: su
Message-ID: <drs11f$2ld$2@news.Stanford.EDU>
References: <drrpk2$og4$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drrpk2$og4$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9858

put it in a different file plz.

> TA's,
> 
> I really want to add a field to each of your structures in 
> sr_protocol.h. This field would be a data field, to easily retrieve the 
> encapsulated data from each packet.
> 
> I.e. for the IP struct:
> 
> struct ip
>   {
> #if __BYTE_ORDER == __LITTLE_ENDIAN
>     unsigned int ip_hl:4;        /* header length */
>     unsigned int ip_v:4;        /* version */
> #elif __BYTE_ORDER == __BIG_ENDIAN
>     unsigned int ip_v:4;        /* version */
>     unsigned int ip_hl:4;        /* header length */
> #else
> #error "Byte ordering not specified "
> #endif
>     uint8_t ip_tos;            /* type of service */
>     uint16_t ip_len;            /* total length */
>     uint16_t ip_id;            /* identification */
>     uint16_t ip_off;            /* fragment offset field */
> #define    IP_RF 0x8000            /* reserved fragment flag */
> #define    IP_DF 0x4000            /* dont fragment flag */
> #define    IP_MF 0x2000            /* more fragments flag */
> #define    IP_OFFMASK 0x1fff        /* mask for fragmenting bits */
>     uint8_t ip_ttl;            /* time to live */
>     uint8_t ip_p;            /* protocol */
>     uint16_t ip_sum;            /* checksum */
>     struct in_addr ip_src, ip_dst;    /* source and dest address */
>     uint8_t data;            /* Encapsulated data */
>   } __attribute__ ((packed)) ;
> 
> Now to get at the data ( e.g. an icmp header ) all you would have to do is:
> 
> icmp_hdr = ( struct sr_icmphdr * )&(ip_hdr->data);
> 
> This is much easier than mucking around with pointer arithmetic. Is it 
> ok to do this for the 3 structs in sr_protocol.h?
> 
> Thanks, Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Inconsistency with ip addresses in the stub code
Date: Wed, 01 Feb 2006 20:18:42 -0800
Lines: 18
Distribution: su
Message-ID: <drs171$2ld$3@news.Stanford.EDU>
References: <drrqhr$pk5$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drrqhr$pk5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9859

Yeah, that is pretty annoying.  This file has been handed down over 3 
generations of sr (long before my time).

Can you make the changes?
else I'll get to it at some point.

thanks for pointing this out,
..martin


> In sr_arphdr in sr_protocol.h the IP addresses are represented as 
> uint32_t's. In the struct ip in the same file IP addresses are 
> represented as struct in_addr, which is just a struct with a single 
> Uint32. Which of these should we use when representing IP addresses in 
> the code? Is it possible to get these consistent so that we know what 
> format an IP address is in when we are writing the code?
> 
> Thanks, Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Byte ordering
Date: Wed, 01 Feb 2006 20:19:43 -0800
Lines: 12
Distribution: su
Message-ID: <drs18t$2ld$4@news.Stanford.EDU>
References: <drrt01$s1v$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drrt01$s1v$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9860



> Hi,
> 
> Just to clarify, what is the byte-ordering of the fields in the packet 
> buffer passed in sr_handlepacket, and what byte-ordering should the 
> packet that we pass to sr_send_packet be? I'm thinking the answer to 
> both is network order, but please clarify.

yup

> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Jens Pillgram-Larsen <jenspl@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Inconsistency with ip addresses in the stub code
Date: Wed, 01 Feb 2006 21:57:10 -0800
Lines: 24
Distribution: su
Message-ID: <drs6vn$8dt$1@news.Stanford.EDU>
References: <drrqhr$pk5$1@news.Stanford.EDU> <drs171$2ld$3@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <drs171$2ld$3@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9861

I will make them all uint32_t's since I now have to have all my structs 
in a separate file since I want my uint8_t data fields in them. No biggie.

Jens.

Martin Casado wrote:
> Yeah, that is pretty annoying.  This file has been handed down over 3 
> generations of sr (long before my time).
> 
> Can you make the changes?
> else I'll get to it at some point.
> 
> thanks for pointing this out,
> .martin
> 
> 
>> In sr_arphdr in sr_protocol.h the IP addresses are represented as 
>> uint32_t's. In the struct ip in the same file IP addresses are 
>> represented as struct in_addr, which is just a struct with a single 
>> Uint32. Which of these should we use when representing IP addresses in 
>> the code? Is it possible to get these consistent so that we know what 
>> format an IP address is in when we are writing the code?
>>
>> Thanks, Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: "Krishna Monian" <kmonian@stanford.edu>
Newsgroups: su.class.cs244a
Subject: 2 thread models
Date: Wed, 1 Feb 2006 22:04:05 -0800
Lines: 27
Distribution: su
Message-ID: <drs7d3$8qd$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9862

Hi,
I have 2 thread models to handle the ARP replies.

1) The main thread adds the pending packet to a list, and the 2nd thread 
keeps checking each packet in the list against the ARP Cache for updates. 
All the main thread does in this case is add entries to the ARP cache when 
it receives an ARP reply.

2) As soon as the main thread receives an ARP reply it walks through the 
pending list and sends out all the packets it can. The secondary threads in 
this case just keep sending out ARP requests periodically for the packets 
and send out a host unreachable after 5 tries. There is a separate thread 
for every different IP in this case.

The 2nd model is more efficient in that the comparison between the new ARP 
reply is just a single walk over the pending list. The first method requires 
the 2nd thread to compare each packet with each entry in the ARP cache. 
However, when it is walking the pending list array, if a burst of packets 
arrive would these packets be considered dropped since the handle_packet 
function will be busy processing the pending list ?

Is one model preferred over the other?

Thanks
Krishna 


.

Path: shelby.stanford.edu!not-for-mail
From: Jens Pillgram-Larsen <jenspl@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Modifying structures in sr_protocol.h
Date: Wed, 01 Feb 2006 22:09:41 -0800
Lines: 50
Distribution: su
Message-ID: <drs7n5$91j$1@news.Stanford.EDU>
References: <drrpk2$og4$1@news.Stanford.EDU> <drs11f$2ld$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <drs11f$2ld$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9863

Is it ok to just copy the contents of sr_protocol.h and make these changes?

Jens

Martin Casado wrote:
> put it in a different file plz.
> 
>> TA's,
>>
>> I really want to add a field to each of your structures in 
>> sr_protocol.h. This field would be a data field, to easily retrieve 
>> the encapsulated data from each packet.
>>
>> I.e. for the IP struct:
>>
>> struct ip
>>   {
>> #if __BYTE_ORDER == __LITTLE_ENDIAN
>>     unsigned int ip_hl:4;        /* header length */
>>     unsigned int ip_v:4;        /* version */
>> #elif __BYTE_ORDER == __BIG_ENDIAN
>>     unsigned int ip_v:4;        /* version */
>>     unsigned int ip_hl:4;        /* header length */
>> #else
>> #error "Byte ordering not specified "
>> #endif
>>     uint8_t ip_tos;            /* type of service */
>>     uint16_t ip_len;            /* total length */
>>     uint16_t ip_id;            /* identification */
>>     uint16_t ip_off;            /* fragment offset field */
>> #define    IP_RF 0x8000            /* reserved fragment flag */
>> #define    IP_DF 0x4000            /* dont fragment flag */
>> #define    IP_MF 0x2000            /* more fragments flag */
>> #define    IP_OFFMASK 0x1fff        /* mask for fragmenting bits */
>>     uint8_t ip_ttl;            /* time to live */
>>     uint8_t ip_p;            /* protocol */
>>     uint16_t ip_sum;            /* checksum */
>>     struct in_addr ip_src, ip_dst;    /* source and dest address */
>>     uint8_t data;            /* Encapsulated data */
>>   } __attribute__ ((packed)) ;
>>
>> Now to get at the data ( e.g. an icmp header ) all you would have to 
>> do is:
>>
>> icmp_hdr = ( struct sr_icmphdr * )&(ip_hdr->data);
>>
>> This is much easier than mucking around with pointer arithmetic. Is it 
>> ok to do this for the 3 structs in sr_protocol.h?
>>
>> Thanks, Jens.
.

Path: shelby.stanford.edu!not-for-mail
From: Will Palmeri <wjp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: traceroute question
Date: Wed, 01 Feb 2006 23:47:04 -0800
Lines: 6
Distribution: su
Message-ID: <drsddv$es5$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9864

What is the expected behavior when we perform a traceroute to an IP on 
the "other" side of our router. E.g. if you traceroute eth1 or eth2 from 
elaine, which has to "go through" eth0 first.

Thanks,
Will
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Modifying structures in sr_protocol.h
Date: Thu, 02 Feb 2006 00:04:19 -0800
Lines: 52
Distribution: su
Message-ID: <drsee1$i3l$1@news.Stanford.EDU>
References: <drrpk2$og4$1@news.Stanford.EDU> <drs11f$2ld$2@news.Stanford.EDU> <drs7n5$91j$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drs7n5$91j$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9865

that's fine
> Is it ok to just copy the contents of sr_protocol.h and make these changes?
> 
> Jens
> 
> Martin Casado wrote:
> 
>> put it in a different file plz.
>>
>>> TA's,
>>>
>>> I really want to add a field to each of your structures in 
>>> sr_protocol.h. This field would be a data field, to easily retrieve 
>>> the encapsulated data from each packet.
>>>
>>> I.e. for the IP struct:
>>>
>>> struct ip
>>>   {
>>> #if __BYTE_ORDER == __LITTLE_ENDIAN
>>>     unsigned int ip_hl:4;        /* header length */
>>>     unsigned int ip_v:4;        /* version */
>>> #elif __BYTE_ORDER == __BIG_ENDIAN
>>>     unsigned int ip_v:4;        /* version */
>>>     unsigned int ip_hl:4;        /* header length */
>>> #else
>>> #error "Byte ordering not specified "
>>> #endif
>>>     uint8_t ip_tos;            /* type of service */
>>>     uint16_t ip_len;            /* total length */
>>>     uint16_t ip_id;            /* identification */
>>>     uint16_t ip_off;            /* fragment offset field */
>>> #define    IP_RF 0x8000            /* reserved fragment flag */
>>> #define    IP_DF 0x4000            /* dont fragment flag */
>>> #define    IP_MF 0x2000            /* more fragments flag */
>>> #define    IP_OFFMASK 0x1fff        /* mask for fragmenting bits */
>>>     uint8_t ip_ttl;            /* time to live */
>>>     uint8_t ip_p;            /* protocol */
>>>     uint16_t ip_sum;            /* checksum */
>>>     struct in_addr ip_src, ip_dst;    /* source and dest address */
>>>     uint8_t data;            /* Encapsulated data */
>>>   } __attribute__ ((packed)) ;
>>>
>>> Now to get at the data ( e.g. an icmp header ) all you would have to 
>>> do is:
>>>
>>> icmp_hdr = ( struct sr_icmphdr * )&(ip_hdr->data);
>>>
>>> This is much easier than mucking around with pointer arithmetic. Is 
>>> it ok to do this for the 3 structs in sr_protocol.h?
>>>
>>> Thanks, Jens.
.

Path: shelby.stanford.edu!elaine35.Stanford.EDU!vijayk
From: Vijay K Kulkarni <vijayk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ProblemSet2, traceroute from external networks
Date: Thu, 2 Feb 2006 00:06:05 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0602020001090.8519-100000@elaine35.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9866

Hi,

traceroute to hpr1-rtr.Stanford.EDU ends at 171.67.255.198 but
host 171.67.255.198 has no entry from elaine.
elaine35:~> host  171.67.255.198
171.67.255.198 does not exist (Authoritative answer)

but 'host hpr1-rtr.Stanford.EDU' gives 171.67.255.249 as the IP address
close to the one displayed in traceroute. Any reasons for this behaviour?

And also I am unable to traceroute from 'external' networks into
sweet-rtr.Stanford.EDU  and bbr2-rtr.Stanford.EDU. Is there any other
stanford m/c I can login to that is on the "other" side of elaine w.r.t
the routers in question.

thanks,
Vijay.

.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sr_send_packet
Date: Thu, 02 Feb 2006 00:15:56 -0800
Lines: 5
Distribution: su
Message-ID: <drsf3q$jhc$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9867

What should I do when sr_send_packet returns -1? Can I just print out 
some error message and continue?

Thanks!
--Michi
.

Path: shelby.stanford.edu!not-for-mail
From: "Krishna Monian" <kmonian@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: 2 thread models
Date: Thu, 2 Feb 2006 01:24:33 -0800
Lines: 44
Distribution: su
Message-ID: <drsj5b$n37$1@news.Stanford.EDU>
References: <drs7d3$8qd$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:9868

Made a mistake in the pros and cons of each. To clarify them:

a) The first method requires the 2nd thread to compare each packet with each 
entry in the ARP cache.

b) The 2nd model is more efficient in that the comparison between the new 
ARP reply is just a single walk over the pending list. However, when it is 
walking the pending list array, if a burst of packets arrive would these 
packets be considered dropped since the handle_packet function will be busy 
processing the pending list?

Thanks
Krishna

"Krishna Monian" <kmonian@stanford.edu> wrote in message 
news:drs7d3$8qd$1@news.Stanford.EDU...
> Hi,
> I have 2 thread models to handle the ARP replies.
>
> 1) The main thread adds the pending packet to a list, and the 2nd thread 
> keeps checking each packet in the list against the ARP Cache for updates. 
> All the main thread does in this case is add entries to the ARP cache when 
> it receives an ARP reply.
>
> 2) As soon as the main thread receives an ARP reply it walks through the 
> pending list and sends out all the packets it can. The secondary threads 
> in this case just keep sending out ARP requests periodically for the 
> packets and send out a host unreachable after 5 tries. There is a separate 
> thread for every different IP in this case.
>
> The 2nd model is more efficient in that the comparison between the new ARP 
> reply is just a single walk over the pending list. The first method 
> requires the 2nd thread to compare each packet with each entry in the ARP 
> cache. However, when it is walking the pending list array, if a burst of 
> packets arrive would these packets be considered dropped since the 
> handle_packet function will be busy processing the pending list ?
>
> Is one model preferred over the other?
>
> Thanks
> Krishna
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sr_send_packet
Date: Thu, 02 Feb 2006 11:18:03 -0800
Lines: 9
Distribution: su
Message-ID: <drtlt9$qpb$1@news.Stanford.EDU>
References: <drsf3q$jhc$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drsf3q$jhc$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9869


> What should I do when sr_send_packet returns -1? Can I just print out 
> some error message and continue?

good enough


> Thanks!
> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: 2 thread models
Date: Thu, 02 Feb 2006 11:18:23 -0800
Lines: 50
Distribution: su
Message-ID: <drtltu$qpb$2@news.Stanford.EDU>
References: <drs7d3$8qd$1@news.Stanford.EDU> <drsj5b$n37$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drsj5b$n37$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9870

These design decisions are yours to make.  Just be sure you
justify them in your writeup


> Made a mistake in the pros and cons of each. To clarify them:
> 
> a) The first method requires the 2nd thread to compare each packet with each 
> entry in the ARP cache.
> 
> b) The 2nd model is more efficient in that the comparison between the new 
> ARP reply is just a single walk over the pending list. However, when it is 
> walking the pending list array, if a burst of packets arrive would these 
> packets be considered dropped since the handle_packet function will be busy 
> processing the pending list?
> 
> Thanks
> Krishna
> 
> "Krishna Monian" <kmonian@stanford.edu> wrote in message 
> news:drs7d3$8qd$1@news.Stanford.EDU...
> 
>>Hi,
>>I have 2 thread models to handle the ARP replies.
>>
>>1) The main thread adds the pending packet to a list, and the 2nd thread 
>>keeps checking each packet in the list against the ARP Cache for updates. 
>>All the main thread does in this case is add entries to the ARP cache when 
>>it receives an ARP reply.
>>
>>2) As soon as the main thread receives an ARP reply it walks through the 
>>pending list and sends out all the packets it can. The secondary threads 
>>in this case just keep sending out ARP requests periodically for the 
>>packets and send out a host unreachable after 5 tries. There is a separate 
>>thread for every different IP in this case.
>>
>>The 2nd model is more efficient in that the comparison between the new ARP 
>>reply is just a single walk over the pending list. The first method 
>>requires the 2nd thread to compare each packet with each entry in the ARP 
>>cache. However, when it is walking the pending list array, if a burst of 
>>packets arrive would these packets be considered dropped since the 
>>handle_packet function will be busy processing the pending list ?
>>
>>Is one model preferred over the other?
>>
>>Thanks
>>Krishna
>>
> 
> 
> 
.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!silvdc
From: Dan C Silver <silvdc@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Rtable file
Date: Thu, 2 Feb 2006 12:53:57 -0800
Lines: 42
Distribution: su
Message-ID: <Pine.GSO.4.44.0602021232370.10760-100000@elaine4.Stanford.EDU>
References: <drhtlp$l6n$1@news.Stanford.EDU> <dri4nn$r00$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <dri4nn$r00$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9871


Just to clarify a bit more -- so we're basically treating each app server
as a router, and not as a host on the same subnet as our router's
interface?  In my particular topology it doesn't seem to be possible to
mask the two subnets properly, so I'm guessing this is the case.

And we don't have subnet masks for each interface, so we're basically
treating each interface as being it's own subnet with a single host?
Should we assume the subnet mask for each interface is 255.255.255.255?
If so, should we still AND the dest ip against our subnet mask to
determine if it's on the same subnet?

Thx,

- Dan

On Sun, 29 Jan 2006, Matt Falkenhagen wrote:

>  From the way you phrased the question I'm not sure how to answer, but....
>
> The rtable is just a list of rules for forwarding packets.  Your router
> reads in this list of rules.
>
> Your toplogy email tells you how your router should forward packets to
> exactly two specific IP addresses (your app servers) and to the rest of
> the Internet.  Given that information, think about what rules you want
> in your rtable.
>
> Ask again if it's not clear.
>
> Sutthipong Thavisomboon wrote:
> > Hi,
> >
> > I read in the newsgroup that we should modify the rtable static file
> > according to the assigned topology. I see the IP address in the email,
> > however, I'm not sure what to put for mask?
> >
> > Sutthipong
> >
> >
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Roy Zeighami" <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: nanosleep
Date: Thu, 2 Feb 2006 15:02:26 -0600
Lines: 13
Distribution: su
Message-ID: <drts15$3la$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9872

Hello...

Is anyone using nanosleep?  The man page says to include time.h, which I 
have, but the compiler keeps complaining:

arp_cache.c:205: warning: implicit declaration of function `nanosleep'

Is it ok to just ignore this warning?

Thanks,
Roy 


.

Path: shelby.stanford.edu!not-for-mail
From: "Roy Zeighami" <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: traceroute
Date: Thu, 2 Feb 2006 17:38:15 -0600
Lines: 82
Distribution: su
Message-ID: <dru55a$dpd$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9873

Hello...

I fired up traceroute and pointed it to one of the application servers 
behind my firewall, but I don't think I am getting the expected behaviour. 
Here is my output

elaine35:~/router> traceroute 192.168.131.113
traceroute to 192.168.131.113 (192.168.131.113): 1-30 hops, 38 byte packets
 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.522 ms  0.379 ms  0.452 ms
 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.650 ms  0.508 ms  0.493 ms
 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.495 ms (ttl=62!)  0.438 ms 
(ttl=62!)  0.451 ms (ttl=62!)
 4  192.168.131.113 (192.168.131.113)  19.5 ms (ttl=60!)  275 ms (ttl=60!) 
4.00 ms (ttl=60!)


The 192.168.131.113 is my app server.  However, I don't see any of the 
router interface anywhere in there.

I looked at the traffic with ethereal and I see a bunch of udp packets being 
sent to 192.168.131.113 but, again, none to my router interfaces.

If a traceroute directly to an interface on the router it seems to work ok.

traceroute to 192.168.131.109 (192.168.131.109): 1-30 hops, 38 byte packets
 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.695 ms  0.460 ms  0.423 ms
 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.572 ms  0.473 ms  0.464 ms
 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.470 ms (ttl=62!)  0.418 ms 
(ttl=62!)  0.431 ms (ttl=62!)
 4  192.168.131.109 (192.168.131.109)  5.45 ms (ttl=61!)  13.8 ms (ttl=61!) 
2.75 ms (ttl=61!)

Looking at the log file for the first traceroute, it appears that the router 
is doing everything that it should with the incoming traffic.

Could you please take a look?  Any advice?  Do I just not understand what 
traceroute should do?

Thanks,

Roy 


begin 666 a.out
MH;+#U `"``0`````````````! `````!0^*770`!:"\````\````/' ``%P`
M`0#@@00FV0@`10``)D<K0 `!$3/4JT /;L"H@W'R1X*D`!(``$/BEUT``6';
M"@0``````````$/BEUT``6M(````*@```"K_______]P``!<``8(!@`!" `&
M! `!< ``7 `&P*B#< ```````,"H@W%#XI==``%RMP```#P````\< ``7 `&
M``1U>^DB" 8``0@`!@0``@`$=7OI(L"H@W%P``!<``; J(-P````````````
M````````````0^*770`!=$P````T````- `$=7OI(G ``%P`!@@`10``)D<K
M0 ``$334JT /;L"H@W'R1X*D`!(``$/BEUT``6';"@1#XI==``%[?@```% `
M``!0< ``7 `&``1U>^DB" !%P !"&X<``$ !7ZS J(-QJT /;@,#0-X`````
M10``)D<K0 ``$334JT /;L"H@W'R1X*D`!(``$/BEUT``6';"@1#XI==``%]
M-0```"H````J________< ``7 `!" 8``0@`!@0``7 ``%P``<"H@VT`````
M``"L&$H10^*770`!A#0````\````/' ``%P``0#@@00FV0@&``$(``8$``(`
MX($$)MFL&$H1< ``7 `!P*B#;0```````````````````````$/BEUT``861
M````4 ```% `X($$)MEP``!<``$(`$7 `$(;AP``/P%@K,"H@W&K0 ]N`P- 
MW@````!%```F1RM ```1--2K0 ]NP*B#<?)'@J0`$@``0^*770`!8=L*!$/B
MEUT``8ZN````/ ```#QP``!<``$`X($$)MD(`$4``"9'+$ ``1$STZM #V[ 
MJ(-Q\D>"I0`2``!#XI==``&(=PL$``````````!#XI==``&04 ```#0````T
M``1U>^DB< ``7 `&" !%```F1RQ ```1--.K0 ]NP*B#<?)'@J4`$@``0^*7
M70`!B'<+!$/BEUT``9,\````4 ```%!P``!<``8`!'5[Z2((`$7 `$(;B ``
M0 %?J\"H@W&K0 ]N`P,900````!%```F1RQ ```1--.K0 ]NP*B#<?)'@J4`
M$@``0^*770`!B'<+!$/BEUT`!N^(````4 ```% `X($$)MEP``!<``$(`$7 
M`$(;B ``/P%@J\"H@W&K0 ]N`P,900````!%```F1RQ ```1--.K0 ]NP*B#
M<?)'@J4`$@``0^*770`!B'<+!$/BEUT`!OE3````/ ```#QP``!<``$`X($$
M)MD(`$4``"9'+4 ``1$STJM #V[ J(-Q\D>"I@`2``!#XI==``;R^ P$````
M``````!#XI==``;[:P```#0````T``1U>^DB< ``7 `&" !%```F1RU ```1
M--*K0 ]NP*B#<?)'@J8`$@``0^*770`&\O@,!$/BEUT`!P*A````4 ```%!P
M``!<``8`!'5[Z2((`$7 `$(;B0``0 %?JL"H@W&K0 ]N`P.MN0````!%```F
M1RU ```1--*K0 ]NP*B#<?)'@J8`$@``0^*770`&\O@,!$/BEUT`!P2"````
M4 ```% `X($$)MEP``!<``$(`$7 `$(;B0``/P%@JL"H@W&K0 ]N`P.MN0``
M``!%```F1RU ```1--*K0 ]NP*B#<?)'@J8`$@``0^*770`&\O@,!$/BEV(`
M`6Y]````/ ```#QP``!<``$`X($$)MD(!@`!" `&! `!`."!!";9K!A*$0``
M`````,"H@VT```````````````````````!#XI=B``%P-P```"H````J`."!
M!";9< ``7 `!" 8``0@`!@0``G ``%P``<"H@VT`X($$)MFL&$H10^*78@`!
M<PX````\````/' ``%P`!@`$=7OI(@@&``$(``8$``$`!'5[Z2+ J(,(````
M````P*B#< ```````````````````````$/BEV(``73A````*@```"H`!'5[
FZ2)P``!<``8(!@`!" `&! `"< ``7 `&P*B#< `$=7OI(L"H@P@`
`
end

.

Path: shelby.stanford.edu!elaine35.Stanford.EDU!zeighami
From: Roy Mehdi Zeighami <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: traceroute
Date: Thu, 2 Feb 2006 16:12:21 -0800
Lines: 93
Distribution: su
Message-ID: <Pine.GSO.4.44.0602021611460.815-100000@elaine35.Stanford.EDU>
References: <dru55a$dpd$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <dru55a$dpd$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9874

Never mind...  I found my problem.  The timeout message had the wrong
source address.

Thanks,

Roy

On Thu, 2 Feb 2006, Roy Zeighami wrote:

> Hello...
>
> I fired up traceroute and pointed it to one of the application servers
> behind my firewall, but I don't think I am getting the expected behaviour.
> Here is my output
>
> elaine35:~/router> traceroute 192.168.131.113
> traceroute to 192.168.131.113 (192.168.131.113): 1-30 hops, 38 byte packets
>  1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.522 ms  0.379 ms  0.452 ms
>  2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.650 ms  0.508 ms  0.493 ms
>  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.495 ms (ttl=62!)  0.438 ms
> (ttl=62!)  0.451 ms (ttl=62!)
>  4  192.168.131.113 (192.168.131.113)  19.5 ms (ttl=60!)  275 ms (ttl=60!)
> 4.00 ms (ttl=60!)
>
>
> The 192.168.131.113 is my app server.  However, I don't see any of the
> router interface anywhere in there.
>
> I looked at the traffic with ethereal and I see a bunch of udp packets being
> sent to 192.168.131.113 but, again, none to my router interfaces.
>
> If a traceroute directly to an interface on the router it seems to work ok.
>
> traceroute to 192.168.131.109 (192.168.131.109): 1-30 hops, 38 byte packets
>  1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.695 ms  0.460 ms  0.423 ms
>  2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.572 ms  0.473 ms  0.464 ms
>  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.470 ms (ttl=62!)  0.418 ms
> (ttl=62!)  0.431 ms (ttl=62!)
>  4  192.168.131.109 (192.168.131.109)  5.45 ms (ttl=61!)  13.8 ms (ttl=61!)
> 2.75 ms (ttl=61!)
>
> Looking at the log file for the first traceroute, it appears that the router
> is doing everything that it should with the incoming traffic.
>
> Could you please take a look?  Any advice?  Do I just not understand what
> traceroute should do?
>
> Thanks,
>
> Roy
>
>
> begin 666 a.out
> MH;+#U `"``0`````````````! `````!0^*770`!:"\````\````/' ``%P`
> M`0#@@00FV0@`10``)D<K0 `!$3/4JT /;L"H@W'R1X*D`!(``$/BEUT``6';
> M"@0``````````$/BEUT``6M(````*@```"K_______]P``!<``8(!@`!" `&
> M! `!< ``7 `&P*B#< ```````,"H@W%#XI==``%RMP```#P````\< ``7 `&
> M``1U>^DB" 8``0@`!@0``@`$=7OI(L"H@W%P``!<``; J(-P````````````
> M````````````0^*770`!=$P````T````- `$=7OI(G ``%P`!@@`10``)D<K
> M0 ``$334JT /;L"H@W'R1X*D`!(``$/BEUT``6';"@1#XI==``%[?@```% `
> M``!0< ``7 `&``1U>^DB" !%P !"&X<``$ !7ZS J(-QJT /;@,#0-X`````
> M10``)D<K0 ``$334JT /;L"H@W'R1X*D`!(``$/BEUT``6';"@1#XI==``%]
> M-0```"H````J________< ``7 `!" 8``0@`!@0``7 ``%P``<"H@VT`````
> M``"L&$H10^*770`!A#0````\````/' ``%P``0#@@00FV0@&``$(``8$``(`
> MX($$)MFL&$H1< ``7 `!P*B#;0```````````````````````$/BEUT``861
> M````4 ```% `X($$)MEP``!<``$(`$7 `$(;AP``/P%@K,"H@W&K0 ]N`P-
> MW@````!%```F1RM ```1--2K0 ]NP*B#<?)'@J0`$@``0^*770`!8=L*!$/B
> MEUT``8ZN````/ ```#QP``!<``$`X($$)MD(`$4``"9'+$ ``1$STZM #V[
> MJ(-Q\D>"I0`2``!#XI==``&(=PL$``````````!#XI==``&04 ```#0````T
> M``1U>^DB< ``7 `&" !%```F1RQ ```1--.K0 ]NP*B#<?)'@J4`$@``0^*7
> M70`!B'<+!$/BEUT``9,\````4 ```%!P``!<``8`!'5[Z2((`$7 `$(;B ``
> M0 %?J\"H@W&K0 ]N`P,900````!%```F1RQ ```1--.K0 ]NP*B#<?)'@J4`
> M$@``0^*770`!B'<+!$/BEUT`!N^(````4 ```% `X($$)MEP``!<``$(`$7
> M`$(;B ``/P%@J\"H@W&K0 ]N`P,900````!%```F1RQ ```1--.K0 ]NP*B#
> M<?)'@J4`$@``0^*770`!B'<+!$/BEUT`!OE3````/ ```#QP``!<``$`X($$
> M)MD(`$4``"9'+4 ``1$STJM #V[ J(-Q\D>"I@`2``!#XI==``;R^ P$````
> M``````!#XI==``;[:P```#0````T``1U>^DB< ``7 `&" !%```F1RU ```1
> M--*K0 ]NP*B#<?)'@J8`$@``0^*770`&\O@,!$/BEUT`!P*A````4 ```%!P
> M``!<``8`!'5[Z2((`$7 `$(;B0``0 %?JL"H@W&K0 ]N`P.MN0````!%```F
> M1RU ```1--*K0 ]NP*B#<?)'@J8`$@``0^*770`&\O@,!$/BEUT`!P2"````
> M4 ```% `X($$)MEP``!<``$(`$7 `$(;B0``/P%@JL"H@W&K0 ]N`P.MN0``
> M``!%```F1RU ```1--*K0 ]NP*B#<?)'@J8`$@``0^*770`&\O@,!$/BEV(`
> M`6Y]````/ ```#QP``!<``$`X($$)MD(!@`!" `&! `!`."!!";9K!A*$0``
> M`````,"H@VT```````````````````````!#XI=B``%P-P```"H````J`."!
> M!";9< ``7 `!" 8``0@`!@0``G ``%P``<"H@VT`X($$)MFL&$H10^*78@`!
> M<PX````\````/' ``%P`!@`$=7OI(@@&``$(``8$``$`!'5[Z2+ J(,(````
> M````P*B#< ```````````````````````$/BEV(``73A````*@```"H`!'5[
> FZ2)P``!<``8(!@`!" `&! `"< ``7 `&P*B#< `$=7OI(L"H@P@`
> `
> end
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Surendra Kumar <surendra@stanford.edu>
Newsgroups: su.class.cs244a
Subject: md5sum for the .iso image ?
Date: Thu, 02 Feb 2006 16:21:16 -0800
Lines: 5
Distribution: su
Message-ID: <dru7m1$h9p$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9875


Can you publish the checksum for the image.

Thanks,
Surendra.
.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: md5sum for the .iso image ?
Date: Thu, 2 Feb 2006 16:59:17 -0800
Organization: Stanford University
Lines: 11
Distribution: su
Message-ID: <20060202165917.12c1d713@ballpoint>
References: <dru7m1$h9p$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9876

One option is to fire up Clack on your topology and use that to download
it.

On Thu, 02 Feb 2006 16:21:16 -0800
Surendra Kumar <surendra@stanford.edu> wrote:

> 
> Can you publish the checksum for the image.
> 
> Thanks,
> Surendra.
.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Sending "Host Unreachable" in a Burst?
Date: Thu, 2 Feb 2006 17:04:31 -0800
Organization: Stanford University
Lines: 7
Distribution: su
Message-ID: <20060202170431.255a6e90@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9877

When my router is not connected and I try to ping it, the vns firewall
gives the following behavior: after about three seconds, it sends three
"Host Unreachable" ICMPs (one for each ping), all at about the same
time.  Is it okay for my router to do the same thing?  Five seconds
after the *first* ARP, it will send a host unreachable for each packet
bound for that hop, even ones that only arrived 0.1 seconds ago?  Or is
it necessary to have a separate 5-second counter for each packet?
.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ARP Cached in Linked List?
Date: Thu, 2 Feb 2006 17:06:26 -0800
Organization: Stanford University
Lines: 5
Distribution: su
Message-ID: <20060202170626.28488b40@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9878

Is it okay to have my ARP cache stored in a linked list that can grow to
arbitrary size?  The benefit is that there are no arbitrary limits on
ARP cache size, but the downside is that I do not delete timed-out
entries.  I just mark them as timed-out?  Is this okay?  Or do I have to
reclaim the memory from timed-out entries?
.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Odd IP Headers
Date: Thu, 2 Feb 2006 17:11:21 -0800
Organization: Stanford University
Lines: 4
Distribution: su
Message-ID: <20060202171121.0fc36885@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9879

What should I do with IP packets that have odd flags set in the header,
like TOS bits?  Is it okay to forward them with the same values, or
should I zero them out?  What about ping responses?  Should I set the
same TOS bits?
.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: UMRs for packed structures
Date: Thu, 02 Feb 2006 17:59:11 -0800
Lines: 7
Distribution: su
Message-ID: <drudda$nph$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9880

I get UMR when accessing ether_type field in sr_ethernet_hdr 
structure. I'm thinking it's because the structure is packed, and the 
size of structure is 14 bytes, instead of 16 bytes. How can I supress 
the UMR message?

Thank you,
--Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Byte ordering
Date: Thu, 02 Feb 2006 20:16:25 -0800
Lines: 38
Distribution: su
Message-ID: <druleu$3er$1@news.Stanford.EDU>
References: <drrt01$s1v$1@news.Stanford.EDU> <drs18t$2ld$4@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <drs18t$2ld$4@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9881

In sr_protocol.h, we have:

#if __BYTE_ORDER == __LITTLE_ENDIAN
     unsigned int ip_hl:4;		/* header length */
     unsigned int ip_v:4;		/* version */
#elif __BYTE_ORDER == __BIG_ENDIAN
     unsigned int ip_v:4;		/* version */
     unsigned int ip_hl:4;		/* header length */
#else
#error "Byte ordering not specified "
#endif

I'm not sure I understand what's going on here. The ver and hl fields 
occupy 4 bits each. So why is *byte* ordering important here? I thought 
byte ordering only applied to byte level types such as 16-bit and 32-bit 
integers.

And a related question: if I need to construct an IP packet from 
scratch, do I need to be concerned about how I assign to ip_v and ip_hl? 
Can I just say iphdr->ip_v = 0x45; or is this bad (dependent on the 
endianess of the machine)?

Thanks.


Martin Casado wrote:
> 
> 
>> Hi,
>>
>> Just to clarify, what is the byte-ordering of the fields in the packet 
>> buffer passed in sr_handlepacket, and what byte-ordering should the 
>> packet that we pass to sr_send_packet be? I'm thinking the answer to 
>> both is network order, but please clarify.
> 
> yup
> 
>> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: icmp generation, ip fragmentation
Date: Thu, 02 Feb 2006 20:38:55 -0800
Lines: 11
Distribution: su
Message-ID: <drump5$4n2$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9882

Hey that rhymes ;)

When I generate an ICMP error (host/port unreachable, ttl expired), what 
should I set the 'identification' and 'flags' fields in the enclosing IP 
header to?

Also, the data portion of na ICMP packet is supposed to have the first 
64 bits  of the packet that caused the error. The first 64 bits starting 
at the ethernet header, the IP header, or the data?

Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Stefan Thomas Mohler <smohler@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: ARP protocol size
Date: Fri, 3 Feb 2006 05:42:08 +0000 (UTC)
Lines: 4
Distribution: su
Message-ID: <druqfg$8ji$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:9883

When I look at incoming ARP requests in ethereal that get
generated when I ping the router it shows the protocol size
field is set to 4 (bytes).  sr_protocol.h shows the protocol as a
short as does networksorcery.  Is anyone else seeing this?
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP protocol size
Date: Thu, 02 Feb 2006 22:00:52 -0800
Lines: 12
Distribution: su
Message-ID: <druriq$a4i$1@news.Stanford.EDU>
References: <druqfg$8ji$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <druqfg$8ji$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9884

Protocol size (or 'Protocol address length' in networksorcery) specifies 
how many bytes are allocated to 'Source protocol address' and 
'Destination protocol address'. If these are IP addresses (which is most 
if not all the time), then protocol size is 4 bytes. The protocol size 
field itself is a short, i.e. it can specify protocol sizes up to 2^8 bytes.


Stefan Thomas Mohler wrote:
> When I look at incoming ARP requests in ethereal that get
> generated when I ping the router it shows the protocol size
> field is set to 4 (bytes).  sr_protocol.h shows the protocol as a
> short as does networksorcery.  Is anyone else seeing this?
.

Path: shelby.stanford.edu!not-for-mail
From: Stefan Thomas Mohler <smohler@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ARP protocol size
Date: Fri, 3 Feb 2006 06:12:43 +0000 (UTC)
Lines: 2
Distribution: su
Message-ID: <drus8r$8ji$2@news.Stanford.EDU>
References: <druqfg$8ji$1@news.Stanford.EDU> <druriq$a4i$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:9885

Awesome, that makes alot more sense now.  Thanks for the help Naeim..

.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP Destination Unreachable payload
Date: Thu, 02 Feb 2006 22:21:28 -0800
Lines: 25
Distribution: su
Message-ID: <druspd$b7p$1@news.Stanford.EDU>
References: <drmkku$lh2$1@news.Stanford.EDU> <drmtcn$4eu$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <drmtcn$4eu$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9886

Is it OK to drop a packet that has less than 64 bits of data (excluding 
the headers) and not generate an ICMP error for it in case its TTL has 
reached zero or its destination is unreachable?


Martin Casado wrote:
> Roy Zeighami wrote:
>> The RFC for ICMP says that, for a destination unreachable ICMP 
>> message, we should return the original IP header and the first 64 bits 
>> of the payload. Is an IP packet always guaranteed to have at least 64 
>> bits of data in the payload?
>>
> 
> I'm not sure, though it is hard to conceive of a smaller, non-malicious 
>  packet.  The minimum ip fragment size is 8 bytes.  And UDP header (much
> smaller than TCP) are 64 bits. Your packet shouldn't crash however if
> it receives a malformed packet
> 
> .m
> 
> 
>> Thanks,
>>
>> Roy
>>
.

Path: shelby.stanford.edu!not-for-mail
From: Sunny Balwani <sunnybalwani@hotmail.com>
Newsgroups: su.class.cs244a
Subject: Checksum
Date: Thu, 02 Feb 2006 22:31:09 -0800
Lines: 13
Distribution: su
Message-ID: <C00838AD.2FEB%sunnybalwani@hotmail.com>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.2.1.051004
Thread-Topic: Checksum
Thread-Index: AcYoi2soqbZ0KJR+EdqYqwARJHuZqg==
Xref: shelby.stanford.edu su.class.cs244a:9887

I have a questions about checksum and ICMP echo

1. I ping my router from a machine and when I recieve a ICMP ECHO_REQUEST
packet, I notice that the check sim for ICMP Header changes everytime.
Shouldn't this stay constant because the ICMP header fields (type and code)
is not changing for every ping packet.  Why is it changing?  when I generate
checksum for my ICMP packets header, the checksum is the same if the two
ICMP header fields are the same.


Thanks in advance.
Sunny.

.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Checksum
Date: Thu, 02 Feb 2006 22:33:32 -0800
Lines: 19
Distribution: su
Message-ID: <drutg1$c9d$1@news.Stanford.EDU>
References: <C00838AD.2FEB%sunnybalwani@hotmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <C00838AD.2FEB%sunnybalwani@hotmail.com>
Xref: shelby.stanford.edu su.class.cs244a:9888

There is an identifier and a sequence number associated with ICMP packets:

http://www.networksorcery.com/enp/protocol/icmp/msg8.htm


Sunny Balwani wrote:
> I have a questions about checksum and ICMP echo
> 
> 1. I ping my router from a machine and when I recieve a ICMP ECHO_REQUEST
> packet, I notice that the check sim for ICMP Header changes everytime.
> Shouldn't this stay constant because the ICMP header fields (type and code)
> is not changing for every ping packet.  Why is it changing?  when I generate
> checksum for my ICMP packets header, the checksum is the same if the two
> ICMP header fields are the same.
> 
> 
> Thanks in advance.
> Sunny.
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Checksum
Date: Thu, 02 Feb 2006 22:35:33 -0800
Lines: 24
Distribution: su
Message-ID: <drutjq$c9d$2@news.Stanford.EDU>
References: <C00838AD.2FEB%sunnybalwani@hotmail.com> <drutg1$c9d$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <drutg1$c9d$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9889

Correction: ICMP echo request and reply packets. Not all ICMP packets.

Naeim Semsarilar wrote:
> There is an identifier and a sequence number associated with ICMP packets:
> 
> http://www.networksorcery.com/enp/protocol/icmp/msg8.htm
> 
> 
> Sunny Balwani wrote:
>> I have a questions about checksum and ICMP echo
>>
>> 1. I ping my router from a machine and when I recieve a ICMP ECHO_REQUEST
>> packet, I notice that the check sim for ICMP Header changes everytime.
>> Shouldn't this stay constant because the ICMP header fields (type and 
>> code)
>> is not changing for every ping packet.  Why is it changing?  when I 
>> generate
>> checksum for my ICMP packets header, the checksum is the same if the two
>> ICMP header fields are the same.
>>
>>
>> Thanks in advance.
>> Sunny.
>>
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: nanosleep
Date: Thu, 02 Feb 2006 22:38:50 -0800
Lines: 16
Distribution: su
Message-ID: <drutoa$crp$1@news.Stanford.EDU>
References: <drts15$3la$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drts15$3la$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9890

put in a prototype for it

Roy Zeighami wrote:
> Hello...
> 
> Is anyone using nanosleep?  The man page says to include time.h, which I 
> have, but the compiler keeps complaining:
> 
> arp_cache.c:205: warning: implicit declaration of function `nanosleep'
> 
> Is it ok to just ignore this warning?
> 
> Thanks,
> Roy 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP Cached in Linked List?
Date: Thu, 02 Feb 2006 22:42:12 -0800
Lines: 8
Distribution: su
Message-ID: <drutuk$crp$2@news.Stanford.EDU>
References: <20060202170626.28488b40@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060202170626.28488b40@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9891

if you justify in README, sure

David Reiss wrote:
> Is it okay to have my ARP cache stored in a linked list that can grow to
> arbitrary size?  The benefit is that there are no arbitrary limits on
> ARP cache size, but the downside is that I do not delete timed-out
> entries.  I just mark them as timed-out?  Is this okay?  Or do I have to
> reclaim the memory from timed-out entries?
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Odd IP Headers
Date: Thu, 02 Feb 2006 22:42:54 -0800
Lines: 7
Distribution: su
Message-ID: <drutvu$crp$3@news.Stanford.EDU>
References: <20060202171121.0fc36885@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060202171121.0fc36885@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9892

You don't need to worry about these.

David Reiss wrote:
> What should I do with IP packets that have odd flags set in the header,
> like TOS bits?  Is it okay to forward them with the same values, or
> should I zero them out?  What about ping responses?  Should I set the
> same TOS bits?
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: UMRs for packed structures
Date: Thu, 02 Feb 2006 22:49:20 -0800
Lines: 14
Distribution: su
Message-ID: <druuc1$da0$1@news.Stanford.EDU>
References: <drudda$nph$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drudda$nph$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9893

Are you sure you're not reading bad memory?  I doubt packed is the 
cause... purify should know.

In any case, don't worry about suppressing purify errors, we don't test 
your code using purify for this assignment.

Michi Mutsuzaki wrote:
> I get UMR when accessing ether_type field in sr_ethernet_hdr structure. 
> I'm thinking it's because the structure is packed, and the size of 
> structure is 14 bytes, instead of 16 bytes. How can I supress the UMR 
> message?
> 
> Thank you,
> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: alex qi <alexqi@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Router conflict
Date: Thu, 02 Feb 2006 22:53:14 -0800
Lines: 9
Distribution: su
Message-ID: <druukp$do6$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9894

Hi Ari/Matt:
Suddenly I got this error:

Client alexqi connecting to Server vns-1.stanford.edu:12345
Requesting topology 75
VNS server closed session.
Reason: reservehost failed

could you tell me the reason?
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: icmp generation, ip fragmentation
Date: Thu, 02 Feb 2006 22:57:28 -0800
Lines: 15
Distribution: su
Message-ID: <druust$e0n$1@news.Stanford.EDU>
References: <drump5$4n2$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <drump5$4n2$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9895

Never mind my second question, but my first question still holds.


Naeim Semsarilar wrote:
> Hey that rhymes ;)
> 
> When I generate an ICMP error (host/port unreachable, ttl expired), what 
> should I set the 'identification' and 'flags' fields in the enclosing IP 
> header to?
> 
> Also, the data portion of na ICMP packet is supposed to have the first 
> 64 bits  of the packet that caused the error. The first 64 bits starting 
> at the ethernet header, the IP header, or the data?
> 
> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ProblemSet2, traceroute from external networks
Date: Thu, 02 Feb 2006 23:06:59 -0800
Lines: 28
Distribution: su
Message-ID: <druvd3$ef3$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0602020001090.8519-100000@elaine35.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0602020001090.8519-100000@elaine35.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9896

Vijay K Kulkarni wrote:
> Hi,
> 
> traceroute to hpr1-rtr.Stanford.EDU ends at 171.67.255.198 but
> host 171.67.255.198 has no entry from elaine.
> elaine35:~> host  171.67.255.198
> 171.67.255.198 does not exist (Authoritative answer)
> 
> but 'host hpr1-rtr.Stanford.EDU' gives 171.67.255.249 as the IP address
> close to the one displayed in traceroute. Any reasons for this behaviour?
> 

I just tried this traceroute and ended up at a different address.

But the behavior you described is possible, if you consider how 
traceroute works and that IPs don't need to be in DNS.

> And also I am unable to traceroute from 'external' networks into
> sweet-rtr.Stanford.EDU  and bbr2-rtr.Stanford.EDU. Is there any other
> stanford m/c I can login to that is on the "other" side of elaine w.r.t
> the routers in question.
> 

Not sure, sorry.

> thanks,
> Vijay.
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: UMRs for packed structures
Date: Thu, 02 Feb 2006 23:34:46 -0800
Lines: 40
Distribution: su
Message-ID: <drv12g$fr6$1@news.Stanford.EDU>
References: <drudda$nph$1@news.Stanford.EDU> <druuc1$da0$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
In-Reply-To: <druuc1$da0$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9897

Here is the line that gets UMR:

    if (eth_hdr.ether_type == ETHERTYPE_ARP) {

and here is the purify output

    UMR: Uninitialized memory read:
      * This is occurring while in:
            sr_handlepacket [sr_router.c:222]
            sr_read_from_server [sr_vns_comm.c:318]
            main           [sr_main.c:149]
            _start         [crt1.o]
      * Reading 4 bytes from 0xffbef5ac on the stack (2 bytes at
        0xffbef5ae uninit).
      * Address 0xffbef5ac is       12 bytes past start of local
        variable "eth_hdr" in function sr_handlepacket.

The variable "eth_hdr is of type struct sr_ethernet_hdr. The program 
reads 4 bytes even though ether_type is 2 byte long. Any idea why this 
is happening?

Thanks!
--Michi


Matt Falkenhagen wrote:
> Are you sure you're not reading bad memory?  I doubt packed is the 
> cause... purify should know.
> 
> In any case, don't worry about suppressing purify errors, we don't test 
> your code using purify for this assignment.
> 
> Michi Mutsuzaki wrote:
>> I get UMR when accessing ether_type field in sr_ethernet_hdr 
>> structure. I'm thinking it's because the structure is packed, and the 
>> size of structure is 14 bytes, instead of 16 bytes. How can I supress 
>> the UMR message?
>>
>> Thank you,
>> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Greg Corrado <gcorrado@stanford.edu>
Newsgroups: su.class.cs244a
Subject: DDD = no VNS
Date: Thu, 2 Feb 2006 23:41:53 -0800
Lines: 15
Distribution: su
Message-ID: <drv1md$gb1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Unison/1.7.3
Xref: shelby.stanford.edu su.class.cs244a:9898

if i do ./sn -t 117 -s vns-1.stanford.edu, every thing works fine.
it connects to vns-1.stanford.edu and requests topology 117

if instead i do ddd ./sn -t 117 -s vns-1.stanford.edu, it won't load my 
topology
it says it's connecting to 171.67.71.18 and requesting topology 0
(171.67.71.18 does appear to be the IP for vns-1, but why is it 
requesting topology 0?)

anyone else having this problem?





.

Path: shelby.stanford.edu!not-for-mail
From: Sunny Balwani <sunnybalwani@hotmail.com>
Newsgroups: su.class.cs244a
Subject: Re: Checksum
Date: Fri, 03 Feb 2006 00:11:13 -0800
Lines: 43
Distribution: su
Message-ID: <C0085021.2FFB%sunnybalwani@hotmail.com>
References: <C00838AD.2FEB%sunnybalwani@hotmail.com> <drutg1$c9d$1@news.Stanford.EDU> <drutjq$c9d$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.2.1.051004
Thread-Topic: Checksum
Thread-Index: AcYomWXRpG59uJSMEdqWAQARJHuZqg==
Xref: shelby.stanford.edu su.class.cs244a:9899

Naeim.

Thanks for the email.  The network sourcery says checksum for ICMP header is
to be calculated starting with the ICMP Type field.  So that gives us 8
bytes total for the ICMP echo header (64 bits).  But when try to calculate
the checksum for an incoming ICMP header, my checksum returns different from
the checksum in the ICMP header.  Though the same checksum() works just fine
for IP header.  Any ideas why the checksum for ICMP echo packets doesn't
return the same result as in the ICMP header?

Thanks again.
Sunny.


On 2/2/06 10:35 PM, in article drutjq$c9d$2@news.Stanford.EDU, "Naeim
Semsarilar" <naeim@stanford.edu> wrote:

> Correction: ICMP echo request and reply packets. Not all ICMP packets.
> 
> Naeim Semsarilar wrote:
>> There is an identifier and a sequence number associated with ICMP packets:
>> 
>> http://www.networksorcery.com/enp/protocol/icmp/msg8.htm
>> 
>> 
>> Sunny Balwani wrote:
>>> I have a questions about checksum and ICMP echo
>>> 
>>> 1. I ping my router from a machine and when I recieve a ICMP ECHO_REQUEST
>>> packet, I notice that the check sim for ICMP Header changes everytime.
>>> Shouldn't this stay constant because the ICMP header fields (type and
>>> code)
>>> is not changing for every ping packet.  Why is it changing?  when I
>>> generate
>>> checksum for my ICMP packets header, the checksum is the same if the two
>>> ICMP header fields are the same.
>>> 
>>> 
>>> Thanks in advance.
>>> Sunny.
>>> 


.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: DDD = no VNS
Date: Fri, 3 Feb 2006 00:14:11 -0800
Organization: Stanford University
Lines: 20
Distribution: su
Message-ID: <20060203001411.5475e32b@ballpoint>
References: <drv1md$gb1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9900

I was able to connect fine with DDD, but I am developing on my own machine.

On Thu, 2 Feb 2006 23:41:53 -0800
Greg Corrado <gcorrado@stanford.edu> wrote:

> if i do ./sn -t 117 -s vns-1.stanford.edu, every thing works fine.
> it connects to vns-1.stanford.edu and requests topology 117
> 
> if instead i do ddd ./sn -t 117 -s vns-1.stanford.edu, it won't load my 
> topology
> it says it's connecting to 171.67.71.18 and requesting topology 0
> (171.67.71.18 does appear to be the IP for vns-1, but why is it 
> requesting topology 0?)
> 
> anyone else having this problem?
> 
> 
> 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Ramanan" <ramananr@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Checksum
Date: Fri, 3 Feb 2006 00:34:32 -0800
Lines: 60
Distribution: su
Message-ID: <drv4iq$m4h$1@news.Stanford.EDU>
References: <C00838AD.2FEB%sunnybalwani@hotmail.com> <drutg1$c9d$1@news.Stanford.EDU> <drutjq$c9d$2@news.Stanford.EDU> <C0085021.2FFB%sunnybalwani@hotmail.com>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9901

Hi Sunny,

For ICMP, I think the Checksum should be calculated over all the data, not 
just the header. That should give you the correct checksum

Ram

"Sunny Balwani" <sunnybalwani@hotmail.com> wrote in message 
news:C0085021.2FFB%sunnybalwani@hotmail.com...
> Naeim.
>
> Thanks for the email.  The network sourcery says checksum for ICMP header 
> is
> to be calculated starting with the ICMP Type field.  So that gives us 8
> bytes total for the ICMP echo header (64 bits).  But when try to calculate
> the checksum for an incoming ICMP header, my checksum returns different 
> from
> the checksum in the ICMP header.  Though the same checksum() works just 
> fine
> for IP header.  Any ideas why the checksum for ICMP echo packets doesn't
> return the same result as in the ICMP header?
>
> Thanks again.
> Sunny.
>
>
> On 2/2/06 10:35 PM, in article drutjq$c9d$2@news.Stanford.EDU, "Naeim
> Semsarilar" <naeim@stanford.edu> wrote:
>
>> Correction: ICMP echo request and reply packets. Not all ICMP packets.
>>
>> Naeim Semsarilar wrote:
>>> There is an identifier and a sequence number associated with ICMP 
>>> packets:
>>>
>>> http://www.networksorcery.com/enp/protocol/icmp/msg8.htm
>>>
>>>
>>> Sunny Balwani wrote:
>>>> I have a questions about checksum and ICMP echo
>>>>
>>>> 1. I ping my router from a machine and when I recieve a ICMP 
>>>> ECHO_REQUEST
>>>> packet, I notice that the check sim for ICMP Header changes everytime.
>>>> Shouldn't this stay constant because the ICMP header fields (type and
>>>> code)
>>>> is not changing for every ping packet.  Why is it changing?  when I
>>>> generate
>>>> checksum for my ICMP packets header, the checksum is the same if the 
>>>> two
>>>> ICMP header fields are the same.
>>>>
>>>>
>>>> Thanks in advance.
>>>> Sunny.
>>>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Checksum
Date: Fri, 03 Feb 2006 00:41:02 -0800
Lines: 51
Distribution: su
Message-ID: <drv4v4$mc9$1@news.Stanford.EDU>
References: <C00838AD.2FEB%sunnybalwani@hotmail.com> <drutg1$c9d$1@news.Stanford.EDU> <drutjq$c9d$2@news.Stanford.EDU> <C0085021.2FFB%sunnybalwani@hotmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <C0085021.2FFB%sunnybalwani@hotmail.com>
Xref: shelby.stanford.edu su.class.cs244a:9902

ICMP checksum is calculated over the whole ICMP message, not just the 
header. Read:

http://www.networksorcery.com/enp/protocol/icmp/msg0.htm#ICMP%20Header%20Checksum



Sunny Balwani wrote:
> Naeim.
> 
> Thanks for the email.  The network sourcery says checksum for ICMP header is
> to be calculated starting with the ICMP Type field.  So that gives us 8
> bytes total for the ICMP echo header (64 bits).  But when try to calculate
> the checksum for an incoming ICMP header, my checksum returns different from
> the checksum in the ICMP header.  Though the same checksum() works just fine
> for IP header.  Any ideas why the checksum for ICMP echo packets doesn't
> return the same result as in the ICMP header?
> 
> Thanks again.
> Sunny.
> 
> 
> On 2/2/06 10:35 PM, in article drutjq$c9d$2@news.Stanford.EDU, "Naeim
> Semsarilar" <naeim@stanford.edu> wrote:
> 
>> Correction: ICMP echo request and reply packets. Not all ICMP packets.
>>
>> Naeim Semsarilar wrote:
>>> There is an identifier and a sequence number associated with ICMP packets:
>>>
>>> http://www.networksorcery.com/enp/protocol/icmp/msg8.htm
>>>
>>>
>>> Sunny Balwani wrote:
>>>> I have a questions about checksum and ICMP echo
>>>>
>>>> 1. I ping my router from a machine and when I recieve a ICMP ECHO_REQUEST
>>>> packet, I notice that the check sim for ICMP Header changes everytime.
>>>> Shouldn't this stay constant because the ICMP header fields (type and
>>>> code)
>>>> is not changing for every ping packet.  Why is it changing?  when I
>>>> generate
>>>> checksum for my ICMP packets header, the checksum is the same if the two
>>>> ICMP header fields are the same.
>>>>
>>>>
>>>> Thanks in advance.
>>>> Sunny.
>>>>
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Lee Hendrickson <lthendri@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: DDD = no VNS
Date: Fri, 03 Feb 2006 01:08:10 -0800
Lines: 23
Distribution: su
Message-ID: <drv6hp$njc$1@news.Stanford.EDU>
References: <drv1md$gb1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <drv1md$gb1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9903

Greg Corrado wrote:
> if i do ./sn -t 117 -s vns-1.stanford.edu, every thing works fine.
> it connects to vns-1.stanford.edu and requests topology 117
> 
> if instead i do ddd ./sn -t 117 -s vns-1.stanford.edu, it won't load my 
> topology
> it says it's connecting to 171.67.71.18 and requesting topology 0
> (171.67.71.18 does appear to be the IP for vns-1, but why is it 
> requesting topology 0?)

For ddd/gdb, you shouldn't be giving runtime arguments for the program 
you're trying to debug when you start ddd/gdb.  Instead, start ddd with:

%> ddd ./sn

And then once inside the debugging environment (i.e., at the (gdb) 
prompt), type:

(gdb) run -t 117 -s vns-1.stanford.edu

Hope that helps.

Lee.
.

Path: shelby.stanford.edu!not-for-mail
From: "Roy Zeighami" <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: DDD = no VNS
Date: Fri, 3 Feb 2006 08:36:59 -0600
Lines: 28
Distribution: su
Message-ID: <drvpqf$c03$1@news.Stanford.EDU>
References: <drv1md$gb1$1@news.Stanford.EDU> <20060203001411.5475e32b@ballpoint>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9904

If its anything like gdb, you would say ddd sr and then specify the 
arguments after the program has launched with the run command.


"David Reiss" <dreiss@stanford.edu> wrote in message 
news:20060203001411.5475e32b@ballpoint...
>I was able to connect fine with DDD, but I am developing on my own machine.
>
> On Thu, 2 Feb 2006 23:41:53 -0800
> Greg Corrado <gcorrado@stanford.edu> wrote:
>
>> if i do ./sn -t 117 -s vns-1.stanford.edu, every thing works fine.
>> it connects to vns-1.stanford.edu and requests topology 117
>>
>> if instead i do ddd ./sn -t 117 -s vns-1.stanford.edu, it won't load my
>> topology
>> it says it's connecting to 171.67.71.18 and requesting topology 0
>> (171.67.71.18 does appear to be the IP for vns-1, but why is it
>> requesting topology 0?)
>>
>> anyone else having this problem?
>>
>>
>>
>>
>> 


.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Sending "Host Unreachable" in a Burst?
Date: Fri, 03 Feb 2006 10:48:07 -0800
Lines: 10
Distribution: su
Message-ID: <ds08h5$q27$1@news.Stanford.EDU>
References: <20060202170431.255a6e90@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060202170431.255a6e90@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9905


thats just fine.

> When my router is not connected and I try to ping it, the vns firewall
> gives the following behavior: after about three seconds, it sends three
> "Host Unreachable" ICMPs (one for each ping), all at about the same
> time.  Is it okay for my router to do the same thing?  Five seconds
> after the *first* ARP, it will send a host unreachable for each packet
> bound for that hop, even ones that only arrived 0.1 seconds ago?  Or is
> it necessary to have a separate 5-second counter for each packet?
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Router conflict
Date: Fri, 03 Feb 2006 10:49:12 -0800
Lines: 16
Distribution: su
Message-ID: <ds08j7$q27$2@news.Stanford.EDU>
References: <druukp$do6$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <druukp$do6$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9906


You've got a router still connected from host
171.64.15.99 (elaine24)
try killing the process.



> Hi Ari/Matt:
> Suddenly I got this error:
> 
> Client alexqi connecting to Server vns-1.stanford.edu:12345
> Requesting topology 75
> VNS server closed session.
> Reason: reservehost failed
> 
> could you tell me the reason?
.

Path: shelby.stanford.edu!not-for-mail
From: alex qi <alexqi@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Router conflict
Date: Fri, 03 Feb 2006 10:58:00 -0800
Lines: 21
Distribution: su
Message-ID: <43E3A7B8.2B871A3E@stanford.edu>
References: <druukp$do6$1@news.Stanford.EDU> <ds08j7$q27$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:9907

I did try to kill it. I use command "jobs" to find the process, it's not
there. could you tell me the command?

Thanks.

Martin Casado wrote:

> You've got a router still connected from host
> 171.64.15.99 (elaine24)
> try killing the process.
>
> > Hi Ari/Matt:
> > Suddenly I got this error:
> >
> > Client alexqi connecting to Server vns-1.stanford.edu:12345
> > Requesting topology 75
> > VNS server closed session.
> > Reason: reservehost failed
> >
> > could you tell me the reason?

.

Path: shelby.stanford.edu!not-for-mail
From: Paul Tarjan <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: thread library?
Date: Fri, 03 Feb 2006 12:13:53 -0800
Lines: 17
Distribution: su
Message-ID: <ds0di1$1jv$1@news.Stanford.EDU>
References: <drpt7a$lbp$1@news.Stanford.EDU> <drq198$pak$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013)
X-Accept-Language: en-us, en
In-Reply-To: <drq198$pak$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9908

Can't we just fork a new process?

Matt Falkenhagen wrote:
> Strictly speaking, there is no ANSI C threading library :-P
> 
> Yes, pthreads is POSIX (where the p comes from).  You should use 
> pthreads for maximum portability.
> 
> Will Palmeri wrote:
> 
>> What threading library can we use and still comply to ANSI C?  I was 
>> under the impression that pthread (as some others have mentioned) is 
>> POSIX. Or is there a solaris-specific library we should use? (Which 
>> would be unfortunate for those of us developing on other flavors of *nix)
>>
>> Thanks,
>> Will
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Router conflict
Date: Fri, 03 Feb 2006 13:20:07 -0800
Lines: 27
Distribution: su
Message-ID: <ds0he6$5if$1@news.Stanford.EDU>
References: <druukp$do6$1@news.Stanford.EDU> <ds08j7$q27$2@news.Stanford.EDU> <43E3A7B8.2B871A3E@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <43E3A7B8.2B871A3E@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:9909

ps -a?


> I did try to kill it. I use command "jobs" to find the process, it's not
> there. could you tell me the command?
> 
> Thanks.
> 
> Martin Casado wrote:
> 
> 
>>You've got a router still connected from host
>>171.64.15.99 (elaine24)
>>try killing the process.
>>
>>
>>>Hi Ari/Matt:
>>>Suddenly I got this error:
>>>
>>>Client alexqi connecting to Server vns-1.stanford.edu:12345
>>>Requesting topology 75
>>>VNS server closed session.
>>>Reason: reservehost failed
>>>
>>>could you tell me the reason?
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP Destination Unreachable payload
Date: Fri, 03 Feb 2006 13:27:23 -0800
Lines: 31
Distribution: su
Message-ID: <ds0hrp$5if$2@news.Stanford.EDU>
References: <drmkku$lh2$1@news.Stanford.EDU> <drmtcn$4eu$1@news.Stanford.EDU> <druspd$b7p$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <druspd$b7p$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9910


That's reasonable

> Is it OK to drop a packet that has less than 64 bits of data (excluding 
> the headers) and not generate an ICMP error for it in case its TTL has 
> reached zero or its destination is unreachable?
> 
> 
> Martin Casado wrote:
> 
>> Roy Zeighami wrote:
>>
>>> The RFC for ICMP says that, for a destination unreachable ICMP 
>>> message, we should return the original IP header and the first 64 
>>> bits of the payload. Is an IP packet always guaranteed to have at 
>>> least 64 bits of data in the payload?
>>>
>>
>> I'm not sure, though it is hard to conceive of a smaller, 
>> non-malicious  packet.  The minimum ip fragment size is 8 bytes.  And 
>> UDP header (much
>> smaller than TCP) are 64 bits. Your packet shouldn't crash however if
>> it receives a malformed packet
>>
>> .m
>>
>>
>>> Thanks,
>>>
>>> Roy
>>>
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: minor turbulance on vns-1
Date: Fri, 03 Feb 2006 13:52:10 -0800
Lines: 1
Distribution: su
Message-ID: <ds0ja8$778$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9911

had to kick a router
.

Path: shelby.stanford.edu!not-for-mail
From: "Sutthipong Thavisomboon" <sthavis@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PING
Date: Fri, 3 Feb 2006 14:32:53 -0800
Lines: 22
Distribution: su
Message-ID: <ds0ln2$9gt$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9912

Hi,

I just want to make sure I understand the last year FAQ posting correctly.

Suppose my eth0 is 192.168.131.99 and my eth1 is 192.168.131.100

I type command:

elaine37:~> ping 192.168.131.100

then I have to send the ICMP ECHO REPLY back through eth0, so i use eth0's 
ip addr as a src ip addr and get the following result :

64 bytes from 192.168.131.99: seq=0 ttl=61 time=5.55 ms.

Is this a correct behavior? Or do I have to use eth1's ip addr as a src ip 
addr in ICMP ECHO REPLY packet?

Thanks,
Sutthipong 


.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: IP headers other than 20 bytes?
Date: Fri, 3 Feb 2006 15:06:07 -0800
Organization: Stanford University
Lines: 1
Distribution: su
Message-ID: <20060203150607.36a2110e@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9913

Do we have to support IP headers longer than 20 bytes?
.

Path: shelby.stanford.edu!not-for-mail
From: "Junhee Seok" <jseok@stanford.edu>
Newsgroups: su.class.cs244a
Subject: about .purify and purify.output
Date: Fri, 3 Feb 2006 15:47:30 -0800
Lines: 10
Distribution: su
Message-ID: <ds0q2i$ev4$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9914

As I know, ".purify" is generated automatically,
and "purify.output" is just dump of text output results during running.
First, am I right?
Secondly, I don't have ".purify" even though I run the sr.purify.
I cannot remember how I did at the fisrt assignment.
Help me.

Junhee 


.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Purify Question
Date: Fri, 03 Feb 2006 17:23:17 -0800
Lines: 14
Distribution: su
Message-ID: <ds0vkn$ldl$1@news.Stanford.EDU>
References: <drfu7d$qv1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drfu7d$qv1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9915

See thread "purify and signals" from the 2004 newsgroup.

Roy Zeighami wrote:
> Since sr never exits, how do we get purify info?  I am running purify 
> remotely, so the output goes to a purify.output file.  Right now, the only 
> way I can make the program exit is with a ctrl-C.  When I do that the output 
> file has nothing interesting (just says it got a signal).  Has anyone 
> figured a way to work around this?
> 
> Thanks,
> 
> Roy 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Rtable file
Date: Fri, 03 Feb 2006 17:25:57 -0800
Lines: 51
Distribution: su
Message-ID: <ds0vpn$ldo$1@news.Stanford.EDU>
References: <drhtlp$l6n$1@news.Stanford.EDU> <dri4nn$r00$1@news.Stanford.EDU> <Pine.GSO.4.44.0602021232370.10760-100000@elaine4.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0602021232370.10760-100000@elaine4.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9916

Dan C Silver wrote:
> Just to clarify a bit more -- so we're basically treating each app server
> as a router, and not as a host on the same subnet as our router's
> interface?  In my particular topology it doesn't seem to be possible to
> mask the two subnets properly, so I'm guessing this is the case.

Yeah that's a good way to think about it.

> 
> And we don't have subnet masks for each interface, so we're basically
> treating each interface as being it's own subnet with a single host?
> Should we assume the subnet mask for each interface is 255.255.255.255?
> If so, should we still AND the dest ip against our subnet mask to
> determine if it's on the same subnet?

Definately do the AND, your router should work with any valid rtable 
file not ones for these simple topologies.

> 
> Thx,
> 
> - Dan
> 
> On Sun, 29 Jan 2006, Matt Falkenhagen wrote:
> 
> 
>> From the way you phrased the question I'm not sure how to answer, but....
>>
>>The rtable is just a list of rules for forwarding packets.  Your router
>>reads in this list of rules.
>>
>>Your toplogy email tells you how your router should forward packets to
>>exactly two specific IP addresses (your app servers) and to the rest of
>>the Internet.  Given that information, think about what rules you want
>>in your rtable.
>>
>>Ask again if it's not clear.
>>
>>Sutthipong Thavisomboon wrote:
>>
>>>Hi,
>>>
>>>I read in the newsgroup that we should modify the rtable static file
>>>according to the assigned topology. I see the IP address in the email,
>>>however, I'm not sure what to put for mask?
>>>
>>>Sutthipong
>>>
>>>
>>
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: traceroute question
Date: Fri, 03 Feb 2006 17:42:35 -0800
Lines: 21
Distribution: su
Message-ID: <ds10os$ma6$1@news.Stanford.EDU>
References: <drsddv$es5$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <drsddv$es5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9917

So the test script is a little flexible about this because different 
routers do different things.  Things to know are

- It's definately wrong to count eth0 and eth[1,2] as two separate hops.
- As the source address of your ICMP packet, you can choose either the 
interface it's going out on or the interface the incoming packet was 
destined to.
- BUT if the incoming packet was an ICMP echo you should conform to the RFC:

    The IP source address in an ICMP Echo Reply MUST be the same as the
    specific-destination address of the corresponding ICMP Echo Request
    message.


Will Palmeri wrote:
> What is the expected behavior when we perform a traceroute to an IP on 
> the "other" side of our router. E.g. if you traceroute eth1 or eth2 from 
> elaine, which has to "go through" eth0 first.
> 
> Thanks,
> Will
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: icmp generation, ip fragmentation
Date: Fri, 03 Feb 2006 17:50:45 -0800
Lines: 28
Distribution: su
Message-ID: <ds1187$mtf$1@news.Stanford.EDU>
References: <drump5$4n2$1@news.Stanford.EDU> <druust$e0n$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <druust$e0n$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9918

 From networksourcery:

"The originating protocol module of an internet datagram sets the 
identification field to a value that must be unique for that 
source-destination pair and protocol for the time the datagram will be 
active in the internet system."

The flags should also be set according to the protocol.  Don't set "Do 
not fragment"; your packets may need to be fragmented as they go to 
their destination.

Naeim Semsarilar wrote:
> Never mind my second question, but my first question still holds.
> 
> 
> Naeim Semsarilar wrote:
> 
>> Hey that rhymes ;)
>>
>> When I generate an ICMP error (host/port unreachable, ttl expired), 
>> what should I set the 'identification' and 'flags' fields in the 
>> enclosing IP header to?
>>
>> Also, the data portion of na ICMP packet is supposed to have the first 
>> 64 bits  of the packet that caused the error. The first 64 bits 
>> starting at the ethernet header, the IP header, or the data?
>>
>> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PING
Date: Fri, 03 Feb 2006 17:54:10 -0800
Lines: 31
Distribution: su
Message-ID: <ds11ek$n63$1@news.Stanford.EDU>
References: <ds0ln2$9gt$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds0ln2$9gt$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9919

No, from the RFC:

    The IP source address in an ICMP Echo Reply MUST be the same as the
    specific-destination address of the corresponding ICMP Echo Request
    message.

Which FAQ question were you looking at?

Sutthipong Thavisomboon wrote:
> Hi,
> 
> I just want to make sure I understand the last year FAQ posting correctly.
> 
> Suppose my eth0 is 192.168.131.99 and my eth1 is 192.168.131.100
> 
> I type command:
> 
> elaine37:~> ping 192.168.131.100
> 
> then I have to send the ICMP ECHO REPLY back through eth0, so i use eth0's 
> ip addr as a src ip addr and get the following result :
> 
> 64 bytes from 192.168.131.99: seq=0 ttl=61 time=5.55 ms.
> 
> Is this a correct behavior? Or do I have to use eth1's ip addr as a src ip 
> addr in ICMP ECHO REPLY packet?
> 
> Thanks,
> Sutthipong 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: IP headers other than 20 bytes?
Date: Fri, 03 Feb 2006 17:54:58 -0800
Lines: 11
Distribution: su
Message-ID: <ds11g3$n63$2@news.Stanford.EDU>
References: <20060203150607.36a2110e@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060203150607.36a2110e@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9920

 From the FAQ

Do I have to be able to handle IP Options?

No, other than that your client may not crash if it receives a packet 
with ip options, you don't have to do anything  with them. You don't 
have to parse them and it is acceptable to drop such packets or generate 
incorrect checksums for them.

David Reiss wrote:
> Do we have to support IP headers longer than 20 bytes?
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: about .purify and purify.output
Date: Fri, 03 Feb 2006 17:55:37 -0800
Lines: 13
Distribution: su
Message-ID: <ds11ha$n63$3@news.Stanford.EDU>
References: <ds0q2i$ev4$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds0q2i$ev4$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9921

Don't worry about these files, they don't need to be submitted.

Junhee Seok wrote:
> As I know, ".purify" is generated automatically,
> and "purify.output" is just dump of text output results during running.
> First, am I right?
> Secondly, I don't have ".purify" even though I run the sr.purify.
> I cannot remember how I did at the fisrt assignment.
> Help me.
> 
> Junhee 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: thread library?
Date: Fri, 03 Feb 2006 17:56:10 -0800
Lines: 22
Distribution: su
Message-ID: <ds11ic$n63$4@news.Stanford.EDU>
References: <drpt7a$lbp$1@news.Stanford.EDU> <drq198$pak$1@news.Stanford.EDU> <ds0di1$1jv$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds0di1$1jv$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9922

If that works for you, sure.

Paul Tarjan wrote:
> Can't we just fork a new process?
> 
> Matt Falkenhagen wrote:
> 
>> Strictly speaking, there is no ANSI C threading library :-P
>>
>> Yes, pthreads is POSIX (where the p comes from).  You should use 
>> pthreads for maximum portability.
>>
>> Will Palmeri wrote:
>>
>>> What threading library can we use and still comply to ANSI C?  I was 
>>> under the impression that pthread (as some others have mentioned) is 
>>> POSIX. Or is there a solaris-specific library we should use? (Which 
>>> would be unfortunate for those of us developing on other flavors of 
>>> *nix)
>>>
>>> Thanks,
>>> Will
.

Path: shelby.stanford.edu!not-for-mail
From: Will Palmeri <wjp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: traceroute question
Date: Fri, 03 Feb 2006 18:28:47 -0800
Lines: 25
Distribution: su
Message-ID: <ds13gs$p3u$1@news.Stanford.EDU>
References: <drsddv$es5$1@news.Stanford.EDU> <ds10os$ma6$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
In-Reply-To: <ds10os$ma6$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9923

Thanks, that definitely cleared things up.

Matt Falkenhagen wrote:
> So the test script is a little flexible about this because different 
> routers do different things.  Things to know are
> 
> - It's definately wrong to count eth0 and eth[1,2] as two separate hops.
> - As the source address of your ICMP packet, you can choose either the 
> interface it's going out on or the interface the incoming packet was 
> destined to.
> - BUT if the incoming packet was an ICMP echo you should conform to the 
> RFC:
> 
>    The IP source address in an ICMP Echo Reply MUST be the same as the
>    specific-destination address of the corresponding ICMP Echo Request
>    message.
> 
> 
> Will Palmeri wrote:
>> What is the expected behavior when we perform a traceroute to an IP on 
>> the "other" side of our router. E.g. if you traceroute eth1 or eth2 
>> from elaine, which has to "go through" eth0 first.
>>
>> Thanks,
>> Will
.

Path: shelby.stanford.edu!not-for-mail
From: Paul Tarjan <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sr_router.h
Date: Fri, 03 Feb 2006 21:59:00 -0800
Lines: 50
Distribution: su
Message-ID: <ds1fr1$68g$1@news.Stanford.EDU>
References: <drqslu$ll3$1@news.Stanford.EDU>	<drrbqo$8sr$1@news.Stanford.EDU> <20060201145014.69b33f8b@ballpoint> <drrjfc$ica$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013)
X-Accept-Language: en-us, en
In-Reply-To: <drrjfc$ica$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9924

Which would you prefer, global variables (for the arp table and packet 
queue) or us to modify sr_instance? I was dinged hard on the last assign 
for globals, so I'm just checking.

Paul

Martin Casado wrote:
> Perhaps I wasn't clear:
> 
> We want to actively discourage students from modifying the
> provided source files.  It makes grading difficult.  Unless
> there is a functional change you require (e.g. signal handlin
> or bug fixes), don't change them.
> 
> Adding to sr_instance is OK, this is a defficiency in our design.
> You are right, we should update the FAQ to say "only add changes to 
> sr_router.[c,h]".
> 
> thanks :)
> .martin
> 
> 
>> You might want to change the FAQ then:
>>
>>   Which files in the stub code can I modify?
>>
>>   The only files in the provided source that you may modify are
>>   sr_router.h and sr_router.c (this does not include bugfixes). You may,
>>   however, add your own files and update the Makefile to support them.
>>
>> I am adding prototypes for all of my funcions to sr_router.h, and I was
>> going to put a pointer to my ARP cache in sr_instance.  Are those okay?
>>
>>
>> On Wed, 01 Feb 2006 14:13:45 -0800
>> Martin Casado <casado@cs.stanford.edu> wrote:
>>
>>
>>> This is something you'll want to clear with us before doing.  It 
>>> makes grading harder and if you are not careful can break grading and 
>>> test.
>>>
>>> Generally the rule is don't muck with files other than sr_router.c
>>>
>>>
>>>> The assignment page says "We ask that you do not modify any of the 
>>>> provided files, except for sr_router.c."  I just want to be 
>>>> clear...  we cannot modify sr_router.h ?
>>>> cheers, Bruce
>>>>
.

Path: shelby.stanford.edu!not-for-mail
From: Greg Corrado <gcorrado@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: DDD = no VNS
Date: Fri, 3 Feb 2006 23:11:31 -0800
Lines: 8
Distribution: su
Message-ID: <ds1k9a$6og$1@news.Stanford.EDU>
References: <drv1md$gb1$1@news.Stanford.EDU> <drv6hp$njc$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Unison/1.7.3
Xref: shelby.stanford.edu su.class.cs244a:9925

> For ddd/gdb, you shouldn't be giving runtime arguments for the program 
> you're trying to debug when you start ddd/gdb.  Instead, start ddd with:

thanks!




.

Path: shelby.stanford.edu!not-for-mail
From: David Reiss <dreiss@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: icmp generation, ip fragmentation
Date: Fri, 3 Feb 2006 23:38:24 -0800
Organization: Stanford University
Lines: 41
Distribution: su
Message-ID: <20060203233824.06e66cbc@ballpoint>
References: <drump5$4n2$1@news.Stanford.EDU>
	<druust$e0n$1@news.Stanford.EDU>
	<ds1187$mtf$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:9926

Should we consider the "source-destination pair" to be just the two IP
addresses (in either order), or one address as the source and another as
the destination.  It would seem that if the only use of the field is to
group fragments together, then the latter is the correct interpretation.
 In that case, is it okay to just use the same identification as the
packet that generated our response?  If the computer that generated the
IP packets followed the protocol and made their identifications unique,
then our identifications should be unique in the opposite direction,
right?

On Fri, 03 Feb 2006 17:50:45 -0800
Matt Falkenhagen <mjf@stanford.edu> wrote:

>  From networksourcery:
> 
> "The originating protocol module of an internet datagram sets the 
> identification field to a value that must be unique for that 
> source-destination pair and protocol for the time the datagram will be 
> active in the internet system."
> 
> The flags should also be set according to the protocol.  Don't set "Do 
> not fragment"; your packets may need to be fragmented as they go to 
> their destination.
> 
> Naeim Semsarilar wrote:
> > Never mind my second question, but my first question still holds.
> > 
> > 
> > Naeim Semsarilar wrote:
> > 
> >> Hey that rhymes ;)
> >>
> >> When I generate an ICMP error (host/port unreachable, ttl expired), 
> >> what should I set the 'identification' and 'flags' fields in the 
> >> enclosing IP header to?
> >>
> >> Also, the data portion of na ICMP packet is supposed to have the first 
> >> 64 bits  of the packet that caused the error. The first 64 bits 
> >> starting at the ethernet header, the IP header, or the data?
> >>
> >> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Rtable file
Date: Fri, 03 Feb 2006 23:43:44 -0800
Lines: 59
Distribution: su
Message-ID: <ds1lvo$ape$1@news.Stanford.EDU>
References: <drhtlp$l6n$1@news.Stanford.EDU> <dri4nn$r00$1@news.Stanford.EDU> <Pine.GSO.4.44.0602021232370.10760-100000@elaine4.Stanford.EDU> <ds0vpn$ldo$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <ds0vpn$ldo$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9927

Could you please explain this a bit more? What exactly is the 
significance of the subnet field in rtable?

Thanks.


Matt Falkenhagen wrote:
> Dan C Silver wrote:
>> Just to clarify a bit more -- so we're basically treating each app server
>> as a router, and not as a host on the same subnet as our router's
>> interface?  In my particular topology it doesn't seem to be possible to
>> mask the two subnets properly, so I'm guessing this is the case.
> 
> Yeah that's a good way to think about it.
> 
>>
>> And we don't have subnet masks for each interface, so we're basically
>> treating each interface as being it's own subnet with a single host?
>> Should we assume the subnet mask for each interface is 255.255.255.255?
>> If so, should we still AND the dest ip against our subnet mask to
>> determine if it's on the same subnet?
> 
> Definately do the AND, your router should work with any valid rtable 
> file not ones for these simple topologies.
> 
>>
>> Thx,
>>
>> - Dan
>>
>> On Sun, 29 Jan 2006, Matt Falkenhagen wrote:
>>
>>
>>> From the way you phrased the question I'm not sure how to answer, 
>>> but....
>>>
>>> The rtable is just a list of rules for forwarding packets.  Your router
>>> reads in this list of rules.
>>>
>>> Your toplogy email tells you how your router should forward packets to
>>> exactly two specific IP addresses (your app servers) and to the rest of
>>> the Internet.  Given that information, think about what rules you want
>>> in your rtable.
>>>
>>> Ask again if it's not clear.
>>>
>>> Sutthipong Thavisomboon wrote:
>>>
>>>> Hi,
>>>>
>>>> I read in the newsgroup that we should modify the rtable static file
>>>> according to the assigned topology. I see the IP address in the email,
>>>> however, I'm not sure what to put for mask?
>>>>
>>>> Sutthipong
>>>>
>>>>
>>>
>>
.

Path: shelby.stanford.edu!not-for-mail
From: "Nazia Zaman" <nazia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Warning
Date: Sat, 4 Feb 2006 01:51:33 -0800
Lines: 9
Distribution: su
Message-ID: <ds1tf7$kk1$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9928

I am getting this warning even though I haven't changed these files:

In file included from sr_if.h:20,
                 from sr_router.c:18:
/usr/include/sys/int_types.h:9: warning: ignoring #pragma ident

Any ideas? 


.

Path: shelby.stanford.edu!not-for-mail
From: "Nikhil Raghavan" <nikhilr@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Query on ICMP Host/PORT Unreach
Date: Sat, 4 Feb 2006 02:46:34 -0800
Organization: Stanford University
Lines: 10
Distribution: su
Message-ID: <ds20mc$nd1$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9929

An ICMP host/port unreach message is supposed
to include the old packet's ip header and the first 8 bytes of data. Do we 
need to blindly copy out
old_iphdr->ip_hl *4 + 8 bytes of data or
are we supposed to change fields like total length and checksum of the old 
ip packet header?

thanks. 


.

Path: shelby.stanford.edu!elaine39.Stanford.EDU!olegs
From: olegs@Stanford.EDU (Oleg Slezberg)
Newsgroups: su.class.cs244a
Subject: Re: Warning
Date: Sat, 4 Feb 2006 15:13:45 +0000 (UTC)
Organization: Stanford University, CA 94305, USA
Lines: 19
Distribution: su
Message-ID: <ds2gb9$8r3$1@news.Stanford.EDU>
References: <ds1tf7$kk1$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9930

There were couple of posts about it before. The TA said we can ignore it.
Also somebody suggested adding -Wno-unknown-pragmas to CFLAGS in the
Makefile -- worked for me.

Oleg.

In article <ds1tf7$kk1$1@news.Stanford.EDU>,
Nazia Zaman <nazia@stanford.edu> wrote:
>I am getting this warning even though I haven't changed these files:
>
>In file included from sr_if.h:20,
>                 from sr_router.c:18:
>/usr/include/sys/int_types.h:9: warning: ignoring #pragma ident
>
>Any ideas? 
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Query on ICMP Host/PORT Unreach
Date: Sat, 04 Feb 2006 09:57:55 -0800
Lines: 15
Distribution: su
Message-ID: <ds2puu$gh6$1@news.Stanford.EDU>
References: <ds20mc$nd1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <ds20mc$nd1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9931

You should be able to determine this yourself.  Remember that you
can log packets and the app servers will respond with the correct
host unreach


> An ICMP host/port unreach message is supposed
> to include the old packet's ip header and the first 8 bytes of data. Do we 
> need to blindly copy out
> old_iphdr->ip_hl *4 + 8 bytes of data or
> are we supposed to change fields like total length and checksum of the old 
> ip packet header?
> 
> thanks. 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Clack with Ethereal component
Date: Sat, 04 Feb 2006 10:13:34 -0800
Lines: 15
Distribution: su
Message-ID: <ds2qsa$hee$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9932

The Clack team has added an component which does a very good
job of mimicking Ethereal.  It shows all header fields and their 
associated byte values.  The interface is much better than tcpdump
so its probably worth checking out if you are still working on the
assignment:

   http://www.clackrouter.net/demo/clack_demo_ethereal.html

If you have any problems with it, e-mail (your very own)
Paul at (ptarjan@gmail.com).  Note, you'll need java 1.5
to use it which I don't believe is installed on any of the
cluster browsers.

thanks,
Martin
.

Path: shelby.stanford.edu!not-for-mail
From: "Bruce Schechter" <bruceds@stanford.edu>
Newsgroups: su.class.cs244a
Subject: IP packets decomposition:  ICMP vs. what other specific choices
Date: Sat, 4 Feb 2006 11:08:20 -0800
Lines: 16
Distribution: su
Message-ID: <ds2u35$kdm$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9933


I noticed in Clack that they have a "Level3Demux" which apparently 
delineates between incoming ICMP, UDP and TCP packets.  This is interesting 
to me because I am trying to determine if my router would treat forwarding 
decisions of IP packets differently between various kinds of IP packets. 
Clearly ICMP packets need special processing.  But I would have thought that 
all other packets (including both UDP and TCP) would be treated as one 
general case.  Yet, Clack seems to differentiate somehow between UDP and 
TCP.  Is there a reason for us to do so as well?  I don't see any 
requirement in the Assignment document?


Thanks,
 -- Bruce


.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Purify running out of threads
Date: Sat, 04 Feb 2006 12:12:15 -0800
Lines: 8
Distribution: su
Message-ID: <ds31r3$noq$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9934

Has anyone else seen Purify terminating your program because it exceeds 
the allowable number of threads?  My program creates threads when 
needed, but from what I can tell the threads all die when they are done. 
  The program works fine when not in Purify.  Does anyone know if this 
is a limitation of Purify or a deficiency of my program?

Thanks,
Steve
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Byte ordering
Date: Sat, 04 Feb 2006 12:24:59 -0800
Lines: 41
Distribution: su
Message-ID: <ds32j5$ogq$1@news.Stanford.EDU>
References: <drrt01$s1v$1@news.Stanford.EDU> <drs18t$2ld$4@news.Stanford.EDU> <druleu$3er$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <druleu$3er$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9935

bump

Naeim Semsarilar wrote:
> In sr_protocol.h, we have:
> 
> #if __BYTE_ORDER == __LITTLE_ENDIAN
>     unsigned int ip_hl:4;        /* header length */
>     unsigned int ip_v:4;        /* version */
> #elif __BYTE_ORDER == __BIG_ENDIAN
>     unsigned int ip_v:4;        /* version */
>     unsigned int ip_hl:4;        /* header length */
> #else
> #error "Byte ordering not specified "
> #endif
> 
> I'm not sure I understand what's going on here. The ver and hl fields 
> occupy 4 bits each. So why is *byte* ordering important here? I thought 
> byte ordering only applied to byte level types such as 16-bit and 32-bit 
> integers.
> 
> And a related question: if I need to construct an IP packet from 
> scratch, do I need to be concerned about how I assign to ip_v and ip_hl? 
> Can I just say iphdr->ip_v = 0x45; or is this bad (dependent on the 
> endianess of the machine)?
> 
> Thanks.
> 
> 
> Martin Casado wrote:
>>
>>
>>> Hi,
>>>
>>> Just to clarify, what is the byte-ordering of the fields in the 
>>> packet buffer passed in sr_handlepacket, and what byte-ordering 
>>> should the packet that we pass to sr_send_packet be? I'm thinking the 
>>> answer to both is network order, but please clarify.
>>
>> yup
>>
>>> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Logging a traceroute
Date: Sat, 04 Feb 2006 14:20:14 -0800
Lines: 11
Distribution: su
Message-ID: <ds39b8$lr$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9936

I looked at the packets that went through my router when I tried 
traceroute to an app server from an elaine machine. In the end, the app 
server sends an ICMP destination unreachable back to the elaine machine. 
This packet has the original IP header, the first 64 bits of the 
original packet (which happens to be the whole UDP header), plus 10 more 
bytes that show up as "Data (10 bytes)" in ethereal.

I thought an ICMP error was supposed to contain only the original IP 
header and the first 64 bits of data. So what are these extra 10 bytes?

Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: "Nazia Zaman" <nazia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: modifying sr_router.c
Date: Sat, 4 Feb 2006 14:32:26 -0800
Lines: 6
Distribution: su
Message-ID: <ds3a1v$13i$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9937

I want to add a function arp_init() in sr_init() in sr_route.c. Can I modify 
the file?
Thanks,
Nazia 


.

Path: shelby.stanford.edu!not-for-mail
From: Paul Tarjan <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Clack with Ethereal component
Date: Sat, 04 Feb 2006 14:40:00 -0800
Lines: 33
Distribution: su
Message-ID: <ds3afv$1bp$1@news.Stanford.EDU>
References: <ds2qsa$hee$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013)
X-Accept-Language: en-us, en
In-Reply-To: <ds2qsa$hee$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9938

Martin, always trying to make more work for me eh? :)

Anyways, firefox doesn't have a java plugin on any of the cluster 
computers, but it has java 1.5 on the command line, so just take the jar:

http://www.clackrouter.net/demo/signed-clack-0.99.1.jar

and run it like this:

java -jar signed-clack-0.99.1.jar -u 
http://www.clackrouter.net/demo/clack_demo_ethereal.topo

I welcome any feature suggestions or bug reports. (ptarjan@gmail.com)

Thanks
Paul

Martin Casado wrote:
> The Clack team has added an component which does a very good
> job of mimicking Ethereal.  It shows all header fields and their 
> associated byte values.  The interface is much better than tcpdump
> so its probably worth checking out if you are still working on the
> assignment:
> 
>   http://www.clackrouter.net/demo/clack_demo_ethereal.html
> 
> If you have any problems with it, e-mail (your very own)
> Paul at (ptarjan@gmail.com).  Note, you'll need java 1.5
> to use it which I don't believe is installed on any of the
> cluster browsers.
> 
> thanks,
> Martin
.

Path: shelby.stanford.edu!not-for-mail
From: "Nazia Zaman" <nazia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Traceroute
Date: Sat, 4 Feb 2006 14:56:00 -0800
Lines: 23
Distribution: su
Message-ID: <ds3be5$275$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9939

A trace route to my router 192.168.130.70 looks like this:
traceroute to 192.168.130.70 (192.168.130.70): 1-30 hops, 38 byte packets
 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.557 ms  0.383 ms  0.369 ms
 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.554 ms  0.582 ms  0.570 ms
 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.451 ms (ttl=62!)  0.420 ms 
(ttl=62!)  0.420 ms (ttl=62!)
 4  192.168.130.70 (192.168.130.70)  2.59 ms !A  2.44 ms !A  2.44 ms !A

A trace route to my application server 192.168.130.72 looks like this:
elaine35:~/cs244a/HW2/stub5FINALCOPY> traceroute 192.168.130.72
traceroute to 192.168.130.72 (192.168.130.72): 1-30 hops, 38 byte packets
 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.751 ms  0.405 ms  0.367 ms
 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.486 ms  0.511 ms  0.557 ms
 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.500 ms (ttl=62!)  0.415 ms 
(ttl=62!)  0.577 ms (ttl=62!)
 4  192.168.130.72 (192.168.130.72)  3.95 ms !A  2.84 ms !A  1.44 ms !A

Are these okay? But if you notice the second trace route it does not show my 
router, it should show it right?
Thanks,
Nazia 


.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: IP packets decomposition:  ICMP vs. what other specific choices
Date: Sat, 04 Feb 2006 15:01:07 -0800
Lines: 24
Distribution: su
Message-ID: <ds3bnd$29l$1@news.Stanford.EDU>
References: <ds2u35$kdm$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <ds2u35$kdm$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9940

Heya Bruce,

Level 3 demultiplexing is only used for packets to Clack
(or least it only should be).  Clack has a TCP stack component
and other L3 processing components.  For sr, you should only
worry about distinguishing packets addressed to you.

..m

> I noticed in Clack that they have a "Level3Demux" which apparently 
> delineates between incoming ICMP, UDP and TCP packets.  This is interesting 
> to me because I am trying to determine if my router would treat forwarding 
> decisions of IP packets differently between various kinds of IP packets. 
> Clearly ICMP packets need special processing.  But I would have thought that 
> all other packets (including both UDP and TCP) would be treated as one 
> general case.  Yet, Clack seems to differentiate somehow between UDP and 
> TCP.  Is there a reason for us to do so as well?  I don't see any 
> requirement in the Assignment document?
> 
> 
> Thanks,
>  -- Bruce
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: modifying sr_router.c
Date: Sat, 04 Feb 2006 15:02:41 -0800
Lines: 9
Distribution: su
Message-ID: <ds3bqa$29l$2@news.Stanford.EDU>
References: <ds3a1v$13i$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <ds3a1v$13i$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9941


You can modify router.c

> I want to add a function arp_init() in sr_init() in sr_route.c. Can I modify 
> the file?
> Thanks,
> Nazia 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Traceroute
Date: Sat, 04 Feb 2006 15:03:49 -0800
Lines: 27
Distribution: su
Message-ID: <ds3bse$29l$3@news.Stanford.EDU>
References: <ds3be5$275$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <ds3be5$275$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9942

N
> 
> A trace route to my application server 192.168.130.72 looks like this:
> elaine35:~/cs244a/HW2/stub5FINALCOPY> traceroute 192.168.130.72
> traceroute to 192.168.130.72 (192.168.130.72): 1-30 hops, 38 byte packets
>  1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.751 ms  0.405 ms  0.367 ms
>  2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.486 ms  0.511 ms  0.557 ms
>  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.500 ms (ttl=62!)  0.415 ms 
> (ttl=62!)  0.577 ms (ttl=62!)
>  4  192.168.130.72 (192.168.130.72)  3.95 ms !A  2.84 ms !A  1.44 ms !A
> 
> Are these okay?

nope

  But if you notice the second trace route it does not show my
> router, it should show it right?

yup

> Thanks,

wecome

> Nazia 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Nazia Zaman" <nazia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Traceroute
Date: Sat, 4 Feb 2006 15:13:51 -0800
Lines: 31
Distribution: su
Message-ID: <ds3cfm$2uc$1@news.Stanford.EDU>
References: <ds3be5$275$1@news.Stanford.EDU> <ds3bse$29l$3@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9943

Any idea why it is doing this?

"Martin Casado" <casado@cs.stanford.edu> wrote in message 
news:ds3bse$29l$3@news.Stanford.EDU...
> N
>>
>> A trace route to my application server 192.168.130.72 looks like this:
>> elaine35:~/cs244a/HW2/stub5FINALCOPY> traceroute 192.168.130.72
>> traceroute to 192.168.130.72 (192.168.130.72): 1-30 hops, 38 byte packets
>>  1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.751 ms  0.405 ms  0.367 ms
>>  2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.486 ms  0.511 ms  0.557 ms
>>  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.500 ms (ttl=62!)  0.415 
>> ms (ttl=62!)  0.577 ms (ttl=62!)
>>  4  192.168.130.72 (192.168.130.72)  3.95 ms !A  2.84 ms !A  1.44 ms !A
>>
>> Are these okay?
>
> nope
>
>  But if you notice the second trace route it does not show my
>> router, it should show it right?
>
> yup
>
>> Thanks,
>
> wecome
>
>> Nazia 


.

Path: shelby.stanford.edu!not-for-mail
From: "Nazia Zaman" <nazia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Traceroute
Date: Sat, 4 Feb 2006 15:15:39 -0800
Lines: 28
Distribution: su
Message-ID: <ds3cj3$35l$1@news.Stanford.EDU>
References: <ds3be5$275$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9944

Is the first one at least ok?

"Nazia Zaman" <nazia@stanford.edu> wrote in message 
news:ds3be5$275$1@news.Stanford.EDU...
>A trace route to my router 192.168.130.70 looks like this:
> traceroute to 192.168.130.70 (192.168.130.70): 1-30 hops, 38 byte packets
> 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.557 ms  0.383 ms  0.369 ms
> 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.554 ms  0.582 ms  0.570 ms
> 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.451 ms (ttl=62!)  0.420 ms 
> (ttl=62!)  0.420 ms (ttl=62!)
> 4  192.168.130.70 (192.168.130.70)  2.59 ms !A  2.44 ms !A  2.44 ms !A
>
> A trace route to my application server 192.168.130.72 looks like this:
> elaine35:~/cs244a/HW2/stub5FINALCOPY> traceroute 192.168.130.72
> traceroute to 192.168.130.72 (192.168.130.72): 1-30 hops, 38 byte packets
> 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.751 ms  0.405 ms  0.367 ms
> 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.486 ms  0.511 ms  0.557 ms
> 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.500 ms (ttl=62!)  0.415 ms 
> (ttl=62!)  0.577 ms (ttl=62!)
> 4  192.168.130.72 (192.168.130.72)  3.95 ms !A  2.84 ms !A  1.44 ms !A
>
> Are these okay? But if you notice the second trace route it does not show 
> my router, it should show it right?
> Thanks,
> Nazia
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Paul Tarjan <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Traceroute
Date: Sat, 04 Feb 2006 15:19:41 -0800
Lines: 43
Distribution: su
Message-ID: <ds3cqc$3au$1@news.Stanford.EDU>
References: <ds3be5$275$1@news.Stanford.EDU> <ds3bse$29l$3@news.Stanford.EDU> <ds3cfm$2uc$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013)
X-Accept-Language: en-us, en
In-Reply-To: <ds3cfm$2uc$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9945

Nazia,

I don't think you are dropping packets when the TTL gets too low.

Paul

Nazia Zaman wrote:
> Any idea why it is doing this?
> 
> "Martin Casado" <casado@cs.stanford.edu> wrote in message 
> news:ds3bse$29l$3@news.Stanford.EDU...
> 
>>N
>>
>>>A trace route to my application server 192.168.130.72 looks like this:
>>>elaine35:~/cs244a/HW2/stub5FINALCOPY> traceroute 192.168.130.72
>>>traceroute to 192.168.130.72 (192.168.130.72): 1-30 hops, 38 byte packets
>>> 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.751 ms  0.405 ms  0.367 ms
>>> 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.486 ms  0.511 ms  0.557 ms
>>> 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.500 ms (ttl=62!)  0.415 
>>>ms (ttl=62!)  0.577 ms (ttl=62!)
>>> 4  192.168.130.72 (192.168.130.72)  3.95 ms !A  2.84 ms !A  1.44 ms !A
>>>
>>>Are these okay?
>>
>>nope
>>
>> But if you notice the second trace route it does not show my
>>
>>>router, it should show it right?
>>
>>yup
>>
>>
>>>Thanks,
>>
>>wecome
>>
>>
>>>Nazia 
> 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Traceroute
Date: Sat, 04 Feb 2006 15:23:08 -0800
Lines: 30
Distribution: su
Message-ID: <ds3d0m$3ht$1@news.Stanford.EDU>
References: <ds3be5$275$1@news.Stanford.EDU> <ds3cj3$35l$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <ds3cj3$35l$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9946

why don't you test it against Clack?

> Is the first one at least ok?
> 
> "Nazia Zaman" <nazia@stanford.edu> wrote in message 
> news:ds3be5$275$1@news.Stanford.EDU...
>> A trace route to my router 192.168.130.70 looks like this:
>> traceroute to 192.168.130.70 (192.168.130.70): 1-30 hops, 38 byte packets
>> 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.557 ms  0.383 ms  0.369 ms
>> 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.554 ms  0.582 ms  0.570 ms
>> 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.451 ms (ttl=62!)  0.420 ms 
>> (ttl=62!)  0.420 ms (ttl=62!)
>> 4  192.168.130.70 (192.168.130.70)  2.59 ms !A  2.44 ms !A  2.44 ms !A
>>
>> A trace route to my application server 192.168.130.72 looks like this:
>> elaine35:~/cs244a/HW2/stub5FINALCOPY> traceroute 192.168.130.72
>> traceroute to 192.168.130.72 (192.168.130.72): 1-30 hops, 38 byte packets
>> 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.751 ms  0.405 ms  0.367 ms
>> 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.486 ms  0.511 ms  0.557 ms
>> 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.500 ms (ttl=62!)  0.415 ms 
>> (ttl=62!)  0.577 ms (ttl=62!)
>> 4  192.168.130.72 (192.168.130.72)  3.95 ms !A  2.84 ms !A  1.44 ms !A
>>
>> Are these okay? But if you notice the second trace route it does not show 
>> my router, it should show it right?
>> Thanks,
>> Nazia
>>
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: George Su <gpsu@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: IP identification field.
Date: Sat, 04 Feb 2006 15:25:17 -0800
Lines: 5
Distribution: su
Message-ID: <ds3d4u$3k5$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9947

The IP identification field is used for fragmentation.  And since we're 
not required to do fraqmentation, can we just put all 0's in the IP 
packets that originates from our router?

--George
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: IP identification field.
Date: Sat, 04 Feb 2006 15:27:11 -0800
Lines: 8
Distribution: su
Message-ID: <ds3d88$3ht$2@news.Stanford.EDU>
References: <ds3d4u$3k5$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <ds3d4u$3k5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9948

nope. What if it is fragmented on route?


> The IP identification field is used for fragmentation.  And since we're 
> not required to do fraqmentation, can we just put all 0's in the IP 
> packets that originates from our router?
> 
> --George
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: routing table mask
Date: Sat, 04 Feb 2006 16:03:06 -0800
Lines: 11
Distribution: su
Message-ID: <ds3fc5$58p$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9949

I'm not exactly sure how the mask field in the routing table is supposed 
to work. Say I have the following (hypothetical) entry in my routing table:

ip  : 192.168.131.0
gw  : 192.168.131.1
mask: 255.255.255.0

Does this mean that packets destined to 192.168.131.0 to 192.168.131.255 
should be forwarded to 192.168.131.1?

Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: "Nazia Zaman" <nazia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Traceroute
Date: Sat, 4 Feb 2006 16:13:07 -0800
Lines: 50
Distribution: su
Message-ID: <ds3fuq$5pk$1@news.Stanford.EDU>
References: <ds3be5$275$1@news.Stanford.EDU> <ds3cj3$35l$1@news.Stanford.EDU> <ds3d0m$3ht$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9950

Clack doesn't reply to a trace route to my router!

 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.536 ms  0.426 ms  0.374 ms
 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.577 ms  0.533 ms  0.518 ms
 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.423 ms (ttl=62!)  0.422 ms 
(ttl=62!)  0.407 ms (ttl=62!)
 4  *  *  *
 5  *  *  *
 6  *  *  *
 7  *  *  *
 8  *  *  *
 9  *  *  *
10  *  *  *
11  *  *  *
12
Is that normal????
"Martin Casado" <casado@cs.stanford.edu> wrote in message 
news:ds3d0m$3ht$1@news.Stanford.EDU...
> why don't you test it against Clack?
>
>> Is the first one at least ok?
>>
>> "Nazia Zaman" <nazia@stanford.edu> wrote in message 
>> news:ds3be5$275$1@news.Stanford.EDU...
>>> A trace route to my router 192.168.130.70 looks like this:
>>> traceroute to 192.168.130.70 (192.168.130.70): 1-30 hops, 38 byte 
>>> packets
>>> 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.557 ms  0.383 ms  0.369 ms
>>> 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.554 ms  0.582 ms  0.570 ms
>>> 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.451 ms (ttl=62!)  0.420 
>>> ms (ttl=62!)  0.420 ms (ttl=62!)
>>> 4  192.168.130.70 (192.168.130.70)  2.59 ms !A  2.44 ms !A  2.44 ms !A
>>>
>>> A trace route to my application server 192.168.130.72 looks like this:
>>> elaine35:~/cs244a/HW2/stub5FINALCOPY> traceroute 192.168.130.72
>>> traceroute to 192.168.130.72 (192.168.130.72): 1-30 hops, 38 byte 
>>> packets
>>> 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.751 ms  0.405 ms  0.367 ms
>>> 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.486 ms  0.511 ms  0.557 ms
>>> 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.500 ms (ttl=62!)  0.415 
>>> ms (ttl=62!)  0.577 ms (ttl=62!)
>>> 4  192.168.130.72 (192.168.130.72)  3.95 ms !A  2.84 ms !A  1.44 ms !A
>>>
>>> Are these okay? But if you notice the second trace route it does not 
>>> show my router, it should show it right?
>>> Thanks,
>>> Nazia
>>>
>> 

.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sr_send_packet
Date: Sat, 04 Feb 2006 16:26:00 -0800
Lines: 13
Distribution: su
Message-ID: <ds3gn2$5fq$1@news.Stanford.EDU>
References: <drsf3q$jhc$1@news.Stanford.EDU> <drtlt9$qpb$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <drtlt9$qpb$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9951

It is OK to exit with an error if sr_send_packet returns -1?


Martin Casado wrote:
> 
>> What should I do when sr_send_packet returns -1? Can I just print out 
>> some error message and continue?
> 
> good enough
> 
> 
>> Thanks!
>> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Global Structure
Date: Sat, 04 Feb 2006 16:36:06 -0800
Lines: 7
Distribution: su
Message-ID: <C00A8876.281B%jpettit@cs.stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.2.1.051004
Thread-Topic: Global Structure
Thread-Index: AcYp7CZnZL4RaJXfEdqqXQARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:9952

There was a question asked that I didn't see an answer to: are we allowed to
use a limited number of global structures?  I plan on launching a thread on
startup, but I don't know how I can share state without either a global
structure or modifying code that we're not supposed to touch.

--Justin

.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Traceroute
Date: Sat, 04 Feb 2006 16:38:43 -0800
Lines: 59
Distribution: su
Message-ID: <ds3het$727$1@news.Stanford.EDU>
References: <ds3be5$275$1@news.Stanford.EDU> <ds3cj3$35l$1@news.Stanford.EDU> <ds3d0m$3ht$1@news.Stanford.EDU> <ds3fuq$5pk$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <ds3fuq$5pk$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9953

I'm getting the same behavior from Clack. It works if I traceroute an 
app server, but when I traceroute any of the router IPs, I get what was 
just described.

Is this normal behavior?

Thanks.


Nazia Zaman wrote:
> Clack doesn't reply to a trace route to my router!
> 
>  1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.536 ms  0.426 ms  0.374 ms
>  2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.577 ms  0.533 ms  0.518 ms
>  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.423 ms (ttl=62!)  0.422 ms 
> (ttl=62!)  0.407 ms (ttl=62!)
>  4  *  *  *
>  5  *  *  *
>  6  *  *  *
>  7  *  *  *
>  8  *  *  *
>  9  *  *  *
> 10  *  *  *
> 11  *  *  *
> 12
> Is that normal????
> "Martin Casado" <casado@cs.stanford.edu> wrote in message 
> news:ds3d0m$3ht$1@news.Stanford.EDU...
>> why don't you test it against Clack?
>>
>>> Is the first one at least ok?
>>>
>>> "Nazia Zaman" <nazia@stanford.edu> wrote in message 
>>> news:ds3be5$275$1@news.Stanford.EDU...
>>>> A trace route to my router 192.168.130.70 looks like this:
>>>> traceroute to 192.168.130.70 (192.168.130.70): 1-30 hops, 38 byte 
>>>> packets
>>>> 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.557 ms  0.383 ms  0.369 ms
>>>> 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.554 ms  0.582 ms  0.570 ms
>>>> 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.451 ms (ttl=62!)  0.420 
>>>> ms (ttl=62!)  0.420 ms (ttl=62!)
>>>> 4  192.168.130.70 (192.168.130.70)  2.59 ms !A  2.44 ms !A  2.44 ms !A
>>>>
>>>> A trace route to my application server 192.168.130.72 looks like this:
>>>> elaine35:~/cs244a/HW2/stub5FINALCOPY> traceroute 192.168.130.72
>>>> traceroute to 192.168.130.72 (192.168.130.72): 1-30 hops, 38 byte 
>>>> packets
>>>> 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.751 ms  0.405 ms  0.367 ms
>>>> 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.486 ms  0.511 ms  0.557 ms
>>>> 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.500 ms (ttl=62!)  0.415 
>>>> ms (ttl=62!)  0.577 ms (ttl=62!)
>>>> 4  192.168.130.72 (192.168.130.72)  3.95 ms !A  2.84 ms !A  1.44 ms !A
>>>>
>>>> Are these okay? But if you notice the second trace route it does not 
>>>> show my router, it should show it right?
>>>> Thanks,
>>>> Nazia
>>>>
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Will Palmeri <wjp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Global Structure
Date: Sat, 04 Feb 2006 16:49:04 -0800
Lines: 10
Distribution: su
Message-ID: <ds3i1r$7ca$1@news.Stanford.EDU>
References: <C00A8876.281B%jpettit@cs.stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
In-Reply-To: <C00A8876.281B%jpettit@cs.stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:9954

I'm interested in this as well...

Justin Pettit wrote:
> There was a question asked that I didn't see an answer to: are we allowed to
> use a limited number of global structures?  I plan on launching a thread on
> startup, but I don't know how I can share state without either a global
> structure or modifying code that we're not supposed to touch.
> 
> --Justin
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Global Structure
Date: Sat, 04 Feb 2006 16:54:35 -0800
Lines: 15
Distribution: su
Message-ID: <ds3ic4$7uk$1@news.Stanford.EDU>
References: <C00A8876.281B%jpettit@cs.stanford.edu> <ds3i1r$7ca$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <ds3i1r$7ca$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9955


You can add a global for your own state.

> I'm interested in this as well...
> 
> Justin Pettit wrote:
>> There was a question asked that I didn't see an answer to: are we 
>> allowed to
>> use a limited number of global structures?  I plan on launching a 
>> thread on
>> startup, but I don't know how I can share state without either a global
>> structure or modifying code that we're not supposed to touch.
>>
>> --Justin
>>
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Traceroute
Date: Sat, 04 Feb 2006 16:55:18 -0800
Lines: 63
Distribution: su
Message-ID: <ds3idf$7uk$2@news.Stanford.EDU>
References: <ds3be5$275$1@news.Stanford.EDU> <ds3cj3$35l$1@news.Stanford.EDU> <ds3d0m$3ht$1@news.Stanford.EDU> <ds3fuq$5pk$1@news.Stanford.EDU> <ds3het$727$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <ds3het$727$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9956


I actually haven't tried tracerouting to the router from Clack.
I apologize if t isn't working. We'll have to fix that.

> I'm getting the same behavior from Clack. It works if I traceroute an 
> app server, but when I traceroute any of the router IPs, I get what was 
> just described.
> 
> Is this normal behavior?
> 
> Thanks.
> 
> 
> Nazia Zaman wrote:
>> Clack doesn't reply to a trace route to my router!
>>
>>  1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.536 ms  0.426 ms  0.374 ms
>>  2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.577 ms  0.533 ms  0.518 ms
>>  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.423 ms (ttl=62!)  
>> 0.422 ms (ttl=62!)  0.407 ms (ttl=62!)
>>  4  *  *  *
>>  5  *  *  *
>>  6  *  *  *
>>  7  *  *  *
>>  8  *  *  *
>>  9  *  *  *
>> 10  *  *  *
>> 11  *  *  *
>> 12
>> Is that normal????
>> "Martin Casado" <casado@cs.stanford.edu> wrote in message 
>> news:ds3d0m$3ht$1@news.Stanford.EDU...
>>> why don't you test it against Clack?
>>>
>>>> Is the first one at least ok?
>>>>
>>>> "Nazia Zaman" <nazia@stanford.edu> wrote in message 
>>>> news:ds3be5$275$1@news.Stanford.EDU...
>>>>> A trace route to my router 192.168.130.70 looks like this:
>>>>> traceroute to 192.168.130.70 (192.168.130.70): 1-30 hops, 38 byte 
>>>>> packets
>>>>> 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.557 ms  0.383 ms  0.369 ms
>>>>> 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.554 ms  0.582 ms  0.570 ms
>>>>> 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.451 ms (ttl=62!)  
>>>>> 0.420 ms (ttl=62!)  0.420 ms (ttl=62!)
>>>>> 4  192.168.130.70 (192.168.130.70)  2.59 ms !A  2.44 ms !A  2.44 ms !A
>>>>>
>>>>> A trace route to my application server 192.168.130.72 looks like this:
>>>>> elaine35:~/cs244a/HW2/stub5FINALCOPY> traceroute 192.168.130.72
>>>>> traceroute to 192.168.130.72 (192.168.130.72): 1-30 hops, 38 byte 
>>>>> packets
>>>>> 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.751 ms  0.405 ms  0.367 ms
>>>>> 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.486 ms  0.511 ms  0.557 ms
>>>>> 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.500 ms (ttl=62!)  
>>>>> 0.415 ms (ttl=62!)  0.577 ms (ttl=62!)
>>>>> 4  192.168.130.72 (192.168.130.72)  3.95 ms !A  2.84 ms !A  1.44 ms !A
>>>>>
>>>>> Are these okay? But if you notice the second trace route it does 
>>>>> not show my router, it should show it right?
>>>>> Thanks,
>>>>> Nazia
>>>>>
>>
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: routing table mask
Date: Sat, 04 Feb 2006 16:56:05 -0800
Lines: 16
Distribution: su
Message-ID: <ds3ieu$7uk$3@news.Stanford.EDU>
References: <ds3fc5$58p$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <ds3fc5$58p$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9957

Naeim Semsarilar wrote:
> I'm not exactly sure how the mask field in the routing table is supposed 
> to work. Say I have the following (hypothetical) entry in my routing table:
> 
> ip  : 192.168.131.0
> gw  : 192.168.131.1
> mask: 255.255.255.0
> 
> Does this mean that packets destined to 192.168.131.0 to 192.168.131.255 
> should be forwarded to 192.168.131.1?

yup, however since we are limited in the IP addresses we can allot, your 
masks should all be 255.255.255.255


> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: icmp generation, ip fragmentation
Date: Sat, 04 Feb 2006 17:22:14 -0800
Lines: 52
Distribution: su
Message-ID: <ds3juq$9c8$1@news.Stanford.EDU>
References: <drump5$4n2$1@news.Stanford.EDU>	<druust$e0n$1@news.Stanford.EDU>	<ds1187$mtf$1@news.Stanford.EDU> <20060203233824.06e66cbc@ballpoint>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <20060203233824.06e66cbc@ballpoint>
Xref: shelby.stanford.edu su.class.cs244a:9958

David Reiss wrote:
> Should we consider the "source-destination pair" to be just the two IP
> addresses (in either order), or one address as the source and another as
> the destination.  It would seem that if the only use of the field is to
> group fragments together, then the latter is the correct interpretation.

I believe you're right, but check the RFC to make sure.

>  In that case, is it okay to just use the same identification as the
> packet that generated our response?  If the computer that generated the
> IP packets followed the protocol and made their identifications unique,
> then our identifications should be unique in the opposite direction,
> right?

Ouch what a hack.  No you shouldn't assume the other host is behaving 
properly.  Make sure yourself.

> 
> On Fri, 03 Feb 2006 17:50:45 -0800
> Matt Falkenhagen <mjf@stanford.edu> wrote:
> 
> 
>> From networksourcery:
>>
>>"The originating protocol module of an internet datagram sets the 
>>identification field to a value that must be unique for that 
>>source-destination pair and protocol for the time the datagram will be 
>>active in the internet system."
>>
>>The flags should also be set according to the protocol.  Don't set "Do 
>>not fragment"; your packets may need to be fragmented as they go to 
>>their destination.
>>
>>Naeim Semsarilar wrote:
>>
>>>Never mind my second question, but my first question still holds.
>>>
>>>
>>>Naeim Semsarilar wrote:
>>>
>>>
>>>>Hey that rhymes ;)
>>>>
>>>>When I generate an ICMP error (host/port unreachable, ttl expired), 
>>>>what should I set the 'identification' and 'flags' fields in the 
>>>>enclosing IP header to?
>>>>
>>>>Also, the data portion of na ICMP packet is supposed to have the first 
>>>>64 bits  of the packet that caused the error. The first 64 bits 
>>>>starting at the ethernet header, the IP header, or the data?
>>>>
>>>>Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Purify running out of threads
Date: Sat, 04 Feb 2006 17:28:22 -0800
Lines: 12
Distribution: su
Message-ID: <ds3ka9$9i8$1@news.Stanford.EDU>
References: <ds31r3$noq$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds31r3$noq$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9959

If you're hitting some limit on number of threads you probably have a 
bad design.  You shouldn't need many threads for this...

Steve Goldman wrote:
> Has anyone else seen Purify terminating your program because it exceeds 
> the allowable number of threads?  My program creates threads when 
> needed, but from what I can tell the threads all die when they are done. 
>  The program works fine when not in Purify.  Does anyone know if this is 
> a limitation of Purify or a deficiency of my program?
> 
> Thanks,
> Steve
.

Path: shelby.stanford.edu!not-for-mail
From: "Nazia Zaman" <nazia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Pinging eth1
Date: Sat, 4 Feb 2006 19:07:50 -0800
Lines: 11
Distribution: su
Message-ID: <ds3q6b$f5c$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9960

Hi,
Clack allows pinging eth1, but since in our rtable, we don't have an entry 
corresponding to the IP addresses of eht1 and eth2, it finds the default 
gateway for 0.0.0.0 and forwards the packet back to the firewall, and so 
ping says packet bounced back. Is that correct behaviour? Or do we need to 
modify the rtable in some way or what?

Thanks,
Nazia 


.

Path: shelby.stanford.edu!not-for-mail
From: Ari Greenberg <arigreen@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: 2 thread models
Date: Sat, 04 Feb 2006 19:23:56 -0800
Lines: 50
Distribution: su
Message-ID: <ds3ra8$g6b$1@news.Stanford.EDU>
References: <drs7d3$8qd$1@news.Stanford.EDU> <drsj5b$n37$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.9 (X11/20041124)
X-Accept-Language: en-us, en
In-Reply-To: <drsj5b$n37$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9961

Krishna Monian wrote:
> Made a mistake in the pros and cons of each. To clarify them:
> 
> a) The first method requires the 2nd thread to compare each packet with each 
> entry in the ARP cache.
> 
> b) The 2nd model is more efficient in that the comparison between the new 
> ARP reply is just a single walk over the pending list. However, when it is 
> walking the pending list array, if a burst of packets arrive would these 
> packets be considered dropped since the handle_packet function will be busy 
> processing the pending list?

You shouldn't have to worry about packets being dropped because 
sr_handle_packet will be called for each packet that is received.
> 
> Thanks
> Krishna
> 
> "Krishna Monian" <kmonian@stanford.edu> wrote in message 
> news:drs7d3$8qd$1@news.Stanford.EDU...
> 
>>Hi,
>>I have 2 thread models to handle the ARP replies.
>>
>>1) The main thread adds the pending packet to a list, and the 2nd thread 
>>keeps checking each packet in the list against the ARP Cache for updates. 
>>All the main thread does in this case is add entries to the ARP cache when 
>>it receives an ARP reply.
>>
>>2) As soon as the main thread receives an ARP reply it walks through the 
>>pending list and sends out all the packets it can. The secondary threads 
>>in this case just keep sending out ARP requests periodically for the 
>>packets and send out a host unreachable after 5 tries. There is a separate 
>>thread for every different IP in this case.
>>
>>The 2nd model is more efficient in that the comparison between the new ARP 
>>reply is just a single walk over the pending list. The first method 
>>requires the 2nd thread to compare each packet with each entry in the ARP 
>>cache. However, when it is walking the pending list array, if a burst of 
>>packets arrive would these packets be considered dropped since the 
>>handle_packet function will be busy processing the pending list ?
>>
>>Is one model preferred over the other?
>>
>>Thanks
>>Krishna
>>
> 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Will Palmeri <wjp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Pinging eth1
Date: Sat, 04 Feb 2006 20:00:23 -0800
Lines: 21
Distribution: su
Message-ID: <ds3t8i$hjd$1@news.Stanford.EDU>
References: <ds3q6b$f5c$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
In-Reply-To: <ds3q6b$f5c$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9962

Let me see if I can help,

You should be checking if a packet is destined for one of your own IP 
addresses, and if it is, and it's an ICMP echo request, then reply as 
appropriate.  The rtable isn't really related as you don't forward 
packets to yourself.

-Will

Nazia Zaman wrote:
> Hi,
> Clack allows pinging eth1, but since in our rtable, we don't have an entry 
> corresponding to the IP addresses of eht1 and eth2, it finds the default 
> gateway for 0.0.0.0 and forwards the packet back to the firewall, and so 
> ping says packet bounced back. Is that correct behaviour? Or do we need to 
> modify the rtable in some way or what?
> 
> Thanks,
> Nazia 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Purify running out of threads
Date: Sat, 04 Feb 2006 21:28:33 -0800
Lines: 21
Distribution: su
Message-ID: <ds42e5$m0f$1@news.Stanford.EDU>
References: <ds31r3$noq$1@news.Stanford.EDU> <ds3ka9$9i8$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds3ka9$9i8$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9963

The design is fine; but it may be an implementation detail that is 
causing a problem.  I am not a thread guy.  I call pthread_create and 
pass a function for the thread to execute.  To my understanding, once 
the thread executes the function, it dies.  Is that correct?  If so, 
then my threads should all be dying.  But that doesn't explain why 
Purify complains.

Matt Falkenhagen wrote:
> If you're hitting some limit on number of threads you probably have a 
> bad design.  You shouldn't need many threads for this...
> 
> Steve Goldman wrote:
> 
>> Has anyone else seen Purify terminating your program because it 
>> exceeds the allowable number of threads?  My program creates threads 
>> when needed, but from what I can tell the threads all die when they 
>> are done.  The program works fine when not in Purify.  Does anyone 
>> know if this is a limitation of Purify or a deficiency of my program?
>>
>> Thanks,
>> Steve
.

Path: shelby.stanford.edu!not-for-mail
From: "Junhee Seok" <jseok@stanford.edu>
Newsgroups: su.class.cs244a
Subject: TTL Question?
Date: Sat, 4 Feb 2006 23:08:51 -0800
Lines: 9
Distribution: su
Message-ID: <ds48a8$qu3$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:9964

When I get a packet with TTL=1, Do I need to reply ttl-expired ICMP packet?
Does it means the right handling of traceroute through the router?
How about the case that TTL=0? Do I also reply ttl-expired ICMP packet?
When I get a UDP packet with TTL=1, which ICMP do I reply? port unreachable 
or ttl-expired or both?

Thank you. 


.

Path: shelby.stanford.edu!not-for-mail
From: alex qi <alexqi@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Traceroute interface
Date: Sat, 04 Feb 2006 23:56:30 -0800
Lines: 5
Distribution: su
Message-ID: <ds4b3e$1q1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9965

So if we try to traceroute interface 1, should we return interface 1 in 
the traceroute result or interface 0? The reason I ask is the traceroute 
request has to go through interface 0 before doing anything else.

Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: George Su <gpsu@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: clock_gettime and struct timespec
Date: Sun, 05 Feb 2006 00:06:27 -0800
Lines: 6
Distribution: su
Message-ID: <ds4bln$2so$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9966

I want to use clock_gettime and struct timespec.  However 
#including<time.h> doesn't brings these definitions in like its supposed 
to.  I can declare struct timespec myself, but the ld won't be able to 
find clock_gettime.  So what am I missing.

--George
.

Path: shelby.stanford.edu!not-for-mail
From: Julie Tung <jct@stanford.edu>
Newsgroups: su.class.cs244a
Subject: pthread_create error
Date: Sun, 05 Feb 2006 04:55:56 -0800
Lines: 12
Distribution: su
Message-ID: <ds4soj$k7u$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9967

Hi,

Has anyone else encountered a problem with just getting pthread_create 
to work?  Here's my code snippet for calling it, but I'm getting a 
return value of -1, which isn't even a defined return val for the create 
fxn.  Is there some setup that I'm doing wrong?

pthread_t sendThread;
int err = pthread_create(&sendThread, NULL, SendLoop, NULL);

Thanks,
Julie
.

Path: shelby.stanford.edu!not-for-mail
From: "Dan T. Murphy" <dtmurphy@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: pthread_create error
Date: Sun, 05 Feb 2006 11:11:04 -0500
Lines: 17
Distribution: su
Message-ID: <ds582n$id$1@news.Stanford.EDU>
References: <ds4soj$k7u$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <ds4soj$k7u$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9968

I hit something similar earlier.  There might be a stub for 
pthread_create in the c runtime that just returns -1.  Try adding 
-lpthread to the LIBS in your makefile.

Julie Tung wrote:
> Hi,
> 
> Has anyone else encountered a problem with just getting pthread_create 
> to work?  Here's my code snippet for calling it, but I'm getting a 
> return value of -1, which isn't even a defined return val for the create 
> fxn.  Is there some setup that I'm doing wrong?
> 
> pthread_t sendThread;
> int err = pthread_create(&sendThread, NULL, SendLoop, NULL);
> 
> Thanks,
> Julie
.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!zeighami
From: Roy Mehdi Zeighami <zeighami@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Aggregating Prefixes
Date: Sun, 5 Feb 2006 10:57:48 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.GSO.4.44.0602051045100.4902-100000@elaine43.Stanford.EDU>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:9969

Hello...

I have a question about aggregrating prefixes/CIDR.

First, for those that are interested, there is a short write up on
wikipedia that I thought was helpful:

http://en.wikipedia.org/wiki/Classless_Inter-doman_Routing

Here is my question:

Say you have a router that is connected to the internet on one interface
and two networks on the other interfaces.  Now, say that the prefix for
one of the networks is a sub-prefix of the network on the other interface.
For arguments sake say that one is a /24 network while the other was a /22
(and their first 22 bits are the same).

It isn't clear to me that the /24 network could be aggregated into the /22
prefix.  For example, if there existed another network with a /23 prefix
that matched the first 23 bits of the /24 then packets destined for the
/24 network would mistakenly get routed to the /23 network instead of the
router with the /22 and the /24.

Did I make that confusing enough?  Am I correct is saying that you cannot
always safely aggregate the longer prefix into matching short one?

Thanks,

Roy

.

Path: shelby.stanford.edu!not-for-mail
From: Stefan Thomas Mohler <smohler@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: ARP source IP mixup
Date: Sun, 5 Feb 2006 19:03:18 +0000 (UTC)
Lines: 37
Distribution: su
Message-ID: <ds5i5m$81u$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:9970

When I ping through my router to one of the hosts on the other side
I notice that after 5 seconds I start getting ARP requests that
are from that host (has hosts MAC as source) but that have an IP
from another topology (192.168.130.177).  Does anyone else see ARP's
from machines that shouldnt be on their networks or is this just
likely my own bug I havent found yet?

There is a file: ~smohler/public_log.txt with the packet trace.

My Topology:

                                           Application Server
                                       +====================+
                                       |                    |
                                       |   192.168.130.32   |
                                       |                    |
                                       +====================+
                                               /
                                              /
                                             /
                   eth0:                    /
                  192.168.130.30           /    eth1: 192.168.130.31
                          +============(eth1)==+
                          |                    |
 internet =============(eth0)  Your Router     |
                          |                    |
                          +============(eth2)==+
                                           \    eth2: 192.168.130.33
                                            \
                                             \
                                              \
                                       +====================+
                                       |                    |
                                       |  192.168.130.34    |
                                       |                    |
                                       +====================+
                                          Application Server
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP source IP mixup
Date: Sun, 05 Feb 2006 11:47:07 -0800
Lines: 46
Distribution: su
Message-ID: <ds5kns$alk$1@news.Stanford.EDU>
References: <ds5i5m$81u$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <ds5i5m$81u$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9971

Does it happen all the time? I had a similar thing happen once, but it 
was an isolated incident. From page 12 of Martin's presentation:

"You might even get random internet traffic, port scans, hackers,
misconfigured computers etc. This is the real world!"



Stefan Thomas Mohler wrote:
> When I ping through my router to one of the hosts on the other side
> I notice that after 5 seconds I start getting ARP requests that
> are from that host (has hosts MAC as source) but that have an IP
> from another topology (192.168.130.177).  Does anyone else see ARP's
> from machines that shouldnt be on their networks or is this just
> likely my own bug I havent found yet?
> 
> There is a file: ~smohler/public_log.txt with the packet trace.
> 
> My Topology:
> 
>                                            Application Server
>                                        +====================+
>                                        |                    |
>                                        |   192.168.130.32   |
>                                        |                    |
>                                        +====================+
>                                                /
>                                               /
>                                              /
>                    eth0:                    /
>                   192.168.130.30           /    eth1: 192.168.130.31
>                           +============(eth1)==+
>                           |                    |
>  internet =============(eth0)  Your Router     |
>                           |                    |
>                           +============(eth2)==+
>                                            \    eth2: 192.168.130.33
>                                             \
>                                              \
>                                               \
>                                        +====================+
>                                        |                    |
>                                        |  192.168.130.34    |
>                                        |                    |
>                                        +====================+
>                                           Application Server
.

Path: shelby.stanford.edu!not-for-mail
From: Will Palmeri <wjp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP source IP mixup
Date: Sun, 05 Feb 2006 12:14:14 -0800
Lines: 54
Distribution: su
Message-ID: <ds5mah$br3$1@news.Stanford.EDU>
References: <ds5i5m$81u$1@news.Stanford.EDU> <ds5kns$alk$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
In-Reply-To: <ds5kns$alk$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9972

I definitely noticed I was getting "random" ARP requests a while ago. 
It's either stopped or I stopped noticing. I don't think it's a problem 
with your router.

-Will


Naeim Semsarilar wrote:
> Does it happen all the time? I had a similar thing happen once, but it 
> was an isolated incident. From page 12 of Martin's presentation:
> 
> "You might even get random internet traffic, port scans, hackers,
> misconfigured computers etc. This is the real world!"
> 
> 
> 
> Stefan Thomas Mohler wrote:
>> When I ping through my router to one of the hosts on the other side
>> I notice that after 5 seconds I start getting ARP requests that
>> are from that host (has hosts MAC as source) but that have an IP
>> from another topology (192.168.130.177).  Does anyone else see ARP's
>> from machines that shouldnt be on their networks or is this just
>> likely my own bug I havent found yet?
>>
>> There is a file: ~smohler/public_log.txt with the packet trace.
>>
>> My Topology:
>>
>>                                            Application Server
>>                                        +====================+
>>                                        |                    |
>>                                        |   192.168.130.32   |
>>                                        |                    |
>>                                        +====================+
>>                                                /
>>                                               /
>>                                              /
>>                    eth0:                    /
>>                   192.168.130.30           /    eth1: 192.168.130.31
>>                           +============(eth1)==+
>>                           |                    |
>>  internet =============(eth0)  Your Router     |
>>                           |                    |
>>                           +============(eth2)==+
>>                                            \    eth2: 192.168.130.33
>>                                             \
>>                                              \
>>                                               \
>>                                        +====================+
>>                                        |                    |
>>                                        |  192.168.130.34    |
>>                                        |                    |
>>                                        +====================+
>>                                           Application Server
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Testing with the application servers
Date: Sun, 05 Feb 2006 12:25:07 -0800
Lines: 11
Distribution: su
Message-ID: <ds5mv7$cov$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9973

Sorry if this is posted somewhere already...

How can we test with the application servers other than pings and 
traceroutes?  The assignment page says we should be able to do 
"traceroutes, pings and downloading some files from a web server and an 
ftp server."  How do we set up the web and ftp servers?  I tried 
pointing my browser at the proper IPs, but my router didn't show any 
packets coming through.

Thanks,
Steve
.

Path: shelby.stanford.edu!not-for-mail
From: Stefan Thomas Mohler <smohler@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Testing with the application servers
Date: Sun, 5 Feb 2006 20:34:10 +0000 (UTC)
Lines: 4
Distribution: su
Message-ID: <ds5ng2$81u$2@news.Stanford.EDU>
References: <ds5mv7$cov$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:9974

When I tried to point a browser at my application servers each one
served up its own page with links.  It probably wont matter if
you arent off campus, but make sure have the browser running on the
same machine you are able to ping from.
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Testing with the application servers
Date: Sun, 05 Feb 2006 12:53:19 -0800
Lines: 10
Distribution: su
Message-ID: <ds5ok3$dvq$1@news.Stanford.EDU>
References: <ds5mv7$cov$1@news.Stanford.EDU> <ds5ng2$81u$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds5ng2$81u$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9975

Good point.  My home computer has a 128 address, so I can't do anything 
from here.  I guess I'll have to hoof it over to Sweet Hall.

Thanks.

Stefan Thomas Mohler wrote:
> When I tried to point a browser at my application servers each one
> served up its own page with links.  It probably wont matter if
> you arent off campus, but make sure have the browser running on the
> same machine you are able to ping from.
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Testing with the application servers
Date: Sun, 05 Feb 2006 12:56:16 -0800
Lines: 14
Distribution: su
Message-ID: <ds5opk$e4f$1@news.Stanford.EDU>
References: <ds5mv7$cov$1@news.Stanford.EDU> <ds5ng2$81u$2@news.Stanford.EDU> <ds5ok3$dvq$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds5ok3$dvq$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9976

I got it to work by running lynx from the telnet command line.  Pretty cool.

Steve Goldman wrote:
> Good point.  My home computer has a 128 address, so I can't do anything 
> from here.  I guess I'll have to hoof it over to Sweet Hall.
> 
> Thanks.
> 
> Stefan Thomas Mohler wrote:
> 
>> When I tried to point a browser at my application servers each one
>> served up its own page with links.  It probably wont matter if
>> you arent off campus, but make sure have the browser running on the
>> same machine you are able to ping from.
.

Path: shelby.stanford.edu!not-for-mail
From: George Su <gpsu@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Forwarding packets back out the same interface.
Date: Sun, 05 Feb 2006 13:20:55 -0800
Lines: 8
Distribution: su
Message-ID: <ds5q7o$fd5$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9977

Suppose eth0 receives a packet whose routing table tells it to
do default routing.  What should be done?

1. send it back to eth0 and let the TTL handles it.
2. Drop it silently
3. Send Host unreachable?

--George
.

Path: shelby.stanford.edu!not-for-mail
From: Ryan Matthew Smith <rysmi@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: queue outgoing ICMP packets
Date: Sun, 5 Feb 2006 22:12:05 +0000 (UTC)
Lines: 21
Distribution: su
Message-ID: <ds5t7l$hht$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.6.15.1smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:9978

can you please confirm correct behavior in this situation: 

in trying to forward a some packets,  a host never 
replies to our ARP request, so we have to send out
ICMP packets to the senders. 

as we are trying to route our ICMP packets, say we don't
have an ARP entry for the next, so .. we have to send an ARP
request and put the ICMP packet in our packet queue.

is this a correct interpretation? 

does this apply to all the packets we send out, eg. we must
route ICMP echo replies that we create, and queue them if
we don't have an ARP entry.

thanks, 
ryan. 



.

Path: shelby.stanford.edu!not-for-mail
From: Ryan Matthew Smith <rysmi@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: dropping ICMP packets
Date: Sun, 5 Feb 2006 22:28:10 +0000 (UTC)
Lines: 21
Distribution: su
Message-ID: <ds5u5q$idj$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.6.15.1smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:9979

the RFC for ICMP says: 

To avoid the infinite regress of messages about messages
   etc., no ICMP messages are sent about ICMP messages.

however, if we have an ICMP echo request in
our queue (bound for one of our app servers), and then we
have to drop it (the app server doesn't respond to arps),
it seems like we should send ICMP errors for that echo request 
(eg. host unreachable)

for the assignment, should i send that error? 

is it reasonable to treat some ICMP packets differently than 
others when we are dropping them? 

for example, sending an ICMP error for a dropped echo request, 
but not for a dropped ICMP error? 

thanks, 
ryan. 
.

Path: shelby.stanford.edu!not-for-mail
From: Stefan Thomas Mohler <smohler@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: ftp to app servers with PORT
Date: Sun, 5 Feb 2006 22:42:41 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <ds5v11$gs2$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:9980

When ftp'ing to both my app servers I hang whenever trying to download
data with PORT.  There is no problem with PASV downloads and the failure
is consistet with ftp from the command line or ftpcopy from assignement 1.
Can anyone else ftp to their app servers and succesfully do an "ls" or
something in PORT mode?
.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Corrupt Stack
Date: Sun, 05 Feb 2006 14:46:52 -0800
Lines: 16
Distribution: su
Message-ID: <ds5v8m$jfg$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
Xref: shelby.stanford.edu su.class.cs244a:9981

I'm getting segmentation fault when calling pthread_mutex_unlock().

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 4]
0xff0ab870 in pthread_mutex_unlock () from /usr/lib/libthread.so.1
(gdb) bt
#0  0xff0ab870 in pthread_mutex_unlock () from /usr/lib/libthread.so.1
#1  0x000133ac in sr_send_requests (args=0xffbef370) at sr_packet.c:307
#2  0xff0bb124 in _thread_start () from /usr/lib/libthread.so.1
#3  0xff0bb124 in _thread_start () from /usr/lib/libthread.so.1
Previous frame identical to this frame (corrupt stack?)

What does corrupt stack mean and how can I fix it?

Thanks,
--Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp to app servers with PORT
Date: Sun, 05 Feb 2006 14:51:05 -0800
Lines: 23
Distribution: su
Message-ID: <ds5vgt$jm1$1@news.Stanford.EDU>
References: <ds5v11$gs2$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds5v11$gs2$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9982

Mine seems to work.

saga13:~> ftp 192.168.130.92
Connected to 192.168.130.92.
220 (vsFTPd 1.2.1)
Name (192.168.130.92:goldmasd): anonymous
331 Please specify the password.
Password:
230 Login successful.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
pub
226 Directory send OK.
5 bytes received in 0.0095 seconds (0.51 Kbytes/s)


Stefan Thomas Mohler wrote:
> When ftp'ing to both my app servers I hang whenever trying to download
> data with PORT.  There is no problem with PASV downloads and the failure
> is consistet with ftp from the command line or ftpcopy from assignement 1.
> Can anyone else ftp to their app servers and succesfully do an "ls" or
> something in PORT mode?
.

Path: shelby.stanford.edu!not-for-mail
From: Michi Mutsuzaki <michi2@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Corrupt Stack
Date: Sun, 05 Feb 2006 15:45:01 -0800
Lines: 22
Distribution: su
Message-ID: <ds62ln$lut$1@news.Stanford.EDU>
References: <ds5v8m$jfg$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Macintosh/20051201)
In-Reply-To: <ds5v8m$jfg$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9983

Never mind, I figured out. I was passing an address of local variable 
to threads.

--Michi

Michi Mutsuzaki wrote:
> I'm getting segmentation fault when calling pthread_mutex_unlock().
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to LWP 4]
> 0xff0ab870 in pthread_mutex_unlock () from /usr/lib/libthread.so.1
> (gdb) bt
> #0  0xff0ab870 in pthread_mutex_unlock () from /usr/lib/libthread.so.1
> #1  0x000133ac in sr_send_requests (args=0xffbef370) at sr_packet.c:307
> #2  0xff0bb124 in _thread_start () from /usr/lib/libthread.so.1
> #3  0xff0bb124 in _thread_start () from /usr/lib/libthread.so.1
> Previous frame identical to this frame (corrupt stack?)
> 
> What does corrupt stack mean and how can I fix it?
> 
> Thanks,
> --Michi
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Rtable file
Date: Sun, 05 Feb 2006 16:09:31 -0800
Lines: 69
Distribution: su
Message-ID: <ds642h$n94$1@news.Stanford.EDU>
References: <drhtlp$l6n$1@news.Stanford.EDU> <dri4nn$r00$1@news.Stanford.EDU> <Pine.GSO.4.44.0602021232370.10760-100000@elaine4.Stanford.EDU> <ds0vpn$ldo$1@news.Stanford.EDU> <ds1lvo$ape$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds1lvo$ape$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9984

The subnet mask of an rtable rule tells you which bits of a packet's 
destination IP to look at when determining whether this rule applies to 
the packet.

Naeim Semsarilar wrote:
> Could you please explain this a bit more? What exactly is the 
> significance of the subnet field in rtable?
> 
> Thanks.
> 
> 
> Matt Falkenhagen wrote:
> 
>> Dan C Silver wrote:
>>
>>> Just to clarify a bit more -- so we're basically treating each app 
>>> server
>>> as a router, and not as a host on the same subnet as our router's
>>> interface?  In my particular topology it doesn't seem to be possible to
>>> mask the two subnets properly, so I'm guessing this is the case.
>>
>>
>> Yeah that's a good way to think about it.
>>
>>>
>>> And we don't have subnet masks for each interface, so we're basically
>>> treating each interface as being it's own subnet with a single host?
>>> Should we assume the subnet mask for each interface is 255.255.255.255?
>>> If so, should we still AND the dest ip against our subnet mask to
>>> determine if it's on the same subnet?
>>
>>
>> Definately do the AND, your router should work with any valid rtable 
>> file not ones for these simple topologies.
>>
>>>
>>> Thx,
>>>
>>> - Dan
>>>
>>> On Sun, 29 Jan 2006, Matt Falkenhagen wrote:
>>>
>>>
>>>> From the way you phrased the question I'm not sure how to answer, 
>>>> but....
>>>>
>>>> The rtable is just a list of rules for forwarding packets.  Your router
>>>> reads in this list of rules.
>>>>
>>>> Your toplogy email tells you how your router should forward packets to
>>>> exactly two specific IP addresses (your app servers) and to the rest of
>>>> the Internet.  Given that information, think about what rules you want
>>>> in your rtable.
>>>>
>>>> Ask again if it's not clear.
>>>>
>>>> Sutthipong Thavisomboon wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I read in the newsgroup that we should modify the rtable static file
>>>>> according to the assigned topology. I see the IP address in the email,
>>>>> however, I'm not sure what to put for mask?
>>>>>
>>>>> Sutthipong
>>>>>
>>>>>
>>>>
>>>
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: TTL Question?
Date: Sun, 05 Feb 2006 16:21:01 -0800
Lines: 26
Distribution: su
Message-ID: <ds64o2$okb$1@news.Stanford.EDU>
References: <ds48a8$qu3$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds48a8$qu3$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9985

Junhee Seok wrote:
> When I get a packet with TTL=1, Do I need to reply ttl-expired ICMP packet?

Yes, if the packet wasn't destined for you.

> Does it means the right handling of traceroute through the router?

I'm not sure what you're asking.  If you reply with ttl-expired ICMP, 
that's the right handling.

> How about the case that TTL=0? Do I also reply ttl-expired ICMP packet?

Yes.

> When I get a UDP packet with TTL=1, which ICMP do I reply? port unreachable 
> or ttl-expired or both?

Depends if the packet was destined for your router or not.

Please see RFC for more information, section 4.2.2.9 is a good starting 
point.

> 
> Thank you. 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Traceroute interface
Date: Sun, 05 Feb 2006 16:22:14 -0800
Lines: 8
Distribution: su
Message-ID: <ds64qb$okb$2@news.Stanford.EDU>
References: <ds4b3e$1q1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds4b3e$1q1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9986

Please see thread "traceroute question" from 2/1/2006 11:47 PM.

alex qi wrote:
> So if we try to traceroute interface 1, should we return interface 1 in 
> the traceroute result or interface 0? The reason I ask is the traceroute 
> request has to go through interface 0 before doing anything else.
> 
> Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: clock_gettime and struct timespec
Date: Sun, 05 Feb 2006 16:23:52 -0800
Lines: 9
Distribution: su
Message-ID: <ds64td$okb$3@news.Stanford.EDU>
References: <ds4bln$2so$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds4bln$2so$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9987

Adding the prototypes doesn't solve it?

George Su wrote:
> I want to use clock_gettime and struct timespec.  However 
> #including<time.h> doesn't brings these definitions in like its supposed 
> to.  I can declare struct timespec myself, but the ld won't be able to 
> find clock_gettime.  So what am I missing.
> 
> --George
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Forwarding packets back out the same interface.
Date: Sun, 05 Feb 2006 16:27:00 -0800
Lines: 11
Distribution: su
Message-ID: <ds6539$p4e$1@news.Stanford.EDU>
References: <ds5q7o$fd5$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds5q7o$fd5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9988

1.

George Su wrote:
> Suppose eth0 receives a packet whose routing table tells it to
> do default routing.  What should be done?
> 
> 1. send it back to eth0 and let the TTL handles it.
> 2. Drop it silently
> 3. Send Host unreachable?
> 
> --George
.

Path: shelby.stanford.edu!not-for-mail
From: "Ramanan" <ramananr@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp to app servers with PORT
Date: Sun, 5 Feb 2006 16:32:12 -0800
Lines: 19
Distribution: su
Message-ID: <ds65ei$pif$1@news.Stanford.EDU>
References: <ds5v11$gs2$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:9989

Stefan,

I seem to be having the exact same problem. Strange thing is, when I open up 
a browser (firerfox, mozilla) and try to connect to the ftp servers from 
within the browser, i seem to be able to connect fine. I haven't figured out 
why... Let me know if you figure it out...

Ram


"Stefan Thomas Mohler" <smohler@Stanford.EDU> wrote in message 
news:ds5v11$gs2$1@news.Stanford.EDU...
> When ftp'ing to both my app servers I hang whenever trying to download
> data with PORT.  There is no problem with PASV downloads and the failure
> is consistet with ftp from the command line or ftpcopy from assignement 1.
> Can anyone else ftp to their app servers and succesfully do an "ls" or
> something in PORT mode? 


.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: queue outgoing ICMP packets
Date: Sun, 05 Feb 2006 16:36:28 -0800
Lines: 28
Distribution: su
Message-ID: <ds65l1$plq$1@news.Stanford.EDU>
References: <ds5t7l$hht$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds5t7l$hht$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9990

Ryan Matthew Smith wrote:
> can you please confirm correct behavior in this situation: 
> 
> in trying to forward a some packets,  a host never 
> replies to our ARP request, so we have to send out
> ICMP packets to the senders. 
> 
> as we are trying to route our ICMP packets, say we don't
> have an ARP entry for the next, so .. we have to send an ARP
> request and put the ICMP packet in our packet queue.
> 
> is this a correct interpretation? 

yeah

> 
> does this apply to all the packets we send out, eg. we must
> route ICMP echo replies that we create, and queue them if
> we don't have an ARP entry.

yeah

> 
> thanks, 
> ryan. 
> 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: dropping ICMP packets
Date: Sun, 05 Feb 2006 16:42:23 -0800
Lines: 26
Distribution: su
Message-ID: <ds6604$pve$1@news.Stanford.EDU>
References: <ds5u5q$idj$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds5u5q$idj$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9991

I think you are required to send that error.  The quote is a little 
misleading, the RFC for IP Routers (1812) tells you when to send ICMPs 
and when not to.

Ryan Matthew Smith wrote:
> the RFC for ICMP says: 
> 
> To avoid the infinite regress of messages about messages
>    etc., no ICMP messages are sent about ICMP messages.
> 
> however, if we have an ICMP echo request in
> our queue (bound for one of our app servers), and then we
> have to drop it (the app server doesn't respond to arps),
> it seems like we should send ICMP errors for that echo request 
> (eg. host unreachable)
> 
> for the assignment, should i send that error? 
> 
> is it reasonable to treat some ICMP packets differently than 
> others when we are dropping them? 
> 
> for example, sending an ICMP error for a dropped echo request, 
> but not for a dropped ICMP error? 
> 
> thanks, 
> ryan. 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Falkenhagen <mjf@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Testing with the application servers
Date: Sun, 05 Feb 2006 16:56:17 -0800
Lines: 20
Distribution: su
Message-ID: <ds66q6$qmi$1@news.Stanford.EDU>
References: <ds5mv7$cov$1@news.Stanford.EDU> <ds5ng2$81u$2@news.Stanford.EDU> <ds5ok3$dvq$1@news.Stanford.EDU> <ds5opk$e4f$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds5opk$e4f$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9992

BTW you can download an X server and then ssh to one of the Sweet Hall 
machines and run a real browser, it will probably be cooler.

Steve Goldman wrote:
> I got it to work by running lynx from the telnet command line.  Pretty 
> cool.
> 
> Steve Goldman wrote:
> 
>> Good point.  My home computer has a 128 address, so I can't do 
>> anything from here.  I guess I'll have to hoof it over to Sweet Hall.
>>
>> Thanks.
>>
>> Stefan Thomas Mohler wrote:
>>
>>> When I tried to point a browser at my application servers each one
>>> served up its own page with links.  It probably wont matter if
>>> you arent off campus, but make sure have the browser running on the
>>> same machine you are able to ping from.
.

Path: shelby.stanford.edu!not-for-mail
From: Stefan Thomas Mohler <smohler@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: clock_gettime and struct timespec
Date: Mon, 6 Feb 2006 01:26:55 +0000 (UTC)
Lines: 4
Distribution: su
Message-ID: <ds68ku$s8c$1@news.Stanford.EDU>
References: <ds4bln$2so$1@news.Stanford.EDU> <ds64td$okb$3@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.6.15.1smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:9993

In your makefile in the solaris section, add:
   -lposix4

For me this made the linker happy
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Testing with the application servers
Date: Sun, 05 Feb 2006 19:12:37 -0800
Lines: 28
Distribution: su
Message-ID: <ds6er9$4es$1@news.Stanford.EDU>
References: <ds5mv7$cov$1@news.Stanford.EDU> <ds5ng2$81u$2@news.Stanford.EDU> <ds5ok3$dvq$1@news.Stanford.EDU> <ds5opk$e4f$1@news.Stanford.EDU> <ds66q6$qmi$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds66q6$qmi$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9994

Thanks for the tip.  Everyone talks about setting up X windows like it 
is so easy, but I have found it really difficult.  In fact, I challenge 
anyone who thinks this is easy to come over to my house and show me.

Steve

Matt Falkenhagen wrote:
> BTW you can download an X server and then ssh to one of the Sweet Hall 
> machines and run a real browser, it will probably be cooler.
> 
> Steve Goldman wrote:
> 
>> I got it to work by running lynx from the telnet command line.  Pretty 
>> cool.
>>
>> Steve Goldman wrote:
>>
>>> Good point.  My home computer has a 128 address, so I can't do 
>>> anything from here.  I guess I'll have to hoof it over to Sweet Hall.
>>>
>>> Thanks.
>>>
>>> Stefan Thomas Mohler wrote:
>>>
>>>> When I tried to point a browser at my application servers each one
>>>> served up its own page with links.  It probably wont matter if
>>>> you arent off campus, but make sure have the browser running on the
>>>> same machine you are able to ping from.
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Aggregating Prefixes
Date: Sun, 05 Feb 2006 19:18:22 -0800
Lines: 35
Distribution: su
Message-ID: <ds6f5f$4qv$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0602051045100.4902-100000@elaine43.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <Pine.GSO.4.44.0602051045100.4902-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9995

It would be a mistake to aggregate in your example below.  Aggregation,
for practical purposes, suggests that you own all IPs within the 
advertised prefix.


> Hello...
> 
> I have a question about aggregrating prefixes/CIDR.
> 
> First, for those that are interested, there is a short write up on
> wikipedia that I thought was helpful:
> 
> http://en.wikipedia.org/wiki/Classless_Inter-doman_Routing
> 
> Here is my question:
> 
> Say you have a router that is connected to the internet on one interface
> and two networks on the other interfaces.  Now, say that the prefix for
> one of the networks is a sub-prefix of the network on the other interface.
> For arguments sake say that one is a /24 network while the other was a /22
> (and their first 22 bits are the same).
> 
> It isn't clear to me that the /24 network could be aggregated into the /22
> prefix.  For example, if there existed another network with a /23 prefix
> that matched the first 23 bits of the /24 then packets destined for the
> /24 network would mistakenly get routed to the /23 network instead of the
> router with the /22 and the /24.
> 
> Did I make that confusing enough?  Am I correct is saying that you cannot
> always safely aggregate the longer prefix into matching short one?
> 
> Thanks,
> 
> Roy
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Testing with the application servers
Date: Sun, 05 Feb 2006 19:20:24 -0800
Lines: 31
Distribution: su
Message-ID: <ds6f99$4qv$2@news.Stanford.EDU>
References: <ds5mv7$cov$1@news.Stanford.EDU> <ds5ng2$81u$2@news.Stanford.EDU> <ds5ok3$dvq$1@news.Stanford.EDU> <ds5opk$e4f$1@news.Stanford.EDU> <ds66q6$qmi$1@news.Stanford.EDU> <ds6er9$4es$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <ds6er9$4es$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9996

what OS are you using?  cygwin's X-server has come a long ways if you
are a windows fella.

> Thanks for the tip.  Everyone talks about setting up X windows like it 
> is so easy, but I have found it really difficult.  In fact, I challenge 
> anyone who thinks this is easy to come over to my house and show me.
> 
> Steve
> 
> Matt Falkenhagen wrote:
>> BTW you can download an X server and then ssh to one of the Sweet Hall 
>> machines and run a real browser, it will probably be cooler.
>>
>> Steve Goldman wrote:
>>
>>> I got it to work by running lynx from the telnet command line.  
>>> Pretty cool.
>>>
>>> Steve Goldman wrote:
>>>
>>>> Good point.  My home computer has a 128 address, so I can't do 
>>>> anything from here.  I guess I'll have to hoof it over to Sweet Hall.
>>>>
>>>> Thanks.
>>>>
>>>> Stefan Thomas Mohler wrote:
>>>>
>>>>> When I tried to point a browser at my application servers each one
>>>>> served up its own page with links.  It probably wont matter if
>>>>> you arent off campus, but make sure have the browser running on the
>>>>> same machine you are able to ping from.
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Traceroute missing a response from the application server
Date: Sun, 05 Feb 2006 19:22:57 -0800
Lines: 21
Distribution: su
Message-ID: <ds6fem$5c1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:9997

So traceroute sends three packets to each hop along the way to the 
destination.  Has anyone seen their application server only sending two 
of them back sometimes?  I'm not sure where this packet is being 
dropped.  Check out this output:

saga14:~> traceroute 192.168.130.92
traceroute to 192.168.130.92 (192.168.130.92): 1-30 hops, 38 byte packets
  1  sweet-rtr.Stanford.EDU (171.64.15.129)  0.706 ms  0.536 ms  1.45 ms
  2  Gates-rtr.Stanford.EDU (171.64.1.178)  0.652 ms  1.19 ms  0.655 ms
  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.571 ms (ttl=62!)  0.556 
ms (ttl=62!)  0.978 ms (ttl=62!)
  4  192.168.130.90 (192.168.130.90)  84.7 ms (ttl=61!)  2.75 ms 
(ttl=61!)  4.32 ms (ttl=61!)
  5  192.168.130.92 (192.168.130.92)  43.1 ms (ttl=60!)  *  5.40 ms 
(ttl=60!)


TA's: do you consider this not handling traceroute correctly?

Thanks,
Steve
.

Path: shelby.stanford.edu!not-for-mail
From: Steve Goldman <steve.goldman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Testing with the application servers
Date: Sun, 05 Feb 2006 19:26:01 -0800
Lines: 41
Distribution: su
Message-ID: <ds6fkd$5c1$2@news.Stanford.EDU>
References: <ds5mv7$cov$1@news.Stanford.EDU> <ds5ng2$81u$2@news.Stanford.EDU> <ds5ok3$dvq$1@news.Stanford.EDU> <ds5opk$e4f$1@news.Stanford.EDU> <ds66q6$qmi$1@news.Stanford.EDU> <ds6er9$4es$1@news.Stanford.EDU> <ds6f99$4qv$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
In-Reply-To: <ds6f99$4qv$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9998

Yes, I'm using Windows.  I tried setting it up earlier this quarter.  I 
even found a website with semi-good documentation.  Problem is it just 
doesn't work.  Whenever I try to open Matlab or, in this case, firefox, 
I get cryptic errors in my X-terminal (if that's the proper lingo). 
Sometimes the Matlab splash screen comes up and just hangs.  Unix people 
need to make this sort of thing easier on the rest of us.

Martin Casado wrote:
> what OS are you using?  cygwin's X-server has come a long ways if you
> are a windows fella.
> 
>> Thanks for the tip.  Everyone talks about setting up X windows like it 
>> is so easy, but I have found it really difficult.  In fact, I 
>> challenge anyone who thinks this is easy to come over to my house and 
>> show me.
>>
>> Steve
>>
>> Matt Falkenhagen wrote:
>>
>>> BTW you can download an X server and then ssh to one of the Sweet 
>>> Hall machines and run a real browser, it will probably be cooler.
>>>
>>> Steve Goldman wrote:
>>>
>>>> I got it to work by running lynx from the telnet command line.  
>>>> Pretty cool.
>>>>
>>>> Steve Goldman wrote:
>>>>
>>>>> Good point.  My home computer has a 128 address, so I can't do 
>>>>> anything from here.  I guess I'll have to hoof it over to Sweet Hall.
>>>>>
>>>>> Thanks.
>>>>>
>>>>> Stefan Thomas Mohler wrote:
>>>>>
>>>>>> When I tried to point a browser at my application servers each one
>>>>>> served up its own page with links.  It probably wont matter if
>>>>>> you arent off campus, but make sure have the browser running on the
>>>>>> same machine you are able to ping from.
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Testing with the application servers
Date: Sun, 05 Feb 2006 19:31:18 -0800
Lines: 52
Distribution: su
Message-ID: <ds6ftn$5g1$1@news.Stanford.EDU>
References: <ds5mv7$cov$1@news.Stanford.EDU> <ds5ng2$81u$2@news.Stanford.EDU> <ds5ok3$dvq$1@news.Stanford.EDU> <ds5opk$e4f$1@news.Stanford.EDU> <ds66q6$qmi$1@news.Stanford.EDU> <ds6er9$4es$1@news.Stanford.EDU> <ds6f99$4qv$2@news.Stanford.EDU> <ds6fkd$5c1$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <ds6fkd$5c1$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:9999

this works well for me.
- from cygwin
- start x (using the "startx" command)
- ssh -X into a stanford machine
- start popping up windows

taa daa.

ymmv


> Yes, I'm using Windows.  I tried setting it up earlier this quarter.  I 
> even found a website with semi-good documentation.  Problem is it just 
> doesn't work.  Whenever I try to open Matlab or, in this case, firefox, 
> I get cryptic errors in my X-terminal (if that's the proper lingo). 
> Sometimes the Matlab splash screen comes up and just hangs.  Unix people 
> need to make this sort of thing easier on the rest of us.
> 
> Martin Casado wrote:
>> what OS are you using?  cygwin's X-server has come a long ways if you
>> are a windows fella.
>>
>>> Thanks for the tip.  Everyone talks about setting up X windows like 
>>> it is so easy, but I have found it really difficult.  In fact, I 
>>> challenge anyone who thinks this is easy to come over to my house and 
>>> show me.
>>>
>>> Steve
>>>
>>> Matt Falkenhagen wrote:
>>>
>>>> BTW you can download an X server and then ssh to one of the Sweet 
>>>> Hall machines and run a real browser, it will probably be cooler.
>>>>
>>>> Steve Goldman wrote:
>>>>
>>>>> I got it to work by running lynx from the telnet command line.  
>>>>> Pretty cool.
>>>>>
>>>>> Steve Goldman wrote:
>>>>>
>>>>>> Good point.  My home computer has a 128 address, so I can't do 
>>>>>> anything from here.  I guess I'll have to hoof it over to Sweet Hall.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> Stefan Thomas Mohler wrote:
>>>>>>
>>>>>>> When I tried to point a browser at my application servers each one
>>>>>>> served up its own page with links.  It probably wont matter if
>>>>>>> you arent off campus, but make sure have the browser running on the
>>>>>>> same machine you are able to ping from.
.

Path: shelby.stanford.edu!not-for-mail
From: "Nazia Zaman" <nazia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Trace route to eth1
Date: Sun, 5 Feb 2006 22:56:52 -0800
Lines: 7
Distribution: su
Message-ID: <ds6rvo$h21$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:10004

So I tested this on Clack, if I run a trace-route to eth1, it doesn't give a 
proper route. Is this the right behaviour?

Thanks,
Nazia 


.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: can't connect to VNS
Date: Mon, 06 Feb 2006 00:06:57 -0800
Lines: 6
Distribution: su
Message-ID: <ds7034$n2v$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:10005

I keep getting this when i try to run my router:

Requesting topology 21
ERROR: Failed to retrieve current time

Could someone please help?
.

Path: shelby.stanford.edu!not-for-mail
From: "Jeremy Robin" <jirobin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: app server 2 crashing firefox
Date: Mon, 6 Feb 2006 00:57:14 -0800
Lines: 12
Distribution: su
Message-ID: <ds7319$q1p$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:10008

has anyone else experienced this?

Everything's fine from app server 1 but on the second it crashes.  tcpdump 
tells me that there are 2 packets forwarded from the server with the error 
"truncated-ip 2 bytes missing".  I think this means the actual length 
doesn't agree with the header.   but every other test I've done has worked 
fine so I was wondering if anyone else has come across something similar.


Jeremy 


.

Path: shelby.stanford.edu!not-for-mail
From: Hau Jia Chew <haujia@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Egress queues
Date: Mon, 06 Feb 2006 01:02:50 -0800
Lines: 12
Distribution: su
Message-ID: <ds73br$qbn$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:10009

Hi,

Is it necessary (or would it be a good idea) to queue all the outgoing 
packets and have a separate thread send them using sr_send_packet 
instead of calling sr_send_packet directly every time we want to send a 
packet?

I guess the only reason we want to have a separate thread do it is that 
sr_send_packet might choke and that would somehow stall that rest of the 
  program?

Hau Jia.
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ICMP, conflicting specs
Date: Mon, 06 Feb 2006 01:13:18 -0800
Lines: 24
Distribution: su
Message-ID: <ds73vi$rbv$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
Xref: shelby.stanford.edu su.class.cs244a:10010

RFC 1812 and networksorcery.com say two different things about what an 
ICMP error should look like.

networksorcery.com says:

"The IP header plus the first 8 bytes of the original datagram's data is 
returned to the sender. This data is used by the host to match the 
message to the appropriate process. If a higher level protocol uses port 
numbers, they are assumed to be in the first 64 data bits of the 
original datagram's data."

RFC 1812 says:

"Historically, every ICMP error message has included the Internet
header and at least the first 8 data bytes of the datagram that
triggered the error.  This is no longer adequate, due to the use of
IP-in-IP tunneling and other technologies.  Therefore, the ICMP
datagram SHOULD contain as much of the original datagram as possible
without the length of the ICMP datagram exceeding 576 bytes."


For this assignment, is it sufficient to go with 8 bytes?

Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Naeim Semsarilar <naeim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: can't connect to VNS
Date: Mon, 06 Feb 2006 01:25:26 -0800
Lines: 11
Distribution: su
Message-ID: <ds74m9$s1j$1@news.Stanford.EDU>
References: <ds7034$n2v$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <ds7034$n2v$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10011

I could connect again for a while, and now it's back to the same error. 
Is it me, or is the server shaky?


Naeim Semsarilar wrote:
> I keep getting this when i try to run my router:
> 
> Requesting topology 21
> ERROR: Failed to retrieve current time
> 
> Could someone please help?
.

Path: shelby.stanford.edu!not-for-mail
From: "Andrew Sakai" <asakai@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: app server 2 crashing firefox
Date: Mon, 6 Feb 2006 01:53:09 -0800
Lines: 23
Distribution: su
Message-ID: <ds76a7$b9$1@news.Stanford.EDU>
References: <ds7319$q1p$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: shelby.stanford.edu su.class.cs244a:10012

I'm running into the same problem.  It also happens when I run Clack for my 
topology, so something strange is definitely going on (assuming Clack 
functions correctly).  Maybe tomorrow I'll go in to Sweet and try to 
duplicate the problem without remote login.

    Cheers,
    Andrew

"Jeremy Robin" <jirobin@stanford.edu> wrote in message 
news:ds7319$q1p$1@news.Stanford.EDU...
> has anyone else experienced this?
>
> Everything's fine from app server 1 but on the second it crashes.  tcpdump 
> tells me that there are 2 packets forwarded from the server with the error 
> "truncated-ip 2 bytes missing".  I think this means the actual length 
> doesn't agree with the header.   but every other test I've done has worked 
> fine so I was wondering if anyone else has come across something similar.
>
>
> Jeremy
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Hector Chan" <chanhp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Ethereal Malformed Frame
Date: Mon, 6 Feb 2006 03:27:45 -0800
Lines: 29
Distribution: su
Message-ID: <ds7brn$4oc$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:10014

Hi,

I was testing ICMP TTL Time Exceeded messages with Mozilla.  While looking 
under Ethereal the ICMP Time Exceeded
messages seems to be working correctly, I saw some [Malformed Frame] 
originated from my router's outgoing
interface and destined to "vns-firewall.Standford.EDU".  Should I care about 
those Malformed Frames?  The
following is what appeared in Ethereal when I select the Malformed Frame 
entry:

Frame 7 (70 on wire, 70 captured)
     Arrival Time: Feb 6, 2006 02:57:20.999080000
     Time delta from previous packet: 0.001129000 seconds
     Time relative to first packet: 0.007278000 seconds
     Frame Number: 7
     Packet Length: 70 bytes
     Capture Length: 70 bytes
IEEE 802.3 Ethernet
     Destination: 00:e0:81:04:26:d9 (vns-firewall.Stanford.EDU)
     Source: 70:00:00:32:00:01 (70:00:00:32:00:01)
     Length: 0
     Trailer: 4500003800010000FF01BDB6C0A8829B
  [Malformed Frame: LLC]

Thanks,
Hector 


.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Unable to download?
Date: Mon, 6 Feb 2006 04:00:48 -0800
Lines: 9
Distribution: su
Message-ID: <ds7dpf$68d$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:10015

Just curious if anyone's having the same problems I am.  Everything seems to
get routed correctly, and with ftp I can ls and cd with no problems, but
whenever I try to get a file, it just hangs.  Same thing with the webserver,
the pictures never load while everything else works fine.

Thanks for any advice,
Waynn


.

Path: shelby.stanford.edu!not-for-mail
From: "Waynn Lue" <wlue@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Unable to download?
Date: Mon, 6 Feb 2006 04:59:28 -0800
Lines: 19
Distribution: su
Message-ID: <ds7h7e$bl7$1@news.Stanford.EDU>
References: <ds7dpf$68d$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Xref: shelby.stanford.edu su.class.cs244a:10016

Never mind...I'm an idiot and I was sending incorrect packets.

Waynn

"Waynn Lue" <wlue@stanford.edu> wrote in message
news:ds7dpf$68d$1@news.Stanford.EDU...
> Just curious if anyone's having the same problems I am.  Everything seems
to
> get routed correctly, and with ftp I can ls and cd with no problems, but
> whenever I try to get a file, it just hangs.  Same thing with the
webserver,
> the pictures never load while everything else works fine.
>
> Thanks for any advice,
> Waynn
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Bruce Schechter" <bruceds@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ethereal question
Date: Mon, 6 Feb 2006 09:02:01 -0800
Lines: 12
Distribution: su
Message-ID: <ds7ved$nkg$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Xref: shelby.stanford.edu su.class.cs244a:10017

Ethereal is working wonderfully for me in general.  It's a godsend. But, 
here is a seemingly simple usage question...  how do I copy or export 
contents (such as a collection of packets or the contents of packets) from 
an ethereal window to place them in email, newsgroup, etc?  I am not a unix 
expert...  am I missing some basic copy/paste semantics?  (I am running on 
the Elaines remotely from home on Windows via XManager2.)

thx, Bruce




.

Path: shelby.stanford.edu!not-for-mail
From: "Bruce Schechter" <bruceds@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ethereal question
Date: Mon, 6 Feb 2006 09:36:58 -0800
Lines: 20
Distribution: su
Message-ID: <ds81ft$pf5$1@news.Stanford.EDU>
References: <ds7ved$nkg$1@news.Stanford.EDU>
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Xref: shelby.stanford.edu su.class.cs244a:10018

Or,  ...rather, are people using tcpdump to generate a textual view for 
newsgroup postings?
-- Bruce

"Bruce Schechter" <bruceds@stanford.edu> wrote in message 
news:ds7ved$nkg$1@news.Stanford.EDU...
> Ethereal is working wonderfully for me in general.  It's a godsend. But, 
> here is a seemingly simple usage question...  how do I copy or export 
> contents (such as a collection of packets or the contents of packets) from 
> an ethereal window to place them in email, newsgroup, etc?  I am not a 
> unix expert...  am I missing some basic copy/paste semantics?  (I am 
> running on the Elaines remotely from home on Windows via XManager2.)
>
> thx, Bruce
>
>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ethereal question
Date: Mon, 06 Feb 2006 09:37:48 -0800
Lines: 22
Distribution: su
Message-ID: <ds81gp$pfc$1@news.Stanford.EDU>
References: <ds7ved$nkg$1@news.Stanford.EDU> <ds81ft$pf5$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <ds81ft$pf5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10019

Yeah, just use tcpdump

> Or,  ...rather, are people using tcpdump to generate a textual view for 
> newsgroup postings?
> -- Bruce
> 
> "Bruce Schechter" <bruceds@stanford.edu> wrote in message 
> news:ds7ved$nkg$1@news.Stanford.EDU...
>> Ethereal is working wonderfully for me in general.  It's a godsend. But, 
>> here is a seemingly simple usage question...  how do I copy or export 
>> contents (such as a collection of packets or the contents of packets) from 
>> an ethereal window to place them in email, newsgroup, etc?  I am not a 
>> unix expert...  am I missing some basic copy/paste semantics?  (I am 
>> running on the Elaines remotely from home on Windows via XManager2.)
>>
>> thx, Bruce
>>
>>
>>
>>
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Egress queues
Date: Mon, 06 Feb 2006 09:39:07 -0800
Lines: 15
Distribution: su
Message-ID: <ds81j7$pfc$2@news.Stanford.EDU>
References: <ds73br$qbn$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <ds73br$qbn$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10020

Yeah, good question.  There is no need to throttle sending on 
sr_send_packet, you should be able to send at a high rate.

> Hi,
> 
> Is it necessary (or would it be a good idea) to queue all the outgoing 
> packets and have a separate thread send them using sr_send_packet 
> instead of calling sr_send_packet directly every time we want to send a 
> packet?
> 
> I guess the only reason we want to have a separate thread do it is that 
> sr_send_packet might choke and that would somehow stall that rest of the 
>  program?
> 
> Hau Jia.
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Trace route to eth1
Date: Mon, 06 Feb 2006 09:39:41 -0800
Lines: 11
Distribution: su
Message-ID: <ds81ka$pfc$3@news.Stanford.EDU>
References: <ds6rvo$h21$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <ds6rvo$h21$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10021

It seems so, this is what others are reporting.  We'll have to fix this.

Paul? :-))

> So I tested this on Clack, if I run a trace-route to eth1, it doesn't give a 
> proper route. Is this the right behaviour?
> 
> Thanks,
> Nazia 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Martin Casado <casado@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP, conflicting specs
Date: Mon, 06 Feb 2006 09:40:53 -0800
Lines: 28
Distribution: su
Message-ID: <ds81mh$pfc$5@news.Stanford.EDU>
References: <ds73vi$rbv$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <ds73vi$rbv$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10023


> RFC 1812 and networksorcery.com say two different things about what an 
> ICMP error should look like.
> 
> networksorcery.com says:
> 
> "The IP header plus the first 8 bytes of the original datagram's data is 
> returned to the sender. This data is used by the host to match the 
> message to the appropriate process. If a higher level protocol uses port 
> numbers, they are assumed to be in the first 64 data bits of the 
> original datagram's data."
> 
> RFC 1812 says:
> 
> "Historically, every ICMP error message has included the Intern