su.class.cs244a



Path: shelby.stanford.edu!not-for-mail
From: Benjamin Nham <nham@stanford.edu>
Newsgroups: su.class.cs244a
Subject: [CS244a] Bookstore is selling a different textbook
Date: Mon, 08 Jan 2007 09:11:13 -0800
Lines: 7
Distribution: su
Message-ID: <45A27B31.6090905@stanford.edu>
NNTP-Posting-Host: nham.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168276274 21872 128.12.94.22 (8 Jan 2007 17:11:14 GMT)
X-Complaints-To: news@news.stanford.edu
To:  nickm@stanford.edu
User-Agent: Thunderbird 1.5.0.8 (Windows/20061025)
Xref: shelby.stanford.edu su.class.cs244a:10902

The bookstore is selling the Kurose and Ross book (ISBN 0321227352).

The website links to the Peterson and Davie book (ISBN 155860832X).

Which is correct?

Ben
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: [CS244a] Bookstore is selling a different textbook
Date: Mon, 08 Jan 2007 09:43:05 -0800
Lines: 12
Distribution: su
Message-ID: <entvr2$mt8$1@news.Stanford.EDU>
References: <45A27B31.6090905@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168278178 23464 127.0.0.1 (8 Jan 2007 17:42:58 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <45A27B31.6090905@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:10903

Benjamin Nham wrote:
> The bookstore is selling the Kurose and Ross book (ISBN 0321227352).
> 
> The website links to the Peterson and Davie book (ISBN 155860832X).
> 
> Which is correct?
> 
> Ben

Kurose and Ross is the correct book.

-David
.

Path: shelby.stanford.edu!paun
From: Filip Paun <paun@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Book Edition
Date: Tue, 09 Jan 2007 09:31:08 -0800
Lines: 2
Distribution: su
Message-ID: <paun-B1D1CE.09310709012007@nntp.stanford.edu>
NNTP-Posting-Host: zosomac.stanford.edu
X-Trace: news.Stanford.EDU 1168363867 13824 128.12.135.184 (9 Jan 2007 17:31:07 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: MT-NewsWatcher/3.5.2 (Intel Mac OS X)
Xref: shelby.stanford.edu su.class.cs244a:10904

Is it okay to use the 2nd edition of the book or are there significant 
changes between the two editions that the 3rd edition is required?
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Book Edition
Date: Tue, 09 Jan 2007 13:59:23 -0800
Lines: 15
Distribution: su
Message-ID: <C1C9503B.7306%jpettit@stanford.edu>
References: <paun-B1D1CE.09310709012007@nntp.stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168379966 29144 127.0.0.1 (9 Jan 2007 21:59:26 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Book Edition
Thread-Index: Acc0OWvRqkAmXqAsEduVdAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10905

Hi, Filip.  We switched to a completely different textbook this year, so we
don't know how different the 2nd edition is.  You are going to need to do
some problems out of the book, so the mapping between the editions may be
difficult to track.  I'd recommend getting the 3rd edition.

--Justin


On 1/9/07 9:31 AM, in article paun-B1D1CE.09310709012007@nntp.stanford.edu,
"Filip Paun" <paun@stanford.edu> wrote:

> Is it okay to use the 2nd edition of the book or are there significant
> changes between the two editions that the 3rd edition is required?


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Handout Drawer
Date: Tue, 09 Jan 2007 16:16:05 -0800
Lines: 8
Distribution: su
Message-ID: <C1C97045.731E%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168388162 7468 127.0.0.1 (10 Jan 2007 00:16:02 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Handout Drawer
Thread-Index: Acc0TISXw0z86aA/EduVdAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10906

We have setup a drawer that will hold extra printings of the handouts and
any graded assignments that have not been picked up.  If you come out of the
elevators on the third floor and hook a left, you will see a number of
filing cabinets once you pass the hallway.  It is the bottom drawer on the
first set of cabinets on your left.

--Justin

.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Linux Access
Date: Tue, 09 Jan 2007 17:02:06 -0800
Lines: 18
Distribution: su
Message-ID: <C1C97B0E.7329%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168390924 10344 127.0.0.1 (10 Jan 2007 01:02:04 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Linux Access
Thread-Index: Acc0UvJGMMFBmaBGEduVdAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10907

I've already gotten questions about where you should do your development.
I'd recommend working on the Xenon systems.  To logon, you'll need a SUNet
id.  If you have a Stanford email address, this is your SUNet id.  If not,
you can set one up here:

    http://sunetid.stanford.edu/

If you are an NDO student and don't have a student id yet, you should
contact HelpSU by phone (650-725-HELP) or file a HelpSU ticket:

    http://helpsu.stanford.edu/

Once you have a SUNet account, you should be able to SSH into Xenons:

    ssh <userid>@xenon.stanford.edu

--Justin

.

Path: shelby.stanford.edu!not-for-mail
From: Dina Thomas <dinat@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Parsing HTTP Request
Date: Wed, 10 Jan 2007 08:09:45 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <eo2709$44m$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine35.stanford.edu
X-Trace: news.Stanford.EDU 1168416585 4246 171.64.15.110 (10 Jan 2007 08:09:45 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:10908


Is the proxy supposed to parse the HTTP request according to the specifications 
in the RFC and ensure it is syntactically correct before forwarding the request
to the server? 
Wanted to confirm this as parsing the request takes up a major portion of the code. 
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Parsing HTTP Request
Date: Wed, 10 Jan 2007 09:35:50 -0800
Lines: 10
Distribution: su
Message-ID: <eo385b$3hl$1@news.Stanford.EDU>
References: <eo2709$44m$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168450539 3637 127.0.0.1 (10 Jan 2007 17:35:39 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eo2709$44m$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10909

Dina Thomas wrote:
> Is the proxy supposed to parse the HTTP request according to the specifications 
> in the RFC and ensure it is syntactically correct before forwarding the request
> to the server? 
> Wanted to confirm this as parsing the request takes up a major portion of the code. 

Yes, if you receive a malformed request from the client it is your 
responsibility to return an appropriate error code, per the RFC.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: No Office Hours This Week
Date: Wed, 10 Jan 2007 10:11:18 -0800
Lines: 6
Distribution: su
Message-ID: <C1CA6C46.7363%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168452678 6031 127.0.0.1 (10 Jan 2007 18:11:18 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: No Office Hours This Week
Thread-Index: Acc04rlV9/LOXKDVEduVdAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10910

Since the first assignment has not officially kicked off, none of the TAs
are going to hold office hours this week.  We will be checking the
newsgroups as usual, though, so post any questions you have here.

--Justin

.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Linux Access
Date: Wed, 10 Jan 2007 13:37:56 -0800
Lines: 31
Distribution: su
Message-ID: <C1CA9CB4.7377%jpettit@stanford.edu>
References: <C1C97B0E.7329%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168465075 16873 127.0.0.1 (10 Jan 2007 21:37:55 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Linux Access
Thread-Index: Acc0UvJGMMFBmaBGEduVdAARJDbi7gArKTah
Xref: shelby.stanford.edu su.class.cs244a:10911

I've heard that Xenon is only available to CS students.  You are all
probably better off using the Myths instead:

    ssh <userid>@myth.stanford.edu

--Justin


On 1/9/07 5:02 PM, in article C1C97B0E.7329%jpettit@stanford.edu, "Justin
Pettit" <jpettit@stanford.edu> wrote:

> I've already gotten questions about where you should do your development.
> I'd recommend working on the Xenon systems.  To logon, you'll need a SUNet
> id.  If you have a Stanford email address, this is your SUNet id.  If not,
> you can set one up here:
> 
>     http://sunetid.stanford.edu/
> 
> If you are an NDO student and don't have a student id yet, you should
> contact HelpSU by phone (650-725-HELP) or file a HelpSU ticket:
> 
>     http://helpsu.stanford.edu/
> 
> Once you have a SUNet account, you should be able to SSH into Xenons:
> 
>     ssh <userid>@xenon.stanford.edu
> 
> --Justin
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Question on Assignment 1: What to read next?
Date: Wed, 10 Jan 2007 16:05:16 -0800
Lines: 13
Distribution: su
Message-ID: <eo3uvm$ofj$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168473911 25075 128.12.194.72 (11 Jan 2007 00:05:11 GMT)
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:10912

Hey guys,

I've read the assignment 1 overview, but I'm not sure what my next step
should be. Since I have no idea on how to get started with the project, 
what should I read next? The RFC? Ch. 3-5 in the Unix socket programming 
book? Or Ch. 1-2 in the Kurose book?

Also, when and where will be the Friday discussion sections be held? 
Will they be web-cast?

Any guidance would be appreciated (those from the TAs especially). Thanks.

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on Assignment 1: What to read next?
Date: Wed, 10 Jan 2007 18:38:33 -0800
Lines: 24
Distribution: su
Message-ID: <eo47uu$2o6$1@news.Stanford.EDU>
References: <eo3uvm$ofj$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168483102 2822 127.0.0.1 (11 Jan 2007 02:38:22 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eo3uvm$ofj$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10913

Yangfan Wang wrote:
> Hey guys,
> 
> I've read the assignment 1 overview, but I'm not sure what my next step
> should be. Since I have no idea on how to get started with the project, 
> what should I read next? The RFC? Ch. 3-5 in the Unix socket programming 
> book? Or Ch. 1-2 in the Kurose book?

I would read Ch 1-2 in the Kurose book first as there is discussion in 
there about HTTP requests and responses as well as elementary socket 
discussion.  When you start the assignment you'll need to read both the 
Unix socket programming book and the RFC.

> Also, when and where will be the Friday discussion sections be held? 
> Will they be web-cast?

Please see the front page of the website:
"Discussion Section: Fridays 11:00-11:50AM, Gates B03, Live on E3"

> Any guidance would be appreciated (those from the TAs especially). Thanks.
> 
> -Yangfan

-David
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Linux Access
Date: Wed, 10 Jan 2007 18:39:44 -0800
Lines: 13
Distribution: su
Message-ID: <eo4815$2o6$2@news.Stanford.EDU>
References: <C1C97B0E.7329%jpettit@stanford.edu> <C1CA9CB4.7377%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168483173 2822 127.0.0.1 (11 Jan 2007 02:39:33 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <C1CA9CB4.7377%jpettit@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:10914

Justin Pettit wrote:
> I've heard that Xenon is only available to CS students.  You are all
> probably better off using the Myths instead:
> 
>     ssh <userid>@myth.stanford.edu
> 
> --Justin

Also beware sometimes the ssh login hangs to the Myths (don't ask me 
why), but usually if you just let it sit there for a bit it will 
eventually go through.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Dina Thomas <dinat@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: HTTP Request grammar is strict?
Date: Thu, 11 Jan 2007 03:23:00 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <eo4aik$4ls$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine6.stanford.edu
X-Trace: news.Stanford.EDU 1168485780 4796 171.64.15.71 (11 Jan 2007 03:23:00 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:10915


Though the RFC seems to indicate that there is one space in the simple-request, 
multiple spaces and tabs did not produce an error when I tried with telnet 
on port 80. 
Does this suggest we have to handle such cases gracefully? 
In addition, do we need to handle the case where a line is ended with newline only and not CRLF?
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HTTP Request grammar is strict?
Date: Wed, 10 Jan 2007 19:36:43 -0800
Lines: 21
Distribution: su
Message-ID: <eo4bc1$5dm$1@news.Stanford.EDU>
References: <eo4aik$4ls$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168486593 5558 127.0.0.1 (11 Jan 2007 03:36:33 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eo4aik$4ls$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10916

Dina Thomas wrote:
> Though the RFC seems to indicate that there is one space in the simple-request, 
> multiple spaces and tabs did not produce an error when I tried with telnet 
> on port 80. 
> Does this suggest we have to handle such cases gracefully? 

You must comply with the RFC, there are areas of it that are notably 
ambiguous, so yes you need to handle the cases gracefully.  A good test 
is to see if they work on production servers, as you have tried.

> In addition, do we need to handle the case where a line is ended with newline only and not CRLF?

Please carefully read the RFC:
5.1  Request-Line

    The Request-Line begins with a method token, followed by the
    Request-URI and the protocol version, and ending with CRLF. The
    elements are separated by SP characters. No CR or LF are allowed
    except in the final CRLF sequence.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Dina Thomas <dinat@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: HTTP Request grammar is strict?
Date: Thu, 11 Jan 2007 04:04:39 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <eo4d0n$6e2$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine6.stanford.edu
X-Trace: news.Stanford.EDU 1168488279 6594 171.64.15.71 (11 Jan 2007 04:04:39 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:10917



What I wanted to ask is whether we can have a Request-line 
ended only with LF instead of CRLF?
Isn't LF='\n' and CR='\r'? So when we use the 'enter' key 
on the keyboard it corresponds to '\n'?

.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HTTP Request grammar is strict?
Date: Wed, 10 Jan 2007 20:10:51 -0800
Lines: 18
Distribution: su
Message-ID: <eo4dc0$6l0$1@news.Stanford.EDU>
References: <eo4d0n$6e2$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168488640 6816 127.0.0.1 (11 Jan 2007 04:10:40 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eo4d0n$6e2$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10918

Dina Thomas wrote:
> What I wanted to ask is whether we can have a Request-line 
> ended only with LF instead of CRLF?
> Isn't LF='\n' and CR='\r'? So when we use the 'enter' key 
> on the keyboard it corresponds to '\n'?
> 

The RFC clearly states the line must end with CRLF, a LF without a CR in 
front if it is an error, and vice versa.  The answer to 'isn't enter 
just sending a LF', well, it depends.  It depends on your OS and how 
your telnet application is interpreting the enter key.  I recommend 
reading the wikipedia article on the topic, it was very enlightening for 
me. http://en.wikipedia.org/wiki/Newline  But I do believe the telnet 
app is sending CRLF.

Hope that helps.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: link to cs106x coding style pdf is broken
Date: Wed, 10 Jan 2007 20:49:06 -0800
Lines: 11
Distribution: su
Message-ID: <eo4fiu$89u$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1168490910 8510 127.0.0.1 (11 Jan 2007 04:48:30 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:10919

I went to the cs106x web page and cannot find the 106x pdf linked to on 
http://www.stanford.edu/class/cs244a/CS244aCodingGuidelines.html either.

Any idea if it is still around somewhere?

Sincerely,
Randy Jennings

The squirrels are your friends! 


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: link to cs106x coding style pdf is broken
Date: Wed, 10 Jan 2007 21:52:36 -0800
Lines: 17
Distribution: su
Message-ID: <eo4jap$asi$1@news.Stanford.EDU>
References: <eo4fiu$89u$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168494745 11154 127.0.0.1 (11 Jan 2007 05:52:25 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eo4fiu$89u$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10920

Randy Jennings wrote:
> I went to the cs106x web page and cannot find the 106x pdf linked to on 
> http://www.stanford.edu/class/cs244a/CS244aCodingGuidelines.html either.
> 
> Any idea if it is still around somewhere?
> 
> Sincerely,
> Randy Jennings
> 
> The squirrels are your friends! 
> 
> 

I couldn't find a readily accessible copy but I'll check in to it. 
Thanks for the pointer.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: "manj" <manj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: maximum url length
Date: Thu, 11 Jan 2007 11:49:44 -0800
Lines: 10
Distribution: su
Message-ID: <eo64cm$sp8$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab434dec.stanford.edu
X-Trace: news.Stanford.EDU 1168544982 29480 171.67.77.236 (11 Jan 2007 19:49:42 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:10921

1) can we make any assumptions about the maximum length of request-uri?

2) Also, can we make any assumptions about the maximum length of 
header:<value> pair?

The rfc does not put any limitations on their size. Does this mean that we 
have to accommodate "request-line", "response-line" and "header-lines" of 
unbounded size? 


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Nick's Office Hours Changed to Tuesday 2:30-3:30PM
Date: Thu, 11 Jan 2007 15:55:06 -0800
Lines: 1
Distribution: su
Message-ID: <eo6iom$cv2$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168559702 13282 127.0.0.1 (11 Jan 2007 23:55:02 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
Xref: shelby.stanford.edu su.class.cs244a:10922

See Subject.
.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: balanced tree/hash table
Date: Thu, 11 Jan 2007 21:05:25 -0800
Lines: 17
Distribution: su
Message-ID: <eo74tg$s3s$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1168578288 28796 127.0.0.1 (12 Jan 2007 05:04:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:10923

I know the first assignment can be done in C or C++, but I am trying to 
start with C now.  Unfortunately, I am suffering withdrawal from STL.

I was wondering if there was a C library with balanced trees (or a hash 
table) that we could use?  I have heard of CS140 having access to such 
things.  These structures are non-trivial; if it was just a ring buffer or 
something like that, I would write it myself.

If not, may I just use the hashing function found at:
http://burtleburtle.net/bob/c/lookup3.c?

Sincerely,
Randy Jennings

The squirrels are your friends! 


.

Path: shelby.stanford.edu!not-for-mail
From: "Brian Thompson" <Brian.C.Thompson@Boeing.com>
Newsgroups: su.class.cs244a
Subject: Windows Only Access
Date: Thu, 11 Jan 2007 21:17:12 -0800
Lines: 8
Distribution: su
Message-ID: <eo75kt$slj$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1168579039 29363 127.0.0.1 (12 Jan 2007 05:17:19 GMT)
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.2962
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:10924

I am a distance student and only have access to Windows XP.  Does anyone 
have a recommendation for the best program/enviroment to access the Lab 
servers and to develop the programming assignments in?

Thanks,
--Brian 


.

Path: shelby.stanford.edu!not-for-mail
From: Benjamin Nham <nham@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Windows Only Access
Date: Thu, 11 Jan 2007 21:32:14 -0800
Lines: 26
Distribution: su
Message-ID: <eo76h0$n$1@news.Stanford.EDU>
References: <eo75kt$slj$1@news.Stanford.EDU>
NNTP-Posting-Host: nham.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168579936 23 128.12.94.22 (12 Jan 2007 05:32:16 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eo75kt$slj$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10925

You probably should download an ssh client like securecrt or putty. Then 
connect to a machine like myth or bramble or another leland machine:

http://www.stanford.edu/services/unixcomputing/which.html

Usually I use myth or hedge (note that hedge runs 64-bit linux, not sure 
if that will impact any of these assignments).

If you want to open X windows you should probably also install a local x 
server like XMing and turn on X11 forwarding in your ssh client so you 
can open xterms and so forth.

Note that I'm just another student, I'm sure the staff will have some 
ideas as well.

Ben

Brian Thompson wrote:
> I am a distance student and only have access to Windows XP.  Does anyone 
> have a recommendation for the best program/enviroment to access the Lab 
> servers and to develop the programming assignments in?
> 
> Thanks,
> --Brian 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Windows Only Access
Date: Thu, 11 Jan 2007 22:16:03 -0800
Lines: 41
Distribution: su
Message-ID: <C1CC67A3.7423%jpettit@stanford.edu>
References: <eo75kt$slj$1@news.Stanford.EDU> <eo76h0$n$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168582560 2154 127.0.0.1 (12 Jan 2007 06:16:00 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Windows Only Access
Thread-Index: Acc2ESLTYTi2NqIEEduVdAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10926

I think you pretty well covered it!  Here's a link to PuTTY, which I've had
pretty good luck with:

    http://www.chiark.greenend.org.uk/~sgtatham/putty/

Thanks,

--Justin


On 1/11/07 9:32 PM, in article eo76h0$n$1@news.Stanford.EDU, "Benjamin Nham"
<nham@stanford.edu> wrote:

> You probably should download an ssh client like securecrt or putty. Then
> connect to a machine like myth or bramble or another leland machine:
> 
> http://www.stanford.edu/services/unixcomputing/which.html
> 
> Usually I use myth or hedge (note that hedge runs 64-bit linux, not sure
> if that will impact any of these assignments).
> 
> If you want to open X windows you should probably also install a local x
> server like XMing and turn on X11 forwarding in your ssh client so you
> can open xterms and so forth.
> 
> Note that I'm just another student, I'm sure the staff will have some
> ideas as well.
> 
> Ben
> 
> Brian Thompson wrote:
>> I am a distance student and only have access to Windows XP.  Does anyone
>> have a recommendation for the best program/enviroment to access the Lab
>> servers and to develop the programming assignments in?
>> 
>> Thanks,
>> --Brian 
>> 
>> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Brian Thompson" <Brian.C.Thompson@Boeing.com>
Newsgroups: su.class.cs244a
Subject: Re: Windows Only Access
Date: Thu, 11 Jan 2007 22:26:23 -0800
Lines: 48
Distribution: su
Message-ID: <eo79mo$2hh$1@news.Stanford.EDU>
References: <eo75kt$slj$1@news.Stanford.EDU> <eo76h0$n$1@news.Stanford.EDU> <C1CC67A3.7423%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1168583194 2609 127.0.0.1 (12 Jan 2007 06:26:34 GMT)
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.2962
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:10927

Thanks I'll give that a try and hopefully get cooking on this assignment.

"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1CC67A3.7423%jpettit@stanford.edu...
>I think you pretty well covered it!  Here's a link to PuTTY, which I've had
> pretty good luck with:
>
>    http://www.chiark.greenend.org.uk/~sgtatham/putty/
>
> Thanks,
>
> --Justin
>
>
> On 1/11/07 9:32 PM, in article eo76h0$n$1@news.Stanford.EDU, "Benjamin 
> Nham"
> <nham@stanford.edu> wrote:
>
>> You probably should download an ssh client like securecrt or putty. Then
>> connect to a machine like myth or bramble or another leland machine:
>>
>> http://www.stanford.edu/services/unixcomputing/which.html
>>
>> Usually I use myth or hedge (note that hedge runs 64-bit linux, not sure
>> if that will impact any of these assignments).
>>
>> If you want to open X windows you should probably also install a local x
>> server like XMing and turn on X11 forwarding in your ssh client so you
>> can open xterms and so forth.
>>
>> Note that I'm just another student, I'm sure the staff will have some
>> ideas as well.
>>
>> Ben
>>
>> Brian Thompson wrote:
>>> I am a distance student and only have access to Windows XP.  Does anyone
>>> have a recommendation for the best program/enviroment to access the Lab
>>> servers and to develop the programming assignments in?
>>>
>>> Thanks,
>>> --Brian
>>>
>>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: maximum url length
Date: Thu, 11 Jan 2007 22:28:14 -0800
Lines: 23
Distribution: su
Message-ID: <C1CC6A7E.742A%jpettit@stanford.edu>
References: <eo64cm$sp8$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168583289 2645 127.0.0.1 (12 Jan 2007 06:28:09 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: maximum url length
Thread-Index: Acc2EtaJFNcyyqIGEduVdAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10928

In both cases, I'd recommend growing the buffer to some reasonable limit
(such as 8KB or 16KB).  Legitimate requests can be quite large, however, you
don't want your system open to a denial of service attack.  Make sure to
document your design decisions in the README file.

--Justin


On 1/11/07 11:49 AM, in article eo64cm$sp8$1@news.Stanford.EDU, "manj"
<manj@stanford.edu> wrote:

> 1) can we make any assumptions about the maximum length of request-uri?
> 
> 2) Also, can we make any assumptions about the maximum length of
> header:<value> pair?
> 
> The rfc does not put any limitations on their size. Does this mean that we
> have to accommodate "request-line", "response-line" and "header-lines" of
> unbounded size? 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: balanced tree/hash table
Date: Thu, 11 Jan 2007 22:33:27 -0800
Lines: 29
Distribution: su
Message-ID: <C1CC6BB7.742D%jpettit@stanford.edu>
References: <eo74tg$s3s$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168583605 2877 127.0.0.1 (12 Jan 2007 06:33:25 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: balanced tree/hash table
Thread-Index: Acc2E5EZz+rFaKIGEduVdAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10929

Sorry to do this to you, Randy, but we would like everyone to stick with
standard libraries and STL.  The concern is that it could really complicate
things--especially the grading.

--Justin


On 1/11/07 9:05 PM, in article eo74tg$s3s$1@news.Stanford.EDU, "Randy
Jennings" <randyj@stanford.edu> wrote:

> I know the first assignment can be done in C or C++, but I am trying to
> start with C now.  Unfortunately, I am suffering withdrawal from STL.
> 
> I was wondering if there was a C library with balanced trees (or a hash
> table) that we could use?  I have heard of CS140 having access to such
> things.  These structures are non-trivial; if it was just a ring buffer or
> something like that, I would write it myself.
> 
> If not, may I just use the hashing function found at:
> http://burtleburtle.net/bob/c/lookup3.c?
> 
> Sincerely,
> Randy Jennings
> 
> The squirrels are your friends!
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Section Slides Posted
Date: Fri, 12 Jan 2007 12:53:49 -0800
Lines: 4
Distribution: su
Message-ID: <eo8shv$n55$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168635263 23717 171.64.74.54 (12 Jan 2007 20:54:23 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
Xref: shelby.stanford.edu su.class.cs244a:10930

Powerpoint slides from today's section are now posted on the website. 
We'll hopefully have a PDF version of them available later on.

Clay
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Section Slides Posted
Date: Fri, 12 Jan 2007 13:16:29 -0800
Lines: 14
Distribution: su
Message-ID: <C1CD3AAD.745F%jpettit@stanford.edu>
References: <eo8shv$n55$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168636584 25027 127.0.0.1 (12 Jan 2007 21:16:24 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Section Slides Posted
Thread-Index: Acc2juzVK0l3bKKCEduVdAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10931

A PDF version has been posted.

--Justin


On 1/12/07 12:53 PM, in article eo8shv$n55$1@news.Stanford.EDU, "Clay
Collier" <ccollier@stanford.edu> wrote:

> Powerpoint slides from today's section are now posted on the website.
> We'll hopefully have a PDF version of them available later on.
> 
> Clay


.

Path: shelby.stanford.edu!xenon.Stanford.EDU!ryanchen
From: Ryan Chen <ryanchen@xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Section Slides Posted
Date: Fri, 12 Jan 2007 19:57:40 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.62.0701121957030.1022@xenon.Stanford.EDU>
References: <eo8shv$n55$1@news.Stanford.EDU> <C1CD3AAD.745F%jpettit@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Trace: news.Stanford.EDU 1168660663 16275 171.64.66.201 (13 Jan 2007 03:57:43 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <C1CD3AAD.745F%jpettit@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:10932

In one of the slides, it mentions this "man pages (section 2)", where is 
this man page that you guys are talking about? Thanks.

On Fri, 12 Jan 2007, 
Justin Pettit wrote:

> A PDF version has been posted.
>
> --Justin
>
>
> On 1/12/07 12:53 PM, in article eo8shv$n55$1@news.Stanford.EDU, "Clay
> Collier" <ccollier@stanford.edu> wrote:
>
>> Powerpoint slides from today's section are now posted on the website.
>> We'll hopefully have a PDF version of them available later on.
>>
>> Clay
>
>
>
.

Path: shelby.stanford.edu!xenon.Stanford.EDU!ryanchen
From: Ryan Chen <ryanchen@xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Section Slides Posted
Date: Fri, 12 Jan 2007 20:05:15 -0800
Lines: 27
Distribution: su
Message-ID: <Pine.LNX.4.62.0701122004360.4582@xenon.Stanford.EDU>
References: <eo8shv$n55$1@news.Stanford.EDU> <C1CD3AAD.745F%jpettit@stanford.edu>
 <Pine.LNX.4.62.0701121957030.1022@xenon.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Trace: news.Stanford.EDU 1168661118 16659 171.64.66.201 (13 Jan 2007 04:05:18 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.62.0701121957030.1022@xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10933

Sorry, never mind. Found one online...... but if the TA likes to provide 
the best man page access, that's fine too.

On Fri, 12 Jan 2007, Ryan Chen 
wrote:

> In one of the slides, it mentions this "man pages (section 2)", where is this 
> man page that you guys are talking about? Thanks.
>
> On Fri, 12 Jan 2007, Justin Pettit wrote:
>
>> A PDF version has been posted.
>> 
>> --Justin
>> 
>> 
>> On 1/12/07 12:53 PM, in article eo8shv$n55$1@news.Stanford.EDU, "Clay
>> Collier" <ccollier@stanford.edu> wrote:
>> 
>>> Powerpoint slides from today's section are now posted on the website.
>>> We'll hopefully have a PDF version of them available later on.
>>> 
>>> Clay
>> 
>> 
>> 
>
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Section Slides Posted
Date: Fri, 12 Jan 2007 20:46:19 -0800
Lines: 65
Distribution: su
Message-ID: <C1CDA41B.7483%jpettit@stanford.edu>
References: <eo8shv$n55$1@news.Stanford.EDU> <C1CD3AAD.745F%jpettit@stanford.edu> <Pine.LNX.4.62.0701121957030.1022@xenon.Stanford.EDU> <Pine.LNX.4.62.0701122004360.4582@xenon.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168663577 18483 127.0.0.1 (13 Jan 2007 04:46:17 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Section Slides Posted
Thread-Index: Acc2zcQgAvUpg6LBEduhVAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10934

Clay was referring to the different sections in the man pages.  For example,
if you type "man write", you'll get the man page for "write" from section
"P", which is a program that writes to the console of another user.
However, if you type "man 2 write", you'll get a man page on the "write"
system call, which is what you want.

Here's a breakdown on the meanings of the some of the main section numbers:

       1   Executable programs or shell commands
       2   System calls (functions provided by the kernel)
       3   Library calls (functions within program libraries)
       4   Special files (usually found in /dev)
       5   File formats and conventions eg /etc/passwd
       6   Games
       7   Miscellaneous (including macro  packages  and  conven-
           tions), e.g. man(7), groff(7)
       8   System administration commands (usually only for root)
       9   Kernel routines [Non standard]

When you're programming, you'll generally want pages out of sections 2 and
3.  You only need to specify the section number when you don't get the page
you wanted, such as with "read" and "write".  The man program just grabs the
first page that matches your request.

By the way, putting the bare section number before your request doesn't work
on all systems.  For example, on Solaris you'd need to type "man -s 2 read".

I hope that clarifies things.

--Justin


On 1/12/07 8:05 PM, in article
Pine.LNX.4.62.0701122004360.4582@xenon.Stanford.EDU, "Ryan Chen"
<ryanchen@xenon.Stanford.EDU> wrote:

> Sorry, never mind. Found one online...... but if the TA likes to provide
> the best man page access, that's fine too.
> 
> On Fri, 12 Jan 2007, Ryan Chen
> wrote:
> 
>> In one of the slides, it mentions this "man pages (section 2)", where is this
>> man page that you guys are talking about? Thanks.
>> 
>> On Fri, 12 Jan 2007, Justin Pettit wrote:
>> 
>>> A PDF version has been posted.
>>> 
>>> --Justin
>>> 
>>> 
>>> On 1/12/07 12:53 PM, in article eo8shv$n55$1@news.Stanford.EDU, "Clay
>>> Collier" <ccollier@stanford.edu> wrote:
>>> 
>>>> Powerpoint slides from today's section are now posted on the website.
>>>> We'll hopefully have a PDF version of them available later on.
>>>> 
>>>> Clay
>>> 
>>> 
>>> 
>> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: balanced tree/hash table
Date: Fri, 12 Jan 2007 21:31:21 -0800
Lines: 8
Distribution: su
Message-ID: <eo9qq4$k93$1@news.Stanford.EDU>
References: <eo74tg$s3s$1@news.Stanford.EDU> <C1CC6BB7.742D%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1168666244 20771 127.0.0.1 (13 Jan 2007 05:30:44 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:10935

Okay.  Do you have an STL implementation in C? :-)  That would be a catch!

> Sorry to do this to you, Randy, but we would like everyone to stick with
> standard libraries and STL.  The concern is that it could really 
> complicate
> things--especially the grading.


.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Windows Only Access
Date: Fri, 12 Jan 2007 21:37:12 -0800
Lines: 24
Distribution: su
Message-ID: <eo9r53$kdq$1@news.Stanford.EDU>
References: <eo75kt$slj$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1168666595 20922 127.0.0.1 (13 Jan 2007 05:36:35 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:10936

Don't forget cygwin (with X11, sftp, ssh, gcc, gdb all modules in it).  This 
way you get to test on your system first.

I said in the recitation session today that cygwin does not claim to be 
thread safe.  That is true; however, I have never had issues with it, so 
saying it works most of the time was not quite correct.

(BTW, if you use xemacs, and you want to use gdb, xemacs must be installed 
for cygwin, not native.  Things don't work, and it does not tell you why.)

Sincerely,
Randy Jennings

"Brian Thompson" <Brian.C.Thompson@Boeing.com> wrote in message 
news:eo75kt$slj$1@news.Stanford.EDU...
>I am a distance student and only have access to Windows XP.  Does anyone 
>have a recommendation for the best program/enviroment to access the Lab 
>servers and to develop the programming assignments in?
>
> Thanks,
> --Brian
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: helper functions from the UNIX network programming book
Date: Fri, 12 Jan 2007 23:16:42 -0800
Lines: 9
Distribution: su
Message-ID: <eoa0u3$o8t$1@news.Stanford.EDU>
NNTP-Posting-Host: jadsdesktop.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168672515 24861 128.12.134.140 (13 Jan 2007 07:15:15 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20060911)
Xref: shelby.stanford.edu su.class.cs244a:10937

Hi,

Can we use the helper functions (writen, readn, ...) from the Network
Programming book in our code. It would make things much simpler (since
those functions are already checked for errors, and are not related to
the core functionality of the proxy).

Thanks,
Jad.
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: helper functions from the UNIX network programming book
Date: Fri, 12 Jan 2007 23:59:25 -0800
Lines: 22
Distribution: su
Message-ID: <C1CDD15D.7494%jpettit@stanford.edu>
References: <eoa0u3$o8t$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168675163 208 127.0.0.1 (13 Jan 2007 07:59:23 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: helper functions from the UNIX network programming book
Thread-Index: Acc26L3r/KUXQqLbEduhVAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10938

Please implement your own methods for reading and writing data.  The point
of this project is to get everyone used to writing socket code, which
includes the pain of not having a read or write call not complete the action
you requested.

--Justin


On 1/12/07 11:16 PM, in article eoa0u3$o8t$1@news.Stanford.EDU, "Jad Naous"
<jnaous@stanford.edu> wrote:

> Hi,
> 
> Can we use the helper functions (writen, readn, ...) from the Network
> Programming book in our code. It would make things much simpler (since
> those functions are already checked for errors, and are not related to
> the core functionality of the proxy).
> 
> Thanks,
> Jad.


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: accept Failure
Date: Sat, 13 Jan 2007 01:03:28 -0800
Lines: 10
Distribution: su
Message-ID: <C1CDE060.7499%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168679006 6417 127.0.0.1 (13 Jan 2007 09:03:26 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: accept Failure
Thread-Index: Acc28bCG711mbKLkEduhVAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10939

We had a question after the review session today about what to do if the
"accept" call fails.  For the purposes of this assignment, it is fine to
just exit with an error return code.  There are times that you could recover
from an "accept" error, but they're in very limited circumstances.  However,
I would recommend that you always print the errno to failed system calls,
since it could indicate a bug in your program, such as not closing your
sockets.

--Justin

.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Question on running perl script.
Date: Sat, 13 Jan 2007 02:05:31 -0800
Lines: 3
Distribution: su
Message-ID: <eoaat0$99f$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168682720 9519 128.12.194.72 (13 Jan 2007 10:05:20 GMT)
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:10940

Um, how do I run a perl script again? :p

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on running perl script.
Date: Sat, 13 Jan 2007 09:58:24 -0800
Lines: 21
Distribution: su
Message-ID: <eob6ip$32t$1@news.Stanford.EDU>
References: <eoaat0$99f$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1168711065 3165 127.0.0.1 (13 Jan 2007 17:57:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:10941

perl <scriptname>

or put
#!/usr/sweet/bin/perl
as the first line (on myth).
Just plain "#! perl" might work, too.

However, if you are talking about the grading script, I would recommend 
using python instead :-).

Sincerely,
Randy Jennings

The squirrels are your friends!
"Yangfan Wang" <yfw@stanford.edu> wrote in message 
news:eoaat0$99f$1@news.Stanford.EDU...
> Um, how do I run a perl script again? :p
>
> -Yangfan 


.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on running perl script.
Date: Sat, 13 Jan 2007 13:57:15 -0800
Lines: 39
Distribution: su
Message-ID: <eobkje$ce2$1@news.Stanford.EDU>
References: <eoaat0$99f$1@news.Stanford.EDU> <eob6ip$32t$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168725422 12738 128.12.194.72 (13 Jan 2007 21:57:02 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eob6ip$32t$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10942

*smacks head*

Right, python.

So...

python <program name> (?)

I have no idea here. I can barely figure out how to run python programs 
in Windows, much less Unix. :(

That's what I get from trying to study at 2AM.

-Yangfan

Randy Jennings wrote:
> perl <scriptname>
> 
> or put
> #!/usr/sweet/bin/perl
> as the first line (on myth).
> Just plain "#! perl" might work, too.
> 
> However, if you are talking about the grading script, I would recommend 
> using python instead :-).
> 
> Sincerely,
> Randy Jennings
> 
> The squirrels are your friends!
> "Yangfan Wang" <yfw@stanford.edu> wrote in message 
> news:eoaat0$99f$1@news.Stanford.EDU...
> 
>>Um, how do I run a perl script again? :p
>>
>>-Yangfan 
> 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Brian Thompson" <Brian.C.Thompson@Boeing.com>
Newsgroups: su.class.cs244a
Subject: Compiling
Date: Sat, 13 Jan 2007 14:04:20 -0800
Lines: 24
Distribution: su
Message-ID: <eobl17$cp2$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1168725863 13090 127.0.0.1 (13 Jan 2007 22:04:23 GMT)
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.2962
Xref: shelby.stanford.edu su.class.cs244a:10943

Before I crash into the assignment I want to make sure I can at least create 
a little program on lab pc since I am a remote student, but I'm having a 
problem running the executable file.  I get the following message:
> hello: Command not found.

I have a the generic hello.c program:

#include <stdio.h>
int
main(int argc, char *argv[])
{
    printf ("hello world\n");
    return 0;
}

and I am compiling by typing:
> gcc -o hello hello.c

Any suggestions why I can't run the hello program and get this error?

Thanks,
--Brian 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Compiling
Date: Sat, 13 Jan 2007 15:04:18 -0800
Lines: 35
Distribution: su
Message-ID: <C1CEA572.74C8%jpettit@stanford.edu>
References: <eobl17$cp2$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168729455 16633 127.0.0.1 (13 Jan 2007 23:04:15 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Compiling
Thread-Index: Acc3ZycSZXx+YKNaEduhVAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10944

For security reason, executable don't execute out of your local directory.
You probably need to run it as "./hello".

--Justin


On 1/13/07 2:04 PM, in article eobl17$cp2$1@news.Stanford.EDU, "Brian
Thompson" <Brian.C.Thompson@Boeing.com> wrote:

> Before I crash into the assignment I want to make sure I can at least create
> a little program on lab pc since I am a remote student, but I'm having a
> problem running the executable file.  I get the following message:
>> hello: Command not found.
> 
> I have a the generic hello.c program:
> 
> #include <stdio.h>
> int
> main(int argc, char *argv[])
> {
>     printf ("hello world\n");
>     return 0;
> }
> 
> and I am compiling by typing:
>> gcc -o hello hello.c
> 
> Any suggestions why I can't run the hello program and get this error?
> 
> Thanks,
> --Brian 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: past exams
Date: Sat, 13 Jan 2007 17:25:40 -0800
Lines: 7
Distribution: su
Message-ID: <eoc0nt$oan$1@news.Stanford.EDU>
NNTP-Posting-Host: jadsdesktop.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168737853 24919 128.12.134.140 (14 Jan 2007 01:24:13 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20060911)
Xref: shelby.stanford.edu su.class.cs244a:10945

Hi,

It would be very useful if we could have past exams posted so we can
know what the format is and how to read the book and what to concentrate on.

Thanks,
Jad.
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: helper functions from the UNIX network programming book
Date: Sat, 13 Jan 2007 18:37:16 -0800
Lines: 29
Distribution: su
Message-ID: <eoc50i$8d$1@news.Stanford.EDU>
References: <eoa0u3$o8t$1@news.Stanford.EDU> <C1CDD15D.7494%jpettit@stanford.edu>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168742226 269 128.12.194.72 (14 Jan 2007 02:37:06 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <C1CDD15D.7494%jpettit@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:10946

What if we re-use the book's algorithm and cite it?

-Yangfan

Justin Pettit wrote:
> Please implement your own methods for reading and writing data.  The point
> of this project is to get everyone used to writing socket code, which
> includes the pain of not having a read or write call not complete the action
> you requested.
> 
> --Justin
> 
> 
> On 1/12/07 11:16 PM, in article eoa0u3$o8t$1@news.Stanford.EDU, "Jad Naous"
> <jnaous@stanford.edu> wrote:
> 
> 
>>Hi,
>>
>>Can we use the helper functions (writen, readn, ...) from the Network
>>Programming book in our code. It would make things much simpler (since
>>those functions are already checked for errors, and are not related to
>>the core functionality of the proxy).
>>
>>Thanks,
>>Jad.
> 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Cannot telnet to localhost?
Date: Sat, 13 Jan 2007 21:04:10 -0800
Lines: 17
Distribution: su
Message-ID: <eocdk0$6m6$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168751041 6854 128.12.194.72 (14 Jan 2007 05:04:01 GMT)
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:10947

I'm trying to test my code by doing this:

../proxy 8118 &
(This starts my proxy on another thread with port 8118.)

telnet localhost 8118
(Then I try to establish a connection to it.)

But then I always get this error:
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host: Connection refused

I believe that this is because the myth cluster is secure, and won't let 
me telnet in even if I'm at localhost. This there a way to get around 
this? What am I doing wrong?

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: "Brian Thompson" <Brian.C.Thompson@Boeing.com>
Newsgroups: su.class.cs244a
Subject: Re: Compiling
Date: Sat, 13 Jan 2007 23:25:35 -0800
Lines: 42
Distribution: su
Message-ID: <eocltm$cds$1@news.Stanford.EDU>
References: <eobl17$cp2$1@news.Stanford.EDU> <C1CEA572.74C8%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1168759543 12732 127.0.0.1 (14 Jan 2007 07:25:43 GMT)
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.2962
Xref: shelby.stanford.edu su.class.cs244a:10948

This worked perfect.  Thanks.

"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1CEA572.74C8%jpettit@stanford.edu...
> For security reason, executable don't execute out of your local directory.
> You probably need to run it as "./hello".
>
> --Justin
>
>
> On 1/13/07 2:04 PM, in article eobl17$cp2$1@news.Stanford.EDU, "Brian
> Thompson" <Brian.C.Thompson@Boeing.com> wrote:
>
>> Before I crash into the assignment I want to make sure I can at least 
>> create
>> a little program on lab pc since I am a remote student, but I'm having a
>> problem running the executable file.  I get the following message:
>>> hello: Command not found.
>>
>> I have a the generic hello.c program:
>>
>> #include <stdio.h>
>> int
>> main(int argc, char *argv[])
>> {
>>     printf ("hello world\n");
>>     return 0;
>> }
>>
>> and I am compiling by typing:
>>> gcc -o hello hello.c
>>
>> Any suggestions why I can't run the hello program and get this error?
>>
>> Thanks,
>> --Brian
>>
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: helper functions from the UNIX network programming book
Date: Sat, 13 Jan 2007 23:55:15 -0800
Lines: 42
Distribution: su
Message-ID: <C1CF21E3.74E1%jpettit@stanford.edu>
References: <eoa0u3$o8t$1@news.Stanford.EDU> <C1CDD15D.7494%jpettit@stanford.edu> <eoc50i$8d$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168761316 16646 127.0.0.1 (14 Jan 2007 07:55:16 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: helper functions from the UNIX network programming book
Thread-Index: Acc3sVNSkb2TmqOkEduhVAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10949

There are only so many ways you can write a function that makes sure all the
data you request to be written is written.  However, make an attempt to
write your own as best you can and make sure you follow the coding
guidelines (e.g. don't use global variables).

--Justin


On 1/13/07 6:37 PM, in article eoc50i$8d$1@news.Stanford.EDU, "Yangfan Wang"
<yfw@stanford.edu> wrote:

> What if we re-use the book's algorithm and cite it?
> 
> -Yangfan
> 
> Justin Pettit wrote:
>> Please implement your own methods for reading and writing data.  The point
>> of this project is to get everyone used to writing socket code, which
>> includes the pain of not having a read or write call not complete the action
>> you requested.
>> 
>> --Justin
>> 
>> 
>> On 1/12/07 11:16 PM, in article eoa0u3$o8t$1@news.Stanford.EDU, "Jad Naous"
>> <jnaous@stanford.edu> wrote:
>> 
>> 
>>> Hi,
>>> 
>>> Can we use the helper functions (writen, readn, ...) from the Network
>>> Programming book in our code. It would make things much simpler (since
>>> those functions are already checked for errors, and are not related to
>>> the core functionality of the proxy).
>>> 
>>> Thanks,
>>> Jad.
>> 
>> 
>> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: past exams
Date: Sun, 14 Jan 2007 00:00:35 -0800
Lines: 18
Distribution: su
Message-ID: <C1CF2323.74E3%jpettit@stanford.edu>
References: <eoc0nt$oan$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168761633 17799 127.0.0.1 (14 Jan 2007 08:00:33 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: past exams
Thread-Index: Acc3shIOUGdRtKOlEduhVAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10950

In previous versions of this course, past exams have been posted.  I'm sure
we'll do the same when we get closer to midterm and final.

--Justin


On 1/13/07 5:25 PM, in article eoc0nt$oan$1@news.Stanford.EDU, "Jad Naous"
<jnaous@stanford.edu> wrote:

> Hi,
> 
> It would be very useful if we could have past exams posted so we can
> know what the format is and how to read the book and what to concentrate on.
> 
> Thanks,
> Jad.


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Cannot telnet to localhost?
Date: Sun, 14 Jan 2007 00:11:08 -0800
Lines: 42
Distribution: su
Message-ID: <C1CF259C.74E6%jpettit@stanford.edu>
References: <eocdk0$6m6$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168762267 18621 127.0.0.1 (14 Jan 2007 08:11:07 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Cannot telnet to localhost?
Thread-Index: Acc3s4taydH/uqOmEduhVAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10951

I just tested my implementation and didn't have any problem.  Are you sure
you're on the same Myth machine?  The Myth cluster is a bunch of different
Linux machines.  Stanford uses some DNS tricks, which we'll cover next
Friday, to make it so that when you SSH into a "myth", it sends you to a
random one.  This means that if you have multiple remote sessions open,
you'll end up on multiple machines.  When you start your proxy on one, it
won't work for testing on another.

To work around this, create your multiple sessions on the same Myth host.
For example, I logged into "myth.stanford.edu", and I can see from my prompt
that I'm on "myth26".  I then create my additional sessions by SSHing to
"myth26.stanford.edu".  If you don't see which Myth machine you are on, you
can run the "hostname" command.

If this doesn't address your problem, let us know.

--Justin


On 1/13/07 9:04 PM, in article eocdk0$6m6$1@news.Stanford.EDU, "Yangfan
Wang" <yfw@stanford.edu> wrote:

> I'm trying to test my code by doing this:
> 
> ./proxy 8118 &
> 
> (This starts my proxy on another thread with port 8118.)
> 
> telnet localhost 8118
> (Then I try to establish a connection to it.)
> 
> But then I always get this error:
> telnet: connect to address 127.0.0.1: Connection refused
> telnet: Unable to connect to remote host: Connection refused
> 
> I believe that this is because the myth cluster is secure, and won't let
> me telnet in even if I'm at localhost. This there a way to get around
> this? What am I doing wrong?
> 
> -Yangfan


.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on running perl script.
Date: Sun, 14 Jan 2007 00:55:41 -0800
Lines: 52
Distribution: su
Message-ID: <eocra7$kgp$1@news.Stanford.EDU>
References: <eoaat0$99f$1@news.Stanford.EDU> <eob6ip$32t$1@news.Stanford.EDU> <eobkje$ce2$1@news.Stanford.EDU>
NNTP-Posting-Host: shelly.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168765063 21017 128.12.133.165 (14 Jan 2007 08:57:43 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eobkje$ce2$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10952

It is much easier in unix than in windows, since your default 
environment is a command prompt.

You guessed the command right.

python <script name> <parameter list>

If that doesn't work, see if python is in your path. You can find the 
executable with

locate python

Yangfan Wang wrote:
> *smacks head*
> 
> Right, python.
> 
> So...
> 
> python <program name> (?)
> 
> I have no idea here. I can barely figure out how to run python programs 
> in Windows, much less Unix. :(
> 
> That's what I get from trying to study at 2AM.
> 
> -Yangfan
> 
> Randy Jennings wrote:
>> perl <scriptname>
>>
>> or put
>> #!/usr/sweet/bin/perl
>> as the first line (on myth).
>> Just plain "#! perl" might work, too.
>>
>> However, if you are talking about the grading script, I would 
>> recommend using python instead :-).
>>
>> Sincerely,
>> Randy Jennings
>>
>> The squirrels are your friends!
>> "Yangfan Wang" <yfw@stanford.edu> wrote in message 
>> news:eoaat0$99f$1@news.Stanford.EDU...
>>
>>> Um, how do I run a perl script again? :p
>>>
>>> -Yangfan 
>>
>>
>>
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Cannot telnet to localhost?
Date: Sun, 14 Jan 2007 05:38:16 -0800
Lines: 62
Distribution: su
Message-ID: <eodbnv$ajc$1@news.Stanford.EDU>
References: <eocdk0$6m6$1@news.Stanford.EDU> <C1CF259C.74E6%jpettit@stanford.edu>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168781887 10860 128.12.194.72 (14 Jan 2007 13:38:07 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <C1CF259C.74E6%jpettit@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:10953

Hmm. The problem only seems to occur if I start the telnet connection 
after my proxy has been running for more than a dozen seconds or so. In 
gdb, I could tell that my proxy goes all the way up to the call to 
accept. Does accept have a time-out mechanism or something?

Also, I could use some clarifications on gethostbyname. After calling 
gethostbyname(<the URL>), I know that I get a struct hostent pointer 
back. But then what? I can't tell from the man page where to get the IP 
address in the "X.X.X.X" form. My best guess was 
<struct>.h_addr_list[0], but I'm getting mangled garbage out of it right 
now. So... am I looking at the wrong thing?

I know that my URL was valid, since <struct>.h_name was different but 
still made sense.

-Yangfan

Justin Pettit wrote:
> I just tested my implementation and didn't have any problem.  Are you sure
> you're on the same Myth machine?  The Myth cluster is a bunch of different
> Linux machines.  Stanford uses some DNS tricks, which we'll cover next
> Friday, to make it so that when you SSH into a "myth", it sends you to a
> random one.  This means that if you have multiple remote sessions open,
> you'll end up on multiple machines.  When you start your proxy on one, it
> won't work for testing on another.
> 
> To work around this, create your multiple sessions on the same Myth host.
> For example, I logged into "myth.stanford.edu", and I can see from my prompt
> that I'm on "myth26".  I then create my additional sessions by SSHing to
> "myth26.stanford.edu".  If you don't see which Myth machine you are on, you
> can run the "hostname" command.
> 
> If this doesn't address your problem, let us know.
> 
> --Justin
> 
> 
> On 1/13/07 9:04 PM, in article eocdk0$6m6$1@news.Stanford.EDU, "Yangfan
> Wang" <yfw@stanford.edu> wrote:
> 
> 
>>I'm trying to test my code by doing this:
>>
>>./proxy 8118 &
>>
>>(This starts my proxy on another thread with port 8118.)
>>
>>telnet localhost 8118
>>(Then I try to establish a connection to it.)
>>
>>But then I always get this error:
>>telnet: connect to address 127.0.0.1: Connection refused
>>telnet: Unable to connect to remote host: Connection refused
>>
>>I believe that this is because the myth cluster is secure, and won't let
>>me telnet in even if I'm at localhost. This there a way to get around
>>this? What am I doing wrong?
>>
>>-Yangfan
> 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Alex" <axle@sonic.net>
Newsgroups: su.class.cs244a
Subject: running grading script
Date: Sun, 14 Jan 2007 16:21:04 -0800
Lines: 39
Distribution: su
Message-ID: <eoehdh$l9f$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1168820465 21807 127.0.0.1 (15 Jan 2007 00:21:05 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:10954

I was trying to run the grading script on my proxy and I get the messages 
below. Why is this happening?

vine7:~/proj1> ./grade proxy.c 98235
Binary: proxy.c
Running on port 98235
Traceback (most recent call last):
  File "./grade", line 100, in ?
    main()
  File "./grade", line 45, in main
    foblist.append(urllib.urlopen(url, None, proxy_map))
  File "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
line 82, in urlopen
    return opener.open(url)
  File "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
line 190, in open
    return getattr(self, name)(url)
  File "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
line 313, in open_http
    h.endheaders()
  File 
"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line 
798, in endheaders
    self._send_output()
  File 
"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line 
679, in _send_output
    self.send(msg)
  File 
"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line 
646, in send
    self.connect()
  File 
"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line 
630, in connect
    raise socket.error, msg
IOError: [Errno socket error] (111, 'Connection refused')


.

Path: shelby.stanford.edu!not-for-mail
From: "Alex" <axle@sonic.net>
Newsgroups: su.class.cs244a
Subject: running grading script
Date: Sun, 14 Jan 2007 16:21:31 -0800
Lines: 39
Distribution: su
Message-ID: <eoeheb$l9m$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1168820491 21814 127.0.0.1 (15 Jan 2007 00:21:31 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:10955

I was trying to run the grading script on my proxy and I get the messages 
below. Why is this happening?

vine7:~/proj1> ./grade proxy.c 98235
Binary: proxy.c
Running on port 98235
Traceback (most recent call last):
  File "./grade", line 100, in ?
    main()
  File "./grade", line 45, in main
    foblist.append(urllib.urlopen(url, None, proxy_map))
  File "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
line 82, in urlopen
    return opener.open(url)
  File "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
line 190, in open
    return getattr(self, name)(url)
  File "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
line 313, in open_http
    h.endheaders()
  File 
"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line 
798, in endheaders
    self._send_output()
  File 
"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line 
679, in _send_output
    self.send(msg)
  File 
"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line 
646, in send
    self.connect()
  File 
"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line 
630, in connect
    raise socket.error, msg
IOError: [Errno socket error] (111, 'Connection refused')


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running grading script
Date: Sun, 14 Jan 2007 16:35:57 -0800
Lines: 52
Distribution: su
Message-ID: <C1D00C6D.7506%jpettit@stanford.edu>
References: <eoeheb$l9m$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168821355 22437 127.0.0.1 (15 Jan 2007 00:35:55 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: running grading script
Thread-Index: Acc4PR8kXeJ0iqQwEduhVAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10956

TCP and UDP port numbers are 16-bit values, which means the maximum value is
65535.  Try something between 1024 and 65535.  You also might want to check
to make sure that you're checking all your socket return values and compiler
warnings.

--Justin


On 1/14/07 4:21 PM, in article eoeheb$l9m$1@news.Stanford.EDU, "Alex"
<axle@sonic.net> wrote:

> I was trying to run the grading script on my proxy and I get the messages
> below. Why is this happening?
> 
> vine7:~/proj1> ./grade proxy.c 98235
> Binary: proxy.c
> Running on port 98235
> Traceback (most recent call last):
>   File "./grade", line 100, in ?
>     main()
>   File "./grade", line 45, in main
>     foblist.append(urllib.urlopen(url, None, proxy_map))
>   File "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
> line 82, in urlopen
>     return opener.open(url)
>   File "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
> line 190, in open
>     return getattr(self, name)(url)
>   File "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
> line 313, in open_http
>     h.endheaders()
>   File 
> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line
> 798, in endheaders
>     self._send_output()
>   File 
> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line
> 679, in _send_output
>     self.send(msg)
>   File 
> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line
> 646, in send
>     self.connect()
>   File 
> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line
> 630, in connect
>     raise socket.error, msg
> IOError: [Errno socket error] (111, 'Connection refused')
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Question on gethostbyname
Date: Sun, 14 Jan 2007 17:17:43 -0800
Lines: 13
Distribution: su
Message-ID: <eoekn7$nr1$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168823847 24417 128.12.194.72 (15 Jan 2007 01:17:27 GMT)
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:10957

(reposted from unanswered post)

I could use some clarifications on gethostbyname. After calling 
gethostbyname(<the URL>), I know that I get a struct hostent pointer 
back. But then what? I can't tell from the man page where to get the IP 
address in the "X.X.X.X" form. My best guess was 
<struct>.h_addr_list[0], but I'm getting mangled garbage out of it right 
now. So... am I looking at the wrong thing?

I know that my URL was valid, since <struct>.h_name was different but 
still made sense.

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: "Alex" <axle@sonic.net>
Newsgroups: su.class.cs244a
Subject: Re: running grading script
Date: Sun, 14 Jan 2007 17:26:41 -0800
Lines: 107
Distribution: su
Message-ID: <eoel8m$ob8$1@news.Stanford.EDU>
References: <eoeheb$l9m$1@news.Stanford.EDU> <C1D00C6D.7506%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1168824406 24936 127.0.0.1 (15 Jan 2007 01:26:46 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:10958

I gave a port in the valid range and I still see this issue. I was able to 
run my proxy on that port and use telnet and do GET correctly but I'm still 
having problems with the grading script.

vine7:~/proj1> ./grade proxy.c 32454
Binary: proxy.c
Running on port 32454
Traceback (most recent call last):
  File "./grade", line 97, in ?
    main()
  File "./grade", line 42, in main
    foblist.append(urllib.urlopen(url, None, proxy_map))
  File "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
line 82, in urlopen
    return opener.open(url)
  File "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
line 190, in open
    return getattr(self, name)(url)
  File "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
line 313, in open_http
    h.endheaders()
  File 
"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line 
798, in endheaders
    self._send_output()
  File 
"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line 
679, in _send_output
    self.send(msg)
  File 
"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line 
646, in send
    self.connect()
  File 
"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line 
630, in connect
    raise socket.error, msg
IOError: [Errno socket error] (111, 'Connection refused')

Alex

"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1D00C6D.7506%jpettit@stanford.edu...
> TCP and UDP port numbers are 16-bit values, which means the maximum value 
> is
> 65535.  Try something between 1024 and 65535.  You also might want to 
> check
> to make sure that you're checking all your socket return values and 
> compiler
> warnings.
>
> --Justin
>
>
> On 1/14/07 4:21 PM, in article eoeheb$l9m$1@news.Stanford.EDU, "Alex"
> <axle@sonic.net> wrote:
>
>> I was trying to run the grading script on my proxy and I get the messages
>> below. Why is this happening?
>>
>> vine7:~/proj1> ./grade proxy.c 98235
>> Binary: proxy.c
>> Running on port 98235
>> Traceback (most recent call last):
>>   File "./grade", line 100, in ?
>>     main()
>>   File "./grade", line 45, in main
>>     foblist.append(urllib.urlopen(url, None, proxy_map))
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>> line 82, in urlopen
>>     return opener.open(url)
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>> line 190, in open
>>     return getattr(self, name)(url)
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>> line 313, in open_http
>>     h.endheaders()
>>   File
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>> line
>> 798, in endheaders
>>     self._send_output()
>>   File
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>> line
>> 679, in _send_output
>>     self.send(msg)
>>   File
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>> line
>> 646, in send
>>     self.connect()
>>   File
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>> line
>> 630, in connect
>>     raise socket.error, msg
>> IOError: [Errno socket error] (111, 'Connection refused')
>>
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Neelima Balakrishnan <bneelima@stanford.edu>
Newsgroups: su.class.cs244a
Subject: RFC compliance
Date: Sun, 14 Jan 2007 19:51:54 -0800
Lines: 20
Distribution: su
Message-ID: <eoetoe$33f$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168833102 3183 127.0.0.1 (15 Jan 2007 03:51:42 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
Xref: shelby.stanford.edu su.class.cs244a:10959

Hi,

I had doubts as to how tolerant should the proxy server be while 
implementing the RFC.

1. Should it accept a request from the client if the method is not in 
upper-case and so on?

2. How should the proxy behave when we have a request that contains 
"CRLF SP CRLF"? When I tried testing this scenario with yahoo, google 
and w3c.org, they behaved differently.

3. Should we accept requests with space preceding GET as valid requests?

4. While checking if the request is properly formatted, do we need to
verify the header sections too?

Thanks
Neelima

.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Question on tab length / left indention
Date: Sun, 14 Jan 2007 22:34:12 -0800
Lines: 4
Distribution: su
Message-ID: <eof795$c4i$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168842853 12434 128.12.194.72 (15 Jan 2007 06:34:13 GMT)
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:10960

Does anyone know how to modify xemacs so that when it auto-formats code, 
the left indention is set at, say, 4 spaces rather than 2?

-Yangfan
.

Path: shelby.stanford.edu!paun
From: Filip Paun <paun@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Cannot telnet to localhost?
Date: Sun, 14 Jan 2007 23:06:01 -0800
Lines: 62
Distribution: su
Message-ID: <paun-DCC8AE.23060014012007@nntp.stanford.edu>
References: <eocdk0$6m6$1@news.Stanford.EDU> <C1CF259C.74E6%jpettit@stanford.edu>
NNTP-Posting-Host: zosomac.stanford.edu
X-Trace: news.Stanford.EDU 1168844761 13595 128.12.135.184 (15 Jan 2007 07:06:01 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: MT-NewsWatcher/3.5.2 (Intel Mac OS X)
Xref: shelby.stanford.edu su.class.cs244a:10961

I am running in the same problem as Yangfan.

I issue the commands:

   ./proxy 10000

   telnet localhost 10000

and get the error:

   telnet: connect to address 127.0.0.1: Connection refused
   telnet: Unable to connect to remote host: Connection refused

On both terminals, I can see that i am on the same myth machine (in my 
case myth23).

Any help is much appreciated.  Thank you in advance.
Filip

In article <C1CF259C.74E6%jpettit@stanford.edu>,
 Justin Pettit <jpettit@stanford.edu> wrote:

> I just tested my implementation and didn't have any problem.  Are you sure
> you're on the same Myth machine?  The Myth cluster is a bunch of different
> Linux machines.  Stanford uses some DNS tricks, which we'll cover next
> Friday, to make it so that when you SSH into a "myth", it sends you to a
> random one.  This means that if you have multiple remote sessions open,
> you'll end up on multiple machines.  When you start your proxy on one, it
> won't work for testing on another.
> 
> To work around this, create your multiple sessions on the same Myth host.
> For example, I logged into "myth.stanford.edu", and I can see from my prompt
> that I'm on "myth26".  I then create my additional sessions by SSHing to
> "myth26.stanford.edu".  If you don't see which Myth machine you are on, you
> can run the "hostname" command.
> 
> If this doesn't address your problem, let us know.
> 
> --Justin
> 
> 
> On 1/13/07 9:04 PM, in article eocdk0$6m6$1@news.Stanford.EDU, "Yangfan
> Wang" <yfw@stanford.edu> wrote:
> 
> > I'm trying to test my code by doing this:
> > 
> > ./proxy 8118 &
> > 
> > (This starts my proxy on another thread with port 8118.)
> > 
> > telnet localhost 8118
> > (Then I try to establish a connection to it.)
> > 
> > But then I always get this error:
> > telnet: connect to address 127.0.0.1: Connection refused
> > telnet: Unable to connect to remote host: Connection refused
> > 
> > I believe that this is because the myth cluster is secure, and won't let
> > me telnet in even if I'm at localhost. This there a way to get around
> > this? What am I doing wrong?
> > 
> > -Yangfan
.

Path: shelby.stanford.edu!paun
From: Filip Paun <paun@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Telnet Error
Date: Sun, 14 Jan 2007 23:11:34 -0800
Lines: 21
Distribution: su
Message-ID: <paun-C442BE.23113414012007@nntp.stanford.edu>
NNTP-Posting-Host: zosomac.stanford.edu
X-Trace: news.Stanford.EDU 1168845095 13595 128.12.135.184 (15 Jan 2007 07:11:35 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: MT-NewsWatcher/3.5.2 (Intel Mac OS X)
Xref: shelby.stanford.edu su.class.cs244a:10962

Hello,

I am running in the same telnet problem as Yangfan.

I issue the commands on two terminals:
  
   ./proxy 10001
   telnet localhost 10001

and receive the following error

   telnet: connect to address 127.0.0.1: Connection refused
   telnet: Unable to connect to remote host: Connection refused

now both commands were issued on the same myth machine (in my case 
myth23).

What do i need to do to solve this error? Your help is much appreciated 
and thank you in advance for your response.

Filip
.

Path: shelby.stanford.edu!not-for-mail
From: Adam Cohen <adam.cohen@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on tab length / left indention
Date: Mon, 15 Jan 2007 00:36:55 -0800
Lines: 24
Distribution: su
Message-ID: <eofefi$lkn$1@news.Stanford.EDU>
References: <eof795$c4i$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1168850226 22167 127.0.0.1 (15 Jan 2007 08:37:06 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Unison/1.7.5
Xref: shelby.stanford.edu su.class.cs244a:10963

On 2007-01-14 22:34:12 -0800, Yangfan Wang <yfw@stanford.edu> said:

> Does anyone know how to modify xemacs so that when it auto-formats 
> code, the left indention is set at, say, 4 spaces rather than 2?
> 
> -Yangfan

There are like 800 ways to do it, which you can get the gritty details 
of by googling, but one way is to edit your .xemacs file to include

(add-hook 'c-mode-hook '(lambda ()
	(setq c-basic-offset 4))))

That'll do it for C files.  On regular old emacs at least. You could also try

(setq default-tab-width 4)

if you want it for all files.






.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on gethostbyname
Date: Mon, 15 Jan 2007 01:30:28 -0800
Lines: 48
Distribution: su
Message-ID: <eofhjl$p1f$1@news.Stanford.EDU>
References: <eoekn7$nr1$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168853429 25647 128.12.194.72 (15 Jan 2007 09:30:29 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eoekn7$nr1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10964

A related question:

 From the man page on gethostbyname:

The hostent structure is defined in <netdb.h> as follows:

               struct hostent {
                       char    *h_name;        /* official name of host */
                       char    **h_aliases;    /* alias list */
                       int     h_addrtype;     /* host address type */
                       int     h_length;       /* length of address */
                       char    **h_addr_list;  /* list of addresses */
               }
               #define h_addr  h_addr_list[0]  /* for backward 
compatibility */

....

h_addr_list
               A zero-terminated array of network addresses for the host 
in network byte order.

What does it mean for a char* (a string, really) to be in network byte 
order? Is this a human readable IP address (X.X.X.X) or a machine 
reabale IP address (in_addr_t)?

This is making me pull my hair out. I just want to go from 
"www.yahoo.com" to a machine readable IP address of type in_addr_t. It 
shouldn't be this complicated. I must be doing something wrong here. :/

Any help would be appreciated. Thanks.

-Yangfan

Yangfan Wang wrote:
> (reposted from unanswered post)
> 
> I could use some clarifications on gethostbyname. After calling 
> gethostbyname(<the URL>), I know that I get a struct hostent pointer 
> back. But then what? I can't tell from the man page where to get the IP 
> address in the "X.X.X.X" form. My best guess was 
> <struct>.h_addr_list[0], but I'm getting mangled garbage out of it right 
> now. So... am I looking at the wrong thing?
> 
> I know that my URL was valid, since <struct>.h_name was different but 
> still made sense.
> 
> -Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on tab length / left indention
Date: Mon, 15 Jan 2007 01:31:53 -0800
Lines: 27
Distribution: su
Message-ID: <eofhmb$p1f$2@news.Stanford.EDU>
References: <eof795$c4i$1@news.Stanford.EDU> <eofefi$lkn$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168853515 25647 128.12.194.72 (15 Jan 2007 09:31:55 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eofefi$lkn$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10965

Adam Cohen wrote:
> On 2007-01-14 22:34:12 -0800, Yangfan Wang <yfw@stanford.edu> said:
> 
>> Does anyone know how to modify xemacs so that when it auto-formats 
>> code, the left indention is set at, say, 4 spaces rather than 2?
>>
>> -Yangfan
> 
> 
> There are like 800 ways to do it, which you can get the gritty details 
> of by googling, but one way is to edit your .xemacs file to include
> 
> (add-hook 'c-mode-hook '(lambda ()
>     (setq c-basic-offset 4))))
> 
> That'll do it for C files.  On regular old emacs at least. You could 
> also try
> 
> (setq default-tab-width 4)
> 
> if you want it for all files.
> 

I can only use xemacs when I'm remotely logged in, but I can try this 
with emacs in the labs. Thank you Adam.

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running grading script
Date: Mon, 15 Jan 2007 01:58:11 -0800
Lines: 123
Distribution: su
Message-ID: <eofjbc$qg9$1@news.Stanford.EDU>
References: <eoeheb$l9m$1@news.Stanford.EDU> <C1D00C6D.7506%jpettit@stanford.edu> <eoel8m$ob8$1@news.Stanford.EDU>
NNTP-Posting-Host: shelly.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168855212 27145 128.12.133.165 (15 Jan 2007 10:00:12 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eoel8m$ob8$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10966

The important error line that is the last one:

 > IOError: [Errno socket error] (111, 'Connection refused')

That means that it is unable to connect to anything on that port. Are 
you sure your running your proxy on that port? Might you be binding the 
port in the wrong 'endian'ness? There is a function that you should be 
using whenever you are taking data from the host and changing it to 
network byte ordering.

See if you can bind to port 1. If you can, you are doing the endianness 
wrong, since a non-root user can't bind to port < 1024.




Alex wrote:
> I gave a port in the valid range and I still see this issue. I was able to 
> run my proxy on that port and use telnet and do GET correctly but I'm still 
> having problems with the grading script.
> 
> vine7:~/proj1> ./grade proxy.c 32454
> Binary: proxy.c
> Running on port 32454
> Traceback (most recent call last):
>   File "./grade", line 97, in ?
>     main()
>   File "./grade", line 42, in main
>     foblist.append(urllib.urlopen(url, None, proxy_map))
>   File "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
> line 82, in urlopen
>     return opener.open(url)
>   File "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
> line 190, in open
>     return getattr(self, name)(url)
>   File "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
> line 313, in open_http
>     h.endheaders()
>   File 
> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line 
> 798, in endheaders
>     self._send_output()
>   File 
> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line 
> 679, in _send_output
>     self.send(msg)
>   File 
> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line 
> 646, in send
>     self.connect()
>   File 
> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", line 
> 630, in connect
>     raise socket.error, msg
> IOError: [Errno socket error] (111, 'Connection refused')
> 
> Alex
> 
> "Justin Pettit" <jpettit@stanford.edu> wrote in message 
> news:C1D00C6D.7506%jpettit@stanford.edu...
>> TCP and UDP port numbers are 16-bit values, which means the maximum value 
>> is
>> 65535.  Try something between 1024 and 65535.  You also might want to 
>> check
>> to make sure that you're checking all your socket return values and 
>> compiler
>> warnings.
>>
>> --Justin
>>
>>
>> On 1/14/07 4:21 PM, in article eoeheb$l9m$1@news.Stanford.EDU, "Alex"
>> <axle@sonic.net> wrote:
>>
>>> I was trying to run the grading script on my proxy and I get the messages
>>> below. Why is this happening?
>>>
>>> vine7:~/proj1> ./grade proxy.c 98235
>>> Binary: proxy.c
>>> Running on port 98235
>>> Traceback (most recent call last):
>>>   File "./grade", line 100, in ?
>>>     main()
>>>   File "./grade", line 45, in main
>>>     foblist.append(urllib.urlopen(url, None, proxy_map))
>>>   File 
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>> line 82, in urlopen
>>>     return opener.open(url)
>>>   File 
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>> line 190, in open
>>>     return getattr(self, name)(url)
>>>   File 
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>> line 313, in open_http
>>>     h.endheaders()
>>>   File
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>>> line
>>> 798, in endheaders
>>>     self._send_output()
>>>   File
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>>> line
>>> 679, in _send_output
>>>     self.send(msg)
>>>   File
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>>> line
>>> 646, in send
>>>     self.connect()
>>>   File
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>>> line
>>> 630, in connect
>>>     raise socket.error, msg
>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>
>>>
>>
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on gethostbyname
Date: Mon, 15 Jan 2007 02:07:15 -0800
Lines: 41
Distribution: su
Message-ID: <eofjsc$rrk$1@news.Stanford.EDU>
References: <eoekn7$nr1$1@news.Stanford.EDU> <eofhjl$p1f$1@news.Stanford.EDU>
NNTP-Posting-Host: shelly.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168855756 28532 128.12.133.165 (15 Jan 2007 10:09:16 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eofhjl$p1f$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10967

Yangfan Wang wrote:
> A related question:
> 
>  From the man page on gethostbyname:
> 
> The hostent structure is defined in <netdb.h> as follows:
> 
>               struct hostent {
>                       char    *h_name;        /* official name of host */
>                       char    **h_aliases;    /* alias list */
>                       int     h_addrtype;     /* host address type */
>                       int     h_length;       /* length of address */
>                       char    **h_addr_list;  /* list of addresses */
>               }
>               #define h_addr  h_addr_list[0]  /* for backward 
> compatibility */
> 
Yes, that is what the function returns.
> ...
> 
> h_addr_list
>               A zero-terminated array of network addresses for the host 
> in network byte order.
> 
> What does it mean for a char* (a string, really) to be in network byte 
> order? Is this a human readable IP address (X.X.X.X) or a machine 
> reabale IP address (in_addr_t)?
Network byte order just is specifying that the number is "Big Endian". 
It is just the order in which the bits are stored (in this case, the 
most significant bit is in the lowest address position). This is needed 
since machines don't have to store all their data in the same order.

You might want to compare a h_addr to a in_addr_t. The similarities 
might alarm you.

> 
> This is making me pull my hair out. I just want to go from 
> "www.yahoo.com" to a machine readable IP address of type in_addr_t. It 
> shouldn't be this complicated. I must be doing something wrong here. :/
> 
You've already done the hard part. 2 more minutes and you will have it
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: RFC compliance
Date: Mon, 15 Jan 2007 02:10:11 -0800
Lines: 31
Distribution: su
Message-ID: <eofk1s$rrk$2@news.Stanford.EDU>
References: <eoetoe$33f$1@news.Stanford.EDU>
NNTP-Posting-Host: shelly.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168855932 28532 128.12.133.165 (15 Jan 2007 10:12:12 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eoetoe$33f$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10968

Please follow the RFC as closely as you can. If other implementations 
differ, and the RFC is very explicit, do exactly what the RFC says. I 
don't want to go through your list and find the pertinent parts of the 
RFC, since part of this assignment is learning how to write a program to 
a given specification.

If the RFC is vague, and you think there is more than one 
interpretation, please code it the most robust way, and then explain 
your decision in your README file.

Neelima Balakrishnan wrote:
> Hi,
> 
> I had doubts as to how tolerant should the proxy server be while 
> implementing the RFC.
> 
> 1. Should it accept a request from the client if the method is not in 
> upper-case and so on?
> 
> 2. How should the proxy behave when we have a request that contains 
> "CRLF SP CRLF"? When I tried testing this scenario with yahoo, google 
> and w3c.org, they behaved differently.
> 
> 3. Should we accept requests with space preceding GET as valid requests?
> 
> 4. While checking if the request is properly formatted, do we need to
> verify the header sections too?
> 
> Thanks
> Neelima
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Telnet Error
Date: Mon, 15 Jan 2007 02:11:17 -0800
Lines: 26
Distribution: su
Message-ID: <eofk3u$rrk$3@news.Stanford.EDU>
References: <paun-C442BE.23113414012007@nntp.stanford.edu>
NNTP-Posting-Host: shelly.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168855998 28532 128.12.133.165 (15 Jan 2007 10:13:18 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <paun-C442BE.23113414012007@nntp.stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:10969

As I posted above, check if you are in network byte order. See if you 
can bind to some ports from 1-1024. If you can, that is an error, since 
non-root users shouldn't be able to bind to ports from 1-1024.

Filip Paun wrote:
> Hello,
> 
> I am running in the same telnet problem as Yangfan.
> 
> I issue the commands on two terminals:
>   
>    ./proxy 10001
>    telnet localhost 10001
> 
> and receive the following error
> 
>    telnet: connect to address 127.0.0.1: Connection refused
>    telnet: Unable to connect to remote host: Connection refused
> 
> now both commands were issued on the same myth machine (in my case 
> myth23).
> 
> What do i need to do to solve this error? Your help is much appreciated 
> and thank you in advance for your response.
> 
> Filip
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on gethostbyname
Date: Mon, 15 Jan 2007 02:50:53 -0800
Lines: 62
Distribution: su
Message-ID: <eofmaf$1l0$1@news.Stanford.EDU>
References: <eoekn7$nr1$1@news.Stanford.EDU> <eofhjl$p1f$1@news.Stanford.EDU> <eofjsc$rrk$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168858255 1696 128.12.194.72 (15 Jan 2007 10:50:55 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eofjsc$rrk$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10970

Paul Tarjan (TA) wrote:
> Yangfan Wang wrote:
> 
>> A related question:
>>
>>  From the man page on gethostbyname:
>>
>> The hostent structure is defined in <netdb.h> as follows:
>>
>>               struct hostent {
>>                       char    *h_name;        /* official name of host */
>>                       char    **h_aliases;    /* alias list */
>>                       int     h_addrtype;     /* host address type */
>>                       int     h_length;       /* length of address */
>>                       char    **h_addr_list;  /* list of addresses */
>>               }
>>               #define h_addr  h_addr_list[0]  /* for backward 
>> compatibility */
>>
> Yes, that is what the function returns.
> 
>> ...
>>
>> h_addr_list
>>               A zero-terminated array of network addresses for the 
>> host in network byte order.
>>
>> What does it mean for a char* (a string, really) to be in network byte 
>> order? Is this a human readable IP address (X.X.X.X) or a machine 
>> reabale IP address (in_addr_t)?
> 
> Network byte order just is specifying that the number is "Big Endian". 
> It is just the order in which the bits are stored (in this case, the 
> most significant bit is in the lowest address position). This is needed 
> since machines don't have to store all their data in the same order.
> 
> You might want to compare a h_addr to a in_addr_t. The similarities 
> might alarm you.
> 

Hmm. So I casted h_addr_list[0], which is a char*, to in_addr_t, but the 
call to bind still failed. (I checked that the endianess is correct. I 
translate it to host byte order when I obtain the value and translate 
back to network byte order before attempting to bind.)

Are you sure it's not an IP string like "127.0.0.1"? Why else would it 
be a char*? And why would I need inet_addr if I can jump straight to the 
32-bit IP address?

I know gethostbyname is giving me a valid hostent struct. I just need to 
  figure out which field will get me to the IP address.

>>
>> This is making me pull my hair out. I just want to go from 
>> "www.yahoo.com" to a machine readable IP address of type in_addr_t. It 
>> shouldn't be this complicated. I must be doing something wrong here. :/
>>
> You've already done the hard part. 2 more minutes and you will have it

Thank you for the encouragement. :)

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Telnet Error
Date: Mon, 15 Jan 2007 02:53:40 -0800
Lines: 35
Distribution: su
Message-ID: <eofmfl$1l0$2@news.Stanford.EDU>
References: <paun-C442BE.23113414012007@nntp.stanford.edu> <eofk3u$rrk$3@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168858421 1696 128.12.194.72 (15 Jan 2007 10:53:41 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eofk3u$rrk$3@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10971

I get this error when I restart my program after it crashes. The port 
number seems to remain allocated for about 20 seconds afterwards, and 
I'd have to wait or change port numbers.

Otherwise, it's working for me. I'm on myth.

-Yangfan

Paul Tarjan (TA) wrote:
> As I posted above, check if you are in network byte order. See if you 
> can bind to some ports from 1-1024. If you can, that is an error, since 
> non-root users shouldn't be able to bind to ports from 1-1024.
> 
> Filip Paun wrote:
> 
>> Hello,
>>
>> I am running in the same telnet problem as Yangfan.
>>
>> I issue the commands on two terminals:
>>      ./proxy 10001
>>    telnet localhost 10001
>>
>> and receive the following error
>>
>>    telnet: connect to address 127.0.0.1: Connection refused
>>    telnet: Unable to connect to remote host: Connection refused
>>
>> now both commands were issued on the same myth machine (in my case 
>> myth23).
>>
>> What do i need to do to solve this error? Your help is much 
>> appreciated and thank you in advance for your response.
>>
>> Filip
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running grading script
Date: Mon, 15 Jan 2007 02:55:18 -0800
Lines: 135
Distribution: su
Message-ID: <eofmin$1l0$3@news.Stanford.EDU>
References: <eoeheb$l9m$1@news.Stanford.EDU> <C1D00C6D.7506%jpettit@stanford.edu> <eoel8m$ob8$1@news.Stanford.EDU> <eofjbc$qg9$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168858519 1696 128.12.194.72 (15 Jan 2007 10:55:19 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eofjbc$qg9$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10972

I'm running into this as well. My proxy doesn't behave properly yet, but 
at least I can telnet to it.

-Yangfan

Paul Tarjan (TA) wrote:
> The important error line that is the last one:
> 
>  > IOError: [Errno socket error] (111, 'Connection refused')
> 
> That means that it is unable to connect to anything on that port. Are 
> you sure your running your proxy on that port? Might you be binding the 
> port in the wrong 'endian'ness? There is a function that you should be 
> using whenever you are taking data from the host and changing it to 
> network byte ordering.
> 
> See if you can bind to port 1. If you can, you are doing the endianness 
> wrong, since a non-root user can't bind to port < 1024.
> 
> 
> 
> 
> Alex wrote:
> 
>> I gave a port in the valid range and I still see this issue. I was 
>> able to run my proxy on that port and use telnet and do GET correctly 
>> but I'm still having problems with the grading script.
>>
>> vine7:~/proj1> ./grade proxy.c 32454
>> Binary: proxy.c
>> Running on port 32454
>> Traceback (most recent call last):
>>   File "./grade", line 97, in ?
>>     main()
>>   File "./grade", line 42, in main
>>     foblist.append(urllib.urlopen(url, None, proxy_map))
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
>> line 82, in urlopen
>>     return opener.open(url)
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
>> line 190, in open
>>     return getattr(self, name)(url)
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
>> line 313, in open_http
>>     h.endheaders()
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>> line 798, in endheaders
>>     self._send_output()
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>> line 679, in _send_output
>>     self.send(msg)
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>> line 646, in send
>>     self.connect()
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>> line 630, in connect
>>     raise socket.error, msg
>> IOError: [Errno socket error] (111, 'Connection refused')
>>
>> Alex
>>
>> "Justin Pettit" <jpettit@stanford.edu> wrote in message 
>> news:C1D00C6D.7506%jpettit@stanford.edu...
>>
>>> TCP and UDP port numbers are 16-bit values, which means the maximum 
>>> value is
>>> 65535.  Try something between 1024 and 65535.  You also might want to 
>>> check
>>> to make sure that you're checking all your socket return values and 
>>> compiler
>>> warnings.
>>>
>>> --Justin
>>>
>>>
>>> On 1/14/07 4:21 PM, in article eoeheb$l9m$1@news.Stanford.EDU, "Alex"
>>> <axle@sonic.net> wrote:
>>>
>>>> I was trying to run the grading script on my proxy and I get the 
>>>> messages
>>>> below. Why is this happening?
>>>>
>>>> vine7:~/proj1> ./grade proxy.c 98235
>>>> Binary: proxy.c
>>>> Running on port 98235
>>>> Traceback (most recent call last):
>>>>   File "./grade", line 100, in ?
>>>>     main()
>>>>   File "./grade", line 45, in main
>>>>     foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>   File 
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>> line 82, in urlopen
>>>>     return opener.open(url)
>>>>   File 
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>> line 190, in open
>>>>     return getattr(self, name)(url)
>>>>   File 
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>> line 313, in open_http
>>>>     h.endheaders()
>>>>   File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>>>> line
>>>> 798, in endheaders
>>>>     self._send_output()
>>>>   File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>>>> line
>>>> 679, in _send_output
>>>>     self.send(msg)
>>>>   File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>>>> line
>>>> 646, in send
>>>>     self.connect()
>>>>   File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>>>> line
>>>> 630, in connect
>>>>     raise socket.error, msg
>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>>
>>>>
>>>
>>
>>
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Telnet Error
Date: Mon, 15 Jan 2007 09:34:53 -0800
Lines: 51
Distribution: su
Message-ID: <eogdvm$spe$1@news.Stanford.EDU>
References: <paun-C442BE.23113414012007@nntp.stanford.edu> <eofk3u$rrk$3@news.Stanford.EDU> <eofmfl$1l0$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168882486 29486 127.0.0.1 (15 Jan 2007 17:34:46 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eofmfl$1l0$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10973

Yangfan Wang wrote:
> I get this error when I restart my program after it crashes. The port 
> number seems to remain allocated for about 20 seconds afterwards, and 
> I'd have to wait or change port numbers.
> 
> Otherwise, it's working for me. I'm on myth.
> 
> -Yangfan
> 
> Paul Tarjan (TA) wrote:
>> As I posted above, check if you are in network byte order. See if you 
>> can bind to some ports from 1-1024. If you can, that is an error, 
>> since non-root users shouldn't be able to bind to ports from 1-1024.
>>
>> Filip Paun wrote:
>>
>>> Hello,
>>>
>>> I am running in the same telnet problem as Yangfan.
>>>
>>> I issue the commands on two terminals:
>>>      ./proxy 10001
>>>    telnet localhost 10001
>>>
>>> and receive the following error
>>>
>>>    telnet: connect to address 127.0.0.1: Connection refused
>>>    telnet: Unable to connect to remote host: Connection refused
>>>
>>> now both commands were issued on the same myth machine (in my case 
>>> myth23).
>>>
>>> What do i need to do to solve this error? Your help is much 
>>> appreciated and thank you in advance for your response.
>>>
>>> Filip

An easy way to check that your program is actually listening correctly 
is to start up the proxy then enter the command "netstat -a" and look 
for the proper port to see if its listening.  IE:


myth21:~/> ./proxy 9988 &
[1] 18476
myth21:~/> netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 *:kshell                *:*                     LISTEN
tcp        0      0 *:9988                  *:*                     LISTEN

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Telnet Error
Date: Mon, 15 Jan 2007 10:47:35 -0800
Lines: 55
Distribution: su
Message-ID: <C1D10C47.752D%jpettit@stanford.edu>
References: <paun-C442BE.23113414012007@nntp.stanford.edu> <eofk3u$rrk$3@news.Stanford.EDU> <eofmfl$1l0$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168887026 4734 127.0.0.1 (15 Jan 2007 18:50:26 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Telnet Error
Thread-Index: Acc41Z7+3USl/KTIEduhVAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10974

This is due to a restriction on reusing a bound port in TCP.  The kernel
wants to wait a few seconds before reusing a port to make sure that no more
traffic related to old program is received and handed to the new one.  We
will cover this in more detail when we get to TCP in the class.  Make sure
that you read the assignment FAQ, since this is the first item covered:

    http://yuba.stanford.edu/vns/proxy_faq.html

You can get around this by changing your listening port.  However, a cleaner
solution is to look into the SO_REUSEADDR socket option, which you can read
about in the Stevens book or search the web.

--Justin


On 1/15/07 2:53 AM, in article eofmfl$1l0$2@news.Stanford.EDU, "Yangfan
Wang" <yfw@stanford.edu> wrote:

> I get this error when I restart my program after it crashes. The port
> number seems to remain allocated for about 20 seconds afterwards, and
> I'd have to wait or change port numbers.
> 
> Otherwise, it's working for me. I'm on myth.
> 
> -Yangfan
> 
> Paul Tarjan (TA) wrote:
>> As I posted above, check if you are in network byte order. See if you
>> can bind to some ports from 1-1024. If you can, that is an error, since
>> non-root users shouldn't be able to bind to ports from 1-1024.
>> 
>> Filip Paun wrote:
>> 
>>> Hello,
>>> 
>>> I am running in the same telnet problem as Yangfan.
>>> 
>>> I issue the commands on two terminals:
>>>      ./proxy 10001
>>>    telnet localhost 10001
>>> 
>>> and receive the following error
>>> 
>>>    telnet: connect to address 127.0.0.1: Connection refused
>>>    telnet: Unable to connect to remote host: Connection refused
>>> 
>>> now both commands were issued on the same myth machine (in my case
>>> myth23).
>>> 
>>> What do i need to do to solve this error? Your help is much
>>> appreciated and thank you in advance for your response.
>>> 
>>> Filip


.

Path: shelby.stanford.edu!not-for-mail
From: Greg Nelson <grourk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Cannot telnet to localhost?
Date: Mon, 15 Jan 2007 11:46:50 -0800
Lines: 6
Distribution: su
Message-ID: <eoglm8$76b$1@news.Stanford.EDU>
References: <eocdk0$6m6$1@news.Stanford.EDU> <C1CF259C.74E6%jpettit@stanford.edu> <paun-DCC8AE.23060014012007@nntp.stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168890376 7371 127.0.0.1 (15 Jan 2007 19:46:16 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070104)
In-Reply-To: <paun-DCC8AE.23060014012007@nntp.stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:10975

When you bind the listening socket, do you set it to accept any IP? 
Something like the following:

servaddr.sin_addr.s_addr = htonl(INADDR_ANY);

Greg
.

Path: shelby.stanford.edu!cardinal4.Stanford.EDU!cjuhasz
From: Christopher Monkhart Juhasz <cjuhasz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: use lex/yacc?
Date: Mon, 15 Jan 2007 11:52:06 -0800
Lines: 6
Distribution: su
Message-ID: <Pine.LNX.4.44.0701151143241.4568-100000@cardinal4.Stanford.EDU>
NNTP-Posting-Host: cardinal4.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1168890730 7595 171.64.15.252 (15 Jan 2007 19:52:10 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:10976

Can we use lex/yacc to assist us in the parsing for this assignment?

Thanks,

Chris

.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: use lex/yacc?
Date: Mon, 15 Jan 2007 12:29:50 -0800
Lines: 11
Distribution: su
Message-ID: <eogo7n$94k$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0701151143241.4568-100000@cardinal4.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168892983 9364 127.0.0.1 (15 Jan 2007 20:29:43 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <Pine.LNX.4.44.0701151143241.4568-100000@cardinal4.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10977

Christopher Monkhart Juhasz wrote:
> Can we use lex/yacc to assist us in the parsing for this assignment?
> 
> Thanks,
> 
> Chris
> 

Please stick with the standard C and C++ libraries for now.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Telnet Error
Date: Mon, 15 Jan 2007 12:58:24 -0800
Lines: 21
Distribution: su
Message-ID: <eogps9$asj$1@news.Stanford.EDU>
References: <paun-C442BE.23113414012007@nntp.stanford.edu> <eofk3u$rrk$3@news.Stanford.EDU> <eofmfl$1l0$2@news.Stanford.EDU> <C1D10C47.752D%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1168894665 11155 127.0.0.1 (15 Jan 2007 20:57:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:10978

> This is due to a restriction on reusing a bound port in TCP.  The kernel
> wants to wait a few seconds before reusing a port to make sure that no 
> more
> traffic related to old program is received and handed to the new one.
> You can get around this by changing your listening port.  However, a 
> cleaner
> solution is to look into the SO_REUSEADDR socket option, which you can 
> read
> about in the Stevens book or search the web.
Justin,

I have been thinking about this (SO_REUSEADDR).  Is this really a cleaner 
solution, or does it allow garbage to show up on the newly opened connection 
(e.g. what the kernel was trying to prevent)?

Sincerely,
Randy Jennings

The squirrels are your friends! 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Telnet Error
Date: Mon, 15 Jan 2007 14:21:58 -0800
Lines: 43
Distribution: su
Message-ID: <C1D13E86.7558%jpettit@stanford.edu>
References: <paun-C442BE.23113414012007@nntp.stanford.edu> <eofk3u$rrk$3@news.Stanford.EDU> <eofmfl$1l0$2@news.Stanford.EDU> <C1D10C47.752D%jpettit@stanford.edu> <eogps9$asj$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168899717 16484 127.0.0.1 (15 Jan 2007 22:21:57 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Telnet Error
Thread-Index: Acc485Hw0Lf5kqTmEduhVAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10979

The chance of having a problem is really tiny with TCP.  When the process
dies, the kernel will mark all of the process's connections as not
available.  In order for old traffic to make it to the new process, a new
connection would have to match an old one's 5-tuple (source IP address,
destination IP address, source port, destination port, and TCP) and fall
within the TCP window.  Every TCP server I have ever written has used
SO_REUSEADDR, and I've never had a problem.

However, UDP traffic is stateless, and the kernel has no way of determining
if the traffic was for the old or new process.  So, if you're using UDP,
your application will need to keep track of whether it knows anything about
this connection (e.g. sequence numbers in the packets).  None of the
assignments in this class use UDP.

--Justin


On 1/15/07 12:58 PM, in article eogps9$asj$1@news.Stanford.EDU, "Randy
Jennings" <randyj@stanford.edu> wrote:

>> This is due to a restriction on reusing a bound port in TCP.  The kernel
>> wants to wait a few seconds before reusing a port to make sure that no
>> more
>> traffic related to old program is received and handed to the new one.
>> You can get around this by changing your listening port.  However, a
>> cleaner
>> solution is to look into the SO_REUSEADDR socket option, which you can
>> read
>> about in the Stevens book or search the web.
> Justin,
> 
> I have been thinking about this (SO_REUSEADDR).  Is this really a cleaner
> solution, or does it allow garbage to show up on the newly opened connection
> (e.g. what the kernel was trying to prevent)?
> 
> Sincerely,
> Randy Jennings
> 
> The squirrels are your friends!
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Riju Kallivalappil" <riju@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Timeouts
Date: Mon, 15 Jan 2007 15:15:27 -0800
Lines: 7
Distribution: su
Message-ID: <eoh1ug$j9q$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1168902928 19770 127.0.0.1 (15 Jan 2007 23:15:28 GMT)
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:10980

 Should we implement connection timeouts in the proxy? Is it ok if reads and 
writes in the proxy block?

Thanks,
Riju 


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Timeouts
Date: Mon, 15 Jan 2007 15:20:10 -0800
Lines: 11
Distribution: su
Message-ID: <eoh273$jd5$1@news.Stanford.EDU>
References: <eoh1ug$j9q$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168903203 19877 127.0.0.1 (15 Jan 2007 23:20:03 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eoh1ug$j9q$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10981

Riju Kallivalappil wrote:
>  Should we implement connection timeouts in the proxy? 

This is an implementation issue and thus is up to you.

>Is it ok if reads and 
> writes in the proxy block?

I'm unsure what you mean by this.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on gethostbyname
Date: Mon, 15 Jan 2007 16:31:03 -0800
Lines: 21
Distribution: su
Message-ID: <eoh6c7$oas$1@news.Stanford.EDU>
References: <eoekn7$nr1$1@news.Stanford.EDU> <eofhjl$p1f$1@news.Stanford.EDU> <eofjsc$rrk$1@news.Stanford.EDU> <eofmaf$1l0$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168907463 24924 128.12.194.72 (16 Jan 2007 00:31:03 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eofmaf$1l0$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10982

>> You might want to compare a h_addr to a in_addr_t. The similarities 
>> might alarm you.
>>
> 
> Hmm. So I casted h_addr_list[0], which is a char*, to in_addr_t, but the 
> call to bind still failed. (I checked that the endianess is correct. I 
> translate it to host byte order when I obtain the value and translate 
> back to network byte order before attempting to bind.)
> 
> Are you sure it's not an IP string like "127.0.0.1"? Why else would it 
> be a char*? And why would I need inet_addr if I can jump straight to the 
> 32-bit IP address?
> 
> I know gethostbyname is giving me a valid hostent struct. I just need to 
>  figure out which field will get me to the IP address.
> 

Really could use some help here. Like Paul said, I'm 2 minutes away from 
the solution. Just need a little push here.

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on gethostbyname
Date: Mon, 15 Jan 2007 16:54:41 -0800
Lines: 26
Distribution: su
Message-ID: <eoh7oa$ppp$1@news.Stanford.EDU>
References: <eoekn7$nr1$1@news.Stanford.EDU> <eofhjl$p1f$1@news.Stanford.EDU> <eofjsc$rrk$1@news.Stanford.EDU> <eofmaf$1l0$1@news.Stanford.EDU> <eoh6c7$oas$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168908874 26425 127.0.0.1 (16 Jan 2007 00:54:34 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eoh6c7$oas$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10983

Yangfan Wang wrote:
>>> You might want to compare a h_addr to a in_addr_t. The similarities 
>>> might alarm you.
>>>
>>
>> Hmm. So I casted h_addr_list[0], which is a char*, to in_addr_t, but 
>> the call to bind still failed. (I checked that the endianess is 
>> correct. I translate it to host byte order when I obtain the value and 
>> translate back to network byte order before attempting to bind.)
>>
>> Are you sure it's not an IP string like "127.0.0.1"? Why else would it 
>> be a char*? And why would I need inet_addr if I can jump straight to 
>> the 32-bit IP address?
>>
>> I know gethostbyname is giving me a valid hostent struct. I just need 
>> to  figure out which field will get me to the IP address.
>>
> 
> Really could use some help here. Like Paul said, I'm 2 minutes away from 
> the solution. Just need a little push here.
> 
> -Yangfan

Take a look at pages 308-310 of the Unix Network Programming book.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: "Shahryar" <shahryar@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Segmentation Fault
Date: Mon, 15 Jan 2007 17:07:50 -0800
Lines: 4
Distribution: su
Message-ID: <eoh8h7$qr1$1@news.Stanford.EDU>
NNTP-Posting-Host: m160-07-s270-cl.stanford.edu
X-Trace: news.Stanford.EDU 1168909671 27489 171.64.139.15 (16 Jan 2007 01:07:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:10984

I am getting this error "Segmentation fault" although I am trying different 
ports but still I am getting the same error .


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Segmentation Fault
Date: Mon, 15 Jan 2007 17:13:27 -0800
Lines: 8
Distribution: su
Message-ID: <eoh8rg$r4r$1@news.Stanford.EDU>
References: <eoh8h7$qr1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168910000 27803 127.0.0.1 (16 Jan 2007 01:13:20 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eoh8h7$qr1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10985

Shahryar wrote:
> I am getting this error "Segmentation fault" although I am trying different 
> ports but still I am getting the same error .

Try using valgrind, it can help locate memory errors which generally 
cause seg faults.  There are many guides around just google it.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on gethostbyname
Date: Mon, 15 Jan 2007 17:43:28 -0800
Lines: 40
Distribution: su
Message-ID: <eohak5$svm$1@news.Stanford.EDU>
References: <eoekn7$nr1$1@news.Stanford.EDU> <eofhjl$p1f$1@news.Stanford.EDU> <eofjsc$rrk$1@news.Stanford.EDU> <eofmaf$1l0$1@news.Stanford.EDU> <eoh6c7$oas$1@news.Stanford.EDU> <eoh7oa$ppp$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168911813 29686 128.12.194.72 (16 Jan 2007 01:43:33 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eoh7oa$ppp$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10986

David Erickson wrote:
> Yangfan Wang wrote:
> 
>>>> You might want to compare a h_addr to a in_addr_t. The similarities 
>>>> might alarm you.
>>>>
>>>
>>> Hmm. So I casted h_addr_list[0], which is a char*, to in_addr_t, but 
>>> the call to bind still failed. (I checked that the endianess is 
>>> correct. I translate it to host byte order when I obtain the value 
>>> and translate back to network byte order before attempting to bind.)
>>>
>>> Are you sure it's not an IP string like "127.0.0.1"? Why else would 
>>> it be a char*? And why would I need inet_addr if I can jump straight 
>>> to the 32-bit IP address?
>>>
>>> I know gethostbyname is giving me a valid hostent struct. I just need 
>>> to  figure out which field will get me to the IP address.
>>>
>>
>> Really could use some help here. Like Paul said, I'm 2 minutes away 
>> from the solution. Just need a little push here.
>>
>> -Yangfan
> 
> 
> Take a look at pages 308-310 of the Unix Network Programming book.
> 
> -David

Okay, using the debugging code from page 309, I get:

official host name = www.yahoo-ht2.akadns.net
         alias = www.yahoo.com
         address = (null)

Do you guys know what might cause this? Note that the official host name 
was correctly obtained. My input was "www.yahoo.com".

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on gethostbyname
Date: Mon, 15 Jan 2007 17:49:55 -0800
Lines: 46
Distribution: su
Message-ID: <eohavs$suu$1@news.Stanford.EDU>
References: <eoekn7$nr1$1@news.Stanford.EDU> <eofhjl$p1f$1@news.Stanford.EDU> <eofjsc$rrk$1@news.Stanford.EDU> <eofmaf$1l0$1@news.Stanford.EDU> <eoh6c7$oas$1@news.Stanford.EDU> <eoh7oa$ppp$1@news.Stanford.EDU> <eohak5$svm$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168912188 29662 127.0.0.1 (16 Jan 2007 01:49:48 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eohak5$svm$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10987

Yangfan Wang wrote:
> David Erickson wrote:
>> Yangfan Wang wrote:
>>
>>>>> You might want to compare a h_addr to a in_addr_t. The similarities 
>>>>> might alarm you.
>>>>>
>>>>
>>>> Hmm. So I casted h_addr_list[0], which is a char*, to in_addr_t, but 
>>>> the call to bind still failed. (I checked that the endianess is 
>>>> correct. I translate it to host byte order when I obtain the value 
>>>> and translate back to network byte order before attempting to bind.)
>>>>
>>>> Are you sure it's not an IP string like "127.0.0.1"? Why else would 
>>>> it be a char*? And why would I need inet_addr if I can jump straight 
>>>> to the 32-bit IP address?
>>>>
>>>> I know gethostbyname is giving me a valid hostent struct. I just 
>>>> need to  figure out which field will get me to the IP address.
>>>>
>>>
>>> Really could use some help here. Like Paul said, I'm 2 minutes away 
>>> from the solution. Just need a little push here.
>>>
>>> -Yangfan
>>
>>
>> Take a look at pages 308-310 of the Unix Network Programming book.
>>
>> -David
> 
> Okay, using the debugging code from page 309, I get:
> 
> official host name = www.yahoo-ht2.akadns.net
>         alias = www.yahoo.com
>         address = (null)
> 
> Do you guys know what might cause this? Note that the official host name 
> was correctly obtained. My input was "www.yahoo.com".
> 
> -Yangfan

inet_ntop returns null on an error, find out what the error was, and go 
from there.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Adam Cohen <adam.cohen@stanford.edu>
Newsgroups: su.class.cs244a
Subject: recv: Connection reset by peer
Date: Mon, 15 Jan 2007 18:14:02 -0800
Lines: 11
Distribution: su
Message-ID: <eohcda$s9n$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1168913642 28983 127.0.0.1 (16 Jan 2007 02:14:02 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Unison/1.7.5
Xref: shelby.stanford.edu su.class.cs244a:10988

After I send a GET request to certain sites (actually, I've only 
observed this with google.com (66.102.7.99) -- yahoo.com and other 
sites don't exhibit this), I get an error while trying to receive the 
web page data. It says, "recv: Connection reset by peer". Anybody know 
what could cause that kind of error? I assume it's a socket setting or 
something, but I can't seem to make it work.





.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: recv: Connection reset by peer
Date: Mon, 15 Jan 2007 18:28:46 -0800
Lines: 15
Distribution: su
Message-ID: <eohd8n$1oe$1@news.Stanford.EDU>
References: <eohcda$s9n$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168914519 1806 127.0.0.1 (16 Jan 2007 02:28:39 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eohcda$s9n$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10989

Adam Cohen wrote:
> After I send a GET request to certain sites (actually, I've only 
> observed this with google.com (66.102.7.99) -- yahoo.com and other sites 
> don't exhibit this), I get an error while trying to receive the web page 
> data. It says, "recv: Connection reset by peer". Anybody know what could 
> cause that kind of error? I assume it's a socket setting or something, 
> but I can't seem to make it work.
> 

If your able to download webpages from other sites besides google, i 
would recommend that you take a look and ensure your requests are 
properly formatted per the rfc, perhaps compare a request from your 
webbrowser directly to google versus one you make through a proxy.

-David
.

Path: shelby.stanford.edu!xenon.Stanford.EDU!ryanchen
From: Ryan Chen <ryanchen@xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: How much to read()
Date: Mon, 15 Jan 2007 20:58:46 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.LNX.4.62.0701152056360.8222@xenon.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Trace: news.Stanford.EDU 1168923528 10388 171.64.66.201 (16 Jan 2007 04:58:48 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:10990


The read system call in man page section 2 indicates that we have to 
specify how much to read from the socket/descriptor. How do we know in 
advance how much the HTTP Request sent in is or how long a server's 
response is? Do we "try" to read as much as possible, up to ssize_max 
(something like that? I forgot), and then process the buffer?

Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running grading script
Date: Mon, 15 Jan 2007 21:12:15 -0800
Lines: 136
Distribution: su
Message-ID: <eohms2$b2q$1@news.Stanford.EDU>
References: <eoeheb$l9m$1@news.Stanford.EDU> <C1D00C6D.7506%jpettit@stanford.edu> <eoel8m$ob8$1@news.Stanford.EDU> <eofjbc$qg9$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168924354 11354 128.12.194.72 (16 Jan 2007 05:12:34 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eofjbc$qg9$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10991

Okay, my proxy is (marginally) working now, and I'm getting the same 
error as Alex when I run the grading script. Could the TAs please look 
into this?

-Yangfan

Paul Tarjan (TA) wrote:
> The important error line that is the last one:
> 
>  > IOError: [Errno socket error] (111, 'Connection refused')
> 
> That means that it is unable to connect to anything on that port. Are 
> you sure your running your proxy on that port? Might you be binding the 
> port in the wrong 'endian'ness? There is a function that you should be 
> using whenever you are taking data from the host and changing it to 
> network byte ordering.
> 
> See if you can bind to port 1. If you can, you are doing the endianness 
> wrong, since a non-root user can't bind to port < 1024.
> 
> 
> 
> 
> Alex wrote:
> 
>> I gave a port in the valid range and I still see this issue. I was 
>> able to run my proxy on that port and use telnet and do GET correctly 
>> but I'm still having problems with the grading script.
>>
>> vine7:~/proj1> ./grade proxy.c 32454
>> Binary: proxy.c
>> Running on port 32454
>> Traceback (most recent call last):
>>   File "./grade", line 97, in ?
>>     main()
>>   File "./grade", line 42, in main
>>     foblist.append(urllib.urlopen(url, None, proxy_map))
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
>> line 82, in urlopen
>>     return opener.open(url)
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
>> line 190, in open
>>     return getattr(self, name)(url)
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
>> line 313, in open_http
>>     h.endheaders()
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>> line 798, in endheaders
>>     self._send_output()
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>> line 679, in _send_output
>>     self.send(msg)
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>> line 646, in send
>>     self.connect()
>>   File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>> line 630, in connect
>>     raise socket.error, msg
>> IOError: [Errno socket error] (111, 'Connection refused')
>>
>> Alex
>>
>> "Justin Pettit" <jpettit@stanford.edu> wrote in message 
>> news:C1D00C6D.7506%jpettit@stanford.edu...
>>
>>> TCP and UDP port numbers are 16-bit values, which means the maximum 
>>> value is
>>> 65535.  Try something between 1024 and 65535.  You also might want to 
>>> check
>>> to make sure that you're checking all your socket return values and 
>>> compiler
>>> warnings.
>>>
>>> --Justin
>>>
>>>
>>> On 1/14/07 4:21 PM, in article eoeheb$l9m$1@news.Stanford.EDU, "Alex"
>>> <axle@sonic.net> wrote:
>>>
>>>> I was trying to run the grading script on my proxy and I get the 
>>>> messages
>>>> below. Why is this happening?
>>>>
>>>> vine7:~/proj1> ./grade proxy.c 98235
>>>> Binary: proxy.c
>>>> Running on port 98235
>>>> Traceback (most recent call last):
>>>>   File "./grade", line 100, in ?
>>>>     main()
>>>>   File "./grade", line 45, in main
>>>>     foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>   File 
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>> line 82, in urlopen
>>>>     return opener.open(url)
>>>>   File 
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>> line 190, in open
>>>>     return getattr(self, name)(url)
>>>>   File 
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>> line 313, in open_http
>>>>     h.endheaders()
>>>>   File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>>>> line
>>>> 798, in endheaders
>>>>     self._send_output()
>>>>   File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>>>> line
>>>> 679, in _send_output
>>>>     self.send(msg)
>>>>   File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>>>> line
>>>> 646, in send
>>>>     self.connect()
>>>>   File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>>>> line
>>>> 630, in connect
>>>>     raise socket.error, msg
>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>>
>>>>
>>>
>>
>>
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running grading script
Date: Mon, 15 Jan 2007 21:30:05 -0800
Lines: 146
Distribution: su
Message-ID: <C1D1A2DD.757B%jpettit@stanford.edu>
References: <eoeheb$l9m$1@news.Stanford.EDU> <C1D00C6D.7506%jpettit@stanford.edu> <eoel8m$ob8$1@news.Stanford.EDU> <eofjbc$qg9$1@news.Stanford.EDU> <eohms2$b2q$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168925406 13026 127.0.0.1 (16 Jan 2007 05:30:06 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: running grading script
Thread-Index: Acc5L2CVnw+6iKUiEduhVAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10992

I just ran it again.  It works.

--Justin


On 1/15/07 9:12 PM, in article eohms2$b2q$1@news.Stanford.EDU, "Yangfan
Wang" <yfw@stanford.edu> wrote:

> Okay, my proxy is (marginally) working now, and I'm getting the same
> error as Alex when I run the grading script. Could the TAs please look
> into this?
> 
> -Yangfan
> 
> Paul Tarjan (TA) wrote:
>> The important error line that is the last one:
>> 
>>> IOError: [Errno socket error] (111, 'Connection refused')
>> 
>> That means that it is unable to connect to anything on that port. Are
>> you sure your running your proxy on that port? Might you be binding the
>> port in the wrong 'endian'ness? There is a function that you should be
>> using whenever you are taking data from the host and changing it to
>> network byte ordering.
>> 
>> See if you can bind to port 1. If you can, you are doing the endianness
>> wrong, since a non-root user can't bind to port < 1024.
>> 
>> 
>> 
>> 
>> Alex wrote:
>> 
>>> I gave a port in the valid range and I still see this issue. I was
>>> able to run my proxy on that port and use telnet and do GET correctly
>>> but I'm still having problems with the grading script.
>>> 
>>> vine7:~/proj1> ./grade proxy.c 32454
>>> Binary: proxy.c
>>> Running on port 32454
>>> Traceback (most recent call last):
>>>   File "./grade", line 97, in ?
>>>     main()
>>>   File "./grade", line 42, in main
>>>     foblist.append(urllib.urlopen(url, None, proxy_map))
>>>   File 
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>> line 82, in urlopen
>>>     return opener.open(url)
>>>   File 
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>> line 190, in open
>>>     return getattr(self, name)(url)
>>>   File 
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>> line 313, in open_http
>>>     h.endheaders()
>>>   File 
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>> line 798, in endheaders
>>>     self._send_output()
>>>   File 
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>> line 679, in _send_output
>>>     self.send(msg)
>>>   File 
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>> line 646, in send
>>>     self.connect()
>>>   File 
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>> line 630, in connect
>>>     raise socket.error, msg
>>> IOError: [Errno socket error] (111, 'Connection refused')
>>> 
>>> Alex
>>> 
>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>> news:C1D00C6D.7506%jpettit@stanford.edu...
>>> 
>>>> TCP and UDP port numbers are 16-bit values, which means the maximum
>>>> value is
>>>> 65535.  Try something between 1024 and 65535.  You also might want to
>>>> check
>>>> to make sure that you're checking all your socket return values and
>>>> compiler
>>>> warnings.
>>>> 
>>>> --Justin
>>>> 
>>>> 
>>>> On 1/14/07 4:21 PM, in article eoeheb$l9m$1@news.Stanford.EDU, "Alex"
>>>> <axle@sonic.net> wrote:
>>>> 
>>>>> I was trying to run the grading script on my proxy and I get the
>>>>> messages
>>>>> below. Why is this happening?
>>>>> 
>>>>> vine7:~/proj1> ./grade proxy.c 98235
>>>>> Binary: proxy.c
>>>>> Running on port 98235
>>>>> Traceback (most recent call last):
>>>>>   File "./grade", line 100, in ?
>>>>>     main()
>>>>>   File "./grade", line 45, in main
>>>>>     foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>>   File 
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>> line 82, in urlopen
>>>>>     return opener.open(url)
>>>>>   File 
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>> line 190, in open
>>>>>     return getattr(self, name)(url)
>>>>>   File 
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>> line 313, in open_http
>>>>>     h.endheaders()
>>>>>   File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>> line
>>>>> 798, in endheaders
>>>>>     self._send_output()
>>>>>   File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>> line
>>>>> 679, in _send_output
>>>>>     self.send(msg)
>>>>>   File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>> line
>>>>> 646, in send
>>>>>     self.connect()
>>>>>   File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>> line
>>>>> 630, in connect
>>>>>     raise socket.error, msg
>>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>>> 
>>>>> 
>>>> 
>>> 
>>> 


.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running grading script
Date: Mon, 15 Jan 2007 22:48:23 -0800
Lines: 169
Distribution: su
Message-ID: <eohsgb$i78$1@news.Stanford.EDU>
References: <eoeheb$l9m$1@news.Stanford.EDU> <C1D00C6D.7506%jpettit@stanford.edu> <eoel8m$ob8$1@news.Stanford.EDU> <eofjbc$qg9$1@news.Stanford.EDU> <eohms2$b2q$1@news.Stanford.EDU> <C1D1A2DD.757B%jpettit@stanford.edu>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168930123 18664 128.12.194.72 (16 Jan 2007 06:48:43 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <C1D1A2DD.757B%jpettit@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:10993

Ah. I see it.

I probably wasn't paying attention when you guys mentioned that the 
proxy should accept requests continuously. The grading script will crash 
otherwise.

One other issue though:

Basic HTTP transactions: 4 of 5 tests passed
Summary:
         4 of 5 tests passed.
Base Score: 0/10 (Remember, one point is based on style!)

If I pass 4 out of the 5 basic tests, then why is my base score still 0?

-Yangfan

Justin Pettit wrote:
> I just ran it again.  It works.
> 
> --Justin
> 
> 
> On 1/15/07 9:12 PM, in article eohms2$b2q$1@news.Stanford.EDU, "Yangfan
> Wang" <yfw@stanford.edu> wrote:
> 
> 
>>Okay, my proxy is (marginally) working now, and I'm getting the same
>>error as Alex when I run the grading script. Could the TAs please look
>>into this?
>>
>>-Yangfan
>>
>>Paul Tarjan (TA) wrote:
>>
>>>The important error line that is the last one:
>>>
>>>
>>>>IOError: [Errno socket error] (111, 'Connection refused')
>>>
>>>That means that it is unable to connect to anything on that port. Are
>>>you sure your running your proxy on that port? Might you be binding the
>>>port in the wrong 'endian'ness? There is a function that you should be
>>>using whenever you are taking data from the host and changing it to
>>>network byte ordering.
>>>
>>>See if you can bind to port 1. If you can, you are doing the endianness
>>>wrong, since a non-root user can't bind to port < 1024.
>>>
>>>
>>>
>>>
>>>Alex wrote:
>>>
>>>
>>>>I gave a port in the valid range and I still see this issue. I was
>>>>able to run my proxy on that port and use telnet and do GET correctly
>>>>but I'm still having problems with the grading script.
>>>>
>>>>vine7:~/proj1> ./grade proxy.c 32454
>>>>Binary: proxy.c
>>>>Running on port 32454
>>>>Traceback (most recent call last):
>>>>  File "./grade", line 97, in ?
>>>>    main()
>>>>  File "./grade", line 42, in main
>>>>    foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>  File 
>>>>"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>line 82, in urlopen
>>>>    return opener.open(url)
>>>>  File 
>>>>"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>line 190, in open
>>>>    return getattr(self, name)(url)
>>>>  File 
>>>>"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>line 313, in open_http
>>>>    h.endheaders()
>>>>  File 
>>>>"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>line 798, in endheaders
>>>>    self._send_output()
>>>>  File 
>>>>"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>line 679, in _send_output
>>>>    self.send(msg)
>>>>  File 
>>>>"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>line 646, in send
>>>>    self.connect()
>>>>  File 
>>>>"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>line 630, in connect
>>>>    raise socket.error, msg
>>>>IOError: [Errno socket error] (111, 'Connection refused')
>>>>
>>>>Alex
>>>>
>>>>"Justin Pettit" <jpettit@stanford.edu> wrote in message
>>>>news:C1D00C6D.7506%jpettit@stanford.edu...
>>>>
>>>>
>>>>>TCP and UDP port numbers are 16-bit values, which means the maximum
>>>>>value is
>>>>>65535.  Try something between 1024 and 65535.  You also might want to
>>>>>check
>>>>>to make sure that you're checking all your socket return values and
>>>>>compiler
>>>>>warnings.
>>>>>
>>>>>--Justin
>>>>>
>>>>>
>>>>>On 1/14/07 4:21 PM, in article eoeheb$l9m$1@news.Stanford.EDU, "Alex"
>>>>><axle@sonic.net> wrote:
>>>>>
>>>>>
>>>>>>I was trying to run the grading script on my proxy and I get the
>>>>>>messages
>>>>>>below. Why is this happening?
>>>>>>
>>>>>>vine7:~/proj1> ./grade proxy.c 98235
>>>>>>Binary: proxy.c
>>>>>>Running on port 98235
>>>>>>Traceback (most recent call last):
>>>>>>  File "./grade", line 100, in ?
>>>>>>    main()
>>>>>>  File "./grade", line 45, in main
>>>>>>    foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>>>  File 
>>>>>>"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>line 82, in urlopen
>>>>>>    return opener.open(url)
>>>>>>  File 
>>>>>>"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>line 190, in open
>>>>>>    return getattr(self, name)(url)
>>>>>>  File 
>>>>>>"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>line 313, in open_http
>>>>>>    h.endheaders()
>>>>>>  File
>>>>>>"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>line
>>>>>>798, in endheaders
>>>>>>    self._send_output()
>>>>>>  File
>>>>>>"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>line
>>>>>>679, in _send_output
>>>>>>    self.send(msg)
>>>>>>  File
>>>>>>"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>line
>>>>>>646, in send
>>>>>>    self.connect()
>>>>>>  File
>>>>>>"/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>line
>>>>>>630, in connect
>>>>>>    raise socket.error, msg
>>>>>>IOError: [Errno socket error] (111, 'Connection refused')
>>>>>>
>>>>>>
>>>>>
>>>>
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running grading script
Date: Mon, 15 Jan 2007 22:55:02 -0800
Lines: 180
Distribution: su
Message-ID: <C1D1B6C6.7582%jpettit@stanford.edu>
References: <eoeheb$l9m$1@news.Stanford.EDU> <C1D00C6D.7506%jpettit@stanford.edu> <eoel8m$ob8$1@news.Stanford.EDU> <eofjbc$qg9$1@news.Stanford.EDU> <eohms2$b2q$1@news.Stanford.EDU> <C1D1A2DD.757B%jpettit@stanford.edu> <eohsgb$i78$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168930499 19100 127.0.0.1 (16 Jan 2007 06:54:59 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: running grading script
Thread-Index: Acc5Oz6hfTXCR6UuEduhVAARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10994

Yes, THAT is a bug in the grading script.  Don't pay attention to the
returned score right now.

--Justin


On 1/15/07 10:48 PM, in article eohsgb$i78$1@news.Stanford.EDU, "Yangfan
Wang" <yfw@stanford.edu> wrote:

> Ah. I see it.
> 
> I probably wasn't paying attention when you guys mentioned that the
> proxy should accept requests continuously. The grading script will crash
> otherwise.
> 
> One other issue though:
> 
> Basic HTTP transactions: 4 of 5 tests passed
> Summary:
>          4 of 5 tests passed.
> Base Score: 0/10 (Remember, one point is based on style!)
> 
> If I pass 4 out of the 5 basic tests, then why is my base score still 0?
> 
> -Yangfan
> 
> Justin Pettit wrote:
>> I just ran it again.  It works.
>> 
>> --Justin
>> 
>> 
>> On 1/15/07 9:12 PM, in article eohms2$b2q$1@news.Stanford.EDU, "Yangfan
>> Wang" <yfw@stanford.edu> wrote:
>> 
>> 
>>> Okay, my proxy is (marginally) working now, and I'm getting the same
>>> error as Alex when I run the grading script. Could the TAs please look
>>> into this?
>>> 
>>> -Yangfan
>>> 
>>> Paul Tarjan (TA) wrote:
>>> 
>>>> The important error line that is the last one:
>>>> 
>>>> 
>>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>> 
>>>> That means that it is unable to connect to anything on that port. Are
>>>> you sure your running your proxy on that port? Might you be binding the
>>>> port in the wrong 'endian'ness? There is a function that you should be
>>>> using whenever you are taking data from the host and changing it to
>>>> network byte ordering.
>>>> 
>>>> See if you can bind to port 1. If you can, you are doing the endianness
>>>> wrong, since a non-root user can't bind to port < 1024.
>>>> 
>>>> 
>>>> 
>>>> 
>>>> Alex wrote:
>>>> 
>>>> 
>>>>> I gave a port in the valid range and I still see this issue. I was
>>>>> able to run my proxy on that port and use telnet and do GET correctly
>>>>> but I'm still having problems with the grading script.
>>>>> 
>>>>> vine7:~/proj1> ./grade proxy.c 32454
>>>>> Binary: proxy.c
>>>>> Running on port 32454
>>>>> Traceback (most recent call last):
>>>>>  File "./grade", line 97, in ?
>>>>>    main()
>>>>>  File "./grade", line 42, in main
>>>>>    foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>>  File 
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>> line 82, in urlopen
>>>>>    return opener.open(url)
>>>>>  File 
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>> line 190, in open
>>>>>    return getattr(self, name)(url)
>>>>>  File 
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>> line 313, in open_http
>>>>>    h.endheaders()
>>>>>  File 
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>> line 798, in endheaders
>>>>>    self._send_output()
>>>>>  File 
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>> line 679, in _send_output
>>>>>    self.send(msg)
>>>>>  File 
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>> line 646, in send
>>>>>    self.connect()
>>>>>  File 
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>> line 630, in connect
>>>>>    raise socket.error, msg
>>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>>> 
>>>>> Alex
>>>>> 
>>>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>>>> news:C1D00C6D.7506%jpettit@stanford.edu...
>>>>> 
>>>>> 
>>>>>> TCP and UDP port numbers are 16-bit values, which means the maximum
>>>>>> value is
>>>>>> 65535.  Try something between 1024 and 65535.  You also might want to
>>>>>> check
>>>>>> to make sure that you're checking all your socket return values and
>>>>>> compiler
>>>>>> warnings.
>>>>>> 
>>>>>> --Justin
>>>>>> 
>>>>>> 
>>>>>> On 1/14/07 4:21 PM, in article eoeheb$l9m$1@news.Stanford.EDU, "Alex"
>>>>>> <axle@sonic.net> wrote:
>>>>>> 
>>>>>> 
>>>>>>> I was trying to run the grading script on my proxy and I get the
>>>>>>> messages
>>>>>>> below. Why is this happening?
>>>>>>> 
>>>>>>> vine7:~/proj1> ./grade proxy.c 98235
>>>>>>> Binary: proxy.c
>>>>>>> Running on port 98235
>>>>>>> Traceback (most recent call last):
>>>>>>>  File "./grade", line 100, in ?
>>>>>>>    main()
>>>>>>>  File "./grade", line 45, in main
>>>>>>>    foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>>>>  File 
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>> line 82, in urlopen
>>>>>>>    return opener.open(url)
>>>>>>>  File 
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>> line 190, in open
>>>>>>>    return getattr(self, name)(url)
>>>>>>>  File 
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>> line 313, in open_http
>>>>>>>    h.endheaders()
>>>>>>>  File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>> line
>>>>>>> 798, in endheaders
>>>>>>>    self._send_output()
>>>>>>>  File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>> line
>>>>>>> 679, in _send_output
>>>>>>>    self.send(msg)
>>>>>>>  File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>> line
>>>>>>> 646, in send
>>>>>>>    self.connect()
>>>>>>>  File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>> line
>>>>>>> 630, in connect
>>>>>>>    raise socket.error, msg
>>>>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>> 
>> 
>> 


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: How much to read()
Date: Mon, 15 Jan 2007 23:22:26 -0800
Lines: 13
Distribution: su
Message-ID: <eohufb$k3i$1@news.Stanford.EDU>
References: <Pine.LNX.4.62.0701152056360.8222@xenon.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168932139 20594 127.0.0.1 (16 Jan 2007 07:22:19 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <Pine.LNX.4.62.0701152056360.8222@xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:10995

Ryan Chen wrote:
> 
> The read system call in man page section 2 indicates that we have to 
> specify how much to read from the socket/descriptor. How do we know in 
> advance how much the HTTP Request sent in is or how long a server's 
> response is? Do we "try" to read as much as possible, up to ssize_max 
> (something like that? I forgot), and then process the buffer?
> 
> Thanks.

Yes.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: "Brian Thompson" <Brian.C.Thompson@Boeing.com>
Newsgroups: su.class.cs244a
Subject: Re: Telnet Error
Date: Tue, 16 Jan 2007 00:53:12 -0800
Lines: 59
Distribution: su
Message-ID: <eoi3ps$su3$1@news.Stanford.EDU>
References: <paun-C442BE.23113414012007@nntp.stanford.edu> <eofk3u$rrk$3@news.Stanford.EDU> <eofmfl$1l0$2@news.Stanford.EDU> <C1D10C47.752D%jpettit@stanford.edu> <eogps9$asj$1@news.Stanford.EDU> <C1D13E86.7558%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1168937596 29635 127.0.0.1 (16 Jan 2007 08:53:16 GMT)
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.2962
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:10996

How do you implement SO_REUSEADDR?  I thought it was in socket.h.  I'm 
tryinng the code below, but I get the message "proxy.c:(.text+0x2ae): 
undefined reference to 'setsocketopt'"

setsockopt_ret = setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, (void *) 
&sock_opt, sizeof(sock_opt));

--Brian

"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1D13E86.7558%jpettit@stanford.edu...
> The chance of having a problem is really tiny with TCP.  When the process
> dies, the kernel will mark all of the process's connections as not
> available.  In order for old traffic to make it to the new process, a new
> connection would have to match an old one's 5-tuple (source IP address,
> destination IP address, source port, destination port, and TCP) and fall
> within the TCP window.  Every TCP server I have ever written has used
> SO_REUSEADDR, and I've never had a problem.
>
> However, UDP traffic is stateless, and the kernel has no way of 
> determining
> if the traffic was for the old or new process.  So, if you're using UDP,
> your application will need to keep track of whether it knows anything 
> about
> this connection (e.g. sequence numbers in the packets).  None of the
> assignments in this class use UDP.
>
> --Justin
>
>
> On 1/15/07 12:58 PM, in article eogps9$asj$1@news.Stanford.EDU, "Randy
> Jennings" <randyj@stanford.edu> wrote:
>
>>> This is due to a restriction on reusing a bound port in TCP.  The kernel
>>> wants to wait a few seconds before reusing a port to make sure that no
>>> more
>>> traffic related to old program is received and handed to the new one.
>>> You can get around this by changing your listening port.  However, a
>>> cleaner
>>> solution is to look into the SO_REUSEADDR socket option, which you can
>>> read
>>> about in the Stevens book or search the web.
>> Justin,
>>
>> I have been thinking about this (SO_REUSEADDR).  Is this really a cleaner
>> solution, or does it allow garbage to show up on the newly opened 
>> connection
>> (e.g. what the kernel was trying to prevent)?
>>
>> Sincerely,
>> Randy Jennings
>>
>> The squirrels are your friends!
>>
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Peter Pawlowski <pawlowski@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Telnet Error
Date: Tue, 16 Jan 2007 01:05:29 -0800
Lines: 59
Distribution: su
Message-ID: <eoi4gr$6n$1@news.Stanford.EDU>
References: <paun-C442BE.23113414012007@nntp.stanford.edu> <eofk3u$rrk$3@news.Stanford.EDU> <eofmfl$1l0$2@news.Stanford.EDU> <C1D10C47.752D%jpettit@stanford.edu> <eogps9$asj$1@news.Stanford.EDU> <C1D13E86.7558%jpettit@stanford.edu> <eoi3ps$su3$1@news.Stanford.EDU>
NNTP-Posting-Host: piotrek.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1168938331 215 128.12.104.53 (16 Jan 2007 09:05:31 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Unison/1.7.7
Xref: shelby.stanford.edu su.class.cs244a:10997

Try setsockopt instead of setsocketopt in your actual code...

P.

On 2007-01-16 00:53:12 -0800, "Brian Thompson" 
<Brian.C.Thompson@Boeing.com> said:

> How do you implement SO_REUSEADDR?  I thought it was in socket.h.  I'm 
> tryinng the code below, but I get the message "proxy.c:(.text+0x2ae): 
> undefined reference to 'setsocketopt'"
> 
> setsockopt_ret = setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, (void *) 
> &sock_opt, sizeof(sock_opt));
> 
> --Brian
> 
> "Justin Pettit" <jpettit@stanford.edu> wrote in message 
> news:C1D13E86.7558%jpettit@stanford.edu...
>> The chance of having a problem is really tiny with TCP.  When the process
>> dies, the kernel will mark all of the process's connections as not
>> available.  In order for old traffic to make it to the new process, a new
>> connection would have to match an old one's 5-tuple (source IP address,
>> destination IP address, source port, destination port, and TCP) and fall
>> within the TCP window.  Every TCP server I have ever written has used
>> SO_REUSEADDR, and I've never had a problem.
>> 
>> However, UDP traffic is stateless, and the kernel has no way of determining
>> if the traffic was for the old or new process.  So, if you're using UDP,
>> your application will need to keep track of whether it knows anything about
>> this connection (e.g. sequence numbers in the packets).  None of the
>> assignments in this class use UDP.
>> 
>> --Justin
>> 
>> 
>> On 1/15/07 12:58 PM, in article eogps9$asj$1@news.Stanford.EDU, "Randy
>> Jennings" <randyj@stanford.edu> wrote:
>> 
>>>> This is due to a restriction on reusing a bound port in TCP.  The kernel
>>>> wants to wait a few seconds before reusing a port to make sure that no
>>>> more
>>>> traffic related to old program is received and handed to the new one.
>>>> You can get around this by changing your listening port.  However, a
>>>> cleaner
>>>> solution is to look into the SO_REUSEADDR socket option, which you can
>>>> read
>>>> about in the Stevens book or search the web.
>>> Justin,
>>> 
>>> I have been thinking about this (SO_REUSEADDR).  Is this really a cleaner
>>> solution, or does it allow garbage to show up on the newly opened connection
>>> (e.g. what the kernel was trying to prevent)?
>>> 
>>> Sincerely,
>>> Randy Jennings
>>> 
>>> The squirrels are your friends!


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Telnet Error
Date: Tue, 16 Jan 2007 01:29:23 -0800
Lines: 75
Distribution: su
Message-ID: <C1D1DAF3.758D%jpettit@stanford.edu>
References: <paun-C442BE.23113414012007@nntp.stanford.edu> <eofk3u$rrk$3@news.Stanford.EDU> <eofmfl$1l0$2@news.Stanford.EDU> <C1D10C47.752D%jpettit@stanford.edu> <eogps9$asj$1@news.Stanford.EDU> <C1D13E86.7558%jpettit@stanford.edu> <eoi3ps$su3$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168939765 2259 127.0.0.1 (16 Jan 2007 09:29:25 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Telnet Error
Thread-Index: Acc5UM6eDQ/xgKVEEdufOgARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:10998

I agree with Peter.  It looks like there's some sort of disconnect between
your code snippet and your error message.  I don't see anything wrong with
what you've shown. 

If you haven't set your dependencies correctly in your makefile, then fixed
typos may still show linker problems.  You may want to "make clean" and
remove any old object files.

--Justin


On 1/16/07 12:53 AM, in article eoi3ps$su3$1@news.Stanford.EDU, "Brian
Thompson" <Brian.C.Thompson@Boeing.com> wrote:

> How do you implement SO_REUSEADDR?  I thought it was in socket.h.  I'm
> tryinng the code below, but I get the message "proxy.c:(.text+0x2ae):
> undefined reference to 'setsocketopt'"
> 
> setsockopt_ret = setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, (void *)
> &sock_opt, sizeof(sock_opt));
> 
> --Brian
> 
> "Justin Pettit" <jpettit@stanford.edu> wrote in message
> news:C1D13E86.7558%jpettit@stanford.edu...
>> The chance of having a problem is really tiny with TCP.  When the process
>> dies, the kernel will mark all of the process's connections as not
>> available.  In order for old traffic to make it to the new process, a new
>> connection would have to match an old one's 5-tuple (source IP address,
>> destination IP address, source port, destination port, and TCP) and fall
>> within the TCP window.  Every TCP server I have ever written has used
>> SO_REUSEADDR, and I've never had a problem.
>> 
>> However, UDP traffic is stateless, and the kernel has no way of
>> determining
>> if the traffic was for the old or new process.  So, if you're using UDP,
>> your application will need to keep track of whether it knows anything
>> about
>> this connection (e.g. sequence numbers in the packets).  None of the
>> assignments in this class use UDP.
>> 
>> --Justin
>> 
>> 
>> On 1/15/07 12:58 PM, in article eogps9$asj$1@news.Stanford.EDU, "Randy
>> Jennings" <randyj@stanford.edu> wrote:
>> 
>>>> This is due to a restriction on reusing a bound port in TCP.  The kernel
>>>> wants to wait a few seconds before reusing a port to make sure that no
>>>> more
>>>> traffic related to old program is received and handed to the new one.
>>>> You can get around this by changing your listening port.  However, a
>>>> cleaner
>>>> solution is to look into the SO_REUSEADDR socket option, which you can
>>>> read
>>>> about in the Stevens book or search the web.
>>> Justin,
>>> 
>>> I have been thinking about this (SO_REUSEADDR).  Is this really a cleaner
>>> solution, or does it allow garbage to show up on the newly opened
>>> connection
>>> (e.g. what the kernel was trying to prevent)?
>>> 
>>> Sincerely,
>>> Randy Jennings
>>> 
>>> The squirrels are your friends!
>>> 
>>> 
>> 
>> 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Mohammad Asif" <mak@slac.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Cannot telnet to localhost?
Date: Tue, 16 Jan 2007 10:26:39 -0800
Lines: 18
Distribution: su
Message-ID: <eoj5da$eag$1@news.Stanford.EDU>
References: <eocdk0$6m6$1@news.Stanford.EDU> <C1CF259C.74E6%jpettit@stanford.edu> <paun-DCC8AE.23060014012007@nntp.stanford.edu> <eoglm8$76b$1@news.Stanford.EDU>
NNTP-Posting-Host: dhcpvisitor217232.slac.stanford.edu
X-Trace: news.Stanford.EDU 1168972010 14672 198.129.217.232 (16 Jan 2007 18:26:50 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
Xref: shelby.stanford.edu su.class.cs244a:10999

Try to use 'ifconfig' on the proxy server on which you bind the proxy.

 then use telnet <IP_ADDRESS_OF_SERVER> <port> instead of localhost.

best regards..
Asif


"Greg Nelson" <grourk@stanford.edu> wrote in message 
news:eoglm8$76b$1@news.Stanford.EDU...
> When you bind the listening socket, do you set it to accept any IP? 
> Something like the following:
>
> servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
>
> Greg 


.

Path: shelby.stanford.edu!not-for-mail
From: Yuliya Sarkisyan <yuliya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: grading script
Date: Tue, 16 Jan 2007 11:03:48 -0800
Lines: 126
Distribution: su
Message-ID: <eoj7in$go8$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168974231 17160 127.0.0.1 (16 Jan 2007 19:03:51 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
Xref: shelby.stanford.edu su.class.cs244a:11000

Hello,

I'm running the grading script using

	./proxy_grader.py proxy 1224

and am getting

	Binary: proxy
	Running on port 1224
	Basic HTTP transactions: 5 of 5 tests passed
	Summary:
         	5 of 5 tests passed.
	Base Score: 8/10 (Remember, one point is based on style!)

However, I changed my code to always use the url http://www.google.com/, 
so I should be passing only one of the five tests.

Am I using the script incorrectly?

Thanks,
Yuliya

P.S.

The grading script I have is


#!/usr/bin/env python

import urllib
import sys
import os
import signal
import time
try:
      import proxy_grade_private
      use_private = True
except ImportError:
      use_private = False

# You can create additional automated tests for your proxy by
# adding URLs to this array.  This will have no effect on your
# grade, but may be helpful in testing and debugging your proxy.
pub_urls = ['http://www.google.com/', 'HTTP://www.stanford.edu/',
                'http://WWW.microsoft.com/en/us/default.aspx',
                'http://search.yahoo.com/search?p=proxy&ei=UTF-8',
                'http://yuba.stanford.edu/vns/images/su.gif']

def main():
      global pub_urls
      try:
           proxy_bin = sys.argv[1]
           port = sys.argv[2]
      except IndexError:
           usage()
           sys.exit(2)

      print 'Binary: %s' % proxy_bin
      print 'Running on port %s' % port

      # Start the proxy running in the background
      cid = os.spawnl(os.P_NOWAIT, proxy_bin, proxy_bin, port)
      # Give the proxy time to start up and start listening on the port
      time.sleep(2)
      proxy_map = {'http':'http://localhost:' + port}

      foblist = []
      for url in pub_urls:
           foblist.append(urllib.urlopen(url, None, proxy_map))

      passcount = 0
      for n in range(len(foblist)):
           proxy_file = foblist[n]
           lines = proxy_file.readlines()
           if (len(lines) == 0):
                print "No data received for " + pub_urls[n]
                continue

           direct_file = urllib.urlopen(pub_urls[n])
           direct_lines = direct_file.readlines()

           for (prox_line, dir_line) in zip(lines, direct_lines):
                if prox_line != dir_line:
                     direct_file.close()
                     continue

           direct_file.close()
           passcount += 1

      for fob in foblist:
           fob.close()

      print r'Basic HTTP transactions: %d of %d tests passed' % 
(passcount, len(pub_urls))


      if (use_private):
           priv_passed = proxy_grade_private.runall(port, cid)


      # Cleanup
      os.kill(cid, signal.SIGINT)
      os.kill(cid, signal.SIGKILL)
      os.waitpid(cid, 0)

      print 'Summary: '
      print '\t%d of %d tests passed.' % (passcount, len(pub_urls))
      score = 0
      if (use_private):
           if (priv_passed):
                print '\t100% of extended tests passed.'
                score += 1
           else:
                print'\tNot all extended tests passed.'

      score += (passcount / len(pub_urls)) * 8
      print 'Base Score: %d/10 (Remember, one point is based on style!)' 
% score

def usage():
      print "Usage: proxy_grader.py path/to/proxy/binary port"


if __name__ == '__main__':
      main()
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Cannot telnet to localhost?
Date: Tue, 16 Jan 2007 13:23:32 -0800
Lines: 18
Distribution: su
Message-ID: <C1D28254.75CF%jpettit@stanford.edu>
References: <eocdk0$6m6$1@news.Stanford.EDU> <C1CF259C.74E6%jpettit@stanford.edu> <paun-DCC8AE.23060014012007@nntp.stanford.edu> <eoglm8$76b$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168982614 29174 127.0.0.1 (16 Jan 2007 21:23:34 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Cannot telnet to localhost?
Thread-Index: Acc5tJKc0PN6RaWnEdufuQARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11001

I would recommend doing this, since it will cause your server to bind all
interfaces.  Specifying an interface can be useful if you want to present
different services to different networks.

--Justin


On 1/15/07 11:46 AM, in article eoglm8$76b$1@news.Stanford.EDU, "Greg
Nelson" <grourk@stanford.edu> wrote:

> When you bind the listening socket, do you set it to accept any IP?
> Something like the following:
> 
> servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
> 
> Greg


.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: grading script
Date: Tue, 16 Jan 2007 15:28:11 -0800
Lines: 5
Distribution: su
Message-ID: <eojn4s$6um$1@news.Stanford.EDU>
References: <eoj7in$go8$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168990173 7126 171.64.74.54 (16 Jan 2007 23:29:33 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <eoj7in$go8$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11002

There was a bug in the grading script that was causing it to mis-report 
some test results.  Please download the new version of the script from 
http://yuba.stanford.edu/vns/proxy_grader.py

Clay
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Updated Grading Script
Date: Tue, 16 Jan 2007 15:30:41 -0800
Lines: 8
Distribution: su
Message-ID: <eojn9j$6um$2@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168990325 7126 171.64.74.54 (16 Jan 2007 23:32:05 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
Xref: shelby.stanford.edu su.class.cs244a:11003

The public testing script has been revised to address a couple of bugs 
that have shown up.  Please download the latest version of the script from:

http://yuba.stanford.edu/vns/proxy_grader.py

Note that one of the URLs in the script has been changed.

Clay
.

Path: shelby.stanford.edu!not-for-mail
From: Yuliya Sarkisyan <yuliya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: grading script
Date: Tue, 16 Jan 2007 16:08:56 -0800
Lines: 112
Distribution: su
Message-ID: <eojpes$9ah$1@news.Stanford.EDU>
References: <eoj7in$go8$1@news.Stanford.EDU> <eojn4s$6um$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168992540 9553 127.0.0.1 (17 Jan 2007 00:09:00 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eojn4s$6um$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11004

Clay Collier wrote:
> There was a bug in the grading script that was causing it to mis-report 
> some test results.  Please download the new version of the script from 
> http://yuba.stanford.edu/vns/proxy_grader.py
> 
> Clay

For some reason I am still passing all of the tests.  When I change the 
url to some bad site (i.e. http://cat/), the grader complains.  However, 
when I set it to http://www.google.com/, I pass all of the tests. Once, 
again the script I used (newly downloaded) was:


#!/usr/bin/env python

import urllib
import sys
import os
import signal
import time
try:
      import proxy_grade_private
      use_private = True
except ImportError:
      use_private = False

# You can create additional automated tests for your proxy by
# adding URLs to this array.  This will have no effect on your
# grade, but may be helpful in testing and debugging your proxy.
pub_urls = ['http://www.google.com/', 'HTTP://www.stanford.edu/',
                'http://WWW.microsoft.com/en/us/default.aspx',
                'http://search.yahoo.com/search?p=proxy&ei=UTF-8',
                'http://yuba.stanford.edu/vns/images/su.gif']

def main():
      global pub_urls
      try:
           proxy_bin = sys.argv[1]
           port = sys.argv[2]
      except IndexError:
           usage()
           sys.exit(2)

      print 'Binary: %s' % proxy_bin
      print 'Running on port %s' % port

      # Start the proxy running in the background
      cid = os.spawnl(os.P_NOWAIT, proxy_bin, proxy_bin, port)
      # Give the proxy time to start up and start listening on the port
      time.sleep(2)
      proxy_map = {'http':'http://localhost:' + port}

      foblist = []
      for url in pub_urls:
           foblist.append(urllib.urlopen(url, None, proxy_map))

      passcount = 0
      for n in range(len(foblist)):
           proxy_file = foblist[n]
           lines = proxy_file.readlines()
           if (len(lines) == 0):
                print "No data received for " + pub_urls[n]
                continue

           direct_file = urllib.urlopen(pub_urls[n])
           direct_lines = direct_file.readlines()

           for (prox_line, dir_line) in zip(lines, direct_lines):
                if prox_line != dir_line:
                     direct_file.close()
                     continue

           direct_file.close()
           passcount += 1

      for fob in foblist:
           fob.close()

      print r'Basic HTTP transactions: %d of %d tests passed' % 
(passcount, len(pub_urls))


      if (use_private):
           priv_passed = proxy_grade_private.runall(port, cid)


      # Cleanup
      os.kill(cid, signal.SIGINT)
      os.kill(cid, signal.SIGKILL)
      os.waitpid(cid, 0)

      print 'Summary: '
      print '\t%d of %d tests passed.' % (passcount, len(pub_urls))
      score = 0
      if (use_private):
           if (priv_passed):
                print '\t100% of extended tests passed.'
                score += 1
           else:
                print'\tNot all extended tests passed.'

      score += (passcount / len(pub_urls)) * 8
      print 'Base Score: %d/10 (Remember, one point is based on style!)' 
% score

def usage():
      print "Usage: proxy_grader.py path/to/proxy/binary port"


if __name__ == '__main__':
      main()

.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: grading script
Date: Tue, 16 Jan 2007 16:12:00 -0800
Lines: 120
Distribution: su
Message-ID: <eojpn1$9c1$1@news.Stanford.EDU>
References: <eoj7in$go8$1@news.Stanford.EDU> <eojn4s$6um$1@news.Stanford.EDU> <eojpes$9ah$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1168992802 9601 171.64.74.54 (17 Jan 2007 00:13:22 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <eojpes$9ah$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11005

The version that you have attached there is the old version of the 
script- your browser may have cached the older version.  Try refreshing 
the page- the new version of the script has the revision number and the 
last change date at the top of the file.

Clay

Yuliya Sarkisyan wrote:
> Clay Collier wrote:
>> There was a bug in the grading script that was causing it to 
>> mis-report some test results.  Please download the new version of the 
>> script from http://yuba.stanford.edu/vns/proxy_grader.py
>>
>> Clay
> 
> For some reason I am still passing all of the tests.  When I change the 
> url to some bad site (i.e. http://cat/), the grader complains.  However, 
> when I set it to http://www.google.com/, I pass all of the tests. Once, 
> again the script I used (newly downloaded) was:
> 
> 
> #!/usr/bin/env python
> 
> import urllib
> import sys
> import os
> import signal
> import time
> try:
>      import proxy_grade_private
>      use_private = True
> except ImportError:
>      use_private = False
> 
> # You can create additional automated tests for your proxy by
> # adding URLs to this array.  This will have no effect on your
> # grade, but may be helpful in testing and debugging your proxy.
> pub_urls = ['http://www.google.com/', 'HTTP://www.stanford.edu/',
>                'http://WWW.microsoft.com/en/us/default.aspx',
>                'http://search.yahoo.com/search?p=proxy&ei=UTF-8',
>                'http://yuba.stanford.edu/vns/images/su.gif']
> 
> def main():
>      global pub_urls
>      try:
>           proxy_bin = sys.argv[1]
>           port = sys.argv[2]
>      except IndexError:
>           usage()
>           sys.exit(2)
> 
>      print 'Binary: %s' % proxy_bin
>      print 'Running on port %s' % port
> 
>      # Start the proxy running in the background
>      cid = os.spawnl(os.P_NOWAIT, proxy_bin, proxy_bin, port)
>      # Give the proxy time to start up and start listening on the port
>      time.sleep(2)
>      proxy_map = {'http':'http://localhost:' + port}
> 
>      foblist = []
>      for url in pub_urls:
>           foblist.append(urllib.urlopen(url, None, proxy_map))
> 
>      passcount = 0
>      for n in range(len(foblist)):
>           proxy_file = foblist[n]
>           lines = proxy_file.readlines()
>           if (len(lines) == 0):
>                print "No data received for " + pub_urls[n]
>                continue
> 
>           direct_file = urllib.urlopen(pub_urls[n])
>           direct_lines = direct_file.readlines()
> 
>           for (prox_line, dir_line) in zip(lines, direct_lines):
>                if prox_line != dir_line:
>                     direct_file.close()
>                     continue
> 
>           direct_file.close()
>           passcount += 1
> 
>      for fob in foblist:
>           fob.close()
> 
>      print r'Basic HTTP transactions: %d of %d tests passed' % 
> (passcount, len(pub_urls))
> 
> 
>      if (use_private):
>           priv_passed = proxy_grade_private.runall(port, cid)
> 
> 
>      # Cleanup
>      os.kill(cid, signal.SIGINT)
>      os.kill(cid, signal.SIGKILL)
>      os.waitpid(cid, 0)
> 
>      print 'Summary: '
>      print '\t%d of %d tests passed.' % (passcount, len(pub_urls))
>      score = 0
>      if (use_private):
>           if (priv_passed):
>                print '\t100% of extended tests passed.'
>                score += 1
>           else:
>                print'\tNot all extended tests passed.'
> 
>      score += (passcount / len(pub_urls)) * 8
>      print 'Base Score: %d/10 (Remember, one point is based on style!)' 
> % score
> 
> def usage():
>      print "Usage: proxy_grader.py path/to/proxy/binary port"
> 
> 
> if __name__ == '__main__':
>      main()
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Yuliya Sarkisyan <yuliya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: grading script
Date: Tue, 16 Jan 2007 18:37:25 -0800
Lines: 167
Distribution: su
Message-ID: <eok259$grf$1@news.Stanford.EDU>
References: <eoj7in$go8$1@news.Stanford.EDU> <eojn4s$6um$1@news.Stanford.EDU> <eojpes$9ah$1@news.Stanford.EDU> <eojpn1$9c1$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169001449 17263 127.0.0.1 (17 Jan 2007 02:37:29 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eojpn1$9c1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11006

It seems that the page at www.google.com keeps changing and is sometimes 
failing the first case of grading script.

The correct response portion of result sometimes says that the page 
should end with

Language Tools</a></font></td></tr></table></form><br><table><tr><td 
valign=center><img src="/images/hpp-cart.gif" alt="" width=40 
height=22></td><td valign=center><font size=-1>Google will <b>give you 
$10</b><br>to spend when you use <a 
href="/checkout/signupbonus_hpp.html#utm_campaign=acct10&utm_source=hpp">Google 
Checkout</a>.</font></td></tr></table><br><br><font size=-1><a 
href="/intl/en/ads/">Advertising Programs</a> - <a 
href=/services/>Business Solutions</a> - <a 
href=/intl/en/about.html>About Google</a><p><a 
href="/jobs/universities.html"><b>Graduating?  Come work with 
us.</b></a></font><p><font size=-2>©2007 
Google</font></p></center></body></html>


and sometimes that the page should end with

Language Tools</a></font></td></tr></table></form><br><br><font 
size=-1><a href="/intl/en/ads/">Advertising Programs</a> - <a 
href=/services/>Business Solutions</a> - <a 
href=/intl/en/about.html>About Google</a><p><a 
href="/jobs/universities.html"><b>Graduating?  Come work with 
us.</b></a></font><p><font size=-2>©2007 
Google</font></p></center></body></html>


The portion

<table><tr><td valign=center><img src="/images/hpp-cart.gif" alt="" 
width=40 height=22></td><td valign=center><font size=-1>Google will 
<b>give you $10</b><br>to spend when you use <a 
href="/checkout/signupbonus_hpp.html#utm_campaign=acct10&utm_source=hpp">Google 
Checkout</a>.</font></td></tr></table>

is sometimes present and sometimes not.


Could the google link be changed to some other stable website so that 
the grading script's results are consistent?


Clay Collier wrote:
> The version that you have attached there is the old version of the 
> script- your browser may have cached the older version.  Try refreshing 
> the page- the new version of the script has the revision number and the 
> last change date at the top of the file.
> 
> Clay
> 
> Yuliya Sarkisyan wrote:
>> Clay Collier wrote:
>>> There was a bug in the grading script that was causing it to 
>>> mis-report some test results.  Please download the new version of the 
>>> script from http://yuba.stanford.edu/vns/proxy_grader.py
>>>
>>> Clay
>>
>> For some reason I am still passing all of the tests.  When I change 
>> the url to some bad site (i.e. http://cat/), the grader complains.  
>> However, when I set it to http://www.google.com/, I pass all of the 
>> tests. Once, again the script I used (newly downloaded) was:
>>
>>
>> #!/usr/bin/env python
>>
>> import urllib
>> import sys
>> import os
>> import signal
>> import time
>> try:
>>      import proxy_grade_private
>>      use_private = True
>> except ImportError:
>>      use_private = False
>>
>> # You can create additional automated tests for your proxy by
>> # adding URLs to this array.  This will have no effect on your
>> # grade, but may be helpful in testing and debugging your proxy.
>> pub_urls = ['http://www.google.com/', 'HTTP://www.stanford.edu/',
>>                'http://WWW.microsoft.com/en/us/default.aspx',
>>                'http://search.yahoo.com/search?p=proxy&ei=UTF-8',
>>                'http://yuba.stanford.edu/vns/images/su.gif']
>>
>> def main():
>>      global pub_urls
>>      try:
>>           proxy_bin = sys.argv[1]
>>           port = sys.argv[2]
>>      except IndexError:
>>           usage()
>>           sys.exit(2)
>>
>>      print 'Binary: %s' % proxy_bin
>>      print 'Running on port %s' % port
>>
>>      # Start the proxy running in the background
>>      cid = os.spawnl(os.P_NOWAIT, proxy_bin, proxy_bin, port)
>>      # Give the proxy time to start up and start listening on the port
>>      time.sleep(2)
>>      proxy_map = {'http':'http://localhost:' + port}
>>
>>      foblist = []
>>      for url in pub_urls:
>>           foblist.append(urllib.urlopen(url, None, proxy_map))
>>
>>      passcount = 0
>>      for n in range(len(foblist)):
>>           proxy_file = foblist[n]
>>           lines = proxy_file.readlines()
>>           if (len(lines) == 0):
>>                print "No data received for " + pub_urls[n]
>>                continue
>>
>>           direct_file = urllib.urlopen(pub_urls[n])
>>           direct_lines = direct_file.readlines()
>>
>>           for (prox_line, dir_line) in zip(lines, direct_lines):
>>                if prox_line != dir_line:
>>                     direct_file.close()
>>                     continue
>>
>>           direct_file.close()
>>           passcount += 1
>>
>>      for fob in foblist:
>>           fob.close()
>>
>>      print r'Basic HTTP transactions: %d of %d tests passed' % 
>> (passcount, len(pub_urls))
>>
>>
>>      if (use_private):
>>           priv_passed = proxy_grade_private.runall(port, cid)
>>
>>
>>      # Cleanup
>>      os.kill(cid, signal.SIGINT)
>>      os.kill(cid, signal.SIGKILL)
>>      os.waitpid(cid, 0)
>>
>>      print 'Summary: '
>>      print '\t%d of %d tests passed.' % (passcount, len(pub_urls))
>>      score = 0
>>      if (use_private):
>>           if (priv_passed):
>>                print '\t100% of extended tests passed.'
>>                score += 1
>>           else:
>>                print'\tNot all extended tests passed.'
>>
>>      score += (passcount / len(pub_urls)) * 8
>>      print 'Base Score: %d/10 (Remember, one point is based on 
>> style!)' % score
>>
>> def usage():
>>      print "Usage: proxy_grader.py path/to/proxy/binary port"
>>
>>
>> if __name__ == '__main__':
>>      main()
>>
.

Path: shelby.stanford.edu!not-for-mail
From: Greg Nelson <grourk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: grading script
Date: Tue, 16 Jan 2007 18:52:02 -0800
Lines: 8
Distribution: su
Message-ID: <eok2v5$hgv$1@news.Stanford.EDU>
References: <eoj7in$go8$1@news.Stanford.EDU> <eojn4s$6um$1@news.Stanford.EDU> <eojpes$9ah$1@news.Stanford.EDU> <eojpn1$9c1$1@news.Stanford.EDU> <eok259$grf$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169002277 17951 127.0.0.1 (17 Jan 2007 02:51:17 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070104)
In-Reply-To: <eok259$grf$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11007

I just discovered this as well.  Spent about five minutes of pulling my 
hair out since the script would report 5 of 5 and one second later would 
report 4 of 5 without any changes to my proxy.

Hopefully the TAs will be aware of this little promotion Google seems to 
be showing for random page views.

Greg
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: grading script
Date: Tue, 16 Jan 2007 19:29:08 -0800
Lines: 6
Distribution: su
Message-ID: <eok58n$j7b$1@news.Stanford.EDU>
References: <eoj7in$go8$1@news.Stanford.EDU> <eojn4s$6um$1@news.Stanford.EDU> <eojpes$9ah$1@news.Stanford.EDU> <eojpn1$9c1$1@news.Stanford.EDU> <eok259$grf$1@news.Stanford.EDU> <eok2v5$hgv$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169004631 19691 171.64.74.54 (17 Jan 2007 03:30:31 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <eok2v5$hgv$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11008

Yes, Google is apparently having a bit of fun with their front page. 
Thanks for bringing this to our attention.  For the time being, try 
changing the Google URL to http://labs.google.com/.  I'll post a 
revision to the grading script as well.

Clay
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Updated Grading Script
Date: Tue, 16 Jan 2007 22:27:10 -0800
Lines: 18
Distribution: su
Message-ID: <eokfjt$rgu$1@news.Stanford.EDU>
References: <eojn9j$6um$2@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169015229 28190 128.12.194.72 (17 Jan 2007 06:27:09 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eojn9j$6um$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11009

Clay Collier wrote:
> The public testing script has been revised to address a couple of bugs 
> that have shown up.  Please download the latest version of the script from:
> 
> http://yuba.stanford.edu/vns/proxy_grader.py
> 
> Note that one of the URLs in the script has been changed.
> 
> Clay

Hi Clay,

has this script been tested on GET HTTP://www.stanford.edu/ HTTP/1.0?

It works just fine with my proxy if I type it in manually, but the 
auto-grader is choking on this test for some reason.

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Updated Grading Script
Date: Tue, 16 Jan 2007 22:53:10 -0800
Lines: 29
Distribution: su
Message-ID: <eokh7b$skp$1@news.Stanford.EDU>
References: <eojn9j$6um$2@news.Stanford.EDU> <eokfjt$rgu$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169016875 29337 171.64.74.54 (17 Jan 2007 06:54:35 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <eokfjt$rgu$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11010

All the URLs in the script should work correctly.  Are you just failing 
the test, or is the script actually exiting with an error?  If it's the 
former, take a look at what the script is actually sending to your proxy 
(try printing the actual request as the proxy sees it), and the data 
that you are sending back.  If it's the latter, please send along 
whatever error you're seeing.

Clay

Yangfan Wang wrote:
> Clay Collier wrote:
>> The public testing script has been revised to address a couple of bugs 
>> that have shown up.  Please download the latest version of the script 
>> from:
>>
>> http://yuba.stanford.edu/vns/proxy_grader.py
>>
>> Note that one of the URLs in the script has been changed.
>>
>> Clay
> 
> Hi Clay,
> 
> has this script been tested on GET HTTP://www.stanford.edu/ HTTP/1.0?
> 
> It works just fine with my proxy if I type it in manually, but the 
> auto-grader is choking on this test for some reason.
> 
> -Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Updated Grading Script
Date: Tue, 16 Jan 2007 23:15:23 -0800
Lines: 52
Distribution: su
Message-ID: <eokie9$cn$1@news.Stanford.EDU>
References: <eojn9j$6um$2@news.Stanford.EDU> <eokfjt$rgu$1@news.Stanford.EDU> <eokh7b$skp$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169018121 407 128.12.194.72 (17 Jan 2007 07:15:21 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eokh7b$skp$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11011

Huh. It doesn't crash anymore. It must have been my bug.

I'm still failing the test though. My proxy is getting the right 
response message back from stanford.edu, and forwarded the header 
correctly. Stanford doesn't specify message body length, so I had to get 
creative. However, I believe I'm sending the body back correctly as well:

 >>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<<< <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

I'm actually sending back the entire HTML page rather than just the 
first line. I'm not sure why the grader is only printing the first line 
when it should expect the entire page.

-Yangfan

Clay Collier wrote:
> All the URLs in the script should work correctly.  Are you just failing 
> the test, or is the script actually exiting with an error?  If it's the 
> former, take a look at what the script is actually sending to your proxy 
> (try printing the actual request as the proxy sees it), and the data 
> that you are sending back.  If it's the latter, please send along 
> whatever error you're seeing.
> 
> Clay
> 
> Yangfan Wang wrote:
> 
>> Clay Collier wrote:
>>
>>> The public testing script has been revised to address a couple of 
>>> bugs that have shown up.  Please download the latest version of the 
>>> script from:
>>>
>>> http://yuba.stanford.edu/vns/proxy_grader.py
>>>
>>> Note that one of the URLs in the script has been changed.
>>>
>>> Clay
>>
>>
>> Hi Clay,
>>
>> has this script been tested on GET HTTP://www.stanford.edu/ HTTP/1.0?
>>
>> It works just fine with my proxy if I type it in manually, but the 
>> auto-grader is choking on this test for some reason.
>>
>> -Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: "Riju Kallivalappil" <riju@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Updated Grading Script
Date: Tue, 16 Jan 2007 23:22:32 -0800
Lines: 19
Distribution: su
Message-ID: <eokirp$pt$1@news.Stanford.EDU>
References: <eojn9j$6um$2@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169018554 829 127.0.0.1 (17 Jan 2007 07:22:34 GMT)
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:11012

Is this the latest version?

#$Rev: 1265 $
#$LastChangedDate: 2007-01-16 19:30:08 -0800 (Tue, 16 Jan 2007) $


"Clay Collier" <ccollier@stanford.edu> wrote in message 
news:eojn9j$6um$2@news.Stanford.EDU...
> The public testing script has been revised to address a couple of bugs 
> that have shown up.  Please download the latest version of the script 
> from:
>
> http://yuba.stanford.edu/vns/proxy_grader.py
>
> Note that one of the URLs in the script has been changed.
>
> Clay 


.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Updated Grading Script
Date: Tue, 16 Jan 2007 23:25:02 -0800
Lines: 38
Distribution: su
Message-ID: <eokj0d$th$1@news.Stanford.EDU>
References: <eojn9j$6um$2@news.Stanford.EDU> <eokfjt$rgu$1@news.Stanford.EDU> <eokh7b$skp$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169018701 945 128.12.194.72 (17 Jan 2007 07:25:01 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eokh7b$skp$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11013

Never mind. I just had to improve my algorithm. The autograder is very 
delicate. :p

-Yangfan

Clay Collier wrote:
> All the URLs in the script should work correctly.  Are you just failing 
> the test, or is the script actually exiting with an error?  If it's the 
> former, take a look at what the script is actually sending to your proxy 
> (try printing the actual request as the proxy sees it), and the data 
> that you are sending back.  If it's the latter, please send along 
> whatever error you're seeing.
> 
> Clay
> 
> Yangfan Wang wrote:
> 
>> Clay Collier wrote:
>>
>>> The public testing script has been revised to address a couple of 
>>> bugs that have shown up.  Please download the latest version of the 
>>> script from:
>>>
>>> http://yuba.stanford.edu/vns/proxy_grader.py
>>>
>>> Note that one of the URLs in the script has been changed.
>>>
>>> Clay
>>
>>
>> Hi Clay,
>>
>> has this script been tested on GET HTTP://www.stanford.edu/ HTTP/1.0?
>>
>> It works just fine with my proxy if I type it in manually, but the 
>> auto-grader is choking on this test for some reason.
>>
>> -Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: running on cluster
Date: Tue, 16 Jan 2007 23:36:55 -0800
Lines: 29
Distribution: su
Message-ID: <eokjju$1jq$1@news.Stanford.EDU>
NNTP-Posting-Host: jadsdesktop.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169019327 1658 128.12.134.140 (17 Jan 2007 07:35:27 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20060911)
Xref: shelby.stanford.edu su.class.cs244a:11014

Hi,

My proxy works fine when I compile and run it on my Linux machine at
home. But when I move the source code and the makefile, and compile it
on the cluster machines (myth or vine), the proxy_grader script fails.
The error is a weird error:

Running on port 1344
Connecting to 216.239.53.132
Error connecting to address: Socket operation on non-socket
Connecting to 171.67.22.33
Error connecting to address: Socket operation on non-socket
Connecting to 207.46.199.60
Error connecting to address: Bad file descriptor
Connecting to 207.46.225.60
Error connecting to address: Bad file descriptor
Connecting to 207.46.18.30
Error connecting to address: Bad file descriptor
....

sometimes i also get:
Error connecting to address: Transport endpoint is already connected

The phrases after the colon are the outputs of perror.
Has anybody run into something similar? Why would the it run perfectly
at the Linux machine at home and not on the cluster?

Thanks,
Jad.
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Updated Grading Script
Date: Tue, 16 Jan 2007 23:45:29 -0800
Lines: 23
Distribution: su
Message-ID: <eokk9f$22i$1@news.Stanford.EDU>
References: <eojn9j$6um$2@news.Stanford.EDU> <eokirp$pt$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169020016 2130 171.64.74.54 (17 Jan 2007 07:46:56 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <eokirp$pt$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11015

Yes, Revision 1265 is the latest version.

Clay
Riju Kallivalappil wrote:
> Is this the latest version?
> 
> #$Rev: 1265 $
> #$LastChangedDate: 2007-01-16 19:30:08 -0800 (Tue, 16 Jan 2007) $
> 
> 
> "Clay Collier" <ccollier@stanford.edu> wrote in message 
> news:eojn9j$6um$2@news.Stanford.EDU...
>> The public testing script has been revised to address a couple of bugs 
>> that have shown up.  Please download the latest version of the script 
>> from:
>>
>> http://yuba.stanford.edu/vns/proxy_grader.py
>>
>> Note that one of the URLs in the script has been changed.
>>
>> Clay 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running on cluster
Date: Tue, 16 Jan 2007 23:53:32 -0800
Lines: 44
Distribution: su
Message-ID: <eokkoh$4rl$1@news.Stanford.EDU>
References: <eokjju$1jq$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169020499 4981 171.64.74.54 (17 Jan 2007 07:54:59 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <eokjju$1jq$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11016

The 'socket operation on a non-socket' and 'bad file descriptor' 
messages both seem to indicate that you're passing either a socket that 
hasn't been established correctly, or an integer that isn't really a 
socket descriptor to a socket function.

Make sure you're checking the return values from socket(), accept(), and 
connect() and that you're using the htons/l() functions appropriately. 
Also, take a look with gdb or printf and see what actual integer you're 
passing as a file/socket descriptor to the function that is raising the 
error, and make sure that it's a legal value that you're getting back 
from accept() or socket().

Clay

Jad Naous wrote:
> Hi,
> 
> My proxy works fine when I compile and run it on my Linux machine at
> home. But when I move the source code and the makefile, and compile it
> on the cluster machines (myth or vine), the proxy_grader script fails.
> The error is a weird error:
> 
> Running on port 1344
> Connecting to 216.239.53.132
> Error connecting to address: Socket operation on non-socket
> Connecting to 171.67.22.33
> Error connecting to address: Socket operation on non-socket
> Connecting to 207.46.199.60
> Error connecting to address: Bad file descriptor
> Connecting to 207.46.225.60
> Error connecting to address: Bad file descriptor
> Connecting to 207.46.18.30
> Error connecting to address: Bad file descriptor
> ...
> 
> sometimes i also get:
> Error connecting to address: Transport endpoint is already connected
> 
> The phrases after the colon are the outputs of perror.
> Has anybody run into something similar? Why would the it run perfectly
> at the Linux machine at home and not on the cluster?
> 
> Thanks,
> Jad.
.

Path: shelby.stanford.edu!not-for-mail
From: "Matt Page" <mpage@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Checking server responses/Yahoo weirdness
Date: Wed, 17 Jan 2007 02:24:01 -0800
Lines: 18
Distribution: su
Message-ID: <eoktg5$dlm$1@news.Stanford.EDU>
NNTP-Posting-Host: wanderlust.stanford.edu
X-Trace: news.Stanford.EDU 1169029445 14006 128.12.104.45 (17 Jan 2007 10:24:05 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11017

Hey All,

I have 2 questions:

1) Are we required to parse/validate the responses
returned from the remote webserver? If so, how should we
proceed if they return a malformed response?

2) I'm having some serious weirdness when testing using Yahoo.
I can forward the request perfectly fine but read/recv blocks
infinitely when I try and get the response. I'm positive the response
is being sent as I can see it go over the wire using ethereal.
Any ideas?

Thanks,
Matt 


.

Path: shelby.stanford.edu!not-for-mail
From: "Madeleine Lam" <mlamone@cisco.com>
Newsgroups: su.class.cs244a
Subject: www.cnn.com
Date: Wed, 17 Jan 2007 03:09:36 -0800
Lines: 28
Distribution: su
Message-ID: <eol05i$g9o$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169032178 16696 127.0.0.1 (17 Jan 2007 11:09:38 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4968.1600
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4971.600
Xref: shelby.stanford.edu su.class.cs244a:11018

Hi,

What is the tricky reason of using www.cnn.com?

I am getting:

proxy: >>> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<<< <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html
lang="en"><head><title>CNN.com - Breaking News, U.S., World, Weather,
Entertainment & Video News</title>     <meta http-equiv="content-type"
content="text/html; charset=iso-8859-1">


I tried manually
telnet www.cnn.com 80
GET / HTTP/1.0
and still got "-//W3C//DTD HTML 4.01 Transitional//EN"

Also tried manually run my code using "GET http://www.cnn.com HTTP/1.0" and
still got the same W3C output

Does the grading script expect "-//IETF//DTD HTML 2.0//EN" ?


Thanks.


.

Path: shelby.stanford.edu!not-for-mail
From: "Euijong Whang" <euijong@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Is Host: header valid in HTTP/1.0?
Date: Wed, 17 Jan 2007 03:30:25 -0800
Lines: 20
Distribution: su
Message-ID: <eol1cr$hbb$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab404b3b.stanford.edu
X-Trace: news.Stanford.EDU 1169033435 17771 171.64.75.59 (17 Jan 2007 11:30:35 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:11019


Hi,

I was running proxy_grader.py and noticed that it was sending
the following request to my proxy:

GET / HTTP/1.0
Host: labs.google.com
User-agent: Python-urllib/1.16

The Host: header was unfamiliar - I couldn't find it in the RFC.
In fact, "HTTP Made Really Easy" says that the Host: header is a HTTP/1.1 
feature.

Should I nontheless support this header?

-Steven



.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Checking server responses/Yahoo weirdness
Date: Wed, 17 Jan 2007 10:38:25 -0800
Lines: 22
Distribution: su
Message-ID: <eolqen$aql$1@news.Stanford.EDU>
References: <eoktg5$dlm$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169059095 11093 127.0.0.1 (17 Jan 2007 18:38:15 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eoktg5$dlm$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11020

Matt Page wrote:
> Hey All,
> 
> I have 2 questions:
> 
> 1) Are we required to parse/validate the responses
> returned from the remote webserver? If so, how should we
> proceed if they return a malformed response?

No just shuttle it directly from the remote server to the client.

> 
> 2) I'm having some serious weirdness when testing using Yahoo.
> I can forward the request perfectly fine but read/recv blocks
> infinitely when I try and get the response. I'm positive the response
> is being sent as I can see it go over the wire using ethereal.
> Any ideas?

Make sure if you are calling recv and it returns 0 that means the 
connection has been closed..

-David
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: www.cnn.com
Date: Wed, 17 Jan 2007 10:39:29 -0800
Lines: 32
Distribution: su
Message-ID: <eolqgn$aql$2@news.Stanford.EDU>
References: <eol05i$g9o$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169059159 11093 127.0.0.1 (17 Jan 2007 18:39:19 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eol05i$g9o$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11021

Madeleine Lam wrote:
> Hi,
> 
> What is the tricky reason of using www.cnn.com?
> 
> I am getting:
> 
> proxy: >>> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> 
> <<< <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html
> lang="en"><head><title>CNN.com - Breaking News, U.S., World, Weather,
> Entertainment & Video News</title>     <meta http-equiv="content-type"
> content="text/html; charset=iso-8859-1">
> 
> 
> I tried manually
> telnet www.cnn.com 80
> GET / HTTP/1.0
> and still got "-//W3C//DTD HTML 4.01 Transitional//EN"
> 
> Also tried manually run my code using "GET http://www.cnn.com HTTP/1.0" and
> still got the same W3C output
> 
> Does the grading script expect "-//IETF//DTD HTML 2.0//EN" ?
> 
> 
> Thanks.

Whatever the remote server sends you just forward that to the client and 
dont worry about it.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: "Lin Kuang" <lkuang@cisco.com>
Newsgroups: su.class.cs244a
Subject: peer is a server or another proxy
Date: Wed, 17 Jan 2007 10:53:07 -0800
Lines: 9
Distribution: su
Message-ID: <eolrak$blk$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169059988 11956 127.0.0.1 (17 Jan 2007 18:53:08 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807
Xref: shelby.stanford.edu su.class.cs244a:11022

Hi TAs,

Something come up in my mind and I'd like to get an clarification. For this
assignment, do we need to handle both the cases  when the "server" is a real
server and when it is another proxy? Thank you for your input.

Lin


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: peer is a server or another proxy
Date: Wed, 17 Jan 2007 10:54:23 -0800
Lines: 12
Distribution: su
Message-ID: <eolrcl$bmc$1@news.Stanford.EDU>
References: <eolrak$blk$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169060053 11980 127.0.0.1 (17 Jan 2007 18:54:13 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eolrak$blk$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11023

Lin Kuang wrote:
> Hi TAs,
> 
> Something come up in my mind and I'd like to get an clarification. For this
> assignment, do we need to handle both the cases  when the "server" is a real
> server and when it is another proxy? Thank you for your input.
> 
> Lin

No, you assume the other end is the actual web server.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Is Host: header valid in HTTP/1.0?
Date: Wed, 17 Jan 2007 10:55:46 -0800
Lines: 18
Distribution: su
Message-ID: <eolrf8$bmc$2@news.Stanford.EDU>
References: <eol1cr$hbb$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169060136 11980 127.0.0.1 (17 Jan 2007 18:55:36 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eol1cr$hbb$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11024

Euijong Whang wrote:
> Hi,
> 
> I was running proxy_grader.py and noticed that it was sending
> the following request to my proxy:
> 
> GET / HTTP/1.0
> Host: labs.google.com
> User-agent: Python-urllib/1.16
> 
> The Host: header was unfamiliar - I couldn't find it in the RFC.
> In fact, "HTTP Made Really Easy" says that the Host: header is a HTTP/1.1 
> feature.

So what does that tell you about this request?

-David

.

Path: shelby.stanford.edu!not-for-mail
From: "Riju Kallivalappil" <riju@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Checking server responses/Yahoo weirdness
Date: Wed, 17 Jan 2007 11:11:09 -0800
Lines: 14
Distribution: su
Message-ID: <eolscf$co2$1@news.Stanford.EDU>
References: <eoktg5$dlm$1@news.Stanford.EDU> <eolqen$aql$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169061071 13058 127.0.0.1 (17 Jan 2007 19:11:11 GMT)
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:11025

>> I have 2 questions:
>>
>> 1) Are we required to parse/validate the responses
>> returned from the remote webserver? If so, how should we
>> proceed if they return a malformed response?
>
> No just shuttle it directly from the remote server to the client.
>

But, wouldn't this break one of the fundamental guidelines for this 
assignment, viz., "be lenient about what you accept, but strict about what 
you send"? 


.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: implications of grading script (or in quest of the correct HTTP version)
Date: Wed, 17 Jan 2007 11:12:42 -0800
Lines: 24
Distribution: su
Message-ID: <eolse2$cqc$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169061122 13132 127.0.0.1 (17 Jan 2007 19:12:02 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11026

I was just thinking about how the public grading script is implemented.

Currently, it does a comparison with what is returned from the webpage.  If 
we do not return exactly what those web pages do, we do not pass the test.

However, this seems to conflict with our mandate to clean up whatever passes 
back.  We could write our own test that checks for a cleaned up response. 
However, that seems, not just like extra work, but the test code would be at 
least as buggy as our actual code.

It seems that, to be safe, we should not modify anything returned from the 
web server.

Another note, I do not see how the response should be exactly the same, 
because I see nothing in the python code that sets the HTTP version to 1.0. 
Is direct_file = urllib.urlopen(pub_urls[n] set up for HTTP/1.0?  I have not 
checked it myself yet.

Just some thoughts.

Sincerely,
Randy Jennings 


.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Is Host: header valid in HTTP/1.0?
Date: Wed, 17 Jan 2007 11:16:24 -0800
Lines: 31
Distribution: su
Message-ID: <eolskv$d0r$1@news.Stanford.EDU>
References: <eol1cr$hbb$1@news.Stanford.EDU> <eolrf8$bmc$2@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169061343 13339 127.0.0.1 (17 Jan 2007 19:15:43 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11027

The request is originally HTTP/1.1 or buggy of course.

The web page says we are supposed to be able to support HTTP/1.0.  Are you 
saying we need to support converting HTTP/1.1 to HTTP/1.0?  That does not 
seem to be what is specified on the assignment.

Sincerely,
Randy Jennings

"David Erickson" <derickso@stanford.edu> wrote in message 
news:eolrf8$bmc$2@news.Stanford.EDU...
> Euijong Whang wrote:
>> Hi,
>>
>> I was running proxy_grader.py and noticed that it was sending
>> the following request to my proxy:
>>
>> GET / HTTP/1.0
>> Host: labs.google.com
>> User-agent: Python-urllib/1.16
>>
>> The Host: header was unfamiliar - I couldn't find it in the RFC.
>> In fact, "HTTP Made Really Easy" says that the Host: header is a HTTP/1.1 
>> feature.
>
> So what does that tell you about this request?
>
> -David
> 


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Checking server responses/Yahoo weirdness
Date: Wed, 17 Jan 2007 11:15:55 -0800
Lines: 17
Distribution: su
Message-ID: <eolsl1$ctk$1@news.Stanford.EDU>
References: <eoktg5$dlm$1@news.Stanford.EDU> <eolqen$aql$1@news.Stanford.EDU> <eolscf$co2$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169061345 13236 127.0.0.1 (17 Jan 2007 19:15:45 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eolscf$co2$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11028

Riju Kallivalappil wrote:
>>> I have 2 questions:
>>>
>>> 1) Are we required to parse/validate the responses
>>> returned from the remote webserver? If so, how should we
>>> proceed if they return a malformed response?
>> No just shuttle it directly from the remote server to the client.
>>
> 
> But, wouldn't this break one of the fundamental guidelines for this 
> assignment, viz., "be lenient about what you accept, but strict about what 
> you send"? 

As far as I am aware this comment is in relation to what you accept from 
the client and the request you send to the remote server.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Checking server responses/Yahoo weirdness
Date: Wed, 17 Jan 2007 11:17:56 -0800
Lines: 28
Distribution: su
Message-ID: <eolsnr$d2o$1@news.Stanford.EDU>
References: <eoktg5$dlm$1@news.Stanford.EDU> <eolqen$aql$1@news.Stanford.EDU> <eolscf$co2$1@news.Stanford.EDU> <eolsl1$ctk$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169061435 13400 127.0.0.1 (17 Jan 2007 19:17:15 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11029

That is not what was said in the help session.  However, that seems to be 
the only realistic conclusion.

Sincerely,
Randy Jennings

The squirrels are your friends!
"David Erickson" <derickso@stanford.edu> wrote in message 
news:eolsl1$ctk$1@news.Stanford.EDU...
> Riju Kallivalappil wrote:
>>>> I have 2 questions:
>>>>
>>>> 1) Are we required to parse/validate the responses
>>>> returned from the remote webserver? If so, how should we
>>>> proceed if they return a malformed response?
>>> No just shuttle it directly from the remote server to the client.
>>>
>>
>> But, wouldn't this break one of the fundamental guidelines for this 
>> assignment, viz., "be lenient about what you accept, but strict about 
>> what you send"?
>
> As far as I am aware this comment is in relation to what you accept from 
> the client and the request you send to the remote server.
>
> -David 


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Is Host: header valid in HTTP/1.0?
Date: Wed, 17 Jan 2007 11:18:50 -0800
Lines: 34
Distribution: su
Message-ID: <eolsqg$ctk$2@news.Stanford.EDU>
References: <eol1cr$hbb$1@news.Stanford.EDU> <eolrf8$bmc$2@news.Stanford.EDU> <eolskv$d0r$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169061520 13236 127.0.0.1 (17 Jan 2007 19:18:40 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eolskv$d0r$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11030

Randy Jennings wrote:
> The request is originally HTTP/1.1 or buggy of course.
> 
> The web page says we are supposed to be able to support HTTP/1.0.  Are you 
> saying we need to support converting HTTP/1.1 to HTTP/1.0?  That does not 
> seem to be what is specified on the assignment.
> 
> Sincerely,
> Randy Jennings
> 
> "David Erickson" <derickso@stanford.edu> wrote in message 
> news:eolrf8$bmc$2@news.Stanford.EDU...
>> Euijong Whang wrote:
>>> Hi,
>>>
>>> I was running proxy_grader.py and noticed that it was sending
>>> the following request to my proxy:
>>>
>>> GET / HTTP/1.0
>>> Host: labs.google.com
>>> User-agent: Python-urllib/1.16
>>>
>>> The Host: header was unfamiliar - I couldn't find it in the RFC.
>>> In fact, "HTTP Made Really Easy" says that the Host: header is a HTTP/1.1 
>>> feature.
>> So what does that tell you about this request?
>>
>> -David
>>

No I am definitely not saying that, if the incoming request is missing 
invalid (according to the spec you are implementing), then what do you do?

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: www.cnn.com
Date: Wed, 17 Jan 2007 11:24:08 -0800
Lines: 52
Distribution: su
Message-ID: <eolt4j$dh1$1@news.Stanford.EDU>
References: <eol05i$g9o$1@news.Stanford.EDU> <eolqgn$aql$2@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169061843 13857 128.12.194.72 (17 Jan 2007 19:24:03 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eolqgn$aql$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11031

David Erickson wrote:
> Madeleine Lam wrote:
> 
>> Hi,
>>
>> What is the tricky reason of using www.cnn.com?
>>
>> I am getting:
>>
>> proxy: >>> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>>
>> <<< <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html
>> lang="en"><head><title>CNN.com - Breaking News, U.S., World, Weather,
>> Entertainment & Video News</title>     <meta 
>> http-equiv="content-type"
>> content="text/html; charset=iso-8859-1">
>>
>>
>> I tried manually
>> telnet www.cnn.com 80
>> GET / HTTP/1.0
>> and still got "-//W3C//DTD HTML 4.01 Transitional//EN"
>>
>> Also tried manually run my code using "GET http://www.cnn.com 
>> HTTP/1.0" and
>> still got the same W3C output
>>
>> Does the grading script expect "-//IETF//DTD HTML 2.0//EN" ?
>>
>>
>> Thanks.
> 
> 
> Whatever the remote server sends you just forward that to the client and 
> dont worry about it.
> 
> -David

David,

the cnn.com website is changing dynamically. I believe sometimes it 
would confuse the grader since the returned HTML page would be different 
when the proxy fetches it and when the grader itself fetches it.

So I would get 4 out of 5 and then 5 out of 5 one second later. :(

This might be true for other "portal" websites as well, obviously.

One way around this would be to run the auto-grader 2 or 3 times for 
each student.

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: "Riju Kallivalappil" <riju@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Is Host: header valid in HTTP/1.0?
Date: Wed, 17 Jan 2007 11:26:24 -0800
Lines: 43
Distribution: su
Message-ID: <eolt94$dk1$1@news.Stanford.EDU>
References: <eol1cr$hbb$1@news.Stanford.EDU> <eolrf8$bmc$2@news.Stanford.EDU> <eolskv$d0r$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169061989 13953 127.0.0.1 (17 Jan 2007 19:26:29 GMT)
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:11032

This is what RFC 1945 say about headers that are unknown. In HTTP/1.0 "Host" 
is an unknown header.

Section 5.2
"Unrecognized header fields are treated as  Entity-Header fields."

-riju

"Randy Jennings" <randyj@stanford.edu> wrote in message 
news:eolskv$d0r$1@news.Stanford.EDU...
> The request is originally HTTP/1.1 or buggy of course.
>
> The web page says we are supposed to be able to support HTTP/1.0.  Are you 
> saying we need to support converting HTTP/1.1 to HTTP/1.0?  That does not 
> seem to be what is specified on the assignment.
>
> Sincerely,
> Randy Jennings
>
> "David Erickson" <derickso@stanford.edu> wrote in message 
> news:eolrf8$bmc$2@news.Stanford.EDU...
>> Euijong Whang wrote:
>>> Hi,
>>>
>>> I was running proxy_grader.py and noticed that it was sending
>>> the following request to my proxy:
>>>
>>> GET / HTTP/1.0
>>> Host: labs.google.com
>>> User-agent: Python-urllib/1.16
>>>
>>> The Host: header was unfamiliar - I couldn't find it in the RFC.
>>> In fact, "HTTP Made Really Easy" says that the Host: header is a 
>>> HTTP/1.1 feature.
>>
>> So what does that tell you about this request?
>>
>> -David
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Lin Kuang" <lkuang@cisco.com>
Newsgroups: su.class.cs244a
Subject: checking the syntax of the Header in client request
Date: Wed, 17 Jan 2007 11:32:11 -0800
Lines: 10
Distribution: su
Message-ID: <eoltjs$e13$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169062332 14371 127.0.0.1 (17 Jan 2007 19:32:12 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807
Xref: shelby.stanford.edu su.class.cs244a:11033

Hi TA,

Something I am not sure about and hope you can shed some lights. Do our
proxies need to check the syntax for the Header (General-Header, or
Request-Header, etc) also in the client request, or we can assume the Header
is always of the right format? Thank you for your input.

Lin


.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Is Host: header valid in HTTP/1.0?
Date: Wed, 17 Jan 2007 11:39:03 -0800
Lines: 16
Distribution: su
Message-ID: <eoltvf$eap$1@news.Stanford.EDU>
References: <eol1cr$hbb$1@news.Stanford.EDU> <eolrf8$bmc$2@news.Stanford.EDU> <eolskv$d0r$1@news.Stanford.EDU> <eolsqg$ctk$2@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169062703 14681 127.0.0.1 (17 Jan 2007 19:38:23 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11034

> No I am definitely not saying that, if the incoming request is missing 
> invalid (according to the spec you are implementing), then what do you do?

I think something got lost between 'missing' and 'invalid', but I think you 
are (now) saying that Host: (while not making the request invalid (according 
to rfc1945, see other post by Riju)) does not compensate for not having the 
full url in the request line (invalid according to our project spec). 
However, that refers back to my previous (in time) post on implications of 
the grading script.

How is python being set to use HTTP/1.0 instead of HTTP/1.1?

Sincerely,
Randy Jennings


.

Path: shelby.stanford.edu!xenon.Stanford.EDU!ryanchen
From: Ryan Chen <ryanchen@xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Checking end of optional message body
Date: Wed, 17 Jan 2007 11:58:20 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.62.0701171148320.24170@xenon.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Trace: news.Stanford.EDU 1169063902 15827 171.64.66.201 (17 Jan 2007 19:58:22 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:11035

Hi, I am curious about reading a client's response, how do we know whether 
it contains an optional message body or how long that message body is? 
Suppose a request is something like:

GET http://www.google.com HTTP/1.0<CR><LF>
<CR><LF>
<optional message body>

How do we know after the second <CR><LF> up there that there is still 
optional message body coming. In getting a response case, because once a 
response is sent from the server, the server closes the socket connection, 
so I can read all bytes until the socket is closed. But in getting the 
client's request case, how do I know it's the end of the request message 
because the socket keeps opened?

In a "telnet www.yahoo.com 80", we could just type "GET ......." and then 
hit "enter" twice and we will get a response, I believe in this case, the 
server sends back a response to us once two <CR><LF> is received, how does 
it know that we don't have "an optional message body"?

Thanks in advance for any clarification or errors I might have mentioned.
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: checking the syntax of the Header in client request
Date: Wed, 17 Jan 2007 12:11:13 -0800
Lines: 15
Distribution: su
Message-ID: <45AE82E1.70803@stanford.edu>
References: <eoltjs$e13$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169064663 16480 127.0.0.1 (17 Jan 2007 20:11:03 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lin Kuang <lkuang@cisco.com>
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eoltjs$e13$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11036

Lin Kuang wrote:
> Hi TA,
> 
> Something I am not sure about and hope you can shed some lights. Do our
> proxies need to check the syntax for the Header (General-Header, or
> Request-Header, etc) also in the client request, or we can assume the Header
> is always of the right format? Thank you for your input.
> 
> Lin
> 
> 

You most definitely cannot assume the header is always in the right format.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Is Host: header valid in HTTP/1.0?
Date: Wed, 17 Jan 2007 12:12:52 -0800
Lines: 18
Distribution: su
Message-ID: <45AE8344.80907@stanford.edu>
References: <eol1cr$hbb$1@news.Stanford.EDU> <eolrf8$bmc$2@news.Stanford.EDU> <eolskv$d0r$1@news.Stanford.EDU> <eolsqg$ctk$2@news.Stanford.EDU> <eoltvf$eap$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169064762 16480 127.0.0.1 (17 Jan 2007 20:12:42 GMT)
X-Complaints-To: news@news.stanford.edu
To: Randy Jennings <randyj@stanford.edu>
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eoltvf$eap$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11037

Randy Jennings wrote:
>> No I am definitely not saying that, if the incoming request is missing 
>> invalid (according to the spec you are implementing), then what do you do?
> 
> I think something got lost between 'missing' and 'invalid', but I think you 
> are (now) saying that Host: (while not making the request invalid (according 
> to rfc1945, see other post by Riju)) does not compensate for not having the 
> full url in the request line (invalid according to our project spec). 
> However, that refers back to my previous (in time) post on implications of 
> the grading script.
> 
> How is python being set to use HTTP/1.0 instead of HTTP/1.1?
> 

I'm not positive which version python is sending requests as, but it 
does not appear to effect the response.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Checking end of optional message body
Date: Wed, 17 Jan 2007 12:25:29 -0800
Lines: 26
Distribution: su
Message-ID: <eom0nf$h4e$1@news.Stanford.EDU>
References: <Pine.LNX.4.62.0701171148320.24170@xenon.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169065519 17550 127.0.0.1 (17 Jan 2007 20:25:19 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <Pine.LNX.4.62.0701171148320.24170@xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11038

Ryan Chen wrote:
> Hi, I am curious about reading a client's response, how do we know 
> whether it contains an optional message body or how long that message 
> body is? Suppose a request is something like:
> 
> GET http://www.google.com HTTP/1.0<CR><LF>
> <CR><LF>
> <optional message body>
> 
> How do we know after the second <CR><LF> up there that there is still 
> optional message body coming. In getting a response case, because once a 
> response is sent from the server, the server closes the socket 
> connection, so I can read all bytes until the socket is closed. But in 
> getting the client's request case, how do I know it's the end of the 
> request message because the socket keeps opened?
> 
> In a "telnet www.yahoo.com 80", we could just type "GET ......." and 
> then hit "enter" twice and we will get a response, I believe in this 
> case, the server sends back a response to us once two <CR><LF> is 
> received, how does it know that we don't have "an optional message body"?
> 
> Thanks in advance for any clarification or errors I might have mentioned.

See section 7.2 of the RFC.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running on cluster
Date: Wed, 17 Jan 2007 12:32:16 -0800
Lines: 50
Distribution: su
Message-ID: <eom11m$h8j$1@news.Stanford.EDU>
References: <eokjju$1jq$1@news.Stanford.EDU> <eokkoh$4rl$1@news.Stanford.EDU>
NNTP-Posting-Host: jadsdesktop.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169065846 17683 128.12.134.140 (17 Jan 2007 20:30:46 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20060911)
In-Reply-To: <eokkoh$4rl$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11039

Thanks,
it actually turned out that when copying the address using memcpy, I was
using the wrong length.
Jad.

Clay Collier wrote:
> The 'socket operation on a non-socket' and 'bad file descriptor'
> messages both seem to indicate that you're passing either a socket that
> hasn't been established correctly, or an integer that isn't really a
> socket descriptor to a socket function.
> 
> Make sure you're checking the return values from socket(), accept(), and
> connect() and that you're using the htons/l() functions appropriately.
> Also, take a look with gdb or printf and see what actual integer you're
> passing as a file/socket descriptor to the function that is raising the
> error, and make sure that it's a legal value that you're getting back
> from accept() or socket().
> 
> Clay
> 
> Jad Naous wrote:
>> Hi,
>>
>> My proxy works fine when I compile and run it on my Linux machine at
>> home. But when I move the source code and the makefile, and compile it
>> on the cluster machines (myth or vine), the proxy_grader script fails.
>> The error is a weird error:
>>
>> Running on port 1344
>> Connecting to 216.239.53.132
>> Error connecting to address: Socket operation on non-socket
>> Connecting to 171.67.22.33
>> Error connecting to address: Socket operation on non-socket
>> Connecting to 207.46.199.60
>> Error connecting to address: Bad file descriptor
>> Connecting to 207.46.225.60
>> Error connecting to address: Bad file descriptor
>> Connecting to 207.46.18.30
>> Error connecting to address: Bad file descriptor
>> ...
>>
>> sometimes i also get:
>> Error connecting to address: Transport endpoint is already connected
>>
>> The phrases after the colon are the outputs of perror.
>> Has anybody run into something similar? Why would the it run perfectly
>> at the Linux machine at home and not on the cluster?
>>
>> Thanks,
>> Jad.
.

Path: shelby.stanford.edu!not-for-mail
From: "Lin Kuang" <lkuang@cisco.com>
Newsgroups: su.class.cs244a
Subject: Re: Checking server responses/Yahoo weirdness
Date: Wed, 17 Jan 2007 13:30:00 -0800
Lines: 35
Distribution: su
Message-ID: <eom4h2$l9f$1@news.Stanford.EDU>
References: <eoktg5$dlm$1@news.Stanford.EDU> <eolqen$aql$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169069410 21807 127.0.0.1 (17 Jan 2007 21:30:10 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807
Xref: shelby.stanford.edu su.class.cs244a:11040

I thought that if the server is using a version higher than 1.0, the proxy
will need to return an error code to the client instead of forwarding the
respond...in this case, the proxy will need to parse the responds from the
server to check the verion....no?

so all the parse and validation is for request from client only?

--Lin

"David Erickson" <derickso@stanford.edu> wrote in message
news:eolqen$aql$1@news.Stanford.EDU...
> Matt Page wrote:
> > Hey All,
> >
> > I have 2 questions:
> >
> > 1) Are we required to parse/validate the responses
> > returned from the remote webserver? If so, how should we
> > proceed if they return a malformed response?
>
> No just shuttle it directly from the remote server to the client.
>
> >
> > 2) I'm having some serious weirdness when testing using Yahoo.
> > I can forward the request perfectly fine but read/recv blocks
> > infinitely when I try and get the response. I'm positive the response
> > is being sent as I can see it go over the wire using ethereal.
> > Any ideas?
>
> Make sure if you are calling recv and it returns 0 that means the
> connection has been closed..
>
> -David


.

Path: shelby.stanford.edu!not-for-mail
From: "Kevin Hart" <kevin.hart@hp.com>
Newsgroups: su.class.cs244a
Subject: Client resetting connection to proxy
Date: Wed, 17 Jan 2007 14:48:27 -0700
Lines: 8
Distribution: su
Message-ID: <eom5jc$m6q$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169070508 22746 127.0.0.1 (17 Jan 2007 21:48:28 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:11041

When my proxy is writing requested data to the client, sometimes it appears 
the client is resetting the connection before the proxy has sent all the 
data.  (The write call produces "Connection reset by peer.")  This only 
happens when sending data from certain Web sites, but they are mainstream 
sites.  Any ideas on what would cause the client to reset its connection 
with the proxy?


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Checking server responses/Yahoo weirdness
Date: Wed, 17 Jan 2007 14:01:12 -0800
Lines: 16
Distribution: su
Message-ID: <eom6ap$mma$1@news.Stanford.EDU>
References: <eoktg5$dlm$1@news.Stanford.EDU> <eolqen$aql$1@news.Stanford.EDU> <eom4h2$l9f$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169071257 23242 127.0.0.1 (17 Jan 2007 22:00:57 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eom4h2$l9f$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11042

Lin Kuang wrote:
> I thought that if the server is using a version higher than 1.0, the proxy
> will need to return an error code to the client instead of forwarding the
> respond...in this case, the proxy will need to parse the responds from the
> server to check the verion....no?
> 
> so all the parse and validation is for request from client only?
> 
> --Lin

I did an informal survey of the public proxy scripts websites it queries 
and they all return a 1.1 response even though you send yours as 1.0, so 
  to answer your question, dont bother parsing the reply, just forward 
it directly on to the client.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Client resetting connection to proxy
Date: Wed, 17 Jan 2007 14:03:23 -0800
Lines: 14
Distribution: su
Message-ID: <eom6es$mma$2@news.Stanford.EDU>
References: <eom5jc$m6q$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169071389 23242 127.0.0.1 (17 Jan 2007 22:03:09 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eom5jc$m6q$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11043

Kevin Hart wrote:
> When my proxy is writing requested data to the client, sometimes it appears 
> the client is resetting the connection before the proxy has sent all the 
> data.  (The write call produces "Connection reset by peer.")  This only 
> happens when sending data from certain Web sites, but they are mainstream 
> sites.  Any ideas on what would cause the client to reset its connection 
> with the proxy?
> 
> 
Generally clients will read until they reach the size of the 
Content-Length header in the reply then close the connection, so make 
sure you don't have an error in your code causing you to write extra data.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Dinesh Gupta <dineshg@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: gif files
Date: Wed, 17 Jan 2007 23:01:09 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <eom9rl$q9o$1@news.Stanford.EDU>
NNTP-Posting-Host: vine7.stanford.edu
X-Trace: news.Stanford.EDU 1169074869 26936 171.64.15.234 (17 Jan 2007 23:01:09 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (Linux/2.6.15.7smp-secfix3 (i686))
Xref: shelby.stanford.edu su.class.cs244a:11044

Hi,

Do we need to do anything special for the .gif files?
Somehow the last 'http://yuba.stanford.edu/vns/images/su.gif' is always
failing for me.

Thanks,
Dinesh

.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: gif files
Date: Wed, 17 Jan 2007 15:09:12 -0800
Lines: 15
Distribution: su
Message-ID: <eomaa9$qsh$1@news.Stanford.EDU>
References: <eom9rl$q9o$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169075338 27537 127.0.0.1 (17 Jan 2007 23:08:58 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eom9rl$q9o$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11045

Dinesh Gupta wrote:
> Hi,
> 
> Do we need to do anything special for the .gif files?
> Somehow the last 'http://yuba.stanford.edu/vns/images/su.gif' is always
> failing for me.
> 
> Thanks,
> Dinesh
> 

Just make sure you pass back to the client everything you receive from 
the server exactly as you receive it.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Page <mpage@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Checking heading field values
Date: Wed, 17 Jan 2007 15:11:37 -0800
Lines: 18
Distribution: su
Message-ID: <eomae7$r6h$1@news.Stanford.EDU>
NNTP-Posting-Host: wanderlust.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169075463 27857 128.12.104.61 (17 Jan 2007 23:11:03 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20060313)
Xref: shelby.stanford.edu su.class.cs244a:11046

Hey All,

Are we supposed to be checking the field values for correctness in the
"field-name: field-value" pairs in the header? That is, I know we need 
to check that that headers are syntactically correct, but what about the
semantics of the field values?

For example, if we get the following "If-Modified-Since" header in the 
request:
GET http://www.xyz.com/index.html HTTP/1.0
If-Modified-Since: invalid-date-format

Should we return "Bad Request" to the client or forward to the server?
More generally, do we need to check that the field values are in 
compliance with what is laid out in the RFC? (I'm assuming yes.)

Thanks,
Matt
.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Written assignment 1
Date: Wed, 17 Jan 2007 15:53:19 -0800
Lines: 7
Distribution: su
Message-ID: <eomcus$63$1@news.Stanford.EDU>
NNTP-Posting-Host: seine.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169078044 195 171.64.74.36 (17 Jan 2007 23:54:04 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.8 (X11/20060911)
Xref: shelby.stanford.edu su.class.cs244a:11047

Hi,

Is there a typo in problem 1? Part a seems to be missing the number of
students.

Thanks,
Jad.
.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Q6 partB
Date: Wed, 17 Jan 2007 18:19:34 -0800
Lines: 5
Distribution: su
Message-ID: <eomlh5$8ac$1@news.Stanford.EDU>
NNTP-Posting-Host: seine.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169086821 8524 171.64.74.36 (18 Jan 2007 02:20:21 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.8 (X11/20060911)
Xref: shelby.stanford.edu su.class.cs244a:11048

Do we still assume that the average queue size is 128kbytes and the avg
pkt size is 260 bytes and no other packet drops?

Thanks,
Jad
.

Path: shelby.stanford.edu!not-for-mail
From: Dinesh Gupta <dineshg@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: errno
Date: Thu, 18 Jan 2007 02:46:52 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <eomn2s$9fg$1@news.Stanford.EDU>
NNTP-Posting-Host: vine7.stanford.edu
X-Trace: news.Stanford.EDU 1169088412 9712 171.64.15.234 (18 Jan 2007 02:46:52 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (Linux/2.6.15.7smp-secfix3 (i686))
Xref: shelby.stanford.edu su.class.cs244a:11049

Hi,

I'm not able to see a valid errno. If the port is in use, bind fails
and returns < 0 but errno is 0. How can I capture correct errno?

Thanks,
Dinesh
.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Q9 part b
Date: Wed, 17 Jan 2007 19:00:34 -0800
Lines: 5
Distribution: su
Message-ID: <eomnu0$a8f$1@news.Stanford.EDU>
NNTP-Posting-Host: seine.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169089280 10511 171.64.74.36 (18 Jan 2007 03:01:20 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.8 (X11/20060911)
Xref: shelby.stanford.edu su.class.cs244a:11050

Do we need to give the arrival process? Are the units still bps or are
they packets per second?

Thanks,
Jad.
.

Path: shelby.stanford.edu!not-for-mail
From: "Alicia Chen" <achen530@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: How much to read()
Date: Wed, 17 Jan 2007 19:43:20 -0800
Lines: 28
Distribution: su
Message-ID: <eomqct$c0v$1@news.Stanford.EDU>
References: <Pine.LNX.4.62.0701152056360.8222@xenon.Stanford.EDU> <eohufb$k3i$1@news.Stanford.EDU>
NNTP-Posting-Host: boxy.stanford.edu
X-Trace: news.Stanford.EDU 1169091805 12319 128.12.83.54 (18 Jan 2007 03:43:25 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11051

Firstly, when I use SSIZE_MAX, it gives an "SSIZE_MAX undefined" compile 
error, which doesn't go away even when I include <limits.h> or 
<sys/limits.h>

Also, from what I can glean, SSIZE_MAX is equivalent to INT_MAX, or 
something exceedingly large, and I don't really want to allocate a buffer 
that big.  Am I wrong on any of these points?  We can't exactly allocate a 
buffer that big...

--Alicia

"David Erickson" <derickso@stanford.edu> wrote in message 
news:eohufb$k3i$1@news.Stanford.EDU...
> Ryan Chen wrote:
>>
>> The read system call in man page section 2 indicates that we have to 
>> specify how much to read from the socket/descriptor. How do we know in 
>> advance how much the HTTP Request sent in is or how long a server's 
>> response is? Do we "try" to read as much as possible, up to ssize_max 
>> (something like that? I forgot), and then process the buffer?
>>
>> Thanks.
>
> Yes.
>
> -David 


.

Path: shelby.stanford.edu!not-for-mail
From: "Alicia Chen" <achen530@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: errno
Date: Wed, 17 Jan 2007 19:51:03 -0800
Lines: 22
Distribution: su
Message-ID: <eomqrc$ci0$1@news.Stanford.EDU>
References: <eomn2s$9fg$1@news.Stanford.EDU>
NNTP-Posting-Host: boxy.stanford.edu
X-Trace: news.Stanford.EDU 1169092268 12864 128.12.83.54 (18 Jan 2007 03:51:08 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11052

Use perror.

perror("Error occurred while blankety blank");

will output

Error occurred while blankety blank: error message from errno here

--Alicia


"Dinesh Gupta" <dineshg@Stanford.EDU> wrote in message 
news:eomn2s$9fg$1@news.Stanford.EDU...
> Hi,
>
> I'm not able to see a valid errno. If the port is in use, bind fails
> and returns < 0 but errno is 0. How can I capture correct errno?
>
> Thanks,
> Dinesh 


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q6 partB
Date: Wed, 17 Jan 2007 20:03:44 -0800
Lines: 10
Distribution: su
Message-ID: <eomrim$dcl$1@news.Stanford.EDU>
References: <eomlh5$8ac$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169093014 13717 127.0.0.1 (18 Jan 2007 04:03:34 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eomlh5$8ac$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11053

Jad Naous wrote:
> Do we still assume that the average queue size is 128kbytes and the avg
> pkt size is 260 bytes and no other packet drops?
> 
> Thanks,
> Jad

Yes.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q9 part b
Date: Wed, 17 Jan 2007 20:06:31 -0800
Lines: 11
Distribution: su
Message-ID: <eomrns$dcg$1@news.Stanford.EDU>
References: <eomnu0$a8f$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169093180 13712 127.0.0.1 (18 Jan 2007 04:06:20 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eomnu0$a8f$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11054

Jad Naous wrote:
> Do we need to give the arrival process? 

You are given this, A(t)

> Are the units still bps or are
> they packets per second?

It depends on which equation you are referring to.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Written assignment 1
Date: Wed, 17 Jan 2007 20:07:27 -0800
Lines: 10
Distribution: su
Message-ID: <eomrpk$dcg$2@news.Stanford.EDU>
References: <eomcus$63$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169093236 13712 127.0.0.1 (18 Jan 2007 04:07:16 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eomcus$63$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11055

Jad Naous wrote:
> Hi,
> 
> Is there a typo in problem 1? Part a seems to be missing the number of
> students.

I'm waiting for a reply from Nick on whether this is just a general 
variable X or an actual number.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Checking heading field values
Date: Wed, 17 Jan 2007 20:09:51 -0800
Lines: 23
Distribution: su
Message-ID: <eomru4$dcg$3@news.Stanford.EDU>
References: <eomae7$r6h$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169093380 13712 127.0.0.1 (18 Jan 2007 04:09:40 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eomae7$r6h$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11056

Matt Page wrote:
> Hey All,
> 
> Are we supposed to be checking the field values for correctness in the
> "field-name: field-value" pairs in the header? That is, I know we need 
> to check that that headers are syntactically correct, but what about the
> semantics of the field values?
> 
> For example, if we get the following "If-Modified-Since" header in the 
> request:
> GET http://www.xyz.com/index.html HTTP/1.0
> If-Modified-Since: invalid-date-format
> 
> Should we return "Bad Request" to the client or forward to the server?
> More generally, do we need to check that the field values are in 
> compliance with what is laid out in the RFC? (I'm assuming yes.)
> 
> Thanks,
> Matt

For the headers just focus on syntax.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: How much to read()
Date: Wed, 17 Jan 2007 20:10:50 -0800
Lines: 13
Distribution: su
Message-ID: <eoms00$dcg$4@news.Stanford.EDU>
References: <Pine.LNX.4.62.0701152056360.8222@xenon.Stanford.EDU> <eohufb$k3i$1@news.Stanford.EDU> <eomqct$c0v$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169093440 13712 127.0.0.1 (18 Jan 2007 04:10:40 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eomqct$c0v$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11057

Alicia Chen wrote:
> Firstly, when I use SSIZE_MAX, it gives an "SSIZE_MAX undefined" compile 
> error, which doesn't go away even when I include <limits.h> or 
> <sys/limits.h>
> 
> Also, from what I can glean, SSIZE_MAX is equivalent to INT_MAX, or 
> something exceedingly large, and I don't really want to allocate a buffer 
> that big.  Am I wrong on any of these points?  We can't exactly allocate a 
> buffer that big...

Check out the function realloc.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q9 part b
Date: Wed, 17 Jan 2007 20:28:50 -0800
Lines: 24
Distribution: su
Message-ID: <eomsv7$ek0$1@news.Stanford.EDU>
References: <eomnu0$a8f$1@news.Stanford.EDU> <eomrns$dcg$1@news.Stanford.EDU>
NNTP-Posting-Host: jadsdesktop.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169094439 14976 128.12.134.140 (18 Jan 2007 04:27:19 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20060911)
In-Reply-To: <eomrns$dcg$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11058

David Erickson wrote:
> Jad Naous wrote:
>> Do we need to give the arrival process? 
> 
> You are given this, A(t)

for part b we aren't given an explicit (equation form as a function of
time) A(t). Do we need to give it?

> 
>> Are the units still bps or are
>> they packets per second?
> 
> It depends on which equation you are referring to.

for part b, is D(t) in bps or packet/s? and X(t) is it in packets or in
bits?


> 
> -David

Thanks,\
Jad
.

Path: shelby.stanford.edu!not-for-mail
From: Dinesh Gupta <dineshg@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: errno
Date: Thu, 18 Jan 2007 04:49:41 +0000 (UTC)
Lines: 26
Distribution: su
Message-ID: <eomu95$fln$1@news.Stanford.EDU>
References: <eomn2s$9fg$1@news.Stanford.EDU> <eomqrc$ci0$1@news.Stanford.EDU>
NNTP-Posting-Host: vine7.stanford.edu
X-Trace: news.Stanford.EDU 1169095781 16055 171.64.15.234 (18 Jan 2007 04:49:41 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (Linux/2.6.15.7smp-secfix3 (i686))
Xref: shelby.stanford.edu su.class.cs244a:11059

Alicia Chen <achen530@stanford.edu> wrote:
> Use perror.

> perror("Error occurred while blankety blank");

> will output

> Error occurred while blankety blank: error message from errno here

> --Alicia

Thanks Alicia, but I wanted to know errno so that I could print
error messages at one place. 


> "Dinesh Gupta" <dineshg@Stanford.EDU> wrote in message 
> news:eomn2s$9fg$1@news.Stanford.EDU...
> > Hi,
> >
> > I'm not able to see a valid errno. If the port is in use, bind fails
> > and returns < 0 but errno is 0. How can I capture correct errno?
> >
> > Thanks,
> > Dinesh 


.

Path: shelby.stanford.edu!xenon.Stanford.EDU!ryanchen
From: Ryan Chen <ryanchen@xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Remote student turning in PS1
Date: Wed, 17 Jan 2007 21:05:16 -0800
Lines: 6
Distribution: su
Message-ID: <Pine.LNX.4.62.0701172103350.3567@xenon.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Trace: news.Stanford.EDU 1169096717 17000 171.64.66.201 (18 Jan 2007 05:05:17 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:11061

Hi, I am an SCPD student and am wondering what is the best way to hand my 
first problem set to Judy Polenta. Can we have her email address so that 
remote students like me can send her our solution using email before the 
deadline?

Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Remote student turning in PS1
Date: Wed, 17 Jan 2007 21:24:47 -0800
Lines: 21
Distribution: su
Message-ID: <C1D4449F.768A%jpettit@stanford.edu>
References: <Pine.LNX.4.62.0701172103350.3567@xenon.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169097891 17968 127.0.0.1 (18 Jan 2007 05:24:51 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Remote student turning in PS1
Thread-Index: Acc6wPfdNmCJrKa0Edui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11062

Just fill out the routing form and fax it to SCPD:

    http://scpd.stanford.edu/scpd/downloads/onlineRouteForm.pdf

They'll deliver it to us.

--Justin


On 1/17/07 9:05 PM, in article
Pine.LNX.4.62.0701172103350.3567@xenon.Stanford.EDU, "Ryan Chen"
<ryanchen@xenon.Stanford.EDU> wrote:

> Hi, I am an SCPD student and am wondering what is the best way to hand my
> first problem set to Judy Polenta. Can we have her email address so that
> remote students like me can send her our solution using email before the
> deadline?
> 
> Thanks.


.

Path: shelby.stanford.edu!not-for-mail
From: Shashidhar Shashidhar <bhandare@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Proxy process getting stuck in read() system call
Date: Thu, 18 Jan 2007 06:01:16 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <eon2fc$j07$1@news.Stanford.EDU>
NNTP-Posting-Host: myth17.stanford.edu
X-Trace: news.Stanford.EDU 1169100076 19463 171.64.15.58 (18 Jan 2007 06:01:16 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (Linux/2.6.17.13smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:11063

Hi,

Sometimes I see that the proxy gets stuck in read( ) system call and
what should we do here. When can this happen and how to come out of this
condition.

Thanks,
Shashidhar.
.

Path: shelby.stanford.edu!not-for-mail
From: "Euijong Whang" <euijong@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Is Host: header valid in HTTP/1.0?
Date: Wed, 17 Jan 2007 22:23:14 -0800
Lines: 30
Distribution: su
Message-ID: <eon3ot$k7k$1@news.Stanford.EDU>
References: <eol1cr$hbb$1@news.Stanford.EDU> <eolrf8$bmc$2@news.Stanford.EDU> <eolskv$d0r$1@news.Stanford.EDU> <eolsqg$ctk$2@news.Stanford.EDU> <eoltvf$eap$1@news.Stanford.EDU> <45AE8344.80907@stanford.edu>
NNTP-Posting-Host: dnab404b3b.stanford.edu
X-Trace: news.Stanford.EDU 1169101405 20724 171.64.75.59 (18 Jan 2007 06:23:25 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:11064


So the original intent of my question was:
isn't your script supposed to be sending us HTTP/1.0 requests instead of 
HTTP/1.1 requests?
Please advise.
-Steven

"David Erickson" <derickso@stanford.edu> wrote in message 
news:45AE8344.80907@stanford.edu...
> Randy Jennings wrote:
>>> No I am definitely not saying that, if the incoming request is missing 
>>> invalid (according to the spec you are implementing), then what do you 
>>> do?
>>
>> I think something got lost between 'missing' and 'invalid', but I think 
>> you are (now) saying that Host: (while not making the request invalid 
>> (according to rfc1945, see other post by Riju)) does not compensate for 
>> not having the full url in the request line (invalid according to our 
>> project spec). However, that refers back to my previous (in time) post on 
>> implications of the grading script.
>>
>> How is python being set to use HTTP/1.0 instead of HTTP/1.1?
>>
>
> I'm not positive which version python is sending requests as, but it does 
> not appear to effect the response.
>
> -David 


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Proxy process getting stuck in read() system call
Date: Wed, 17 Jan 2007 22:26:04 -0800
Lines: 11
Distribution: su
Message-ID: <eon3ts$k8s$1@news.Stanford.EDU>
References: <eon2fc$j07$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169101564 20764 127.0.0.1 (18 Jan 2007 06:26:04 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eon2fc$j07$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11065

Shashidhar Shashidhar wrote:
> Hi,
> 
> Sometimes I see that the proxy gets stuck in read( ) system call and
> what should we do here. When can this happen and how to come out of this
> condition.
> 
> Thanks,
> Shashidhar.

reading from the client or server?
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Is Host: header valid in HTTP/1.0?
Date: Wed, 17 Jan 2007 22:28:28 -0800
Lines: 10
Distribution: su
Message-ID: <eon42c$k8s$2@news.Stanford.EDU>
References: <eol1cr$hbb$1@news.Stanford.EDU> <eolrf8$bmc$2@news.Stanford.EDU> <eolskv$d0r$1@news.Stanford.EDU> <eolsqg$ctk$2@news.Stanford.EDU> <eoltvf$eap$1@news.Stanford.EDU> <45AE8344.80907@stanford.edu> <eon3ot$k7k$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169101708 20764 127.0.0.1 (18 Jan 2007 06:28:28 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eon3ot$k7k$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11066

Euijong Whang wrote:
> So the original intent of my question was:
> isn't your script supposed to be sending us HTTP/1.0 requests instead of 
> HTTP/1.1 requests?
> Please advise.
> -Steven

Drop Clay an email about it.

-David
.

Path: shelby.stanford.edu!xenon.Stanford.EDU!ryanchen
From: Ryan Chen <ryanchen@xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: How much to read()
Date: Wed, 17 Jan 2007 22:39:46 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.LNX.4.62.0701172238050.26374@xenon.Stanford.EDU>
References: <Pine.LNX.4.62.0701152056360.8222@xenon.Stanford.EDU>
 <eohufb$k3i$1@news.Stanford.EDU> <eomqct$c0v$1@news.Stanford.EDU>
 <eoms00$dcg$4@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Trace: news.Stanford.EDU 1169102388 21490 171.64.66.201 (18 Jan 2007 06:39:48 GMT)
X-Complaints-To: news@news.stanford.edu
To: David Erickson <derickso@stanford.edu>
In-Reply-To: <eoms00$dcg$4@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11067

Just so you know, I actually didn't use a variable named ssize_max in my 
implmentation. I was only saying allocate a buffer that can get as much 
as possible from the socket. Don't spend time looking up this ssize_max. 
Try think about how to recursively use the realloc or similar functions 
to implement this. Hopefully this clear some things up.

On Wed, 17 Jan 
2007, David Erickson wrote:

> Alicia Chen wrote:
>> Firstly, when I use SSIZE_MAX, it gives an "SSIZE_MAX undefined" compile 
>> error, which doesn't go away even when I include <limits.h> or 
>> <sys/limits.h>
>> 
>> Also, from what I can glean, SSIZE_MAX is equivalent to INT_MAX, or 
>> something exceedingly large, and I don't really want to allocate a buffer 
>> that big.  Am I wrong on any of these points?  We can't exactly allocate a 
>> buffer that big...
>
> Check out the function realloc.
>
> -David
>
.

Path: shelby.stanford.edu!not-for-mail
From: "Kevin Hart" <kevin.hart@hp.com>
Newsgroups: su.class.cs244a
Subject: Grade script hanging
Date: Wed, 17 Jan 2007 23:43:35 -0700
Lines: 14
Distribution: su
Message-ID: <eon4uo$l8h$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169102616 21777 127.0.0.1 (18 Jan 2007 06:43:36 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:11068

I haven't used python before.  When I type "./proxy_grader.py proxy 5001" at 
the prompt on bramble, I get...

Binary: proxy
Running on port 5001

But then nothing happens.  How do you get visibility into what's going on? 
The call trace that appears when I hit ctrl-c isn't very enlightening.

(FYI, when I use my proxy on Linux at home with a Firefox browser, it seems 
to work fine.)



.

Path: shelby.stanford.edu!not-for-mail
From: Shashidhar Shashidhar <bhandare@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Proxy process getting stuck in read() system call
Date: Thu, 18 Jan 2007 07:14:40 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <eon6p0$m45$1@news.Stanford.EDU>
References: <eon2fc$j07$1@news.Stanford.EDU> <eon3ts$k8s$1@news.Stanford.EDU>
NNTP-Posting-Host: myth18.stanford.edu
X-Trace: news.Stanford.EDU 1169104480 22661 171.64.15.61 (18 Jan 2007 07:14:40 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (Linux/2.6.17.13smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:11069

David Erickson <derickso@stanford.edu> wrote:
> Shashidhar Shashidhar wrote:
> > Hi,
> > 
> > Sometimes I see that the proxy gets stuck in read( ) system call and
> > what should we do here. When can this happen and how to come out of this
> > condition.
> > 
> > Thanks,
> > Shashidhar.

> reading from the client or server?

Mostly while reading from the client. Once saw from the client also.
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Proxy process getting stuck in read() system call
Date: Wed, 17 Jan 2007 23:55:09 -0800
Lines: 21
Distribution: su
Message-ID: <eon94t$rbe$1@news.Stanford.EDU>
References: <eon2fc$j07$1@news.Stanford.EDU> <eon3ts$k8s$1@news.Stanford.EDU> <eon6p0$m45$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169106909 28014 127.0.0.1 (18 Jan 2007 07:55:09 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eon6p0$m45$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11070

Shashidhar Shashidhar wrote:
> David Erickson <derickso@stanford.edu> wrote:
>> Shashidhar Shashidhar wrote:
>>> Hi,
>>>
>>> Sometimes I see that the proxy gets stuck in read( ) system call and
>>> what should we do here. When can this happen and how to come out of this
>>> condition.
>>>
>>> Thanks,
>>> Shashidhar.
> 
>> reading from the client or server?
> 
> Mostly while reading from the client. Once saw from the client also.

Make sure you only read until you get the full request from the client, 
if you try and read beyond what the client is going to send it will hang 
until the client disconnects the socket.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Grade script hanging
Date: Wed, 17 Jan 2007 23:56:09 -0800
Lines: 19
Distribution: su
Message-ID: <eon96p$rbe$2@news.Stanford.EDU>
References: <eon4uo$l8h$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169106969 28014 127.0.0.1 (18 Jan 2007 07:56:09 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eon4uo$l8h$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11071

Kevin Hart wrote:
> I haven't used python before.  When I type "./proxy_grader.py proxy 5001" at 
> the prompt on bramble, I get...
> 
> Binary: proxy
> Running on port 5001
> 
> But then nothing happens.  How do you get visibility into what's going on? 
> The call trace that appears when I hit ctrl-c isn't very enlightening.
> 
> (FYI, when I use my proxy on Linux at home with a Firefox browser, it seems 
> to work fine.)
>

You can edit the script and have it dump what its doing to you if you'd 
like, but your better off I would imagine printing status from your 
proxy executable to the console.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: "Brian Thompson" <Brian.C.Thompson@Boeing.com>
Newsgroups: su.class.cs244a
Subject: Re: Proxy process getting stuck in read() system call
Date: Thu, 18 Jan 2007 01:19:06 -0800
Lines: 31
Distribution: su
Message-ID: <eone2e$42e$1@news.Stanford.EDU>
References: <eon2fc$j07$1@news.Stanford.EDU> <eon3ts$k8s$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169111950 4174 127.0.0.1 (18 Jan 2007 09:19:10 GMT)
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.2962
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:11072

I am runninng into the same problem with my proxy, I don't get a response 
from the server.  I show that I connect just fine using serive name of www 
on port 80.

As a check I have run the server.c and setup a server with a port of 8001. 
Then I ran my proxy on 8000 and telneted to localhost 8000, sent a message 
to localhost on port 8001, saw my message reach the server and then get a 
response.

I'm starting to think that there is something blocking the returns of the 
reads.  I notice that when I do a normal telnet to www.yahoo.com 80 and then 
GET / HTTP/1.0 I have to press enter 3 times to get the data to show.  Do I 
need to somehow mimic this to get my proxy to read the data?

--Brian

"David Erickson" <derickso@stanford.edu> wrote in message 
news:eon3ts$k8s$1@news.Stanford.EDU...
> Shashidhar Shashidhar wrote:
>> Hi,
>>
>> Sometimes I see that the proxy gets stuck in read( ) system call and
>> what should we do here. When can this happen and how to come out of this
>> condition.
>>
>> Thanks,
>> Shashidhar.
>
> reading from the client or server? 


.

Path: shelby.stanford.edu!not-for-mail
From: "Euijong Whang" <euijong@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Is Host: header valid in HTTP/1.0?
Date: Thu, 18 Jan 2007 01:29:31 -0800
Lines: 24
Distribution: su
Message-ID: <eonem6$4ib$1@news.Stanford.EDU>
References: <eol1cr$hbb$1@news.Stanford.EDU> <eolrf8$bmc$2@news.Stanford.EDU> <eolskv$d0r$1@news.Stanford.EDU> <eolsqg$ctk$2@news.Stanford.EDU> <eoltvf$eap$1@news.Stanford.EDU> <45AE8344.80907@stanford.edu> <eon3ot$k7k$1@news.Stanford.EDU> <eon42c$k8s$2@news.Stanford.EDU>
NNTP-Posting-Host: dnab404b3b.stanford.edu
X-Trace: news.Stanford.EDU 1169112582 4683 171.64.75.59 (18 Jan 2007 09:29:42 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:11073


David,

My apologies.. I was printing out the request line after explicitly removing 
the host.
Totally my mistake.

-Steven


"David Erickson" <derickso@stanford.edu> wrote in message 
news:eon42c$k8s$2@news.Stanford.EDU...
> Euijong Whang wrote:
>> So the original intent of my question was:
>> isn't your script supposed to be sending us HTTP/1.0 requests instead of 
>> HTTP/1.1 requests?
>> Please advise.
>> -Steven
>
> Drop Clay an email about it.
>
> -David 


.

Path: shelby.stanford.edu!not-for-mail
From: Dinesh Gupta <dineshg@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Proxy process getting stuck in read() system call
Date: Thu, 18 Jan 2007 15:54:07 +0000 (UTC)
Lines: 44
Distribution: su
Message-ID: <eoo56v$qrp$1@news.Stanford.EDU>
References: <eon2fc$j07$1@news.Stanford.EDU> <eon3ts$k8s$1@news.Stanford.EDU> <eone2e$42e$1@news.Stanford.EDU>
NNTP-Posting-Host: myth25.stanford.edu
X-Trace: news.Stanford.EDU 1169135647 27513 171.64.15.40 (18 Jan 2007 15:54:07 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (Linux/2.6.17.13smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:11074

Hi,

I'm also seeing this problem when I configured firefox to use my proxy.
It's stuck in read while reading from the remote server(yahoo). It
worked fine with cnn though. So it doesn't happen always but very
annoying when it happens. Please let me know how to come out of this read call.

Thanks,
Dinesh



Brian Thompson <Brian.C.Thompson@boeing.com> wrote:
> I am runninng into the same problem with my proxy, I don't get a response 
> from the server.  I show that I connect just fine using serive name of www 
> on port 80.

> As a check I have run the server.c and setup a server with a port of 8001. 
> Then I ran my proxy on 8000 and telneted to localhost 8000, sent a message 
> to localhost on port 8001, saw my message reach the server and then get a 
> response.

> I'm starting to think that there is something blocking the returns of the 
> reads.  I notice that when I do a normal telnet to www.yahoo.com 80 and then 
> GET / HTTP/1.0 I have to press enter 3 times to get the data to show.  Do I 
> need to somehow mimic this to get my proxy to read the data?

> --Brian

> "David Erickson" <derickso@stanford.edu> wrote in message 
> news:eon3ts$k8s$1@news.Stanford.EDU...
> > Shashidhar Shashidhar wrote:
> >> Hi,
> >>
> >> Sometimes I see that the proxy gets stuck in read( ) system call and
> >> what should we do here. When can this happen and how to come out of this
> >> condition.
> >>
> >> Thanks,
> >> Shashidhar.
> >
> > reading from the client or server? 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Proxy process getting stuck in read() system call
Date: Thu, 18 Jan 2007 09:24:29 -0800
Lines: 44
Distribution: su
Message-ID: <C1D4ED4D.76BE%jpettit@stanford.edu>
References: <eon2fc$j07$1@news.Stanford.EDU> <eon3ts$k8s$1@news.Stanford.EDU> <eone2e$42e$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169141073 3256 127.0.0.1 (18 Jan 2007 17:24:33 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Proxy process getting stuck in read() system call
Thread-Index: Acc7JYJYwQWx4KcYEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11075

You definitely should not send three "\r\n" to indicate the end of a
request--that's contrary to the RFC.  I just connected to www.yahoo.com over
a dozen times, and never had to hit enter more than twice.  Are you running
your tests on one of the Myths?

--Justin


On 1/18/07 1:19 AM, in article eone2e$42e$1@news.Stanford.EDU, "Brian
Thompson" <Brian.C.Thompson@Boeing.com> wrote:

> I am runninng into the same problem with my proxy, I don't get a response
> from the server.  I show that I connect just fine using serive name of www
> on port 80.
> 
> As a check I have run the server.c and setup a server with a port of 8001.
> Then I ran my proxy on 8000 and telneted to localhost 8000, sent a message
> to localhost on port 8001, saw my message reach the server and then get a
> response.
> 
> I'm starting to think that there is something blocking the returns of the
> reads.  I notice that when I do a normal telnet to www.yahoo.com 80 and then
> GET / HTTP/1.0 I have to press enter 3 times to get the data to show.  Do I
> need to somehow mimic this to get my proxy to read the data?
> 
> --Brian
> 
> "David Erickson" <derickso@stanford.edu> wrote in message
> news:eon3ts$k8s$1@news.Stanford.EDU...
>> Shashidhar Shashidhar wrote:
>>> Hi,
>>> 
>>> Sometimes I see that the proxy gets stuck in read( ) system call and
>>> what should we do here. When can this happen and how to come out of this
>>> condition.
>>> 
>>> Thanks,
>>> Shashidhar.
>> 
>> reading from the client or server?
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Proxy process getting stuck in read() system call
Date: Thu, 18 Jan 2007 09:28:45 -0800
Lines: 61
Distribution: su
Message-ID: <C1D4EE4D.76C2%jpettit@stanford.edu>
References: <eon2fc$j07$1@news.Stanford.EDU> <eon3ts$k8s$1@news.Stanford.EDU> <eone2e$42e$1@news.Stanford.EDU> <eoo56v$qrp$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169141326 3383 127.0.0.1 (18 Jan 2007 17:28:46 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Proxy process getting stuck in read() system call
Thread-Index: Acc7JhruWVQOgKcZEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11076

The best way to prevent blocking is to use the system call "select" or
"poll" to determine whether there is data to be read.  You can also mark the
socket as non-blocking.  However, you shouldn't need to do either of these
for this assignment.

As David mentioned earlier, make sure that you don't immediately try to
read() again after getting a zero return value, otherwise you'll block.

--Justin
 

On 1/18/07 7:54 AM, in article eoo56v$qrp$1@news.Stanford.EDU, "Dinesh
Gupta" <dineshg@Stanford.EDU> wrote:

> Hi,
> 
> I'm also seeing this problem when I configured firefox to use my proxy.
> It's stuck in read while reading from the remote server(yahoo). It
> worked fine with cnn though. So it doesn't happen always but very
> annoying when it happens. Please let me know how to come out of this read
> call.
> 
> Thanks,
> Dinesh
> 
> 
> 
> Brian Thompson <Brian.C.Thompson@boeing.com> wrote:
>> I am runninng into the same problem with my proxy, I don't get a response
>> from the server.  I show that I connect just fine using serive name of www
>> on port 80.
> 
>> As a check I have run the server.c and setup a server with a port of 8001.
>> Then I ran my proxy on 8000 and telneted to localhost 8000, sent a message
>> to localhost on port 8001, saw my message reach the server and then get a
>> response.
> 
>> I'm starting to think that there is something blocking the returns of the
>> reads.  I notice that when I do a normal telnet to www.yahoo.com 80 and then
>> GET / HTTP/1.0 I have to press enter 3 times to get the data to show.  Do I
>> need to somehow mimic this to get my proxy to read the data?
> 
>> --Brian
> 
>> "David Erickson" <derickso@stanford.edu> wrote in message
>> news:eon3ts$k8s$1@news.Stanford.EDU...
>>> Shashidhar Shashidhar wrote:
>>>> Hi,
>>>> 
>>>> Sometimes I see that the proxy gets stuck in read( ) system call and
>>>> what should we do here. When can this happen and how to come out of this
>>>> condition.
>>>> 
>>>> Thanks,
>>>> Shashidhar.
>>> 
>>> reading from the client or server?
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Updated Problem Set 1
Date: Thu, 18 Jan 2007 10:01:08 -0800
Lines: 5
Distribution: su
Message-ID: <eoocl4$50r$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169143268 5147 127.0.0.1 (18 Jan 2007 18:01:08 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
Xref: shelby.stanford.edu su.class.cs244a:11077

Please be aware I have posted an updated Problem Set 1, there was a typo 
in 1a which has been fixed.

Thanks,
David
.

Path: shelby.stanford.edu!not-for-mail
From: "Alex" <axle@sonic.net>
Newsgroups: su.class.cs244a
Subject: Submission
Date: Thu, 18 Jan 2007 11:05:11 -0800
Lines: 4
Distribution: su
Message-ID: <eoogd8$8kk$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169147112 8852 127.0.0.1 (18 Jan 2007 19:05:12 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11078

When I tried to submit the web proxy on the course website I get "You do not 
have permission to access the requested directory." Why is this happening? 


.

Path: shelby.stanford.edu!myth22.Stanford.EDU!shchoi
From: Seung Hoon Choi <shchoi@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Parsing request
Date: Thu, 18 Jan 2007 12:26:46 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.LNX.4.44.0701181225270.12959-100000@myth22.Stanford.EDU>
NNTP-Posting-Host: myth22.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1169152009 13143 171.64.15.36 (18 Jan 2007 20:26:49 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:11079


Hi,

How exact do we need to parse the request/response? Do I need to make sure
that requests and responses are exactly as defined in RFC documents?


Thanks,
-Seung

.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Submission
Date: Thu, 18 Jan 2007 12:38:28 -0800
Lines: 10
Distribution: su
Message-ID: <eoolvc$dei$1@news.Stanford.EDU>
References: <eoogd8$8kk$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169152812 13778 171.64.74.54 (18 Jan 2007 20:40:12 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <eoogd8$8kk$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11080

Alex wrote:
> When I tried to submit the web proxy on the course website I get "You do not 
> have permission to access the requested directory." Why is this happening? 
> 
> 
Are you seeing this error as soon as you click on the 'Submit an 
Assignment' link from the front page, or only after you press the submit 
button on the submissions page?  Are you able to authenticate with WebAuth?

Clay
.

Path: shelby.stanford.edu!not-for-mail
From: Chee-Hyung Yoon <chyoon@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Error code for unknown host
Date: Thu, 18 Jan 2007 13:09:32 -0800
Lines: 5
Distribution: su
Message-ID: <eoonmf$erk$1@news.Stanford.EDU>
NNTP-Posting-Host: hr-chyoon-1158559642.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169154575 15220 171.66.147.181 (18 Jan 2007 21:09:35 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Macintosh/20061207)
Xref: shelby.stanford.edu su.class.cs244a:11081

If the user sends a request from an unknown host, what error should we 
return? Is it 400 Bad Request or 404 Not Found?

Thanks,
Chee-Hyung
.

Path: shelby.stanford.edu!not-for-mail
From: "Alex" <axle@sonic.net>
Newsgroups: su.class.cs244a
Subject: Re: Submission
Date: Thu, 18 Jan 2007 13:22:45 -0800
Lines: 16
Distribution: su
Message-ID: <eooof8$frb$1@news.Stanford.EDU>
References: <eoogd8$8kk$1@news.Stanford.EDU> <eoolvc$dei$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169155368 16235 127.0.0.1 (18 Jan 2007 21:22:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11082

After I authenticate I see this issue.

"Clay Collier" <ccollier@stanford.edu> wrote in message 
news:eoolvc$dei$1@news.Stanford.EDU...
> Alex wrote:
>> When I tried to submit the web proxy on the course website I get "You do 
>> not have permission to access the requested directory." Why is this 
>> happening?
> Are you seeing this error as soon as you click on the 'Submit an 
> Assignment' link from the front page, or only after you press the submit 
> button on the submissions page?  Are you able to authenticate with 
> WebAuth?
>
> Clay 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Error code for unknown host
Date: Thu, 18 Jan 2007 13:34:31 -0800
Lines: 17
Distribution: su
Message-ID: <C1D527E7.76F4%jpettit@stanford.edu>
References: <eoonmf$erk$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169156077 16962 127.0.0.1 (18 Jan 2007 21:34:37 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Error code for unknown host
Thread-Index: Acc7SHA7rpdD1Kc7Edui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11083

Do you mean "to an unknown host"?  If so, then send back a 400.  You won't
need to generate a 404, since that has to do with missing pages.  However,
if the server generates a 404, you should pass that on.

--Justin


On 1/18/07 1:09 PM, in article eoonmf$erk$1@news.Stanford.EDU, "Chee-Hyung
Yoon" <chyoon@stanford.edu> wrote:

> If the user sends a request from an unknown host, what error should we
> return? Is it 400 Bad Request or 404 Not Found?
> 
> Thanks,
> Chee-Hyung


.

Path: shelby.stanford.edu!not-for-mail
From: Dina Thomas <dinat@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: GetHostByName error
Date: Thu, 18 Jan 2007 21:49:20 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <eooq10$h40$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine6.stanford.edu
X-Trace: news.Stanford.EDU 1169156960 17536 171.64.15.71 (18 Jan 2007 21:49:20 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:11084


Hi,
  When I try to connect to the site HTTP://www.stanford.edu directly
it works fine. However when I run it through the grading script
I get an error for gethostbyname() which correcponds to TRY_AGAIN.
The function doesnt return successfully even with a number of tries. 
What could be wrong?

Thanks
Dina 
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: GetHostByName error
Date: Thu, 18 Jan 2007 14:04:50 -0800
Lines: 21
Distribution: su
Message-ID: <C1D52F02.76FB%jpettit@stanford.edu>
References: <eooq10$h40$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169157894 18463 127.0.0.1 (18 Jan 2007 22:04:54 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: GetHostByName error
Thread-Index: Acc7TKxx6skMOac/Edui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11085

Are you trying to resolve "HTTP://www.stanford.edu"?  If so, then you need
to strip off the "HTTP://" before passing it to the resolver.

--Justin


On 1/18/07 1:49 PM, in article eooq10$h40$1@news.Stanford.EDU, "Dina Thomas"
<dinat@Stanford.EDU> wrote:

> 
> Hi,
>   When I try to connect to the site HTTP://www.stanford.edu directly
> it works fine. However when I run it through the grading script
> I get an error for gethostbyname() which correcponds to TRY_AGAIN.
> The function doesnt return successfully even with a number of tries.
> What could be wrong?
> 
> Thanks
> Dina 


.

Path: shelby.stanford.edu!not-for-mail
From: Adam Cohen <adam.cohen@stanford.edu>
Newsgroups: su.class.cs244a
Subject: strdup
Date: Thu, 18 Jan 2007 14:45:27 -0800
Lines: 13
Distribution: su
Message-ID: <eoota9$j2m$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1169160330 19542 127.0.0.1 (18 Jan 2007 22:45:30 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Unison/1.7.5
Xref: shelby.stanford.edu su.class.cs244a:11086

Hello. I used strdup() fairly liberally in my program, only to find out 
today when I tried to submit that they are technically (I belive) not 
supported by ANSI C. Is this a big enough problem that I should go 
through my code and change them, or can I just compile without the 
-ansi flag and go with it.

As a second unrelated question, if I run the tests over and over again, 
I occassionally encounter a failure. Sometimes it's a date string that 
changed on one of the sites, and sometimes it looks like the GET just 
choked for whatever reason. Is the testing script going to be run 
multiple times to isolate spot failures?


.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Submission
Date: Thu, 18 Jan 2007 14:51:06 -0800
Lines: 23
Distribution: su
Message-ID: <eooto3$kb9$1@news.Stanford.EDU>
References: <eoogd8$8kk$1@news.Stanford.EDU> <eoolvc$dei$1@news.Stanford.EDU> <eooof8$frb$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169160771 20841 171.64.74.54 (18 Jan 2007 22:52:51 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <eooof8$frb$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11087

Try clearing your browser cache and trying the link again.  Also, make 
sure that your browser is accepting cookies from both 
webauth.stanford.edu and www.stanford.edu.

Clay

Alex wrote:
> After I authenticate I see this issue.
> 
> "Clay Collier" <ccollier@stanford.edu> wrote in message 
> news:eoolvc$dei$1@news.Stanford.EDU...
>> Alex wrote:
>>> When I tried to submit the web proxy on the course website I get "You do 
>>> not have permission to access the requested directory." Why is this 
>>> happening?
>> Are you seeing this error as soon as you click on the 'Submit an 
>> Assignment' link from the front page, or only after you press the submit 
>> button on the submissions page?  Are you able to authenticate with 
>> WebAuth?
>>
>> Clay 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Chun Kai Wang <chunkaiw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: elaine vs. myth
Date: Thu, 18 Jan 2007 22:54:20 +0000 (UTC)
Organization: Your Company
Lines: 1
Distribution: su
Message-ID: <Xns98BC97A2A5FE4chunkaiwstanfordedu@171.64.14.103>
NNTP-Posting-Host: rescomp-06-59601.stanford.edu
X-Trace: news.Stanford.EDU 1169160860 20983 128.12.22.217 (18 Jan 2007 22:54:20 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Xnews/5.04.25
Xref: shelby.stanford.edu su.class.cs244a:11088

i can't seem to log-in properly on myth. can i use elaine?
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: elaine vs. myth
Date: Thu, 18 Jan 2007 15:06:39 -0800
Lines: 15
Distribution: su
Message-ID: <C1D53D7F.770B%jpettit@stanford.edu>
References: <Xns98BC97A2A5FE4chunkaiwstanfordedu@171.64.14.103>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169161602 21684 127.0.0.1 (18 Jan 2007 23:06:42 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: elaine vs. myth
Thread-Index: Acc7VU8tjaRo/qdIEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11089

You're welcome to use it.  Keep in mind that the Elaines are Solaris Sparc
machines.  We're going to be testing them on Linux x86 systems.  If you
write properly portable code, then you won't haven any issues, but that can
be tricky.

--Justin


On 1/18/07 2:54 PM, in article
Xns98BC97A2A5FE4chunkaiwstanfordedu@171.64.14.103, "Chun Kai Wang"
<chunkaiw@stanford.edu> wrote:

> i can't seem to log-in properly on myth. can i use elaine?


.

Path: shelby.stanford.edu!xenon.Stanford.EDU!ryanchen
From: Ryan Chen <ryanchen@xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Sending error code back
Date: Thu, 18 Jan 2007 15:08:14 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.LNX.4.62.0701181504050.29823@xenon.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Trace: news.Stanford.EDU 1169161697 21789 171.64.66.201 (18 Jan 2007 23:08:17 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:11090

For a bad request from the client, I am trying to send "HTTP/1.0 400 Bad 
Request\r\n\r\n" back to the client via the socket with the client, but 
once I close the socket, it gives me a socket error from the grader 
script:

IOError: [Errno socket error] (-2, 'Name or service not known')

Any clue why this is happening? If I send the message back to the client, 
but "don't" close the socket to the client, then this message won't 
appear, but the process just hangs, so it seems to me the client is still 
trying to read the socket somehow even though I sent a bad reqest response 
back......

Thanks for any answer.
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: strdup
Date: Thu, 18 Jan 2007 15:14:54 -0800
Lines: 26
Distribution: su
Message-ID: <C1D53F6E.770E%jpettit@stanford.edu>
References: <eoota9$j2m$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169162102 22154 127.0.0.1 (18 Jan 2007 23:15:02 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: strdup
Thread-Index: Acc7VnY4tIIKUqdJEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11091

On 1/18/07 2:45 PM, in article eoota9$j2m$1@news.Stanford.EDU, "Adam Cohen"
<adam.cohen@stanford.edu> wrote:

> Hello. I used strdup() fairly liberally in my program, only to find out
> today when I tried to submit that they are technically (I belive) not
> supported by ANSI C. Is this a big enough problem that I should go
> through my code and change them, or can I just compile without the
> -ansi flag and go with it.

Don't worry too much about that.  It's part of the standard C libraries on
the Myth systems, so as long as it compiles cleanly, we're happy.

> As a second unrelated question, if I run the tests over and over again,
> I occassionally encounter a failure. Sometimes it's a date string that
> changed on one of the sites, and sometimes it looks like the GET just
> choked for whatever reason. Is the testing script going to be run
> multiple times to isolate spot failures?

I imagine that if we see a problem we'll give it another shot.  If you are
finding particular problems in the grading script, please keep posting them
on the newsgroup.  Also, if you get dinged in your grade and you can
demonstrate it's a problem in the grading script, we'll gladly add the
points back. 

--Justin

.

Path: shelby.stanford.edu!not-for-mail
From: Chun Kai Wang <chunkaiw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: what's going on???? // = error?
Date: Thu, 18 Jan 2007 23:19:46 +0000 (UTC)
Organization: Your Company
Lines: 14
Distribution: su
Message-ID: <Xns98BC9BF29A199chunkaiwstanfordedu@171.64.14.103>
NNTP-Posting-Host: rescomp-06-59601.stanford.edu
X-Trace: news.Stanford.EDU 1169162386 20983 128.12.22.217 (18 Jan 2007 23:19:46 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Xnews/5.04.25
Xref: shelby.stanford.edu su.class.cs244a:11092

i'm going crazy...

all i have is

void main()
{
    	int x;    	//x
}

and this doesn't compile.

but if i remove "//x" it compiles just fine...

i'm using myth
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Parsing request
Date: Thu, 18 Jan 2007 15:21:43 -0800
Lines: 23
Distribution: su
Message-ID: <C1D54107.7715%jpettit@stanford.edu>
References: <Pine.LNX.4.44.0701181225270.12959-100000@myth22.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169162504 22449 127.0.0.1 (18 Jan 2007 23:21:44 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Parsing request
Thread-Index: Acc7V2oBqErqjKdKEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11093

Don't worry about parsing much of the request and response.  For the
request, make sure that it makes sense, but you don't have to verify all the
headers.  For the response, make sure that you get a proper response status
line and then just pass everything else through unmodified.

--Justin


On 1/18/07 12:26 PM, in article
Pine.LNX.4.44.0701181225270.12959-100000@myth22.Stanford.EDU, "Seung Hoon
Choi" <shchoi@stanford.edu> wrote:

> 
> Hi,
> 
> How exact do we need to parse the request/response? Do I need to make sure
> that requests and responses are exactly as defined in RFC documents?
> 
> 
> Thanks,
> -Seung
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "David Gobaud" <gobaudd@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: what's going on???? // = error?
Date: Thu, 18 Jan 2007 15:22:22 -0800
Lines: 22
Distribution: su
Message-ID: <eoovfq$m14$1@news.Stanford.EDU>
References: <Xns98BC9BF29A199chunkaiwstanfordedu@171.64.14.103>
NNTP-Posting-Host: norad.stanford.edu
X-Trace: news.Stanford.EDU 1169162554 22564 128.12.81.44 (18 Jan 2007 23:22:34 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11094

// isn't valid commenting in ANSI C AFAIK. Use /* ... */

David Gobaud

"Chun Kai Wang" <chunkaiw@stanford.edu> wrote in message 
news:Xns98BC9BF29A199chunkaiwstanfordedu@171.64.14.103...
> i'm going crazy...
>
> all i have is
>
> void main()
> {
>    int x;    //x
> }
>
> and this doesn't compile.
>
> but if i remove "//x" it compiles just fine...
>
> i'm using myth 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: what's going on???? // = error?
Date: Thu, 18 Jan 2007 15:23:09 -0800
Lines: 29
Distribution: su
Message-ID: <C1D5415D.7716%jpettit@stanford.edu>
References: <Xns98BC9BF29A199chunkaiwstanfordedu@171.64.14.103>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169162594 22580 127.0.0.1 (18 Jan 2007 23:23:14 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: what's going on???? // = error?
Thread-Index: Acc7V51D2+FoVadKEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11095

That's a C++ comment.  Try this:

    int x;  /* x */

Some compilers are sticklers about the C code using C++ comments.

--Justin


On 1/18/07 3:19 PM, in article
Xns98BC9BF29A199chunkaiwstanfordedu@171.64.14.103, "Chun Kai Wang"
<chunkaiw@stanford.edu> wrote:

> i'm going crazy...
> 
> all i have is
> 
> void main()
> {
> int x;     //x
> }
> 
> and this doesn't compile.
> 
> but if i remove "//x" it compiles just fine...
> 
> i'm using myth


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Sending error code back
Date: Thu, 18 Jan 2007 15:30:59 -0800
Lines: 27
Distribution: su
Message-ID: <C1D54333.771C%jpettit@stanford.edu>
References: <Pine.LNX.4.62.0701181504050.29823@xenon.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169163065 22969 127.0.0.1 (18 Jan 2007 23:31:05 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Sending error code back
Thread-Index: Acc7WLVn87RmdadLEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11096

Are you sure the write completed?  It doesn't seem like you've written
enough data to require it, but you may need to call write() multiple times
to completely send your data.

--Justin


On 1/18/07 3:08 PM, in article
Pine.LNX.4.62.0701181504050.29823@xenon.Stanford.EDU, "Ryan Chen"
<ryanchen@xenon.Stanford.EDU> wrote:

> For a bad request from the client, I am trying to send "HTTP/1.0 400 Bad
> Request\r\n\r\n" back to the client via the socket with the client, but
> once I close the socket, it gives me a socket error from the grader
> script:
> 
> IOError: [Errno socket error] (-2, 'Name or service not known')
> 
> Any clue why this is happening? If I send the message back to the client,
> but "don't" close the socket to the client, then this message won't
> appear, but the process just hangs, so it seems to me the client is still
> trying to read the socket somehow even though I sent a bad reqest response
> back......
> 
> Thanks for any answer.


.

Path: shelby.stanford.edu!xenon.Stanford.EDU!ryanchen
From: Ryan Chen <ryanchen@xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Sending error code back
Date: Thu, 18 Jan 2007 15:40:40 -0800
Lines: 39
Distribution: su
Message-ID: <Pine.LNX.4.62.0701181538530.24805@xenon.Stanford.EDU>
References: <Pine.LNX.4.62.0701181504050.29823@xenon.Stanford.EDU>
 <C1D54333.771C%jpettit@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Trace: news.Stanford.EDU 1169163642 23424 171.64.66.201 (18 Jan 2007 23:40:42 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <C1D54333.771C%jpettit@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:11097

Yes, I am sure iis written through, I checked the number of bytes return 
by the write() call, and it equals the number of chars in my string.

Also, what do you mean by "it doens't seem like you've written enough data 
to require it"? What is this "required it"? Require what?

Thanks.


On Thu, 18 Jan 2007, Justin Pettit wrote:

> Are you sure the write completed?  It doesn't seem like you've written
> enough data to require it, but you may need to call write() multiple times
> to completely send your data.
>
> --Justin
>
>
> On 1/18/07 3:08 PM, in article
> Pine.LNX.4.62.0701181504050.29823@xenon.Stanford.EDU, "Ryan Chen"
> <ryanchen@xenon.Stanford.EDU> wrote:
>
>> For a bad request from the client, I am trying to send "HTTP/1.0 400 Bad
>> Request\r\n\r\n" back to the client via the socket with the client, but
>> once I close the socket, it gives me a socket error from the grader
>> script:
>>
>> IOError: [Errno socket error] (-2, 'Name or service not known')
>>
>> Any clue why this is happening? If I send the message back to the client,
>> but "don't" close the socket to the client, then this message won't
>> appear, but the process just hangs, so it seems to me the client is still
>> trying to read the socket somehow even though I sent a bad reqest response
>> back......
>>
>> Thanks for any answer.
>
>
>
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: elaine vs. myth
Date: Thu, 18 Jan 2007 15:39:11 -0800
Lines: 22
Distribution: su
Message-ID: <eop0i8$mm9$1@news.Stanford.EDU>
References: <Xns98BC97A2A5FE4chunkaiwstanfordedu@171.64.14.103> <C1D53D7F.770B%jpettit@stanford.edu>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169163656 23241 171.64.74.54 (18 Jan 2007 23:40:56 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <C1D53D7F.770B%jpettit@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:11098

It's also worth mentioning that the myth machines sometimes hang on 
login for no apparent reason- trying back in a few minutes may net a 
different result.  The bramble and hedge machines are also running x86 
Linux, if you want to try those instead.

Clay
Justin Pettit wrote:
> You're welcome to use it.  Keep in mind that the Elaines are Solaris Sparc
> machines.  We're going to be testing them on Linux x86 systems.  If you
> write properly portable code, then you won't haven any issues, but that can
> be tricky.
> 
> --Justin
> 
> 
> On 1/18/07 2:54 PM, in article
> Xns98BC97A2A5FE4chunkaiwstanfordedu@171.64.14.103, "Chun Kai Wang"
> <chunkaiw@stanford.edu> wrote:
> 
>> i can't seem to log-in properly on myth. can i use elaine?
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Submission Tarballs
Date: Thu, 18 Jan 2007 15:45:37 -0800
Lines: 7
Distribution: su
Message-ID: <eop0ua$n6m$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169164042 23766 171.64.74.54 (18 Jan 2007 23:47:22 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
Xref: shelby.stanford.edu su.class.cs244a:11099

Please make sure that you are gzipping the tar archives that you submit 
(use 'tar zcf' to create the file)- it will save you time performing the 
upload, and makes it easier for us to process the submissions in a 
batch.  Check out the sample Makefile on the assignment page if you're 
not sure how to tar up your working files.

Clay
.

Path: shelby.stanford.edu!not-for-mail
From: "David Gobaud" <gobaudd@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: How much to read()
Date: Thu, 18 Jan 2007 15:50:59 -0800
Lines: 25
Distribution: su
Message-ID: <eop15e$nek$1@news.Stanford.EDU>
References: <Pine.LNX.4.62.0701152056360.8222@xenon.Stanford.EDU> <eohufb$k3i$1@news.Stanford.EDU> <eomqct$c0v$1@news.Stanford.EDU> <eoms00$dcg$4@news.Stanford.EDU>
NNTP-Posting-Host: norad.stanford.edu
X-Trace: news.Stanford.EDU 1169164270 24020 128.12.81.44 (18 Jan 2007 23:51:10 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11100

So we shouldn't allocate a buffer of size SSIZE_MAX as it seems to be 
defined as something big (LONG_MAX) correct? Shouldn't we allocate a 
temporary read buffer in the range of something like [1024, 10240], pass 
that buffer to recv, and copy from it to the real data buffer which is 
grown/realloced as needed?

David Gobaud

"David Erickson" <derickso@stanford.edu> wrote in message 
news:eoms00$dcg$4@news.Stanford.EDU...
> Alicia Chen wrote:
>> Firstly, when I use SSIZE_MAX, it gives an "SSIZE_MAX undefined" compile 
>> error, which doesn't go away even when I include <limits.h> or 
>> <sys/limits.h>
>>
>> Also, from what I can glean, SSIZE_MAX is equivalent to INT_MAX, or 
>> something exceedingly large, and I don't really want to allocate a buffer 
>> that big.  Am I wrong on any of these points?  We can't exactly allocate 
>> a buffer that big...
>
> Check out the function realloc.
>
> -David 


.

Path: shelby.stanford.edu!not-for-mail
From: "Brian Thompson" <Brian.C.Thompson@Boeing.com>
Newsgroups: su.class.cs244a
Subject: Re: Proxy process getting stuck in read() system call
Date: Thu, 18 Jan 2007 15:52:47 -0800
Lines: 61
Distribution: su
Message-ID: <eop18i$nic$1@news.Stanford.EDU>
References: <eon2fc$j07$1@news.Stanford.EDU> <eon3ts$k8s$1@news.Stanford.EDU> <eone2e$42e$1@news.Stanford.EDU> <C1D4ED4D.76BE%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1169164371 24140 127.0.0.1 (18 Jan 2007 23:52:51 GMT)
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.2962
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:11101

Yeah, I use PUTTY to get into myth.stanford.edu and run Exceed for an X 
windows.  Should I be on something else?

--Brian

"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1D4ED4D.76BE%jpettit@stanford.edu...
> You definitely should not send three "\r\n" to indicate the end of a
> request--that's contrary to the RFC.  I just connected to www.yahoo.com 
> over
> a dozen times, and never had to hit enter more than twice.  Are you 
> running
> your tests on one of the Myths?
>
> --Justin
>
>
> On 1/18/07 1:19 AM, in article eone2e$42e$1@news.Stanford.EDU, "Brian
> Thompson" <Brian.C.Thompson@Boeing.com> wrote:
>
>> I am runninng into the same problem with my proxy, I don't get a response
>> from the server.  I show that I connect just fine using serive name of 
>> www
>> on port 80.
>>
>> As a check I have run the server.c and setup a server with a port of 
>> 8001.
>> Then I ran my proxy on 8000 and telneted to localhost 8000, sent a 
>> message
>> to localhost on port 8001, saw my message reach the server and then get a
>> response.
>>
>> I'm starting to think that there is something blocking the returns of the
>> reads.  I notice that when I do a normal telnet to www.yahoo.com 80 and 
>> then
>> GET / HTTP/1.0 I have to press enter 3 times to get the data to show.  Do 
>> I
>> need to somehow mimic this to get my proxy to read the data?
>>
>> --Brian
>>
>> "David Erickson" <derickso@stanford.edu> wrote in message
>> news:eon3ts$k8s$1@news.Stanford.EDU...
>>> Shashidhar Shashidhar wrote:
>>>> Hi,
>>>>
>>>> Sometimes I see that the proxy gets stuck in read( ) system call and
>>>> what should we do here. When can this happen and how to come out of 
>>>> this
>>>> condition.
>>>>
>>>> Thanks,
>>>> Shashidhar.
>>>
>>> reading from the client or server?
>>
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Riju Kallivalappil" <riju@stanford.edu>
Newsgroups: su.class.cs244a
Subject: valgrind errors
Date: Thu, 18 Jan 2007 16:08:15 -0800
Lines: 87
Distribution: su
Message-ID: <eop22e$oeo$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169165198 25048 127.0.0.1 (19 Jan 2007 00:06:38 GMT)
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:11102

When I run my proxy with valgrind I get the following errors. Can I ignore 
these? From what I can tell, this has nothing to do with my code

==7650== Conditional jump or move depends on uninitialised value(s)
==7650==    at 0x40104FE: (within /lib/ld-2.3.6.so)
==7650==    by 0x4006581: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C1751B: (within /lib/libc-2.3.6.so)
==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C180C9: _dl_open (in /lib/libc-2.3.6.so)
==7650==    by 0x4C19627: (within /lib/libc-2.3.6.so)
==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C196D2: __libc_dlopen_mode (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF50F1: __nss_lookup_function (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF5253: (within /lib/libc-2.3.6.so)
==7650==    by 0x4BF9E70: gethostbyname_r (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF96BE: gethostbyname (in /lib/libc-2.3.6.so)
==7650==
==7650== Conditional jump or move depends on uninitialised value(s)
==7650==    at 0x4010509: (within /lib/ld-2.3.6.so)
==7650==    by 0x4006581: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C1751B: (within /lib/libc-2.3.6.so)
==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C180C9: _dl_open (in /lib/libc-2.3.6.so)
==7650==    by 0x4C19627: (within /lib/libc-2.3.6.so)
==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C196D2: __libc_dlopen_mode (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF50F1: __nss_lookup_function (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF5253: (within /lib/libc-2.3.6.so)
==7650==    by 0x4BF9E70: gethostbyname_r (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF96BE: gethostbyname (in /lib/libc-2.3.6.so)
==7650==
==7650== Conditional jump or move depends on uninitialised value(s)
==7650==    at 0x4010514: (within /lib/ld-2.3.6.so)
==7650==    by 0x4006581: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C1751B: (within /lib/libc-2.3.6.so)
==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C180C9: _dl_open (in /lib/libc-2.3.6.so)
==7650==    by 0x4C19627: (within /lib/libc-2.3.6.so)
==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C196D2: __libc_dlopen_mode (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF50F1: __nss_lookup_function (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF5253: (within /lib/libc-2.3.6.so)
==7650==    by 0x4BF9E70: gethostbyname_r (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF96BE: gethostbyname (in /lib/libc-2.3.6.so)
==7650==
==7650== Conditional jump or move depends on uninitialised value(s)
==7650==    at 0x4010671: (within /lib/ld-2.3.6.so)
==7650==    by 0x4006718: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C1751B: (within /lib/libc-2.3.6.so)
==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C180C9: _dl_open (in /lib/libc-2.3.6.so)
==7650==    by 0x4C19627: (within /lib/libc-2.3.6.so)
==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C196D2: __libc_dlopen_mode (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF50F1: __nss_lookup_function (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF5253: (within /lib/libc-2.3.6.so)
==7650==    by 0x4BF9E70: gethostbyname_r (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF96BE: gethostbyname (in /lib/libc-2.3.6.so)
==7650==
==7650== Invalid read of size 8
==7650==    at 0x4010664: (within /lib/ld-2.3.6.so)
==7650==    by 0x40089BC: (within /lib/ld-2.3.6.so)
==7650==    by 0x4004DF3: (within /lib/ld-2.3.6.so)
==7650==    by 0x4006612: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C1751B: (within /lib/libc-2.3.6.so)
==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C180C9: _dl_open (in /lib/libc-2.3.6.so)
==7650==    by 0x4C19627: (within /lib/libc-2.3.6.so)
==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C196D2: __libc_dlopen_mode (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF50F1: __nss_lookup_function (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF5253: (within /lib/libc-2.3.6.so)
==7650==  Address 0x4D586D8 is 16 bytes inside a block of size 23 alloc'd
==7650==    at 0x4A19A16: malloc (vg_replace_malloc.c:149)
==7650==    by 0x4006A00: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C1751B: (within /lib/libc-2.3.6.so)
==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C180C9: _dl_open (in /lib/libc-2.3.6.so)
==7650==    by 0x4C19627: (within /lib/libc-2.3.6.so)
==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
==7650==    by 0x4C196D2: __libc_dlopen_mode (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF50F1: __nss_lookup_function (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF5253: (within /lib/libc-2.3.6.so)
==7650==    by 0x4BF9E70: gethostbyname_r (in /lib/libc-2.3.6.so)
==7650==    by 0x4BF96BE: gethostbyname (in /lib/libc-2.3.6.so)


.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Store-and-forward delay
Date: Thu, 18 Jan 2007 16:21:27 -0800
Lines: 7
Distribution: su
Message-ID: <eop2vq$pan$1@news.Stanford.EDU>
NNTP-Posting-Host: seine.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169166138 25943 171.64.74.36 (19 Jan 2007 00:22:18 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.8 (X11/20060911)
Xref: shelby.stanford.edu su.class.cs244a:11103

Prof. McKeown said in class that the store-and-forward delay is
negligible. But isn't that delay equal to the transmission delay? And if
we are considering the transmission delay, shouldn't we then consider
the store-and-forward delay?

Thanks,
Jad.
.

Path: shelby.stanford.edu!xenon.Stanford.EDU!ryanchen
From: Ryan Chen <ryanchen@xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Sending error code back
Date: Thu, 18 Jan 2007 16:30:07 -0800
Lines: 52
Distribution: su
Message-ID: <Pine.LNX.4.62.0701181627500.2601@xenon.Stanford.EDU>
References: <Pine.LNX.4.62.0701181504050.29823@xenon.Stanford.EDU>
 <C1D54333.771C%jpettit@stanford.edu> <Pine.LNX.4.62.0701181538530.24805@xenon.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Trace: news.Stanford.EDU 1169166608 26669 171.64.66.201 (19 Jan 2007 00:30:08 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.62.0701181538530.24805@xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11104

After reading the error output, I found the error line is caused by line 
54 in the proxy_grader.py, which is the

direct_file = urllib.urlopen(pub_urls[n])

that is failing which is telling me that it's the grader itself couldn't 
open a socket connection to a bad address that I passed in. Can someone 
tell me whether the grader script can handle a url like "http://error/", 
because it seems to me the grader script can't handle it.

On Thu, 18 Jan 2007, Ryan Chen wrote:

> Yes, I am sure iis written through, I checked the number of bytes return by 
> the write() call, and it equals the number of chars in my string.
>
> Also, what do you mean by "it doens't seem like you've written enough data to 
> require it"? What is this "required it"? Require what?
>
> Thanks.
>
>
> On Thu, 18 Jan 2007, Justin Pettit wrote:
>
>> Are you sure the write completed?  It doesn't seem like you've written
>> enough data to require it, but you may need to call write() multiple times
>> to completely send your data.
>> 
>> --Justin
>> 
>> 
>> On 1/18/07 3:08 PM, in article
>> Pine.LNX.4.62.0701181504050.29823@xenon.Stanford.EDU, "Ryan Chen"
>> <ryanchen@xenon.Stanford.EDU> wrote:
>> 
>>> For a bad request from the client, I am trying to send "HTTP/1.0 400 Bad
>>> Request\r\n\r\n" back to the client via the socket with the client, but
>>> once I close the socket, it gives me a socket error from the grader
>>> script:
>>> 
>>> IOError: [Errno socket error] (-2, 'Name or service not known')
>>> 
>>> Any clue why this is happening? If I send the message back to the client,
>>> but "don't" close the socket to the client, then this message won't
>>> appear, but the process just hangs, so it seems to me the client is still
>>> trying to read the socket somehow even though I sent a bad reqest response
>>> back......
>>> 
>>> Thanks for any answer.
>> 
>> 
>> 
>
.

Path: shelby.stanford.edu!not-for-mail
From: "Derek Schumacher" <dschumac@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Proxy process getting stuck in read() system call
Date: Thu, 18 Jan 2007 16:41:26 -0800
Lines: 85
Distribution: su
Message-ID: <eop44m$qno$1@news.Stanford.EDU>
References: <eon2fc$j07$1@news.Stanford.EDU> <eon3ts$k8s$1@news.Stanford.EDU> <eone2e$42e$1@news.Stanford.EDU> <eoo56v$qrp$1@news.Stanford.EDU> <C1D4EE4D.76C2%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1169167318 27384 127.0.0.1 (19 Jan 2007 00:41:58 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11105

For some reason I'm never seeing read() return a zero value when the number 
of bytes sent by the client and read in by read() is less than the size of 
the buffer I've supplied in the read() call.  Should I expect a single 
additional call to read() to return zero after the initial one returns a 
positive value?

Thanks,
Derek


"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1D4EE4D.76C2%jpettit@stanford.edu...
> The best way to prevent blocking is to use the system call "select" or
> "poll" to determine whether there is data to be read.  You can also mark 
> the
> socket as non-blocking.  However, you shouldn't need to do either of these
> for this assignment.
>
> As David mentioned earlier, make sure that you don't immediately try to
> read() again after getting a zero return value, otherwise you'll block.
>
> --Justin
>
>
> On 1/18/07 7:54 AM, in article eoo56v$qrp$1@news.Stanford.EDU, "Dinesh
> Gupta" <dineshg@Stanford.EDU> wrote:
>
>> Hi,
>>
>> I'm also seeing this problem when I configured firefox to use my proxy.
>> It's stuck in read while reading from the remote server(yahoo). It
>> worked fine with cnn though. So it doesn't happen always but very
>> annoying when it happens. Please let me know how to come out of this read
>> call.
>>
>> Thanks,
>> Dinesh
>>
>>
>>
>> Brian Thompson <Brian.C.Thompson@boeing.com> wrote:
>>> I am runninng into the same problem with my proxy, I don't get a 
>>> response
>>> from the server.  I show that I connect just fine using serive name of 
>>> www
>>> on port 80.
>>
>>> As a check I have run the server.c and setup a server with a port of 
>>> 8001.
>>> Then I ran my proxy on 8000 and telneted to localhost 8000, sent a 
>>> message
>>> to localhost on port 8001, saw my message reach the server and then get 
>>> a
>>> response.
>>
>>> I'm starting to think that there is something blocking the returns of 
>>> the
>>> reads.  I notice that when I do a normal telnet to www.yahoo.com 80 and 
>>> then
>>> GET / HTTP/1.0 I have to press enter 3 times to get the data to show. 
>>> Do I
>>> need to somehow mimic this to get my proxy to read the data?
>>
>>> --Brian
>>
>>> "David Erickson" <derickso@stanford.edu> wrote in message
>>> news:eon3ts$k8s$1@news.Stanford.EDU...
>>>> Shashidhar Shashidhar wrote:
>>>>> Hi,
>>>>>
>>>>> Sometimes I see that the proxy gets stuck in read( ) system call and
>>>>> what should we do here. When can this happen and how to come out of 
>>>>> this
>>>>> condition.
>>>>>
>>>>> Thanks,
>>>>> Shashidhar.
>>>>
>>>> reading from the client or server?
>>
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Sending error code back
Date: Thu, 18 Jan 2007 16:46:28 -0800
Lines: 65
Distribution: su
Message-ID: <eop4gd$qo0$1@news.Stanford.EDU>
References: <Pine.LNX.4.62.0701181504050.29823@xenon.Stanford.EDU> <C1D54333.771C%jpettit@stanford.edu> <Pine.LNX.4.62.0701181538530.24805@xenon.Stanford.EDU> <Pine.LNX.4.62.0701181627500.2601@xenon.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169167693 27392 171.64.74.54 (19 Jan 2007 00:48:13 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <Pine.LNX.4.62.0701181627500.2601@xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11106

No- the script is expecting that the URLs in the URL array will be valid 
hosts.  The script that was posted will likely do something odd or break 
if a non-existant host is added to the URL list.

Clay

Ryan Chen wrote:
> After reading the error output, I found the error line is caused by line 
> 54 in the proxy_grader.py, which is the
> 
> direct_file = urllib.urlopen(pub_urls[n])
> 
> that is failing which is telling me that it's the grader itself couldn't 
> open a socket connection to a bad address that I passed in. Can someone 
> tell me whether the grader script can handle a url like "http://error/", 
> because it seems to me the grader script can't handle it.
> 
> On Thu, 18 Jan 2007, Ryan Chen wrote:
> 
>> Yes, I am sure iis written through, I checked the number of bytes 
>> return by the write() call, and it equals the number of chars in my 
>> string.
>>
>> Also, what do you mean by "it doens't seem like you've written enough 
>> data to require it"? What is this "required it"? Require what?
>>
>> Thanks.
>>
>>
>> On Thu, 18 Jan 2007, Justin Pettit wrote:
>>
>>> Are you sure the write completed?  It doesn't seem like you've written
>>> enough data to require it, but you may need to call write() multiple 
>>> times
>>> to completely send your data.
>>>
>>> --Justin
>>>
>>>
>>> On 1/18/07 3:08 PM, in article
>>> Pine.LNX.4.62.0701181504050.29823@xenon.Stanford.EDU, "Ryan Chen"
>>> <ryanchen@xenon.Stanford.EDU> wrote:
>>>
>>>> For a bad request from the client, I am trying to send "HTTP/1.0 400 
>>>> Bad
>>>> Request\r\n\r\n" back to the client via the socket with the client, but
>>>> once I close the socket, it gives me a socket error from the grader
>>>> script:
>>>>
>>>> IOError: [Errno socket error] (-2, 'Name or service not known')
>>>>
>>>> Any clue why this is happening? If I send the message back to the 
>>>> client,
>>>> but "don't" close the socket to the client, then this message won't
>>>> appear, but the process just hangs, so it seems to me the client is 
>>>> still
>>>> trying to read the socket somehow even though I sent a bad reqest 
>>>> response
>>>> back......
>>>>
>>>> Thanks for any answer.
>>>
>>>
>>>
>>
.

Path: shelby.stanford.edu!not-for-mail
From: "Jin Wang" <jinwang@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Parsing response
Date: Fri, 19 Jan 2007 01:02:17 -0500
Lines: 13
Distribution: su
Message-ID: <eop5cs$s09$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169168604 28681 127.0.0.1 (19 Jan 2007 01:03:24 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
Xref: shelby.stanford.edu su.class.cs244a:11107

How much parsing/validation of the response from a web server is necessary?

1) Do we need to check syntax of the status line and headers?
2) To whom (client or server or both) do we issue the error messages?
3) What should the error codes be?

Also, what phone number can remote SCPD students use to reach TA's during
office hours?

Thanks,
Jin


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Sending error code back
Date: Thu, 18 Jan 2007 17:09:30 -0800
Lines: 51
Distribution: su
Message-ID: <C1D55A4A.7736%jpettit@stanford.edu>
References: <Pine.LNX.4.62.0701181504050.29823@xenon.Stanford.EDU> <C1D54333.771C%jpettit@stanford.edu> <Pine.LNX.4.62.0701181538530.24805@xenon.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169168971 28855 127.0.0.1 (19 Jan 2007 01:09:31 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Sending error code back
Thread-Index: Acc7ZnijtynjCKdZEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11108

I meant that you hadn't written very much data, so it's unlikely you
wouldn't be able to send it in one call to write().

--Justin


On 1/18/07 3:40 PM, in article
Pine.LNX.4.62.0701181538530.24805@xenon.Stanford.EDU, "Ryan Chen"
<ryanchen@xenon.Stanford.EDU> wrote:

> Yes, I am sure iis written through, I checked the number of bytes return
> by the write() call, and it equals the number of chars in my string.
> 
> Also, what do you mean by "it doens't seem like you've written enough data
> to require it"? What is this "required it"? Require what?
> 
> Thanks.
> 
> 
> On Thu, 18 Jan 2007, Justin Pettit wrote:
> 
>> Are you sure the write completed?  It doesn't seem like you've written
>> enough data to require it, but you may need to call write() multiple times
>> to completely send your data.
>> 
>> --Justin
>> 
>> 
>> On 1/18/07 3:08 PM, in article
>> Pine.LNX.4.62.0701181504050.29823@xenon.Stanford.EDU, "Ryan Chen"
>> <ryanchen@xenon.Stanford.EDU> wrote:
>> 
>>> For a bad request from the client, I am trying to send "HTTP/1.0 400 Bad
>>> Request\r\n\r\n" back to the client via the socket with the client, but
>>> once I close the socket, it gives me a socket error from the grader
>>> script:
>>> 
>>> IOError: [Errno socket error] (-2, 'Name or service not known')
>>> 
>>> Any clue why this is happening? If I send the message back to the client,
>>> but "don't" close the socket to the client, then this message won't
>>> appear, but the process just hangs, so it seems to me the client is still
>>> trying to read the socket somehow even though I sent a bad reqest response
>>> back......
>>> 
>>> Thanks for any answer.
>> 
>> 
>> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: How much to read()
Date: Thu, 18 Jan 2007 17:11:45 -0800
Lines: 36
Distribution: su
Message-ID: <C1D55AD1.7737%jpettit@stanford.edu>
References: <Pine.LNX.4.62.0701152056360.8222@xenon.Stanford.EDU> <eohufb$k3i$1@news.Stanford.EDU> <eomqct$c0v$1@news.Stanford.EDU> <eoms00$dcg$4@news.Stanford.EDU> <eop15e$nek$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169169108 29225 127.0.0.1 (19 Jan 2007 01:11:48 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: How much to read()
Thread-Index: Acc7ZskaB4FgYadaEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11109

Yes, growing a buffer is a good strategy.  Definitely don't just allocate an
SSIZE_MAX buffer right off the bat.

--Justin


On 1/18/07 3:50 PM, in article eop15e$nek$1@news.Stanford.EDU, "David
Gobaud" <gobaudd@stanford.edu> wrote:

> So we shouldn't allocate a buffer of size SSIZE_MAX as it seems to be
> defined as something big (LONG_MAX) correct? Shouldn't we allocate a
> temporary read buffer in the range of something like [1024, 10240], pass
> that buffer to recv, and copy from it to the real data buffer which is
> grown/realloced as needed?
> 
> David Gobaud
> 
> "David Erickson" <derickso@stanford.edu> wrote in message
> news:eoms00$dcg$4@news.Stanford.EDU...
>> Alicia Chen wrote:
>>> Firstly, when I use SSIZE_MAX, it gives an "SSIZE_MAX undefined" compile
>>> error, which doesn't go away even when I include <limits.h> or
>>> <sys/limits.h>
>>> 
>>> Also, from what I can glean, SSIZE_MAX is equivalent to INT_MAX, or
>>> something exceedingly large, and I don't really want to allocate a buffer
>>> that big.  Am I wrong on any of these points?  We can't exactly allocate
>>> a buffer that big...
>> 
>> Check out the function realloc.
>> 
>> -David 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Proxy process getting stuck in read() system call
Date: Thu, 18 Jan 2007 17:36:27 -0800
Lines: 72
Distribution: su
Message-ID: <C1D5609B.773D%jpettit@stanford.edu>
References: <eon2fc$j07$1@news.Stanford.EDU> <eon3ts$k8s$1@news.Stanford.EDU> <eone2e$42e$1@news.Stanford.EDU> <C1D4ED4D.76BE%jpettit@stanford.edu> <eop18i$nic$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169170592 423 127.0.0.1 (19 Jan 2007 01:36:32 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Proxy process getting stuck in read() system call
Thread-Index: Acc7ajxxeyVlK6ddEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11110

The Myths are the best systems to do your work on, since I think that's
where we're going to do the grading.

--Justin


On 1/18/07 3:52 PM, in article eop18i$nic$1@news.Stanford.EDU, "Brian
Thompson" <Brian.C.Thompson@Boeing.com> wrote:

> Yeah, I use PUTTY to get into myth.stanford.edu and run Exceed for an X
> windows.  Should I be on something else?
> 
> --Brian
> 
> "Justin Pettit" <jpettit@stanford.edu> wrote in message
> news:C1D4ED4D.76BE%jpettit@stanford.edu...
>> You definitely should not send three "\r\n" to indicate the end of a
>> request--that's contrary to the RFC.  I just connected to www.yahoo.com
>> over
>> a dozen times, and never had to hit enter more than twice.  Are you
>> running
>> your tests on one of the Myths?
>> 
>> --Justin
>> 
>> 
>> On 1/18/07 1:19 AM, in article eone2e$42e$1@news.Stanford.EDU, "Brian
>> Thompson" <Brian.C.Thompson@Boeing.com> wrote:
>> 
>>> I am runninng into the same problem with my proxy, I don't get a response
>>> from the server.  I show that I connect just fine using serive name of
>>> www
>>> on port 80.
>>> 
>>> As a check I have run the server.c and setup a server with a port of
>>> 8001.
>>> Then I ran my proxy on 8000 and telneted to localhost 8000, sent a
>>> message
>>> to localhost on port 8001, saw my message reach the server and then get a
>>> response.
>>> 
>>> I'm starting to think that there is something blocking the returns of the
>>> reads.  I notice that when I do a normal telnet to www.yahoo.com 80 and
>>> then
>>> GET / HTTP/1.0 I have to press enter 3 times to get the data to show.  Do
>>> I
>>> need to somehow mimic this to get my proxy to read the data?
>>> 
>>> --Brian
>>> 
>>> "David Erickson" <derickso@stanford.edu> wrote in message
>>> news:eon3ts$k8s$1@news.Stanford.EDU...
>>>> Shashidhar Shashidhar wrote:
>>>>> Hi,
>>>>> 
>>>>> Sometimes I see that the proxy gets stuck in read( ) system call and
>>>>> what should we do here. When can this happen and how to come out of
>>>>> this
>>>>> condition.
>>>>> 
>>>>> Thanks,
>>>>> Shashidhar.
>>>> 
>>>> reading from the client or server?
>>> 
>>> 
>> 
>> 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Proxy process getting stuck in read() system call
Date: Thu, 18 Jan 2007 17:39:28 -0800
Lines: 96
Distribution: su
Message-ID: <C1D56150.773F%jpettit@stanford.edu>
References: <eon2fc$j07$1@news.Stanford.EDU> <eon3ts$k8s$1@news.Stanford.EDU> <eone2e$42e$1@news.Stanford.EDU> <eoo56v$qrp$1@news.Stanford.EDU> <C1D4EE4D.76C2%jpettit@stanford.edu> <eop44m$qno$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169170771 563 127.0.0.1 (19 Jan 2007 01:39:31 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Proxy process getting stuck in read() system call
Thread-Index: Acc7aqhU5vqNLKddEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11111

Yes, you should keep calling read() until you receive a 0 (no more data) or
a -1 (there was an error).

--Justin


On 1/18/07 4:41 PM, in article eop44m$qno$1@news.Stanford.EDU, "Derek
Schumacher" <dschumac@stanford.edu> wrote:

> For some reason I'm never seeing read() return a zero value when the number
> of bytes sent by the client and read in by read() is less than the size of
> the buffer I've supplied in the read() call.  Should I expect a single
> additional call to read() to return zero after the initial one returns a
> positive value?
> 
> Thanks,
> Derek
> 
> 
> "Justin Pettit" <jpettit@stanford.edu> wrote in message
> news:C1D4EE4D.76C2%jpettit@stanford.edu...
>> The best way to prevent blocking is to use the system call "select" or
>> "poll" to determine whether there is data to be read.  You can also mark
>> the
>> socket as non-blocking.  However, you shouldn't need to do either of these
>> for this assignment.
>> 
>> As David mentioned earlier, make sure that you don't immediately try to
>> read() again after getting a zero return value, otherwise you'll block.
>> 
>> --Justin
>> 
>> 
>> On 1/18/07 7:54 AM, in article eoo56v$qrp$1@news.Stanford.EDU, "Dinesh
>> Gupta" <dineshg@Stanford.EDU> wrote:
>> 
>>> Hi,
>>> 
>>> I'm also seeing this problem when I configured firefox to use my proxy.
>>> It's stuck in read while reading from the remote server(yahoo). It
>>> worked fine with cnn though. So it doesn't happen always but very
>>> annoying when it happens. Please let me know how to come out of this read
>>> call.
>>> 
>>> Thanks,
>>> Dinesh
>>> 
>>> 
>>> 
>>> Brian Thompson <Brian.C.Thompson@boeing.com> wrote:
>>>> I am runninng into the same problem with my proxy, I don't get a
>>>> response
>>>> from the server.  I show that I connect just fine using serive name of
>>>> www
>>>> on port 80.
>>> 
>>>> As a check I have run the server.c and setup a server with a port of
>>>> 8001.
>>>> Then I ran my proxy on 8000 and telneted to localhost 8000, sent a
>>>> message
>>>> to localhost on port 8001, saw my message reach the server and then get
>>>> a
>>>> response.
>>> 
>>>> I'm starting to think that there is something blocking the returns of
>>>> the
>>>> reads.  I notice that when I do a normal telnet to www.yahoo.com 80 and
>>>> then
>>>> GET / HTTP/1.0 I have to press enter 3 times to get the data to show.
>>>> Do I
>>>> need to somehow mimic this to get my proxy to read the data?
>>> 
>>>> --Brian
>>> 
>>>> "David Erickson" <derickso@stanford.edu> wrote in message
>>>> news:eon3ts$k8s$1@news.Stanford.EDU...
>>>>> Shashidhar Shashidhar wrote:
>>>>>> Hi,
>>>>>> 
>>>>>> Sometimes I see that the proxy gets stuck in read( ) system call and
>>>>>> what should we do here. When can this happen and how to come out of
>>>>>> this
>>>>>> condition.
>>>>>> 
>>>>>> Thanks,
>>>>>> Shashidhar.
>>>>> 
>>>>> reading from the client or server?
>>> 
>>> 
>> 
>> 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: valgrind errors
Date: Thu, 18 Jan 2007 17:58:18 -0800
Lines: 98
Distribution: su
Message-ID: <C1D565BA.7740%jpettit@stanford.edu>
References: <eop22e$oeo$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169171902 1586 127.0.0.1 (19 Jan 2007 01:58:22 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: valgrind errors
Thread-Index: Acc7bUnciG3jvadgEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11112

Those are fine.  You can probably switch to gethotbyname_r to make them go
away, but we won't ding you for them.

--Justin


On 1/18/07 4:08 PM, in article eop22e$oeo$1@news.Stanford.EDU, "Riju
Kallivalappil" <riju@stanford.edu> wrote:

> When I run my proxy with valgrind I get the following errors. Can I ignore
> these? From what I can tell, this has nothing to do with my code
> 
> ==7650== Conditional jump or move depends on uninitialised value(s)
> ==7650==    at 0x40104FE: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4006581: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C1751B: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C180C9: _dl_open (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4C19627: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C196D2: __libc_dlopen_mode (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF50F1: __nss_lookup_function (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF5253: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF9E70: gethostbyname_r (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF96BE: gethostbyname (in /lib/libc-2.3.6.so)
> ==7650==
> ==7650== Conditional jump or move depends on uninitialised value(s)
> ==7650==    at 0x4010509: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4006581: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C1751B: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C180C9: _dl_open (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4C19627: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C196D2: __libc_dlopen_mode (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF50F1: __nss_lookup_function (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF5253: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF9E70: gethostbyname_r (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF96BE: gethostbyname (in /lib/libc-2.3.6.so)
> ==7650==
> ==7650== Conditional jump or move depends on uninitialised value(s)
> ==7650==    at 0x4010514: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4006581: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C1751B: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C180C9: _dl_open (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4C19627: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C196D2: __libc_dlopen_mode (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF50F1: __nss_lookup_function (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF5253: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF9E70: gethostbyname_r (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF96BE: gethostbyname (in /lib/libc-2.3.6.so)
> ==7650==
> ==7650== Conditional jump or move depends on uninitialised value(s)
> ==7650==    at 0x4010671: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4006718: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C1751B: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C180C9: _dl_open (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4C19627: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C196D2: __libc_dlopen_mode (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF50F1: __nss_lookup_function (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF5253: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF9E70: gethostbyname_r (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF96BE: gethostbyname (in /lib/libc-2.3.6.so)
> ==7650==
> ==7650== Invalid read of size 8
> ==7650==    at 0x4010664: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x40089BC: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4004DF3: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4006612: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C1751B: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C180C9: _dl_open (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4C19627: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C196D2: __libc_dlopen_mode (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF50F1: __nss_lookup_function (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF5253: (within /lib/libc-2.3.6.so)
> ==7650==  Address 0x4D586D8 is 16 bytes inside a block of size 23 alloc'd
> ==7650==    at 0x4A19A16: malloc (vg_replace_malloc.c:149)
> ==7650==    by 0x4006A00: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C1751B: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C180C9: _dl_open (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4C19627: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x400B13F: (within /lib/ld-2.3.6.so)
> ==7650==    by 0x4C196D2: __libc_dlopen_mode (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF50F1: __nss_lookup_function (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF5253: (within /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF9E70: gethostbyname_r (in /lib/libc-2.3.6.so)
> ==7650==    by 0x4BF96BE: gethostbyname (in /lib/libc-2.3.6.so)
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Parsing response
Date: Thu, 18 Jan 2007 18:04:36 -0800
Lines: 24
Distribution: su
Message-ID: <C1D56734.7745%jpettit@stanford.edu>
References: <eop5cs$s09$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169172284 2026 127.0.0.1 (19 Jan 2007 02:04:45 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Parsing response
Thread-Index: Acc7bisqaZjEMqdhEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11113

> 1) Do we need to check syntax of the status line and headers?

See my post from earlier today titled "Re: Parsing request".

> 2) To whom (client or server or both) do we issue the error messages?

You only need to return error messages to the client.  There isn't really a
way to send error messages to the server.

> 3) What should the error codes be?

Look through the RFC.  Focus on 400 and 500.
 
> Also, what phone number can remote SCPD students use to reach TA's during
> office hours?

We're trying to figure that out, since we don't have phone service in the
labs.  If you're in the area, I tried to position my office hours so that
they'd be usable by SCPD students.

--Justin
 


.

Path: shelby.stanford.edu!not-for-mail
From: "Riju Kallivalappil" <riju@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Submission
Date: Thu, 18 Jan 2007 18:22:17 -0800
Lines: 28
Distribution: su
Message-ID: <eop9u2$2q3$1@news.Stanford.EDU>
References: <eoogd8$8kk$1@news.Stanford.EDU> <eoolvc$dei$1@news.Stanford.EDU> <eooof8$frb$1@news.Stanford.EDU> <eooto3$kb9$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169173250 2883 127.0.0.1 (19 Jan 2007 02:20:50 GMT)
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:11114

I too am getting the same error. Is there any other way to submit the 
tarball?

"Clay Collier" <ccollier@stanford.edu> wrote in message 
news:eooto3$kb9$1@news.Stanford.EDU...
> Try clearing your browser cache and trying the link again.  Also, make 
> sure that your browser is accepting cookies from both webauth.stanford.edu 
> and www.stanford.edu.
>
> Clay
>
> Alex wrote:
>> After I authenticate I see this issue.
>>
>> "Clay Collier" <ccollier@stanford.edu> wrote in message 
>> news:eoolvc$dei$1@news.Stanford.EDU...
>>> Alex wrote:
>>>> When I tried to submit the web proxy on the course website I get "You 
>>>> do not have permission to access the requested directory." Why is this 
>>>> happening?
>>> Are you seeing this error as soon as you click on the 'Submit an 
>>> Assignment' link from the front page, or only after you press the submit 
>>> button on the submissions page?  Are you able to authenticate with 
>>> WebAuth?
>>>
>>> Clay
>> 

.

Path: shelby.stanford.edu!not-for-mail
From: Yuliya Sarkisyan <yuliya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Do we need to handle simple request/response?
Date: Thu, 18 Jan 2007 18:31:52 -0800
Lines: 1
Distribution: su
Message-ID: <eopaiu$33r$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169173918 3195 127.0.0.1 (19 Jan 2007 02:31:58 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
Xref: shelby.stanford.edu su.class.cs244a:11115

Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Do we need to handle simple request/response?
Date: Thu, 18 Jan 2007 18:39:09 -0800
Lines: 11
Distribution: su
Message-ID: <C1D56F4D.7750%jpettit@stanford.edu>
References: <eopaiu$33r$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169174353 3846 127.0.0.1 (19 Jan 2007 02:39:13 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Do we need to handle simple request/response?
Thread-Index: Acc7cv7FPVWkVadmEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11116

Yes, you need to support HTTP/1.0 as defined in the RFC.

--Justin


On 1/18/07 6:31 PM, in article eopaiu$33r$2@news.Stanford.EDU, "Yuliya
Sarkisyan" <yuliya@stanford.edu> wrote:

> Thanks.


.

Path: shelby.stanford.edu!not-for-mail
From: Chun Kai Wang <chunkaiw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ANSI C struct?
Date: Fri, 19 Jan 2007 03:29:42 +0000 (UTC)
Organization: Your Company
Lines: 11
Distribution: su
Message-ID: <Xns98BCC651F8D7chunkaiwstanfordedu@171.64.14.103>
NNTP-Posting-Host: rescomp-06-59601.stanford.edu
X-Trace: news.Stanford.EDU 1169177382 6494 128.12.22.217 (19 Jan 2007 03:29:42 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Xnews/5.04.25
Xref: shelby.stanford.edu su.class.cs244a:11117

is there struct in ANSI C???

i have 


proxy.c:12: error: 'proxyServerSide_t' undeclared (first use in this 
function)

even though i did declare it right before main.


.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: what's going on???? // = error?
Date: Thu, 18 Jan 2007 19:51:55 -0800
Lines: 42
Distribution: su
Message-ID: <eopf7i$7ra$1@news.Stanford.EDU>
References: <Xns98BC9BF29A199chunkaiwstanfordedu@171.64.14.103> <C1D5415D.7716%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1169178674 8042 127.0.0.1 (19 Jan 2007 03:51:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11118

It is because of the -ansi (which is a requirement of the project).  I have 
heard that // comments were a part of C99 (and, also exciting, that scoped 
variables might join C sometime in the 21st century); however, gcc acts like 
it does not.

Sincerely,
Randy Jennings

The squirrels are your friends!
"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1D5415D.7716%jpettit@stanford.edu...
> That's a C++ comment.  Try this:
>
>    int x;  /* x */
>
> Some compilers are sticklers about the C code using C++ comments.
>
> --Justin
>
>
> On 1/18/07 3:19 PM, in article
> Xns98BC9BF29A199chunkaiwstanfordedu@171.64.14.103, "Chun Kai Wang"
> <chunkaiw@stanford.edu> wrote:
>
>> i'm going crazy...
>>
>> all i have is
>>
>> void main()
>> {
>> int x;     //x
>> }
>>
>> and this doesn't compile.
>>
>> but if i remove "//x" it compiles just fine...
>>
>> i'm using myth
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ANSI C struct?
Date: Thu, 18 Jan 2007 19:59:21 -0800
Lines: 43
Distribution: su
Message-ID: <eopflh$86g$1@news.Stanford.EDU>
References: <Xns98BCC651F8D7chunkaiwstanfordedu@171.64.14.103>
X-Trace: news.Stanford.EDU 1169179121 8400 127.0.0.1 (19 Jan 2007 03:58:42 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11119

Both enums and structs have to be preceded with their type qualifiers (they 
are like namespace identifiers).
IOW, with
struct Fred_ {
    int toes;
    int fingers;
};

You have to declare an instance of Fred_ like so:
struct Fred_ dishwasher;

If you do a typedef (typedef Fred_ Fred) you do not need 'struct' preceding 
the instance declaration.

That is why you commonly see:
typedef struct Fred_ {
    int toes;
    int fingers;
} Fred;
in C code.

It is so common, C++ removed the requirement.

Sincerely,
Randy Jennings

The squirrels are your friends!

"Chun Kai Wang" <chunkaiw@stanford.edu> wrote in message 
news:Xns98BCC651F8D7chunkaiwstanfordedu@171.64.14.103...
> is there struct in ANSI C???
>
> i have
>
>
> proxy.c:12: error: 'proxyServerSide_t' undeclared (first use in this
> function)
>
> even though i did declare it right before main.
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: How much to read()
Date: Thu, 18 Jan 2007 20:04:27 -0800
Lines: 55
Distribution: su
Message-ID: <eopfv3$8hl$1@news.Stanford.EDU>
References: <Pine.LNX.4.62.0701152056360.8222@xenon.Stanford.EDU> <eohufb$k3i$1@news.Stanford.EDU> <eomqct$c0v$1@news.Stanford.EDU> <eoms00$dcg$4@news.Stanford.EDU> <eop15e$nek$1@news.Stanford.EDU> <C1D55AD1.7737%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1169179427 8757 127.0.0.1 (19 Jan 2007 04:03:47 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11120

Actually, growing the buffer is not a good strategy, but it is probably 
acceptable within the constraints of the problem.  It can lead to horrible 
fragmentation of memory, and is a performance penalty.  Picking a fixed size 
and relaying chunks (cut-through proxying :-) ) is a much better approach 
(not required by the assignment)!

Sincerely,
Randy Jennings

The squirrels are your friends!

"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1D55AD1.7737%jpettit@stanford.edu...
> Yes, growing a buffer is a good strategy.  Definitely don't just allocate 
> an
> SSIZE_MAX buffer right off the bat.
>
> --Justin
>
>
> On 1/18/07 3:50 PM, in article eop15e$nek$1@news.Stanford.EDU, "David
> Gobaud" <gobaudd@stanford.edu> wrote:
>
>> So we shouldn't allocate a buffer of size SSIZE_MAX as it seems to be
>> defined as something big (LONG_MAX) correct? Shouldn't we allocate a
>> temporary read buffer in the range of something like [1024, 10240], pass
>> that buffer to recv, and copy from it to the real data buffer which is
>> grown/realloced as needed?
>>
>> David Gobaud
>>
>> "David Erickson" <derickso@stanford.edu> wrote in message
>> news:eoms00$dcg$4@news.Stanford.EDU...
>>> Alicia Chen wrote:
>>>> Firstly, when I use SSIZE_MAX, it gives an "SSIZE_MAX undefined" 
>>>> compile
>>>> error, which doesn't go away even when I include <limits.h> or
>>>> <sys/limits.h>
>>>>
>>>> Also, from what I can glean, SSIZE_MAX is equivalent to INT_MAX, or
>>>> something exceedingly large, and I don't really want to allocate a 
>>>> buffer
>>>> that big.  Am I wrong on any of these points?  We can't exactly 
>>>> allocate
>>>> a buffer that big...
>>>
>>> Check out the function realloc.
>>>
>>> -David
>>
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Chun Kai Wang <chunkaiw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ANSI C struct?
Date: Fri, 19 Jan 2007 04:15:48 +0000 (UTC)
Organization: Your Company
Lines: 1
Distribution: su
Message-ID: <Xns98BCCE22EE318chunkaiwstanfordedu@171.64.14.103>
References: <Xns98BCC651F8D7chunkaiwstanfordedu@171.64.14.103> <eopflh$86g$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-59601.stanford.edu
X-Trace: news.Stanford.EDU 1169180148 9259 128.12.22.217 (19 Jan 2007 04:15:48 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Xnews/5.04.25
Xref: shelby.stanford.edu su.class.cs244a:11121

perfect. thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: "Derek Schumacher" <dschumac@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Proxy process getting stuck in read() system call
Date: Thu, 18 Jan 2007 20:20:15 -0800
Lines: 115
Distribution: su
Message-ID: <eopgut$9hf$1@news.Stanford.EDU>
References: <eon2fc$j07$1@news.Stanford.EDU> <eon3ts$k8s$1@news.Stanford.EDU> <eone2e$42e$1@news.Stanford.EDU> <eoo56v$qrp$1@news.Stanford.EDU> <C1D4EE4D.76C2%jpettit@stanford.edu> <eop44m$qno$1@news.Stanford.EDU> <C1D56150.773F%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1169180445 9775 127.0.0.1 (19 Jan 2007 04:20:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11122

Any reason why I may not be seeing this happen?  I'm reasonably sure I'm 
only doing two calls to read, one that returns the number of bytes read 
initially (a non-zero positive number) and the second one which appears to 
block.

Thanks,
Derek

"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1D56150.773F%jpettit@stanford.edu...
> Yes, you should keep calling read() until you receive a 0 (no more data) 
> or
> a -1 (there was an error).
>
> --Justin
>
>
> On 1/18/07 4:41 PM, in article eop44m$qno$1@news.Stanford.EDU, "Derek
> Schumacher" <dschumac@stanford.edu> wrote:
>
>> For some reason I'm never seeing read() return a zero value when the 
>> number
>> of bytes sent by the client and read in by read() is less than the size 
>> of
>> the buffer I've supplied in the read() call.  Should I expect a single
>> additional call to read() to return zero after the initial one returns a
>> positive value?
>>
>> Thanks,
>> Derek
>>
>>
>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>> news:C1D4EE4D.76C2%jpettit@stanford.edu...
>>> The best way to prevent blocking is to use the system call "select" or
>>> "poll" to determine whether there is data to be read.  You can also mark
>>> the
>>> socket as non-blocking.  However, you shouldn't need to do either of 
>>> these
>>> for this assignment.
>>>
>>> As David mentioned earlier, make sure that you don't immediately try to
>>> read() again after getting a zero return value, otherwise you'll block.
>>>
>>> --Justin
>>>
>>>
>>> On 1/18/07 7:54 AM, in article eoo56v$qrp$1@news.Stanford.EDU, "Dinesh
>>> Gupta" <dineshg@Stanford.EDU> wrote:
>>>
>>>> Hi,
>>>>
>>>> I'm also seeing this problem when I configured firefox to use my proxy.
>>>> It's stuck in read while reading from the remote server(yahoo). It
>>>> worked fine with cnn though. So it doesn't happen always but very
>>>> annoying when it happens. Please let me know how to come out of this 
>>>> read
>>>> call.
>>>>
>>>> Thanks,
>>>> Dinesh
>>>>
>>>>
>>>>
>>>> Brian Thompson <Brian.C.Thompson@boeing.com> wrote:
>>>>> I am runninng into the same problem with my proxy, I don't get a
>>>>> response
>>>>> from the server.  I show that I connect just fine using serive name of
>>>>> www
>>>>> on port 80.
>>>>
>>>>> As a check I have run the server.c and setup a server with a port of
>>>>> 8001.
>>>>> Then I ran my proxy on 8000 and telneted to localhost 8000, sent a
>>>>> message
>>>>> to localhost on port 8001, saw my message reach the server and then 
>>>>> get
>>>>> a
>>>>> response.
>>>>
>>>>> I'm starting to think that there is something blocking the returns of
>>>>> the
>>>>> reads.  I notice that when I do a normal telnet to www.yahoo.com 80 
>>>>> and
>>>>> then
>>>>> GET / HTTP/1.0 I have to press enter 3 times to get the data to show.
>>>>> Do I
>>>>> need to somehow mimic this to get my proxy to read the data?
>>>>
>>>>> --Brian
>>>>
>>>>> "David Erickson" <derickso@stanford.edu> wrote in message
>>>>> news:eon3ts$k8s$1@news.Stanford.EDU...
>>>>>> Shashidhar Shashidhar wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> Sometimes I see that the proxy gets stuck in read( ) system call and
>>>>>>> what should we do here. When can this happen and how to come out of
>>>>>>> this
>>>>>>> condition.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Shashidhar.
>>>>>>
>>>>>> reading from the client or server?
>>>>
>>>>
>>>
>>>
>>
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Chun Kai Wang <chunkaiw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: inet_aton
Date: Fri, 19 Jan 2007 05:57:41 +0000 (UTC)
Organization: Your Company
Lines: 12
Distribution: su
Message-ID: <Xns98BCDF68FC373chunkaiwstanfordedu@171.64.14.103>
NNTP-Posting-Host: rescomp-06-59601.stanford.edu
X-Trace: news.Stanford.EDU 1169186261 13898 128.12.22.217 (19 Jan 2007 05:57:41 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Xnews/5.04.25
Xref: shelby.stanford.edu su.class.cs244a:11123

i have:

inet_aton("209.131.36.158", &(proxyClient.serverAddr.sin_addr) );

printf(inet_ntoa(proxyClient.serverAddr.sin_addr)); 



but it prints 209.131.36.1580


why? where did the extra 0 come from?
.

Path: shelby.stanford.edu!not-for-mail
From: Chun Kai Wang <chunkaiw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: proxy.c:40: warning: implicit declaration of function
Date: Fri, 19 Jan 2007 06:45:09 +0000 (UTC)
Organization: Your Company
Lines: 10
Distribution: su
Message-ID: <Xns98BCE7752A0A2chunkaiwstanfordedu@171.64.14.103>
NNTP-Posting-Host: rescomp-06-59601.stanford.edu
X-Trace: news.Stanford.EDU 1169189109 16173 128.12.22.217 (19 Jan 2007 06:45:09 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Xnews/5.04.25
Xref: shelby.stanford.edu su.class.cs244a:11124

anyone know how to solve: 


proxy.c:40: warning: implicit declaration of function 'read'
proxy.c:47: warning: implicit declaration of function 'bzero'
proxy.c:50: warning: implicit declaration of function 'inet_aton'
proxy.c:51: warning: implicit declaration of function 'memset'


? thanks : )
.

Path: shelby.stanford.edu!paun
From: Filip Paun <paun@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Question on Referencing
Date: Thu, 18 Jan 2007 23:11:32 -0800
Lines: 7
Distribution: su
Message-ID: <paun-071956.23113218012007@nntp.stanford.edu>
NNTP-Posting-Host: zosomac.stanford.edu
X-Trace: news.Stanford.EDU 1169190693 17510 128.12.135.184 (19 Jan 2007 07:11:33 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: MT-NewsWatcher/3.5.2 (Intel Mac OS X)
Xref: shelby.stanford.edu su.class.cs244a:11125

 I have code that looks very similar to the code presented in one of the 
books as well as the referenced website, and i would like to acknowledge 
this code 'inspiration'.  On top of this, i have talked about the high 
level project issues with other classmates.  

 Just to make sure, the specifics of the above need to go in our README, 
correct?
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: inet_aton
Date: Thu, 18 Jan 2007 23:15:40 -0800
Lines: 23
Distribution: su
Message-ID: <C1D5B01C.7784%jpettit@stanford.edu>
References: <Xns98BCDF68FC373chunkaiwstanfordedu@171.64.14.103>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169190942 18012 127.0.0.1 (19 Jan 2007 07:15:42 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: inet_aton
Thread-Index: Acc7mZ/G3hmqnqeMEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11126

I don't know.  I couldn't reproduce on the Myths.

--Justin


On 1/18/07 9:57 PM, in article
Xns98BCDF68FC373chunkaiwstanfordedu@171.64.14.103, "Chun Kai Wang"
<chunkaiw@stanford.edu> wrote:

> i have:
> 
> inet_aton("209.131.36.158", &(proxyClient.serverAddr.sin_addr) );
> 
> printf(inet_ntoa(proxyClient.serverAddr.sin_addr));
> 
> 
> 
> but it prints 209.131.36.1580
> 
> 
> why? where did the extra 0 come from?


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on Referencing
Date: Thu, 18 Jan 2007 23:20:54 -0800
Lines: 20
Distribution: su
Message-ID: <C1D5B156.778A%jpettit@stanford.edu>
References: <paun-071956.23113218012007@nntp.stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169191257 18245 127.0.0.1 (19 Jan 2007 07:20:57 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Question on Referencing
Thread-Index: Acc7mlrvmW7W+qeNEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11127

Yes, that's exactly where it should go.  I would recommend mentioning your
"inspiration" in a comment above the code, too.  That way, no one reading
the code without immediate access to the README will get concerned.

--Justin


On 1/18/07 11:11 PM, in article
paun-071956.23113218012007@nntp.stanford.edu, "Filip Paun"
<paun@stanford.edu> wrote:

>  I have code that looks very similar to the code presented in one of the
> books as well as the referenced website, and i would like to acknowledge
> this code 'inspiration'.  On top of this, i have talked about the high
> level project issues with other classmates.
> 
>  Just to make sure, the specifics of the above need to go in our README,
> correct?


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Proxy process getting stuck in read() system call
Date: Thu, 18 Jan 2007 23:27:10 -0800
Lines: 128
Distribution: su
Message-ID: <C1D5B2CE.778C%jpettit@stanford.edu>
References: <eon2fc$j07$1@news.Stanford.EDU> <eon3ts$k8s$1@news.Stanford.EDU> <eone2e$42e$1@news.Stanford.EDU> <eoo56v$qrp$1@news.Stanford.EDU> <C1D4EE4D.76C2%jpettit@stanford.edu> <eop44m$qno$1@news.Stanford.EDU> <C1D56150.773F%jpettit@stanford.edu> <eopgut$9hf$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169191633 18491 127.0.0.1 (19 Jan 2007 07:27:13 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Proxy process getting stuck in read() system call
Thread-Index: Acc7mzsMeZAjOKeOEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11128

Are you seeing this problem from the web server?  Make sure that you're
sending it HTTP/1.0 and not using keep-alive extension.  If so, it seems
like it's not closing its connection.  Are you seeing this when you type in
a request manually, using the grading script, or Firefox?

--Justin
 

On 1/18/07 8:20 PM, in article eopgut$9hf$1@news.Stanford.EDU, "Derek
Schumacher" <dschumac@stanford.edu> wrote:

> Any reason why I may not be seeing this happen?  I'm reasonably sure I'm
> only doing two calls to read, one that returns the number of bytes read
> initially (a non-zero positive number) and the second one which appears to
> block.
> 
> Thanks,
> Derek
> 
> "Justin Pettit" <jpettit@stanford.edu> wrote in message
> news:C1D56150.773F%jpettit@stanford.edu...
>> Yes, you should keep calling read() until you receive a 0 (no more data)
>> or
>> a -1 (there was an error).
>> 
>> --Justin
>> 
>> 
>> On 1/18/07 4:41 PM, in article eop44m$qno$1@news.Stanford.EDU, "Derek
>> Schumacher" <dschumac@stanford.edu> wrote:
>> 
>>> For some reason I'm never seeing read() return a zero value when the
>>> number
>>> of bytes sent by the client and read in by read() is less than the size
>>> of
>>> the buffer I've supplied in the read() call.  Should I expect a single
>>> additional call to read() to return zero after the initial one returns a
>>> positive value?
>>> 
>>> Thanks,
>>> Derek
>>> 
>>> 
>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>> news:C1D4EE4D.76C2%jpettit@stanford.edu...
>>>> The best way to prevent blocking is to use the system call "select" or
>>>> "poll" to determine whether there is data to be read.  You can also mark
>>>> the
>>>> socket as non-blocking.  However, you shouldn't need to do either of
>>>> these
>>>> for this assignment.
>>>> 
>>>> As David mentioned earlier, make sure that you don't immediately try to
>>>> read() again after getting a zero return value, otherwise you'll block.
>>>> 
>>>> --Justin
>>>> 
>>>> 
>>>> On 1/18/07 7:54 AM, in article eoo56v$qrp$1@news.Stanford.EDU, "Dinesh
>>>> Gupta" <dineshg@Stanford.EDU> wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> I'm also seeing this problem when I configured firefox to use my proxy.
>>>>> It's stuck in read while reading from the remote server(yahoo). It
>>>>> worked fine with cnn though. So it doesn't happen always but very
>>>>> annoying when it happens. Please let me know how to come out of this
>>>>> read
>>>>> call.
>>>>> 
>>>>> Thanks,
>>>>> Dinesh
>>>>> 
>>>>> 
>>>>> 
>>>>> Brian Thompson <Brian.C.Thompson@boeing.com> wrote:
>>>>>> I am runninng into the same problem with my proxy, I don't get a
>>>>>> response
>>>>>> from the server.  I show that I connect just fine using serive name of
>>>>>> www
>>>>>> on port 80.
>>>>> 
>>>>>> As a check I have run the server.c and setup a server with a port of
>>>>>> 8001.
>>>>>> Then I ran my proxy on 8000 and telneted to localhost 8000, sent a
>>>>>> message
>>>>>> to localhost on port 8001, saw my message reach the server and then
>>>>>> get
>>>>>> a
>>>>>> response.
>>>>> 
>>>>>> I'm starting to think that there is something blocking the returns of
>>>>>> the
>>>>>> reads.  I notice that when I do a normal telnet to www.yahoo.com 80
>>>>>> and
>>>>>> then
>>>>>> GET / HTTP/1.0 I have to press enter 3 times to get the data to show.
>>>>>> Do I
>>>>>> need to somehow mimic this to get my proxy to read the data?
>>>>> 
>>>>>> --Brian
>>>>> 
>>>>>> "David Erickson" <derickso@stanford.edu> wrote in message
>>>>>> news:eon3ts$k8s$1@news.Stanford.EDU...
>>>>>>> Shashidhar Shashidhar wrote:
>>>>>>>> Hi,
>>>>>>>> 
>>>>>>>> Sometimes I see that the proxy gets stuck in read( ) system call and
>>>>>>>> what should we do here. When can this happen and how to come out of
>>>>>>>> this
>>>>>>>> condition.
>>>>>>>> 
>>>>>>>> Thanks,
>>>>>>>> Shashidhar.
>>>>>>> 
>>>>>>> reading from the client or server?
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Derek Schumacher" <dschumac@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Proxy process getting stuck in read() system call
Date: Thu, 18 Jan 2007 23:29:57 -0800
Lines: 150
Distribution: su
Message-ID: <eops2j$i9c$1@news.Stanford.EDU>
References: <eon2fc$j07$1@news.Stanford.EDU> <eon3ts$k8s$1@news.Stanford.EDU> <eone2e$42e$1@news.Stanford.EDU> <eoo56v$qrp$1@news.Stanford.EDU> <C1D4EE4D.76C2%jpettit@stanford.edu> <eop44m$qno$1@news.Stanford.EDU> <C1D56150.773F%jpettit@stanford.edu> <eopgut$9hf$1@news.Stanford.EDU> <C1D5B2CE.778C%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1169191827 18732 127.0.0.1 (19 Jan 2007 07:30:27 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11129

I see this when simply taking the request in from the client when using the 
grading script.  I haven't tried any other methods as of yet.

Derek


"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1D5B2CE.778C%jpettit@stanford.edu...
> Are you seeing this problem from the web server?  Make sure that you're
> sending it HTTP/1.0 and not using keep-alive extension.  If so, it seems
> like it's not closing its connection.  Are you seeing this when you type 
> in
> a request manually, using the grading script, or Firefox?
>
> --Justin
>
>
> On 1/18/07 8:20 PM, in article eopgut$9hf$1@news.Stanford.EDU, "Derek
> Schumacher" <dschumac@stanford.edu> wrote:
>
>> Any reason why I may not be seeing this happen?  I'm reasonably sure I'm
>> only doing two calls to read, one that returns the number of bytes read
>> initially (a non-zero positive number) and the second one which appears 
>> to
>> block.
>>
>> Thanks,
>> Derek
>>
>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>> news:C1D56150.773F%jpettit@stanford.edu...
>>> Yes, you should keep calling read() until you receive a 0 (no more data)
>>> or
>>> a -1 (there was an error).
>>>
>>> --Justin
>>>
>>>
>>> On 1/18/07 4:41 PM, in article eop44m$qno$1@news.Stanford.EDU, "Derek
>>> Schumacher" <dschumac@stanford.edu> wrote:
>>>
>>>> For some reason I'm never seeing read() return a zero value when the
>>>> number
>>>> of bytes sent by the client and read in by read() is less than the size
>>>> of
>>>> the buffer I've supplied in the read() call.  Should I expect a single
>>>> additional call to read() to return zero after the initial one returns 
>>>> a
>>>> positive value?
>>>>
>>>> Thanks,
>>>> Derek
>>>>
>>>>
>>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>>> news:C1D4EE4D.76C2%jpettit@stanford.edu...
>>>>> The best way to prevent blocking is to use the system call "select" or
>>>>> "poll" to determine whether there is data to be read.  You can also 
>>>>> mark
>>>>> the
>>>>> socket as non-blocking.  However, you shouldn't need to do either of
>>>>> these
>>>>> for this assignment.
>>>>>
>>>>> As David mentioned earlier, make sure that you don't immediately try 
>>>>> to
>>>>> read() again after getting a zero return value, otherwise you'll 
>>>>> block.
>>>>>
>>>>> --Justin
>>>>>
>>>>>
>>>>> On 1/18/07 7:54 AM, in article eoo56v$qrp$1@news.Stanford.EDU, "Dinesh
>>>>> Gupta" <dineshg@Stanford.EDU> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I'm also seeing this problem when I configured firefox to use my 
>>>>>> proxy.
>>>>>> It's stuck in read while reading from the remote server(yahoo). It
>>>>>> worked fine with cnn though. So it doesn't happen always but very
>>>>>> annoying when it happens. Please let me know how to come out of this
>>>>>> read
>>>>>> call.
>>>>>>
>>>>>> Thanks,
>>>>>> Dinesh
>>>>>>
>>>>>>
>>>>>>
>>>>>> Brian Thompson <Brian.C.Thompson@boeing.com> wrote:
>>>>>>> I am runninng into the same problem with my proxy, I don't get a
>>>>>>> response
>>>>>>> from the server.  I show that I connect just fine using serive name 
>>>>>>> of
>>>>>>> www
>>>>>>> on port 80.
>>>>>>
>>>>>>> As a check I have run the server.c and setup a server with a port of
>>>>>>> 8001.
>>>>>>> Then I ran my proxy on 8000 and telneted to localhost 8000, sent a
>>>>>>> message
>>>>>>> to localhost on port 8001, saw my message reach the server and then
>>>>>>> get
>>>>>>> a
>>>>>>> response.
>>>>>>
>>>>>>> I'm starting to think that there is something blocking the returns 
>>>>>>> of
>>>>>>> the
>>>>>>> reads.  I notice that when I do a normal telnet to www.yahoo.com 80
>>>>>>> and
>>>>>>> then
>>>>>>> GET / HTTP/1.0 I have to press enter 3 times to get the data to 
>>>>>>> show.
>>>>>>> Do I
>>>>>>> need to somehow mimic this to get my proxy to read the data?
>>>>>>
>>>>>>> --Brian
>>>>>>
>>>>>>> "David Erickson" <derickso@stanford.edu> wrote in message
>>>>>>> news:eon3ts$k8s$1@news.Stanford.EDU...
>>>>>>>> Shashidhar Shashidhar wrote:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Sometimes I see that the proxy gets stuck in read( ) system call 
>>>>>>>>> and
>>>>>>>>> what should we do here. When can this happen and how to come out 
>>>>>>>>> of
>>>>>>>>> this
>>>>>>>>> condition.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Shashidhar.
>>>>>>>>
>>>>>>>> reading from the client or server?
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Neelima Balakrishnan <bneelima@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Parsing request
Date: Thu, 18 Jan 2007 23:33:29 -0800
Lines: 28
Distribution: su
Message-ID: <eops83$idj$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0701181225270.12959-100000@myth22.Stanford.EDU> <C1D54107.7715%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169192004 18867 127.0.0.1 (19 Jan 2007 07:33:24 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <C1D54107.7715%jpettit@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:11130

If the response status line is not proper, then what should be done?

Thanks
Neelima

Justin Pettit wrote:
> Don't worry about parsing much of the request and response.  For the
> request, make sure that it makes sense, but you don't have to verify all the
> headers.  For the response, make sure that you get a proper response status
> line and then just pass everything else through unmodified.
> 
> --Justin
> 
> 
> On 1/18/07 12:26 PM, in article
> Pine.LNX.4.44.0701181225270.12959-100000@myth22.Stanford.EDU, "Seung Hoon
> Choi" <shchoi@stanford.edu> wrote:
> 
>> Hi,
>>
>> How exact do we need to parse the request/response? Do I need to make sure
>> that requests and responses are exactly as defined in RFC documents?
>>
>>
>> Thanks,
>> -Seung
>>
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Proxy process getting stuck in read() system call
Date: Thu, 18 Jan 2007 23:39:06 -0800
Lines: 170
Distribution: su
Message-ID: <C1D5B59A.7793%jpettit@stanford.edu>
References: <eon2fc$j07$1@news.Stanford.EDU> <eon3ts$k8s$1@news.Stanford.EDU> <eone2e$42e$1@news.Stanford.EDU> <eoo56v$qrp$1@news.Stanford.EDU> <C1D4EE4D.76C2%jpettit@stanford.edu> <eop44m$qno$1@news.Stanford.EDU> <C1D56150.773F%jpettit@stanford.edu> <eopgut$9hf$1@news.Stanford.EDU> <C1D5B2CE.778C%jpettit@stanford.edu> <eops2j$i9c$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169192348 19100 127.0.0.1 (19 Jan 2007 07:39:08 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Proxy process getting stuck in read() system call
Thread-Index: Acc7nOXRJCzeNqeQEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11131

Ahh.  I think this discussion started with a question about reading data
from the server, which is different, since it sends data and then closes the
connection.  When the connection is closed, the read() call return 0, when
there is no more data.

However, the client doesn't close the connection, since it still wants to
get a response back.  For this, you should read data in and look for
"\r\n\r\n"--the indicator that the request is completed.  At this point, you
will only ever write to the client's socket.

Does that make sense?

--Justin


On 1/18/07 11:29 PM, in article eops2j$i9c$1@news.Stanford.EDU, "Derek
Schumacher" <dschumac@stanford.edu> wrote:

> I see this when simply taking the request in from the client when using the
> grading script.  I haven't tried any other methods as of yet.
> 
> Derek
> 
> 
> "Justin Pettit" <jpettit@stanford.edu> wrote in message
> news:C1D5B2CE.778C%jpettit@stanford.edu...
>> Are you seeing this problem from the web server?  Make sure that you're
>> sending it HTTP/1.0 and not using keep-alive extension.  If so, it seems
>> like it's not closing its connection.  Are you seeing this when you type
>> in
>> a request manually, using the grading script, or Firefox?
>> 
>> --Justin
>> 
>> 
>> On 1/18/07 8:20 PM, in article eopgut$9hf$1@news.Stanford.EDU, "Derek
>> Schumacher" <dschumac@stanford.edu> wrote:
>> 
>>> Any reason why I may not be seeing this happen?  I'm reasonably sure I'm
>>> only doing two calls to read, one that returns the number of bytes read
>>> initially (a non-zero positive number) and the second one which appears
>>> to
>>> block.
>>> 
>>> Thanks,
>>> Derek
>>> 
>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>> news:C1D56150.773F%jpettit@stanford.edu...
>>>> Yes, you should keep calling read() until you receive a 0 (no more data)
>>>> or
>>>> a -1 (there was an error).
>>>> 
>>>> --Justin
>>>> 
>>>> 
>>>> On 1/18/07 4:41 PM, in article eop44m$qno$1@news.Stanford.EDU, "Derek
>>>> Schumacher" <dschumac@stanford.edu> wrote:
>>>> 
>>>>> For some reason I'm never seeing read() return a zero value when the
>>>>> number
>>>>> of bytes sent by the client and read in by read() is less than the size
>>>>> of
>>>>> the buffer I've supplied in the read() call.  Should I expect a single
>>>>> additional call to read() to return zero after the initial one returns
>>>>> a
>>>>> positive value?
>>>>> 
>>>>> Thanks,
>>>>> Derek
>>>>> 
>>>>> 
>>>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>>>> news:C1D4EE4D.76C2%jpettit@stanford.edu...
>>>>>> The best way to prevent blocking is to use the system call "select" or
>>>>>> "poll" to determine whether there is data to be read.  You can also
>>>>>> mark
>>>>>> the
>>>>>> socket as non-blocking.  However, you shouldn't need to do either of
>>>>>> these
>>>>>> for this assignment.
>>>>>> 
>>>>>> As David mentioned earlier, make sure that you don't immediately try
>>>>>> to
>>>>>> read() again after getting a zero return value, otherwise you'll
>>>>>> block.
>>>>>> 
>>>>>> --Justin
>>>>>> 
>>>>>> 
>>>>>> On 1/18/07 7:54 AM, in article eoo56v$qrp$1@news.Stanford.EDU, "Dinesh
>>>>>> Gupta" <dineshg@Stanford.EDU> wrote:
>>>>>> 
>>>>>>> Hi,
>>>>>>> 
>>>>>>> I'm also seeing this problem when I configured firefox to use my
>>>>>>> proxy.
>>>>>>> It's stuck in read while reading from the remote server(yahoo). It
>>>>>>> worked fine with cnn though. So it doesn't happen always but very
>>>>>>> annoying when it happens. Please let me know how to come out of this
>>>>>>> read
>>>>>>> call.
>>>>>>> 
>>>>>>> Thanks,
>>>>>>> Dinesh
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> Brian Thompson <Brian.C.Thompson@boeing.com> wrote:
>>>>>>>> I am runninng into the same problem with my proxy, I don't get a
>>>>>>>> response
>>>>>>>> from the server.  I show that I connect just fine using serive name
>>>>>>>> of
>>>>>>>> www
>>>>>>>> on port 80.
>>>>>>> 
>>>>>>>> As a check I have run the server.c and setup a server with a port of
>>>>>>>> 8001.
>>>>>>>> Then I ran my proxy on 8000 and telneted to localhost 8000, sent a
>>>>>>>> message
>>>>>>>> to localhost on port 8001, saw my message reach the server and then
>>>>>>>> get
>>>>>>>> a
>>>>>>>> response.
>>>>>>> 
>>>>>>>> I'm starting to think that there is something blocking the returns
>>>>>>>> of
>>>>>>>> the
>>>>>>>> reads.  I notice that when I do a normal telnet to www.yahoo.com 80
>>>>>>>> and
>>>>>>>> then
>>>>>>>> GET / HTTP/1.0 I have to press enter 3 times to get the data to
>>>>>>>> show.
>>>>>>>> Do I
>>>>>>>> need to somehow mimic this to get my proxy to read the data?
>>>>>>> 
>>>>>>>> --Brian
>>>>>>> 
>>>>>>>> "David Erickson" <derickso@stanford.edu> wrote in message
>>>>>>>> news:eon3ts$k8s$1@news.Stanford.EDU...
>>>>>>>>> Shashidhar Shashidhar wrote:
>>>>>>>>>> Hi,
>>>>>>>>>> 
>>>>>>>>>> Sometimes I see that the proxy gets stuck in read( ) system call
>>>>>>>>>> and
>>>>>>>>>> what should we do here. When can this happen and how to come out
>>>>>>>>>> of
>>>>>>>>>> this
>>>>>>>>>> condition.
>>>>>>>>>> 
>>>>>>>>>> Thanks,
>>>>>>>>>> Shashidhar.
>>>>>>>>> 
>>>>>>>>> reading from the client or server?
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Parsing request
Date: Thu, 18 Jan 2007 23:44:34 -0800
Lines: 41
Distribution: su
Message-ID: <C1D5B6E2.7797%jpettit@stanford.edu>
References: <Pine.LNX.4.44.0701181225270.12959-100000@myth22.Stanford.EDU> <C1D54107.7715%jpettit@stanford.edu> <eops83$idj$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169192677 19400 127.0.0.1 (19 Jan 2007 07:44:37 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Parsing request
Thread-Index: Acc7nalS6AGJt6eQEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11132

If by not proper, you mean doesn't conform to the RFC spec, then I'd return
a 400.  There's not a great mapping in the spec, but that seems to be the
best fit.  This could happen if the proxy connects to a service that's not
HTTP.  

--Justin


On 1/18/07 11:33 PM, in article eops83$idj$1@news.Stanford.EDU, "Neelima
Balakrishnan" <bneelima@stanford.edu> wrote:

> If the response status line is not proper, then what should be done?
> 
> Thanks
> Neelima
> 
> Justin Pettit wrote:
>> Don't worry about parsing much of the request and response.  For the
>> request, make sure that it makes sense, but you don't have to verify all the
>> headers.  For the response, make sure that you get a proper response status
>> line and then just pass everything else through unmodified.
>> 
>> --Justin
>> 
>> 
>> On 1/18/07 12:26 PM, in article
>> Pine.LNX.4.44.0701181225270.12959-100000@myth22.Stanford.EDU, "Seung Hoon
>> Choi" <shchoi@stanford.edu> wrote:
>> 
>>> Hi,
>>> 
>>> How exact do we need to parse the request/response? Do I need to make sure
>>> that requests and responses are exactly as defined in RFC documents?
>>> 
>>> 
>>> Thanks,
>>> -Seung
>>> 
>> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Derek Schumacher" <dschumac@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Proxy process getting stuck in read() system call
Date: Thu, 18 Jan 2007 23:54:52 -0800
Lines: 194
Distribution: su
Message-ID: <eopthb$luc$1@news.Stanford.EDU>
References: <eon2fc$j07$1@news.Stanford.EDU> <eon3ts$k8s$1@news.Stanford.EDU> <eone2e$42e$1@news.Stanford.EDU> <eoo56v$qrp$1@news.Stanford.EDU> <C1D4EE4D.76C2%jpettit@stanford.edu> <eop44m$qno$1@news.Stanford.EDU> <C1D56150.773F%jpettit@stanford.edu> <eopgut$9hf$1@news.Stanford.EDU> <C1D5B2CE.778C%jpettit@stanford.edu> <eops2j$i9c$1@news.Stanford.EDU> <C1D5B59A.7793%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1169193323 22476 127.0.0.1 (19 Jan 2007 07:55:23 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11133

Yep, thanks; although it complicates what I had been trying to do in reusing 
code that reads from a stream, but I should be able to get around that.

Derek

"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1D5B59A.7793%jpettit@stanford.edu...
> Ahh.  I think this discussion started with a question about reading data
> from the server, which is different, since it sends data and then closes 
> the
> connection.  When the connection is closed, the read() call return 0, when
> there is no more data.
>
> However, the client doesn't close the connection, since it still wants to
> get a response back.  For this, you should read data in and look for
> "\r\n\r\n"--the indicator that the request is completed.  At this point, 
> you
> will only ever write to the client's socket.
>
> Does that make sense?
>
> --Justin
>
>
> On 1/18/07 11:29 PM, in article eops2j$i9c$1@news.Stanford.EDU, "Derek
> Schumacher" <dschumac@stanford.edu> wrote:
>
>> I see this when simply taking the request in from the client when using 
>> the
>> grading script.  I haven't tried any other methods as of yet.
>>
>> Derek
>>
>>
>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>> news:C1D5B2CE.778C%jpettit@stanford.edu...
>>> Are you seeing this problem from the web server?  Make sure that you're
>>> sending it HTTP/1.0 and not using keep-alive extension.  If so, it seems
>>> like it's not closing its connection.  Are you seeing this when you type
>>> in
>>> a request manually, using the grading script, or Firefox?
>>>
>>> --Justin
>>>
>>>
>>> On 1/18/07 8:20 PM, in article eopgut$9hf$1@news.Stanford.EDU, "Derek
>>> Schumacher" <dschumac@stanford.edu> wrote:
>>>
>>>> Any reason why I may not be seeing this happen?  I'm reasonably sure 
>>>> I'm
>>>> only doing two calls to read, one that returns the number of bytes read
>>>> initially (a non-zero positive number) and the second one which appears
>>>> to
>>>> block.
>>>>
>>>> Thanks,
>>>> Derek
>>>>
>>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>>> news:C1D56150.773F%jpettit@stanford.edu...
>>>>> Yes, you should keep calling read() until you receive a 0 (no more 
>>>>> data)
>>>>> or
>>>>> a -1 (there was an error).
>>>>>
>>>>> --Justin
>>>>>
>>>>>
>>>>> On 1/18/07 4:41 PM, in article eop44m$qno$1@news.Stanford.EDU, "Derek
>>>>> Schumacher" <dschumac@stanford.edu> wrote:
>>>>>
>>>>>> For some reason I'm never seeing read() return a zero value when the
>>>>>> number
>>>>>> of bytes sent by the client and read in by read() is less than the 
>>>>>> size
>>>>>> of
>>>>>> the buffer I've supplied in the read() call.  Should I expect a 
>>>>>> single
>>>>>> additional call to read() to return zero after the initial one 
>>>>>> returns
>>>>>> a
>>>>>> positive value?
>>>>>>
>>>>>> Thanks,
>>>>>> Derek
>>>>>>
>>>>>>
>>>>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>>>>> news:C1D4EE4D.76C2%jpettit@stanford.edu...
>>>>>>> The best way to prevent blocking is to use the system call "select" 
>>>>>>> or
>>>>>>> "poll" to determine whether there is data to be read.  You can also
>>>>>>> mark
>>>>>>> the
>>>>>>> socket as non-blocking.  However, you shouldn't need to do either of
>>>>>>> these
>>>>>>> for this assignment.
>>>>>>>
>>>>>>> As David mentioned earlier, make sure that you don't immediately try
>>>>>>> to
>>>>>>> read() again after getting a zero return value, otherwise you'll
>>>>>>> block.
>>>>>>>
>>>>>>> --Justin
>>>>>>>
>>>>>>>
>>>>>>> On 1/18/07 7:54 AM, in article eoo56v$qrp$1@news.Stanford.EDU, 
>>>>>>> "Dinesh
>>>>>>> Gupta" <dineshg@Stanford.EDU> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I'm also seeing this problem when I configured firefox to use my
>>>>>>>> proxy.
>>>>>>>> It's stuck in read while reading from the remote server(yahoo). It
>>>>>>>> worked fine with cnn though. So it doesn't happen always but very
>>>>>>>> annoying when it happens. Please let me know how to come out of 
>>>>>>>> this
>>>>>>>> read
>>>>>>>> call.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Dinesh
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Brian Thompson <Brian.C.Thompson@boeing.com> wrote:
>>>>>>>>> I am runninng into the same problem with my proxy, I don't get a
>>>>>>>>> response
>>>>>>>>> from the server.  I show that I connect just fine using serive 
>>>>>>>>> name
>>>>>>>>> of
>>>>>>>>> www
>>>>>>>>> on port 80.
>>>>>>>>
>>>>>>>>> As a check I have run the server.c and setup a server with a port 
>>>>>>>>> of
>>>>>>>>> 8001.
>>>>>>>>> Then I ran my proxy on 8000 and telneted to localhost 8000, sent a
>>>>>>>>> message
>>>>>>>>> to localhost on port 8001, saw my message reach the server and 
>>>>>>>>> then
>>>>>>>>> get
>>>>>>>>> a
>>>>>>>>> response.
>>>>>>>>
>>>>>>>>> I'm starting to think that there is something blocking the returns
>>>>>>>>> of
>>>>>>>>> the
>>>>>>>>> reads.  I notice that when I do a normal telnet to www.yahoo.com 
>>>>>>>>> 80
>>>>>>>>> and
>>>>>>>>> then
>>>>>>>>> GET / HTTP/1.0 I have to press enter 3 times to get the data to
>>>>>>>>> show.
>>>>>>>>> Do I
>>>>>>>>> need to somehow mimic this to get my proxy to read the data?
>>>>>>>>
>>>>>>>>> --Brian
>>>>>>>>
>>>>>>>>> "David Erickson" <derickso@stanford.edu> wrote in message
>>>>>>>>> news:eon3ts$k8s$1@news.Stanford.EDU...
>>>>>>>>>> Shashidhar Shashidhar wrote:
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> Sometimes I see that the proxy gets stuck in read( ) system call
>>>>>>>>>>> and
>>>>>>>>>>> what should we do here. When can this happen and how to come out
>>>>>>>>>>> of
>>>>>>>>>>> this
>>>>>>>>>>> condition.
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>> Shashidhar.
>>>>>>>>>>
>>>>>>>>>> reading from the client or server?
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Submission Tarballs
Date: Fri, 19 Jan 2007 00:15:18 -0800
Lines: 14
Distribution: su
Message-ID: <eopumc$ole$1@news.Stanford.EDU>
References: <eop0ua$n6m$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169194509 25262 128.12.194.72 (19 Jan 2007 08:15:09 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eop0ua$n6m$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11134

Clay Collier wrote:
> Please make sure that you are gzipping the tar archives that you submit 
> (use 'tar zcf' to create the file)- it will save you time performing the 
> upload, and makes it easier for us to process the submissions in a 
> batch.  Check out the sample Makefile on the assignment page if you're 
> not sure how to tar up your working files.
> 
> Clay

Clay,

should we re-submit if we've already submitted the tar file?

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on Referencing
Date: Fri, 19 Jan 2007 00:27:21 -0800
Lines: 45
Distribution: su
Message-ID: <eopvcv$pcb$1@news.Stanford.EDU>
References: <paun-071956.23113218012007@nntp.stanford.edu> <C1D5B156.778A%jpettit@stanford.edu>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169195231 25995 128.12.194.72 (19 Jan 2007 08:27:11 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <C1D5B156.778A%jpettit@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:11135

Um, what?

I only mentioned my code inspirations in the source code itself, since 
the specs for the README made no mention of repeating this information.

 From the website:

The second deliverable is a project writeup. This file should be a file 
called README (all caps) and should be a text file. This file should 
contain the following:

     * An overview of the structure of your code.
     * Any design decisions you made and a short justification for them. 
If you found ambiguities in the assignment itself, also list here how 
they were resolved in your implementation.
     * Answers to any questions the assignment asks.

But that's just the website. I'm not sure whether the TAs override the 
website or it's the other way around. :p

-Yangfan

Justin Pettit wrote:
> Yes, that's exactly where it should go.  I would recommend mentioning your
> "inspiration" in a comment above the code, too.  That way, no one reading
> the code without immediate access to the README will get concerned.
> 
> --Justin
> 
> 
> On 1/18/07 11:11 PM, in article
> paun-071956.23113218012007@nntp.stanford.edu, "Filip Paun"
> <paun@stanford.edu> wrote:
> 
> 
>> I have code that looks very similar to the code presented in one of the
>>books as well as the referenced website, and i would like to acknowledge
>>this code 'inspiration'.  On top of this, i have talked about the high
>>level project issues with other classmates.
>>
>> Just to make sure, the specifics of the above need to go in our README,
>>correct?
> 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question on Referencing
Date: Fri, 19 Jan 2007 00:40:16 -0800
Lines: 59
Distribution: su
Message-ID: <C1D5C3F0.77AC%jpettit@stanford.edu>
References: <paun-071956.23113218012007@nntp.stanford.edu> <C1D5B156.778A%jpettit@stanford.edu> <eopvcv$pcb$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169196019 26695 127.0.0.1 (19 Jan 2007 08:40:19 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Question on Referencing
Thread-Index: Acc7pXFPr6KwqKeYEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11136

I think documenting the source code itself is safest, so that you don't
accidentally reuse the code later and miss a proper attribution.  However,
we'll look in both places before we drag you in front of the Judicial
Affairs Counsel.  ;)  Hopefully, you didn't need very much "inspiration",
either.

--Justin


On 1/19/07 12:27 AM, in article eopvcv$pcb$1@news.Stanford.EDU, "Yangfan
Wang" <yfw@stanford.edu> wrote:

> Um, what?
> 
> I only mentioned my code inspirations in the source code itself, since
> the specs for the README made no mention of repeating this information.
> 
>  From the website:
> 
> The second deliverable is a project writeup. This file should be a file
> called README (all caps) and should be a text file. This file should
> contain the following:
> 
>      * An overview of the structure of your code.
>      * Any design decisions you made and a short justification for them.
> If you found ambiguities in the assignment itself, also list here how
> they were resolved in your implementation.
>      * Answers to any questions the assignment asks.
> 
> But that's just the website. I'm not sure whether the TAs override the
> website or it's the other way around. :p
> 
> -Yangfan
> 
> Justin Pettit wrote:
>> Yes, that's exactly where it should go.  I would recommend mentioning your
>> "inspiration" in a comment above the code, too.  That way, no one reading
>> the code without immediate access to the README will get concerned.
>> 
>> --Justin
>> 
>> 
>> On 1/18/07 11:11 PM, in article
>> paun-071956.23113218012007@nntp.stanford.edu, "Filip Paun"
>> <paun@stanford.edu> wrote:
>> 
>> 
>>> I have code that looks very similar to the code presented in one of the
>>> books as well as the referenced website, and i would like to acknowledge
>>> this code 'inspiration'.  On top of this, i have talked about the high
>>> level project issues with other classmates.
>>> 
>>> Just to make sure, the specifics of the above need to go in our README,
>>> correct?
>> 
>> 
>> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Potential Submission Problems
Date: Fri, 19 Jan 2007 00:42:03 -0800
Lines: 14
Distribution: su
Message-ID: <C1D5C45B.77B1%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169196123 26746 127.0.0.1 (19 Jan 2007 08:42:03 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Potential Submission Problems
Thread-Index: Acc7pbEV72yxR6eYEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11137

We've gotten a few reports from students getting "Access Forbidden" pages
after authenticating via WebAuth.  We think the problem is limited to SCPD
students and that we've fixed the problem.  However, if you receive that
error when submitting Friday, just email the tarball directly to your TA.
Please put "CS244A" in the subject line, so that we can easily spot your
submission. 

Hopefully that won't be necessary.  Keep in mind that the 5PM deadline is
still in effect, so don't wait until the last minute to try submitting.

Good luck!

--Justin

.

Path: shelby.stanford.edu!not-for-mail
From: "Euijong Whang" <euijong@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Potential Submission Problems
Date: Fri, 19 Jan 2007 01:16:51 -0800
Lines: 26
Distribution: su
Message-ID: <eoq2ai$t1r$1@news.Stanford.EDU>
References: <C1D5C45B.77B1%jpettit@stanford.edu>
NNTP-Posting-Host: dnab404b3b.stanford.edu
X-Trace: news.Stanford.EDU 1169198226 29755 171.64.75.59 (19 Jan 2007 09:17:06 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:11138


This is off-topic, but is there a way to check and confirm that we 
successfully submitted our work?
The one-time "Your submission is complete!" message itself is not quite 
assuring enough for me :-)

-Steven

"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1D5C45B.77B1%jpettit@stanford.edu...
> We've gotten a few reports from students getting "Access Forbidden" pages
> after authenticating via WebAuth.  We think the problem is limited to SCPD
> students and that we've fixed the problem.  However, if you receive that
> error when submitting Friday, just email the tarball directly to your TA.
> Please put "CS244A" in the subject line, so that we can easily spot your
> submission.
>
> Hopefully that won't be necessary.  Keep in mind that the 5PM deadline is
> still in effect, so don't wait until the last minute to try submitting.
>
> Good luck!
>
> --Justin
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Yuliya Sarkisyan <yuliya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Parsing request
Date: Fri, 19 Jan 2007 01:28:27 -0800
Lines: 17
Distribution: su
Message-ID: <eoq301$jn$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0701181225270.12959-100000@myth22.Stanford.EDU> <C1D54107.7715%jpettit@stanford.edu> <eops83$idj$1@news.Stanford.EDU> <C1D5B6E2.7797%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169198913 631 127.0.0.1 (19 Jan 2007 09:28:33 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <C1D5B6E2.7797%jpettit@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:11139

Justin Pettit wrote:
> If by not proper, you mean doesn't conform to the RFC spec, then I'd return
> a 400.  There's not a great mapping in the spec, but that seems to be the
> best fit.  This could happen if the proxy connects to a service that's not
> HTTP.  
> 
> --Justin
> 

Isn't the response code
	
	502 Bad Gateway
	The server, while acting as a gateway or proxy, received an
	invalid response from the upstream server it accessed in
	attempting to fulfill the request.

more appropriate?
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Submission Tarballs
Date: Fri, 19 Jan 2007 01:26:44 -0800
Lines: 18
Distribution: su
Message-ID: <eoq301$ku$1@news.Stanford.EDU>
References: <eop0ua$n6m$1@news.Stanford.EDU> <eopumc$ole$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169198914 670 171.64.74.54 (19 Jan 2007 09:28:34 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <eopumc$ole$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11140

If you have a chance to do so, it would be helpful.

Clay
Yangfan Wang wrote:
> Clay Collier wrote:
>> Please make sure that you are gzipping the tar archives that you 
>> submit (use 'tar zcf' to create the file)- it will save you time 
>> performing the upload, and makes it easier for us to process the 
>> submissions in a batch.  Check out the sample Makefile on the 
>> assignment page if you're not sure how to tar up your working files.
>>
>> Clay
> 
> Clay,
> 
> should we re-submit if we've already submitted the tar file?
> 
> -Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Potential Submission Problems
Date: Fri, 19 Jan 2007 01:36:17 -0800
Lines: 38
Distribution: su
Message-ID: <eoq3hv$13h$1@news.Stanford.EDU>
References: <C1D5C45B.77B1%jpettit@stanford.edu> <eoq2ai$t1r$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169199488 1137 171.64.74.54 (19 Jan 2007 09:38:08 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <eoq2ai$t1r$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11141

At the moment, you'll have to put your faith in the confidence-inspiring 
'submission accepted' message.  I think it shouldn't be too difficult to 
set something up to allow you to check the status of your submission and 
ensure that things have gone through- I'll try to get that set up early 
tomorrow.

Clay





Euijong Whang wrote:
> This is off-topic, but is there a way to check and confirm that we 
> successfully submitted our work?
> The one-time "Your submission is complete!" message itself is not quite 
> assuring enough for me :-)
> 
> -Steven
> 
> "Justin Pettit" <jpettit@stanford.edu> wrote in message 
> news:C1D5C45B.77B1%jpettit@stanford.edu...
>> We've gotten a few reports from students getting "Access Forbidden" pages
>> after authenticating via WebAuth.  We think the problem is limited to SCPD
>> students and that we've fixed the problem.  However, if you receive that
>> error when submitting Friday, just email the tarball directly to your TA.
>> Please put "CS244A" in the subject line, so that we can easily spot your
>> submission.
>>
>> Hopefully that won't be necessary.  Keep in mind that the 5PM deadline is
>> still in effect, so don't wait until the last minute to try submitting.
>>
>> Good luck!
>>
>> --Justin
>>
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Parsing request
Date: Fri, 19 Jan 2007 01:38:33 -0800
Lines: 33
Distribution: su
Message-ID: <C1D5D199.77BA%jpettit@stanford.edu>
References: <Pine.LNX.4.44.0701181225270.12959-100000@myth22.Stanford.EDU> <C1D54107.7715%jpettit@stanford.edu> <eops83$idj$1@news.Stanford.EDU> <C1D5B6E2.7797%jpettit@stanford.edu> <eoq301$jn$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169199516 1240 127.0.0.1 (19 Jan 2007 09:38:36 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Parsing request
Thread-Index: Acc7rZWu1D/BeKegEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11142

You're right.  I think that's a better choice.  I was thinking that if the
client specifies port 443, for example, and the server is expecting SSL,
then it would be a bad request.  However, 502 makes more sense.  Regardless,
it is fine to return either either 502 or 400 for the purposes of the
assignment.

Thanks for pointing that out!

--Justin  


On 1/19/07 1:28 AM, in article eoq301$jn$1@news.Stanford.EDU, "Yuliya
Sarkisyan" <yuliya@stanford.edu> wrote:

> Justin Pettit wrote:
>> If by not proper, you mean doesn't conform to the RFC spec, then I'd return
>> a 400.  There's not a great mapping in the spec, but that seems to be the
>> best fit.  This could happen if the proxy connects to a service that's not
>> HTTP.  
>> 
>> --Justin
>> 
> 
> Isn't the response code
> 
> 502 Bad Gateway
> The server, while acting as a gateway or proxy, received an
> invalid response from the upstream server it accessed in
> attempting to fulfill the request.
> 
> more appropriate?


.

Path: shelby.stanford.edu!not-for-mail
From: "David Gobaud" <gobaudd@stanford.edu>
Newsgroups: su.class.cs244a
Subject: multithreading
Date: Fri, 19 Jan 2007 03:25:52 -0800
Lines: 12
Distribution: su
Message-ID: <eoq9s1$6b9$1@news.Stanford.EDU>
NNTP-Posting-Host: norad.stanford.edu
X-Trace: news.Stanford.EDU 1169205953 6505 128.12.81.44 (19 Jan 2007 11:25:53 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11143

Hi,

What is the gcc compiler option to link to multithreaded c and c++ standard 
libraries? Also, is the socket library thread-safe by default or must one 
synchronize socket calls? If only a single thread deals with each socket is 
it thread-safe?

Thank you,
David Gobaud



.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Do we need to handle simple request/response?
Date: Fri, 19 Jan 2007 03:41:32 -0800
Lines: 33
Distribution: su
Message-ID: <eoqao5$6v0$1@news.Stanford.EDU>
References: <eopaiu$33r$2@news.Stanford.EDU> <C1D56F4D.7750%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1169206853 7136 127.0.0.1 (19 Jan 2007 11:40:53 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11144

Then talking about validating anything (including the status line) from the 
server is a farce.

My document could just happen to read:
HTTP/bunnyrabit.litter 747 Go HOME

I can imagine fun things to do with a 1.1 looking status line followed by a 
(perfectly legitimate) ContentLength of 1 gazillion.

What a spec!

I guess that makes my life easier...

Sincerely,
Randy Jennings

The squirrels are your friends!

"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1D56F4D.7750%jpettit@stanford.edu...
> Yes, you need to support HTTP/1.0 as defined in the RFC.
>
> --Justin
>
>
> On 1/18/07 6:31 PM, in article eopaiu$33r$2@news.Stanford.EDU, "Yuliya
> Sarkisyan" <yuliya@stanford.edu> wrote:
>
>> Thanks.
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "David Gobaud" <gobaudd@stanford.edu>
Newsgroups: su.class.cs244a
Subject: broken pipe?
Date: Fri, 19 Jan 2007 05:16:16 -0800
Lines: 9
Distribution: su
Message-ID: <eoqgb1$dk0$1@news.Stanford.EDU>
NNTP-Posting-Host: norad.stanford.edu
X-Trace: news.Stanford.EDU 1169212577 13952 128.12.81.44 (19 Jan 2007 13:16:17 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11145

Hi,

Sometimes when my proxy is processing requests it exits and says "Broken 
pipe". Ideas... ? I can't reproduce it reliably.

Thank you,
David Gobaud 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: broken pipe?
Date: Fri, 19 Jan 2007 08:14:19 -0800
Lines: 22
Distribution: su
Message-ID: <C1D62E5B.77CA%jpettit@stanford.edu>
References: <eoqgb1$dk0$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169223262 22793 127.0.0.1 (19 Jan 2007 16:14:22 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: broken pipe?
Thread-Index: Acc75N9mHeZsrKfYEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11146

I actual spoke with another student who had a similar problem.  It has to do
with trying to write to a socket that was closed by the other end.  Look
into handling the SIGPIPE signal.  If you don't have a handler, the system
kills your process.

--Justin


On 1/19/07 5:16 AM, in article eoqgb1$dk0$1@news.Stanford.EDU, "David
Gobaud" <gobaudd@stanford.edu> wrote:

> Hi,
> 
> Sometimes when my proxy is processing requests it exits and says "Broken
> pipe". Ideas... ? I can't reproduce it reliably.
> 
> Thank you,
> David Gobaud 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: multithreading
Date: Fri, 19 Jan 2007 08:25:49 -0800
Lines: 29
Distribution: su
Message-ID: <C1D6310D.77CE%jpettit@stanford.edu>
References: <eoq9s1$6b9$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169223952 23321 127.0.0.1 (19 Jan 2007 16:25:52 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: multithreading
Thread-Index: Acc75nqsuV65hKfZEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11147

I'm not quite sure what you are asking in your first question, but I assume
you figured it out, since a later post seems to have working code.

Most of the socket calls are thread-safe.  There are a few, such as
gethostent, which are not thread-safe, but they have sister functions with
an "_r", such as gethostent_r.  They are listed on the same man page as the
normal call, so keep your eyes open for them.  However, you should look at
Chapter 26 of Stevens for a full discussion.

--Justin


On 1/19/07 3:25 AM, in article eoq9s1$6b9$1@news.Stanford.EDU, "David
Gobaud" <gobaudd@stanford.edu> wrote:

> Hi,
> 
> What is the gcc compiler option to link to multithreaded c and c++ standard
> libraries? Also, is the socket library thread-safe by default or must one
> synchronize socket calls? If only a single thread deals with each socket is
> it thread-safe?
> 
> Thank you,
> David Gobaud
> 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Chun Kai Wang <chunkaiw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: grading script vs. telnet
Date: Fri, 19 Jan 2007 16:27:24 +0000 (UTC)
Organization: Your Company
Lines: 21
Distribution: su
Message-ID: <Xns98BD5608CADEFchunkaiwstanfordedu@171.64.14.103>
NNTP-Posting-Host: rescomp-06-59601.stanford.edu
X-Trace: news.Stanford.EDU 1169224044 23349 128.12.22.217 (19 Jan 2007 16:27:24 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Xnews/5.04.25
Xref: shelby.stanford.edu su.class.cs244a:11148

my grading script says:

>>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<<< <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html 
lang="en"><head><title>CNN.com - Breaking News, U.S., World, Weather, 
Entertainment & Video News</title>     <meta http-equiv="content-type" 
content="text/html; charset=iso-8859-1">


but when i telnet and do GET http://www.cnn.com/

it works just fine and i get 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html 
lang="en"><head><title>CNN.com - Breaking News, U.S., World, Weather, 
Entertainment & Video News</title>     <meta http-equiv="content-type" 
content="text/html; charset=iso-8859-1">


help...
.

Path: shelby.stanford.edu!not-for-mail
From: Chun Kai Wang <chunkaiw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: www.cnn.com
Date: Fri, 19 Jan 2007 16:31:28 +0000 (UTC)
Organization: Your Company
Lines: 49
Distribution: su
Message-ID: <Xns98BD56B9B74EDchunkaiwstanfordedu@171.64.14.103>
References: <eol05i$g9o$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-59601.stanford.edu
X-Trace: news.Stanford.EDU 1169224288 23349 128.12.22.217 (19 Jan 2007 16:31:28 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Xnews/5.04.25
Xref: shelby.stanford.edu su.class.cs244a:11149

i have a similar problem except mine is: 

>>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<<< <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html 
lang="en"><head><title>CNN.com - Breaking News, U.S., World, Weather, 
Entertainment & Video News</title>     <meta http-equiv="content-
type" content="text/html; charset=iso-8859-1">


but when i telnet, i get what is expected in the <<<

help...



"Madeleine Lam" <mlamone@cisco.com> wrote in
news:eol05i$g9o$1@news.Stanford.EDU: 

> Hi,
> 
> What is the tricky reason of using www.cnn.com?
> 
> I am getting:
> 
> proxy: >>> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> 
> <<< <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
> Transitional//EN"><html lang="en"><head><title>CNN.com - Breaking
> News, U.S., World, Weather, Entertainment & Video News</title>    
> <meta http-equiv="content-type" content="text/html;
> charset=iso-8859-1"> 
> 
> 
> I tried manually
> telnet www.cnn.com 80
> GET / HTTP/1.0
> and still got "-//W3C//DTD HTML 4.01 Transitional//EN"
> 
> Also tried manually run my code using "GET http://www.cnn.com
> HTTP/1.0" and still got the same W3C output
> 
> Does the grading script expect "-//IETF//DTD HTML 2.0//EN" ?
> 
> 
> Thanks.
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Raymond Thang <rlt5654@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: grading script vs. telnet
Date: Fri, 19 Jan 2007 08:45:22 -0800
Lines: 28
Distribution: su
Message-ID: <eoqsj5$npg$1@news.Stanford.EDU>
References: <Xns98BD5608CADEFchunkaiwstanfordedu@171.64.14.103>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169225125 24368 127.0.0.1 (19 Jan 2007 16:45:25 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <Xns98BD5608CADEFchunkaiwstanfordedu@171.64.14.103>
Xref: shelby.stanford.edu su.class.cs244a:11150

Someone noted (in the newsgroup) that cnn.com can sometimes serves up 
different responses.  I have also found that to be the case; but I find 
that for the majority of times, cnn.com passes the grading script runs.

- Raymond

Chun Kai Wang wrote:
> my grading script says:
> 
>>>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> 
> <<< <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html 
> lang="en"><head><title>CNN.com - Breaking News, U.S., World, Weather, 
> Entertainment & Video News</title>     <meta http-equiv="content-type" 
> content="text/html; charset=iso-8859-1">
> 
> 
> but when i telnet and do GET http://www.cnn.com/
> 
> it works just fine and i get 
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html 
> lang="en"><head><title>CNN.com - Breaking News, U.S., World, Weather, 
> Entertainment & Video News</title>     <meta http-equiv="content-type" 
> content="text/html; charset=iso-8859-1">
> 
> 
> help...
.

Path: shelby.stanford.edu!not-for-mail
From: Raymond Thang <rlt5654@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: broken pipe?
Date: Fri, 19 Jan 2007 08:46:01 -0800
Lines: 26
Distribution: su
Message-ID: <eoqskc$npg$2@news.Stanford.EDU>
References: <eoqgb1$dk0$1@news.Stanford.EDU> <C1D62E5B.77CA%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169225164 24368 127.0.0.1 (19 Jan 2007 16:46:04 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <C1D62E5B.77CA%jpettit@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:11151

Will we be marked off if we don't have signal handlers?
- Raymond

Justin Pettit wrote:
> I actual spoke with another student who had a similar problem.  It has to do
> with trying to write to a socket that was closed by the other end.  Look
> into handling the SIGPIPE signal.  If you don't have a handler, the system
> kills your process.
> 
> --Justin
> 
> 
> On 1/19/07 5:16 AM, in article eoqgb1$dk0$1@news.Stanford.EDU, "David
> Gobaud" <gobaudd@stanford.edu> wrote:
> 
>> Hi,
>>
>> Sometimes when my proxy is processing requests it exits and says "Broken
>> pipe". Ideas... ? I can't reproduce it reliably.
>>
>> Thank you,
>> David Gobaud 
>>
>>
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: broken pipe?
Date: Fri, 19 Jan 2007 08:57:33 -0800
Lines: 39
Distribution: su
Message-ID: <C1D6387D.77DD%jpettit@stanford.edu>
References: <eoqgb1$dk0$1@news.Stanford.EDU> <C1D62E5B.77CA%jpettit@stanford.edu> <eoqskc$npg$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169225855 25000 127.0.0.1 (19 Jan 2007 16:57:35 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: broken pipe?
Thread-Index: Acc76umLJ/3ZSKfeEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11152

No, but if your program dies during execution, then you'll definitely lose
points.  I've only heard about SIGPIPE problems related to multithreaded
implementations of the assignment.  My version of the assignment didn't have
any signal handlers (I did a forking version).

--Justin
 

On 1/19/07 8:46 AM, in article eoqskc$npg$2@news.Stanford.EDU, "Raymond
Thang" <rlt5654@stanford.edu> wrote:

> Will we be marked off if we don't have signal handlers?
> - Raymond
> 
> Justin Pettit wrote:
>> I actual spoke with another student who had a similar problem.  It has to do
>> with trying to write to a socket that was closed by the other end.  Look
>> into handling the SIGPIPE signal.  If you don't have a handler, the system
>> kills your process.
>> 
>> --Justin
>> 
>> 
>> On 1/19/07 5:16 AM, in article eoqgb1$dk0$1@news.Stanford.EDU, "David
>> Gobaud" <gobaudd@stanford.edu> wrote:
>> 
>>> Hi,
>>> 
>>> Sometimes when my proxy is processing requests it exits and says "Broken
>>> pipe". Ideas... ? I can't reproduce it reliably.
>>> 
>>> Thank you,
>>> David Gobaud 
>>> 
>>> 
>> 
>> 


.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: proxy.c:40: warning: implicit declaration of function
Date: Fri, 19 Jan 2007 09:16:40 -0800
Lines: 17
Distribution: su
Message-ID: <eoqub0$pbe$1@news.Stanford.EDU>
References: <Xns98BCE7752A0A2chunkaiwstanfordedu@171.64.14.103>
NNTP-Posting-Host: jadsdesktop.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169226912 25966 128.12.134.140 (19 Jan 2007 17:15:12 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20060911)
In-Reply-To: <Xns98BCE7752A0A2chunkaiwstanfordedu@171.64.14.103>
Xref: shelby.stanford.edu su.class.cs244a:11153

You need to include headers for these functions. Do a man for each of
them and you can find what header they are declared in for example.
memset is in string.h. So you need to add #include <string.h> to your code.

Jad.

Chun Kai Wang wrote:
> anyone know how to solve: 
> 
> 
> proxy.c:40: warning: implicit declaration of function 'read'
> proxy.c:47: warning: implicit declaration of function 'bzero'
> proxy.c:50: warning: implicit declaration of function 'inet_aton'
> proxy.c:51: warning: implicit declaration of function 'memset'
> 
> 
> ? thanks : )
.

Path: shelby.stanford.edu!not-for-mail
From: "manj" <manj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: how do we know that submissions have gone through?
Date: Fri, 19 Jan 2007 09:32:14 -0800
Lines: 6
Distribution: su
Message-ID: <eoqvam$q5u$1@news.Stanford.EDU>
NNTP-Posting-Host: zeus2.stanford.edu
X-Trace: news.Stanford.EDU 1169227926 26814 128.12.137.163 (19 Jan 2007 17:32:06 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:11154

How do we know that that submissions have gone through?

Is there any way to log into the myth machines and check a directory to make 
sure that there exists a submission with my "suid-name"


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: how do we know that submissions have gone through?
Date: Fri, 19 Jan 2007 10:01:51 -0800
Lines: 16
Distribution: su
Message-ID: <C1D6478F.77E8%jpettit@stanford.edu>
References: <eoqvam$q5u$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169229712 28757 127.0.0.1 (19 Jan 2007 18:01:52 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: how do we know that submissions have gone through?
Thread-Index: Acc78+UYI4ov/KfnEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11155

Look for the thread titled "Re: Potential Submission Problems".

--Justin


On 1/19/07 9:32 AM, in article eoqvam$q5u$1@news.Stanford.EDU, "manj"
<manj@stanford.edu> wrote:

> How do we know that that submissions have gone through?
> 
> Is there any way to log into the myth machines and check a directory to make
> sure that there exists a submission with my "suid-name"
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Raymond Thang <rlt5654@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Submission Tarballs
Date: Fri, 19 Jan 2007 10:30:43 -0800
Lines: 15
Distribution: su
Message-ID: <eor2on$11a$1@news.Stanford.EDU>
References: <eop0ua$n6m$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169231447 1066 127.0.0.1 (19 Jan 2007 18:30:47 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eop0ua$n6m$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11156

Clay Collier wrote:
> Please make sure that you are gzipping the tar archives that you submit 
> (use 'tar zcf' to create the file)- it will save you time performing the 
> upload, and makes it easier for us to process the submissions in a 
> batch.  Check out the sample Makefile on the assignment page if you're 
> not sure how to tar up your working files.
> 
> Clay

(This may sound a little silly)

If we've updated the makefile sources and headers correctly, shouldn't 
we just be able to 'make submit' and submit the pa1.tar.gz file it produces?

- Raymond
.

Path: shelby.stanford.edu!not-for-mail
From: Chun Kai Wang <chunkaiw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: error handling
Date: Fri, 19 Jan 2007 19:44:36 +0000 (UTC)
Organization: Your Company
Lines: 12
Distribution: su
Message-ID: <Xns98BD7777D7820chunkaiwstanfordedu@171.64.14.103>
NNTP-Posting-Host: rescomp-06-59601.stanford.edu
X-Trace: news.Stanford.EDU 1169235876 6067 128.12.22.217 (19 Jan 2007 19:44:36 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Xnews/5.04.25
Xref: shelby.stanford.edu su.class.cs244a:11157

what should the error handling be?

right now, when i change the grading script such that there is an invalid 
url, say "ht://www.c.com" then a valid one after that "http://www.cnn.com/"

the grading script will exit and print the error message for the invalid 
URL


is this correct? or is it suppose to continue?


.

Path: shelby.stanford.edu!not-for-mail
From: Chun Kai Wang <chunkaiw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: unable to open socket
Date: Fri, 19 Jan 2007 20:00:55 +0000 (UTC)
Organization: Your Company
Lines: 10
Distribution: su
Message-ID: <Xns98BD7A3BF1A55chunkaiwstanfordedu@171.64.14.103>
NNTP-Posting-Host: rescomp-06-59601.stanford.edu
X-Trace: news.Stanford.EDU 1169236855 6067 128.12.22.217 (19 Jan 2007 20:00:55 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Xnews/5.04.25
Xref: shelby.stanford.edu su.class.cs244a:11158

i passed the grading script but when i use IE to access the proxy, 

it works at first, but once i press "F5, or refresh", 


then the proxy shuts down and returns cannot open socket for all 
websites...


is this normal?
.

Path: shelby.stanford.edu!not-for-mail
From: Yuliya Sarkisyan <yuliya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Segmentation Fault
Date: Fri, 19 Jan 2007 12:04:33 -0800
Lines: 48
Distribution: su
Message-ID: <eor88o$6va$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169237080 7146 127.0.0.1 (19 Jan 2007 20:04:40 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
Xref: shelby.stanford.edu su.class.cs244a:11159

I am consistently getting a segmentation fault on ports 1300, 1304 and 
1307, but on no others in the 1300-1325 range.

The following are my first lines in main():

   if ( (listenfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
     error("ERROR opening socket");

   if (argc < 2)
     error("ERROR, no port provided\n");

   portno = atoi(argv[1]);

   printf("port: %d\n", portno);

   bzero((char *) &servaddr, sizeof(servaddr));
   servaddr.sin_family = AF_INET;
   servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
   servaddr.sin_port = htons(portno);

   printf("created socket struct\n");

   /* BIND SOCKET */

   if (bind(listenfd, (SA *) &servaddr, sizeof(servaddr)) < 0)
     error("ERROR on binding");

   printf("bound to socket\n");


The port is printed correctly and so is "created socket struct\n", but 
the segmentation fault occurs before "bound to socket\n" is printed.

Why would the program crash on some ports and work on others?

Thanks for the help,
Yuliya

P.S.

I am having trouble running valgrind and am getting the following error 
message:

vine7:~/cs244a> valgrind proxy 1301
Executable range 0xb0000000-0xb0819730 is outside the
acceptable range 0x80d7000-0x7fa11000
valgrind: failed to load /usr/lib/valgrind/stage2: Cannot allocate memory

.

Path: shelby.stanford.edu!not-for-mail
From: Douglas Wightman <wightman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Basing code upon other code
Date: Fri, 19 Jan 2007 12:23:55 -0800
Lines: 10
Distribution: su
Message-ID: <eor9cr$7ps$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169238235 7996 127.0.0.1 (19 Jan 2007 20:23:55 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
Xref: shelby.stanford.edu su.class.cs244a:11160

This is my first programming assignment at Stanford. Please confirm 
whether or not it is alright to cut & paste code snippets from other 
sources (so long as they are cited). For example:
http://www.cs.rpi.edu/courses/sysprog/sockets/sock.html

Would this be considered plagiarism? Clearly, the functioning of these 
examples significantly differs from our assignment. Would it decrease my 
mark on the assignment?

Thanks
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: error handling
Date: Fri, 19 Jan 2007 12:40:07 -0800
Lines: 25
Distribution: su
Message-ID: <C1D66CA7.780C%jpettit@stanford.edu>
References: <Xns98BD7777D7820chunkaiwstanfordedu@171.64.14.103>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169239212 8884 127.0.0.1 (19 Jan 2007 20:40:12 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: error handling
Thread-Index: Acc8CgEmP7e9lqf9Edui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11161

If you receive a request like that, then send back an error to the client
and be in a state that you can handle a new connection.  The grading script
is fairly fragile, so do that sort of testing manually.

--Justin


On 1/19/07 11:44 AM, in article
Xns98BD7777D7820chunkaiwstanfordedu@171.64.14.103, "Chun Kai Wang"
<chunkaiw@stanford.edu> wrote:

> what should the error handling be?
> 
> right now, when i change the grading script such that there is an invalid
> url, say "ht://www.c.com" then a valid one after that "http://www.cnn.com/"
> 
> the grading script will exit and print the error message for the invalid
> URL
> 
> 
> is this correct? or is it suppose to continue?
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: unable to open socket
Date: Fri, 19 Jan 2007 12:48:51 -0800
Lines: 25
Distribution: su
Message-ID: <C1D66EB3.7813%jpettit@stanford.edu>
References: <Xns98BD7A3BF1A55chunkaiwstanfordedu@171.64.14.103>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169239735 9313 127.0.0.1 (19 Jan 2007 20:48:55 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: unable to open socket
Thread-Index: Acc8Czl6eAgcMKf+Edui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11162

If you didn't write a select-based, thread-based, or fork-based proxy, then
your browser is probably going to have really bad performance and seem to
hang, since it issues many simultaneous requests.  That's why the grading
script does one request at a time.  Regardless, though, if your proxy "shuts
down", that doesn't sound good.

--Justin


On 1/19/07 12:00 PM, in article
Xns98BD7A3BF1A55chunkaiwstanfordedu@171.64.14.103, "Chun Kai Wang"
<chunkaiw@stanford.edu> wrote:

> i passed the grading script but when i use IE to access the proxy,
> 
> it works at first, but once i press "F5, or refresh",
> 
> 
> then the proxy shuts down and returns cannot open socket for all
> websites...
> 
> 
> is this normal?


.

Path: shelby.stanford.edu!myth15.Stanford.EDU!shchoi
From: Seung Hoon Choi <shchoi@stanford.edu>
Newsgroups: su.class.cs244a
Subject: HTTP/0.9 Compatibility
Date: Fri, 19 Jan 2007 12:54:12 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.LNX.4.44.0701191253430.8861-100000@myth15.Stanford.EDU>
NNTP-Posting-Host: myth15.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1169240054 9683 171.64.15.56 (19 Jan 2007 20:54:14 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:11163


Hi,

Do we need to make the proxy backward compatible to HTTP/0.9?


Thanks,
-Seung

.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Checking Assignment Submissions
Date: Fri, 19 Jan 2007 12:55:02 -0800
Lines: 10
Distribution: su
Message-ID: <eorbas$9ia$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169240221 9802 171.64.74.54 (19 Jan 2007 20:57:01 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
Xref: shelby.stanford.edu su.class.cs244a:11164

If you would like to check that your assignment was submitted 
successfully, take a look at

http://www.stanford.edu/class/cs244a/cgi-bin/submit/status.php

You should see a listing of the assignments that you have submitted 
(including resubmissions) and the dates that we have recorded for those 
submissions.

Clay
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: grading script vs. telnet
Date: Fri, 19 Jan 2007 13:01:41 -0800
Lines: 38
Distribution: su
Message-ID: <eorbn8$9ia$2@news.Stanford.EDU>
References: <Xns98BD5608CADEFchunkaiwstanfordedu@171.64.14.103> <eoqsj5$npg$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169240618 9802 171.64.74.54 (19 Jan 2007 21:03:38 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <eoqsj5$npg$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11165

Yes- CNN does vary once in a while, and we will be using a static 
version of the page when we do the actual grading, to make sure that we 
don't get spurious errors when we test your proxy.

If the script is failing occasionally with slight variations, it is 
likely just CNN's server changing things around; if you are failing 
consistently, and seeing the same error every time, it's likely that 
your proxy is altering the data returned from the server in some way.

Clay
Raymond Thang wrote:
> Someone noted (in the newsgroup) that cnn.com can sometimes serves up 
> different responses.  I have also found that to be the case; but I find 
> that for the majority of times, cnn.com passes the grading script runs.
> 
> - Raymond
> 
> Chun Kai Wang wrote:
>> my grading script says:
>>
>>>>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>>
>> <<< <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 
>> Transitional//EN"><html lang="en"><head><title>CNN.com - Breaking 
>> News, U.S., World, Weather, Entertainment & Video News</title>     
>> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
>>
>>
>> but when i telnet and do GET http://www.cnn.com/
>>
>> it works just fine and i get
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html 
>> lang="en"><head><title>CNN.com - Breaking News, U.S., World, Weather, 
>> Entertainment & Video News</title>     <meta 
>> http-equiv="content-type" content="text/html; charset=iso-8859-1">
>>
>>
>> help...
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Submission Tarballs
Date: Fri, 19 Jan 2007 13:23:47 -0800
Lines: 22
Distribution: su
Message-ID: <eord0m$b5r$1@news.Stanford.EDU>
References: <eop0ua$n6m$1@news.Stanford.EDU> <eor2on$11a$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169241944 11451 171.64.74.54 (19 Jan 2007 21:25:44 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <eor2on$11a$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11166

Yes- as long as you've added any additional source files that you 
created to the source list, the 'make submit' from the Makefile should 
produce a perfectly acceptable file.

Clay
Raymond Thang wrote:
> Clay Collier wrote:
>> Please make sure that you are gzipping the tar archives that you 
>> submit (use 'tar zcf' to create the file)- it will save you time 
>> performing the upload, and makes it easier for us to process the 
>> submissions in a batch.  Check out the sample Makefile on the 
>> assignment page if you're not sure how to tar up your working files.
>>
>> Clay
> 
> (This may sound a little silly)
> 
> If we've updated the makefile sources and headers correctly, shouldn't 
> we just be able to 'make submit' and submit the pa1.tar.gz file it 
> produces?
> 
> - Raymond
.

Path: shelby.stanford.edu!not-for-mail
From: "Alicia Chen" <achen530@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Connection close by foreign host
Date: Fri, 19 Jan 2007 13:31:18 -0800
Lines: 7
Distribution: su
Message-ID: <eordba$ble$1@news.Stanford.EDU>
NNTP-Posting-Host: boxy.stanford.edu
X-Trace: news.Stanford.EDU 1169242282 11950 128.12.83.54 (19 Jan 2007 21:31:22 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11167

When I try to connect to the Stanford website, it gets alll-most all the way 
to the end before getting shut down by the other side.  This happens both 
with IE and telnet.  Any ideas?

--Alicia 


.

Path: shelby.stanford.edu!not-for-mail
From: "David Gobaud" <gobaudd@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: multithreading
Date: Fri, 19 Jan 2007 13:45:11 -0800
Lines: 46
Distribution: su
Message-ID: <eore59$cav$1@news.Stanford.EDU>
References: <eoq9s1$6b9$1@news.Stanford.EDU> <C1D6310D.77CE%jpettit@stanford.edu>
NNTP-Posting-Host: norad.stanford.edu
X-Trace: news.Stanford.EDU 1169243113 12639 128.12.81.44 (19 Jan 2007 21:45:13 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11168

I'm used to programming for Windows and think in Visual Studio one can 
select either a single threaded or multithreaded CRT library to link to and 
if one uses the single threaded one with a multithreaded program I believe 
there are problems.

Is it the same in Unix?

David Gobaud

"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1D6310D.77CE%jpettit@stanford.edu...
> I'm not quite sure what you are asking in your first question, but I 
> assume
> you figured it out, since a later post seems to have working code.
>
> Most of the socket calls are thread-safe.  There are a few, such as
> gethostent, which are not thread-safe, but they have sister functions with
> an "_r", such as gethostent_r.  They are listed on the same man page as 
> the
> normal call, so keep your eyes open for them.  However, you should look at
> Chapter 26 of Stevens for a full discussion.
>
> --Justin
>
>
> On 1/19/07 3:25 AM, in article eoq9s1$6b9$1@news.Stanford.EDU, "David
> Gobaud" <gobaudd@stanford.edu> wrote:
>
>> Hi,
>>
>> What is the gcc compiler option to link to multithreaded c and c++ 
>> standard
>> libraries? Also, is the socket library thread-safe by default or must one
>> synchronize socket calls? If only a single thread deals with each socket 
>> is
>> it thread-safe?
>>
>> Thank you,
>> David Gobaud
>>
>>
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "David Gobaud" <gobaudd@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: broken pipe?
Date: Fri, 19 Jan 2007 13:47:00 -0800
Lines: 53
Distribution: su
Message-ID: <eore8l$ce6$1@news.Stanford.EDU>
References: <eoqgb1$dk0$1@news.Stanford.EDU> <C1D62E5B.77CA%jpettit@stanford.edu> <eoqskc$npg$2@news.Stanford.EDU> <C1D6387D.77DD%jpettit@stanford.edu>
NNTP-Posting-Host: norad.stanford.edu
X-Trace: news.Stanford.EDU 1169243221 12742 128.12.81.44 (19 Jan 2007 21:47:01 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11169

My implementation is single threaded. I think I fixed the problem by being 
more careful and not writing to sockets on which a recv or send has already 
failed.

David Gobaud

"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1D6387D.77DD%jpettit@stanford.edu...
> No, but if your program dies during execution, then you'll definitely lose
> points.  I've only heard about SIGPIPE problems related to multithreaded
> implementations of the assignment.  My version of the assignment didn't 
> have
> any signal handlers (I did a forking version).
>
> --Justin
>
>
> On 1/19/07 8:46 AM, in article eoqskc$npg$2@news.Stanford.EDU, "Raymond
> Thang" <rlt5654@stanford.edu> wrote:
>
>> Will we be marked off if we don't have signal handlers?
>> - Raymond
>>
>> Justin Pettit wrote:
>>> I actual spoke with another student who had a similar problem.  It has 
>>> to do
>>> with trying to write to a socket that was closed by the other end.  Look
>>> into handling the SIGPIPE signal.  If you don't have a handler, the 
>>> system
>>> kills your process.
>>>
>>> --Justin
>>>
>>>
>>> On 1/19/07 5:16 AM, in article eoqgb1$dk0$1@news.Stanford.EDU, "David
>>> Gobaud" <gobaudd@stanford.edu> wrote:
>>>
>>>> Hi,
>>>>
>>>> Sometimes when my proxy is processing requests it exits and says 
>>>> "Broken
>>>> pipe". Ideas... ? I can't reproduce it reliably.
>>>>
>>>> Thank you,
>>>> David Gobaud
>>>>
>>>>
>>>
>>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "David Gobaud" <gobaudd@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Connection close by foreign host
Date: Fri, 19 Jan 2007 13:47:48 -0800
Lines: 14
Distribution: su
Message-ID: <eorea5$cf0$1@news.Stanford.EDU>
References: <eordba$ble$1@news.Stanford.EDU>
NNTP-Posting-Host: norad.stanford.edu
X-Trace: news.Stanford.EDU 1169243269 12768 128.12.81.44 (19 Jan 2007 21:47:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11170

I'm having the same problem with an HTTP .9 session to www.yahoo.com

David Gobaud

"Alicia Chen" <achen530@stanford.edu> wrote in message 
news:eordba$ble$1@news.Stanford.EDU...
> When I try to connect to the Stanford website, it gets alll-most all the 
> way to the end before getting shut down by the other side.  This happens 
> both with IE and telnet.  Any ideas?
>
> --Alicia
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: multithreading
Date: Fri, 19 Jan 2007 13:50:13 -0800
Lines: 56
Distribution: su
Message-ID: <C1D67D15.7825%jpettit@stanford.edu>
References: <eoq9s1$6b9$1@news.Stanford.EDU> <C1D6310D.77CE%jpettit@stanford.edu> <eore59$cav$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169243420 13031 127.0.0.1 (19 Jan 2007 21:50:20 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: multithreading
Thread-Index: Acc8E8wfCo0jJKgHEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11171

Just stick to the thread-safe version of calls, and you should be fine.

--Justin


On 1/19/07 1:45 PM, in article eore59$cav$1@news.Stanford.EDU, "David
Gobaud" <gobaudd@stanford.edu> wrote:

> I'm used to programming for Windows and think in Visual Studio one can
> select either a single threaded or multithreaded CRT library to link to and
> if one uses the single threaded one with a multithreaded program I believe
> there are problems.
> 
> Is it the same in Unix?
> 
> David Gobaud
> 
> "Justin Pettit" <jpettit@stanford.edu> wrote in message
> news:C1D6310D.77CE%jpettit@stanford.edu...
>> I'm not quite sure what you are asking in your first question, but I
>> assume
>> you figured it out, since a later post seems to have working code.
>> 
>> Most of the socket calls are thread-safe.  There are a few, such as
>> gethostent, which are not thread-safe, but they have sister functions with
>> an "_r", such as gethostent_r.  They are listed on the same man page as
>> the
>> normal call, so keep your eyes open for them.  However, you should look at
>> Chapter 26 of Stevens for a full discussion.
>> 
>> --Justin
>> 
>> 
>> On 1/19/07 3:25 AM, in article eoq9s1$6b9$1@news.Stanford.EDU, "David
>> Gobaud" <gobaudd@stanford.edu> wrote:
>> 
>>> Hi,
>>> 
>>> What is the gcc compiler option to link to multithreaded c and c++
>>> standard
>>> libraries? Also, is the socket library thread-safe by default or must one
>>> synchronize socket calls? If only a single thread deals with each socket
>>> is
>>> it thread-safe?
>>> 
>>> Thank you,
>>> David Gobaud
>>> 
>>> 
>>> 
>> 
>> 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HTTP/0.9 Compatibility
Date: Fri, 19 Jan 2007 13:51:16 -0800
Lines: 20
Distribution: su
Message-ID: <C1D67D54.7826%jpettit@stanford.edu>
References: <Pine.LNX.4.44.0701191253430.8861-100000@myth15.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169243478 13031 127.0.0.1 (19 Jan 2007 21:51:18 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: HTTP/0.9 Compatibility
Thread-Index: Acc8E/GsMDwVxKgHEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11172

We'll only send HTTP/1.0 requests.

--Justin


On 1/19/07 12:54 PM, in article
Pine.LNX.4.44.0701191253430.8861-100000@myth15.Stanford.EDU, "Seung Hoon
Choi" <shchoi@stanford.edu> wrote:

> 
> Hi,
> 
> Do we need to make the proxy backward compatible to HTTP/0.9?
> 
> 
> Thanks,
> -Seung
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Brian Thompson" <Brian.C.Thompson@Boeing.com>
Newsgroups: su.class.cs244a
Subject: Char to String
Date: Fri, 19 Jan 2007 14:07:02 -0800
Lines: 3
Distribution: su
Message-ID: <eorfea$dib$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169244426 13899 127.0.0.1 (19 Jan 2007 22:07:06 GMT)
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.2962
Xref: shelby.stanford.edu su.class.cs244a:11173

What is the best method for changing a char to a string in C? 


.

Path: shelby.stanford.edu!not-for-mail
From: "Darius Henderson" <darius.henderson@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running grading script
Date: Fri, 19 Jan 2007 15:16:03 -0800
Lines: 125
Distribution: su
Message-ID: <eorjfo$h9a$1@news.Stanford.EDU>
References: <eoeheb$l9m$1@news.Stanford.EDU> <C1D00C6D.7506%jpettit@stanford.edu> <eoel8m$ob8$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169248568 17706 127.0.0.1 (19 Jan 2007 23:16:08 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:11174

I've been testing my proxy through telnet and my browsers mostly, so I just 
started using the grading script and I've got this error too. I don't have 
any trouble making connections through the browsers though. Anyone know some 
reasons why this would occur only with the script or if there's a way to 
debug my program while the script is executing?

Thanks,
Darius


"Alex" <axle@sonic.net> wrote in message 
news:eoel8m$ob8$1@news.Stanford.EDU...
>I gave a port in the valid range and I still see this issue. I was able to 
>run my proxy on that port and use telnet and do GET correctly but I'm still 
>having problems with the grading script.
>
> vine7:~/proj1> ./grade proxy.c 32454
> Binary: proxy.c
> Running on port 32454
> Traceback (most recent call last):
>  File "./grade", line 97, in ?
>    main()
>  File "./grade", line 42, in main
>    foblist.append(urllib.urlopen(url, None, proxy_map))
>  File 
> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", line 
> 82, in urlopen
>    return opener.open(url)
>  File 
> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", line 
> 190, in open
>    return getattr(self, name)(url)
>  File 
> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", line 
> 313, in open_http
>    h.endheaders()
>  File 
> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
> line 798, in endheaders
>    self._send_output()
>  File 
> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
> line 679, in _send_output
>    self.send(msg)
>  File 
> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
> line 646, in send
>    self.connect()
>  File 
> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
> line 630, in connect
>    raise socket.error, msg
> IOError: [Errno socket error] (111, 'Connection refused')
>
> Alex
>
> "Justin Pettit" <jpettit@stanford.edu> wrote in message 
> news:C1D00C6D.7506%jpettit@stanford.edu...
>> TCP and UDP port numbers are 16-bit values, which means the maximum value 
>> is
>> 65535.  Try something between 1024 and 65535.  You also might want to 
>> check
>> to make sure that you're checking all your socket return values and 
>> compiler
>> warnings.
>>
>> --Justin
>>
>>
>> On 1/14/07 4:21 PM, in article eoeheb$l9m$1@news.Stanford.EDU, "Alex"
>> <axle@sonic.net> wrote:
>>
>>> I was trying to run the grading script on my proxy and I get the 
>>> messages
>>> below. Why is this happening?
>>>
>>> vine7:~/proj1> ./grade proxy.c 98235
>>> Binary: proxy.c
>>> Running on port 98235
>>> Traceback (most recent call last):
>>>   File "./grade", line 100, in ?
>>>     main()
>>>   File "./grade", line 45, in main
>>>     foblist.append(urllib.urlopen(url, None, proxy_map))
>>>   File 
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>> line 82, in urlopen
>>>     return opener.open(url)
>>>   File 
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>> line 190, in open
>>>     return getattr(self, name)(url)
>>>   File 
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>> line 313, in open_http
>>>     h.endheaders()
>>>   File
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>>> line
>>> 798, in endheaders
>>>     self._send_output()
>>>   File
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>>> line
>>> 679, in _send_output
>>>     self.send(msg)
>>>   File
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>>> line
>>> 646, in send
>>>     self.connect()
>>>   File
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py", 
>>> line
>>> 630, in connect
>>>     raise socket.error, msg
>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>
>>>
>>
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Brian Thompson" <Brian.C.Thompson@Boeing.com>
Newsgroups: su.class.cs244a
Subject: Re: Char to String
Date: Fri, 19 Jan 2007 15:52:21 -0800
Lines: 9
Distribution: su
Message-ID: <eorljq$j0h$1@news.Stanford.EDU>
References: <eorfea$dib$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169250746 19473 127.0.0.1 (19 Jan 2007 23:52:26 GMT)
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.2962
Xref: shelby.stanford.edu su.class.cs244a:11175

Nevermind.   I found a way to do this by creating a 2 char array and then 
assigning [0] the char and [1] the '\0'.

"Brian Thompson" <Brian.C.Thompson@Boeing.com> wrote in message 
news:eorfea$dib$1@news.Stanford.EDU...
> What is the best method for changing a char to a string in C?
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Basing code upon other code
Date: Fri, 19 Jan 2007 16:21:20 -0800
Lines: 24
Distribution: su
Message-ID: <C1D6A080.783C%jpettit@stanford.edu>
References: <eor9cr$7ps$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169252489 21165 127.0.0.1 (20 Jan 2007 00:21:29 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Basing code upon other code
Thread-Index: Acc8KOh5JzQBt6gcEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11176

As I've stated before, there's only so many ways to do relatively simple
things.  If you are just doing basic things like creating sockets, binding
to interfaces, etc. then don't worry too much about citing your sources.  If
you are using bigger things (e.g. a modified version of Stevens's readline
function), then you should provide attribution.

--Justin


On 1/19/07 12:23 PM, in article eor9cr$7ps$1@news.Stanford.EDU, "Douglas
Wightman" <wightman@stanford.edu> wrote:

> This is my first programming assignment at Stanford. Please confirm
> whether or not it is alright to cut & paste code snippets from other
> sources (so long as they are cited). For example:
> http://www.cs.rpi.edu/courses/sysprog/sockets/sock.html
> 
> Would this be considered plagiarism? Clearly, the functioning of these
> examples significantly differs from our assignment. Would it decrease my
> mark on the assignment?
> 
> Thanks


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Segmentation Fault
Date: Fri, 19 Jan 2007 16:57:47 -0800
Lines: 61
Distribution: su
Message-ID: <C1D6A90B.7858%jpettit@stanford.edu>
References: <eor88o$6va$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169254671 22954 127.0.0.1 (20 Jan 2007 00:57:51 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Segmentation Fault
Thread-Index: Acc8LgAHPqFClqghEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11177

I don't see anything from my quick look at the code.  I'd recommend running
it through gdb.  I haven't seen your valgrind error before.  If you have
some memory problem that's causing a segmentation fault, it may be causing
valgrind problems.  Hopefully, it would warn you first, though.

--Justin


On 1/19/07 12:04 PM, in article eor88o$6va$1@news.Stanford.EDU, "Yuliya
Sarkisyan" <yuliya@stanford.edu> wrote:

> I am consistently getting a segmentation fault on ports 1300, 1304 and
> 1307, but on no others in the 1300-1325 range.
> 
> The following are my first lines in main():
> 
>    if ( (listenfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
>      error("ERROR opening socket");
> 
>    if (argc < 2)
>      error("ERROR, no port provided\n");
> 
>    portno = atoi(argv[1]);
> 
>    printf("port: %d\n", portno);
> 
>    bzero((char *) &servaddr, sizeof(servaddr));
>    servaddr.sin_family = AF_INET;
>    servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
>    servaddr.sin_port = htons(portno);
> 
>    printf("created socket struct\n");
> 
>    /* BIND SOCKET */
> 
>    if (bind(listenfd, (SA *) &servaddr, sizeof(servaddr)) < 0)
>      error("ERROR on binding");
> 
>    printf("bound to socket\n");
> 
> 
> The port is printed correctly and so is "created socket struct\n", but
> the segmentation fault occurs before "bound to socket\n" is printed.
> 
> Why would the program crash on some ports and work on others?
> 
> Thanks for the help,
> Yuliya
> 
> P.S.
> 
> I am having trouble running valgrind and am getting the following error
> message:
> 
> vine7:~/cs244a> valgrind proxy 1301
> Executable range 0xb0000000-0xb0819730 is outside the
> acceptable range 0x80d7000-0x7fa11000
> valgrind: failed to load /usr/lib/valgrind/stage2: Cannot allocate memory
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running grading script
Date: Fri, 19 Jan 2007 17:01:56 -0800
Lines: 138
Distribution: su
Message-ID: <C1D6AA04.785A%jpettit@stanford.edu>
References: <eoeheb$l9m$1@news.Stanford.EDU> <C1D00C6D.7506%jpettit@stanford.edu> <eoel8m$ob8$1@news.Stanford.EDU> <eorjfo$h9a$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169254919 23286 127.0.0.1 (20 Jan 2007 01:01:59 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: running grading script
Thread-Index: Acc8LpRx0zaVeKghEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11178

It looks like you may be closing the socket you have listening on 32454,
since the script is complaining that it can't connect to your proxy.  You
may want to telnet to your proxy and manually type in the requests from the
grading script.  Is your proxy crashing on one of the queries?

--Justin


On 1/19/07 3:16 PM, in article eorjfo$h9a$1@news.Stanford.EDU, "Darius
Henderson" <darius.henderson@stanford.edu> wrote:

> I've been testing my proxy through telnet and my browsers mostly, so I just
> started using the grading script and I've got this error too. I don't have
> any trouble making connections through the browsers though. Anyone know some
> reasons why this would occur only with the script or if there's a way to
> debug my program while the script is executing?
> 
> Thanks,
> Darius
> 
> 
> "Alex" <axle@sonic.net> wrote in message
> news:eoel8m$ob8$1@news.Stanford.EDU...
>> I gave a port in the valid range and I still see this issue. I was able to
>> run my proxy on that port and use telnet and do GET correctly but I'm still
>> having problems with the grading script.
>> 
>> vine7:~/proj1> ./grade proxy.c 32454
>> Binary: proxy.c
>> Running on port 32454
>> Traceback (most recent call last):
>>  File "./grade", line 97, in ?
>>    main()
>>  File "./grade", line 42, in main
>>    foblist.append(urllib.urlopen(url, None, proxy_map))
>>  File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", line
>> 82, in urlopen
>>    return opener.open(url)
>>  File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", line
>> 190, in open
>>    return getattr(self, name)(url)
>>  File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", line
>> 313, in open_http
>>    h.endheaders()
>>  File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>> line 798, in endheaders
>>    self._send_output()
>>  File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>> line 679, in _send_output
>>    self.send(msg)
>>  File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>> line 646, in send
>>    self.connect()
>>  File 
>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>> line 630, in connect
>>    raise socket.error, msg
>> IOError: [Errno socket error] (111, 'Connection refused')
>> 
>> Alex
>> 
>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>> news:C1D00C6D.7506%jpettit@stanford.edu...
>>> TCP and UDP port numbers are 16-bit values, which means the maximum value
>>> is
>>> 65535.  Try something between 1024 and 65535.  You also might want to
>>> check
>>> to make sure that you're checking all your socket return values and
>>> compiler
>>> warnings.
>>> 
>>> --Justin
>>> 
>>> 
>>> On 1/14/07 4:21 PM, in article eoeheb$l9m$1@news.Stanford.EDU, "Alex"
>>> <axle@sonic.net> wrote:
>>> 
>>>> I was trying to run the grading script on my proxy and I get the
>>>> messages
>>>> below. Why is this happening?
>>>> 
>>>> vine7:~/proj1> ./grade proxy.c 98235
>>>> Binary: proxy.c
>>>> Running on port 98235
>>>> Traceback (most recent call last):
>>>>   File "./grade", line 100, in ?
>>>>     main()
>>>>   File "./grade", line 45, in main
>>>>     foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>   File 
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>> line 82, in urlopen
>>>>     return opener.open(url)
>>>>   File 
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>> line 190, in open
>>>>     return getattr(self, name)(url)
>>>>   File 
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>> line 313, in open_http
>>>>     h.endheaders()
>>>>   File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>> line
>>>> 798, in endheaders
>>>>     self._send_output()
>>>>   File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>> line
>>>> 679, in _send_output
>>>>     self.send(msg)
>>>>   File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>> line
>>>> 646, in send
>>>>     self.connect()
>>>>   File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>> line
>>>> 630, in connect
>>>>     raise socket.error, msg
>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Problem Set Submission
Date: Fri, 19 Jan 2007 18:46:22 -0800
Lines: 19
Distribution: su
Message-ID: <C1D6C27E.786E%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169261183 28105 127.0.0.1 (20 Jan 2007 02:46:23 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Problem Set Submission
Thread-Index: Acc8PStFahSl0agwEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11179

As you should all be aware, the first problem set is due Tuesday at noon.
If you are on-campus, please drop off your assignment at Judy Polenta's
office.  If she is not there, please slip the assignment under her door.
Her office is Gates 351.

If you are an SCPD student, you are more than welcome to drop off your
homework.  However, this is probably not convenient, so feel free to fax it
directly to SCPD.  They'll take care of delivering it to us.  Here's the
routing form that you'll need:

    http://scpd.stanford.edu/scpd/downloads/remoteRouteForm.pdf

Assignments that are handed in will be returned in class.  Faxed assignments
will be sent back to you through SCPD.

If you have any questions, please let me know.

--Justin

.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: broken pipe?
Date: Fri, 19 Jan 2007 19:41:19 -0800
Lines: 85
Distribution: su
Message-ID: <eos2vo$cp$1@news.Stanford.EDU>
References: <eoqgb1$dk0$1@news.Stanford.EDU> <C1D62E5B.77CA%jpettit@stanford.edu> <eoqskc$npg$2@news.Stanford.EDU> <C1D6387D.77DD%jpettit@stanford.edu> <eore8l$ce6$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169264440 409 127.0.0.1 (20 Jan 2007 03:40:40 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11180

> My implementation is single threaded. I think I fixed the problem by being 
> more careful and not writing to sockets on which a recv or send has 
> already failed.

That actually will not save you.  There is a good discussion of it in UNP. 
The high and low of it is that the first time you read a socket that was 
closed, you get a SIGPIPE.  After, it returns an error value.  So, it is 
very easy to blow up code that does not have a signal handler; just send a 
content length that is plausible, but longer than the data you will really 
send.

However, when I compile with -ansi, the preprocessor fails to find the 
functions.  This is in spite of the top of the file saying they are in C99 
(actually, POSIX is the standard).

-ansi gives:
proxy.c: In function 'unp_signal':
proxy.c:283: error: storage size of 'act' isn't known
proxy.c:283: error: storage size of 'oact' isn't known
proxy.c:285: warning: implicit declaration of function 'sigemptyset'
proxy.c:298: warning: implicit declaration of function 'sigaction'
proxy.c:283: warning: unused variable 'oact'
proxy.c:283: warning: unused variable 'act'
proxy.c:300: warning: control reaches end of non-void function

Sincerely,
Randy Jennings

The squirrels are your friends!
"David Gobaud" <gobaudd@stanford.edu> wrote in message 
news:eore8l$ce6$1@news.Stanford.EDU...
>
> David Gobaud
>
> "Justin Pettit" <jpettit@stanford.edu> wrote in message 
> news:C1D6387D.77DD%jpettit@stanford.edu...
>> No, but if your program dies during execution, then you'll definitely 
>> lose
>> points.  I've only heard about SIGPIPE problems related to multithreaded
>> implementations of the assignment.  My version of the assignment didn't 
>> have
>> any signal handlers (I did a forking version).
>>
>> --Justin
>>
>>
>> On 1/19/07 8:46 AM, in article eoqskc$npg$2@news.Stanford.EDU, "Raymond
>> Thang" <rlt5654@stanford.edu> wrote:
>>
>>> Will we be marked off if we don't have signal handlers?
>>> - Raymond
>>>
>>> Justin Pettit wrote:
>>>> I actual spoke with another student who had a similar problem.  It has 
>>>> to do
>>>> with trying to write to a socket that was closed by the other end. 
>>>> Look
>>>> into handling the SIGPIPE signal.  If you don't have a handler, the 
>>>> system
>>>> kills your process.
>>>>
>>>> --Justin
>>>>
>>>>
>>>> On 1/19/07 5:16 AM, in article eoqgb1$dk0$1@news.Stanford.EDU, "David
>>>> Gobaud" <gobaudd@stanford.edu> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Sometimes when my proxy is processing requests it exits and says 
>>>>> "Broken
>>>>> pipe". Ideas... ? I can't reproduce it reliably.
>>>>>
>>>>> Thank you,
>>>>> David Gobaud
>>>>>
>>>>>
>>>>
>>>>
>>
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Reposted: Store-and-forward delay
Date: Sat, 20 Jan 2007 00:29:41 -0800
Lines: 7
Distribution: su
Message-ID: <eosjqt$fo0$1@news.Stanford.EDU>
NNTP-Posting-Host: jadsdesktop.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169281693 16128 128.12.134.140 (20 Jan 2007 08:28:13 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20060911)
Xref: shelby.stanford.edu su.class.cs244a:11181

Prof. McKeown said in class that the store-and-forward delay is
negligible. But isn't that delay equal to the transmission delay? And if
we are considering the transmission delay, shouldn't we then consider
the store-and-forward delay?

Thanks,
Jad.
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Reposted: Store-and-forward delay
Date: Sat, 20 Jan 2007 11:29:46 -0800
Lines: 18
Distribution: su
Message-ID: <eotqj6$j01$1@news.Stanford.EDU>
References: <eosjqt$fo0$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169321382 19457 127.0.0.1 (20 Jan 2007 19:29:42 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eosjqt$fo0$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11182

Jad Naous wrote:
> Prof. McKeown said in class that the store-and-forward delay is
> negligible. But isn't that delay equal to the transmission delay? And if
> we are considering the transmission delay, shouldn't we then consider
> the store-and-forward delay?
> 
> Thanks,
> Jad.

The transmission delay IS the store and forward delay.  IE if you were 
traversing from host A to B over n links, and all the links had the same 
bandwidth, then you would have to consider n transmission delays 
(because the packet must be accumulated at each router then sent on to 
the next).  However if you were not accumulating the packet at each 
router before sending it on, IE doing a cut-through router style, then 
you would only consider a single transmission delay over the full route.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Reposted: Store-and-forward delay
Date: Sat, 20 Jan 2007 13:25:37 -0800
Lines: 32
Distribution: su
Message-ID: <eou19n$ohv$1@news.Stanford.EDU>
References: <eosjqt$fo0$1@news.Stanford.EDU> <eotqj6$j01$1@news.Stanford.EDU>
NNTP-Posting-Host: jadsdesktop.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169328247 25151 128.12.134.140 (20 Jan 2007 21:24:07 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20060911)
In-Reply-To: <eotqj6$j01$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11183

If the packet length is L and the link rate is R, when the first bit of
a packet reaches the router, it takes R/L to get the full packet into
the router before we do anything with it. That's the store-and-forward
delay, right?

And then after processing and queuing, when the first bit is ready to go
out on the link, it takes another R/L to put the packet back on the
wire, isn't that the transmission delay? So doesn't a packet experience
2*R/L delays going through a router?

Thanks,
Jad.

David Erickson wrote:
> Jad Naous wrote:
>> Prof. McKeown said in class that the store-and-forward delay is
>> negligible. But isn't that delay equal to the transmission delay? And if
>> we are considering the transmission delay, shouldn't we then consider
>> the store-and-forward delay?
>>
>> Thanks,
>> Jad.
> 
> The transmission delay IS the store and forward delay.  IE if you were
> traversing from host A to B over n links, and all the links had the same
> bandwidth, then you would have to consider n transmission delays
> (because the packet must be accumulated at each router then sent on to
> the next).  However if you were not accumulating the packet at each
> router before sending it on, IE doing a cut-through router style, then
> you would only consider a single transmission delay over the full route.
> 
> -David
.

Path: shelby.stanford.edu!not-for-mail
From: "manj" <manj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: collaboration on the problem set
Date: Sat, 20 Jan 2007 14:53:28 -0800
Lines: 3
Distribution: su
Message-ID: <eou6h1$sd8$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab434df3.stanford.edu
X-Trace: news.Stanford.EDU 1169333601 29096 171.67.77.243 (20 Jan 2007 22:53:21 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11184

Are we allowed to collaborate/discuss on the problem set?


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Reposted: Store-and-forward delay
Date: Sat, 20 Jan 2007 15:12:57 -0800
Lines: 47
Distribution: su
Message-ID: <eou7ll$2m$1@news.Stanford.EDU>
References: <eosjqt$fo0$1@news.Stanford.EDU> <eotqj6$j01$1@news.Stanford.EDU> <eou19n$ohv$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169334774 86 127.0.0.1 (20 Jan 2007 23:12:54 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eou19n$ohv$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11185

 > David Erickson wrote:
 >> Jad Naous wrote:
 >>> Prof. McKeown said in class that the store-and-forward delay is
 >>> negligible. But isn't that delay equal to the transmission delay? 
And if
 >>> we are considering the transmission delay, shouldn't we then consider
 >>> the store-and-forward delay?
 >>>
 >>> Thanks,
 >>> Jad.
 >> The transmission delay IS the store and forward delay.  IE if you were
 >> traversing from host A to B over n links, and all the links had the same
 >> bandwidth, then you would have to consider n transmission delays
 >> (because the packet must be accumulated at each router then sent on to
 >> the next).  However if you were not accumulating the packet at each
 >> router before sending it on, IE doing a cut-through router style, then
 >> you would only consider a single transmission delay over the full route.
 >>
 >> -David

Jad Naous wrote:
> If the packet length is L and the link rate is R, when the first bit of
> a packet reaches the router, it takes R/L to get the full packet into
> the router before we do anything with it. That's the store-and-forward
> delay, right?
> 
> And then after processing and queuing, when the first bit is ready to go
> out on the link, it takes another R/L to put the packet back on the
> wire, isn't that the transmission delay? So doesn't a packet experience
> 2*R/L delays going through a router?
> 
> Thanks,
> Jad.
> 

Its better to think about it from the packets point of view.  Lets 
assume L is the packet size, R is the rate of all of the links in b/s. 
Then the time for the entire packet to make it from origin router to 
router 2 is the transmission delay: L/R + some Propogation delay (Prop). 
  Once at the second router I may experience some processing and 
queueing delay.  Then from router 2 to router 3 the delay is similar as 
from origin to 2, Transmission delay of L/R + Prop, and so it goes 
through each router in series until the end.

Does that make more sense?

-David
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Office Hours
Date: Sat, 20 Jan 2007 15:30:08 -0800
Lines: 6
Distribution: su
Message-ID: <eou8m5$pv$1@news.Stanford.EDU>
NNTP-Posting-Host: paulinator.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169335813 831 128.12.133.106 (20 Jan 2007 23:30:13 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
Xref: shelby.stanford.edu su.class.cs244a:11186

My Office hours have changed to Monday from 12:45 - 2:45. The Wednesday 
hours conflicted with another class I must take.

Sorry for any inconvenience this might have caused.

Paul
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: collaboration on the problem set
Date: Sat, 20 Jan 2007 15:32:29 -0800
Lines: 6
Distribution: su
Message-ID: <eou8qi$pv$2@news.Stanford.EDU>
References: <eou6h1$sd8$1@news.Stanford.EDU>
NNTP-Posting-Host: paulinator.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169335954 831 128.12.133.106 (20 Jan 2007 23:32:34 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eou6h1$sd8$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11187

Manj, please read the Logistics handout on the website. It is the first 
one. I won't paste it all here, but the full answer to your question is 
there.

In short, you can generally collaborate but not specifically. For more 
detail see the handout.
.

Path: shelby.stanford.edu!not-for-mail
From: Benjamin Nham <nham@stanford.edu>
Newsgroups: su.class.cs244a
Subject: watching lectures
Date: Sat, 20 Jan 2007 20:44:13 -0800
Lines: 5
Distribution: su
Message-ID: <eour2u$e8d$1@news.Stanford.EDU>
NNTP-Posting-Host: nham.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169354654 14605 128.12.94.22 (21 Jan 2007 04:44:14 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
Xref: shelby.stanford.edu su.class.cs244a:11188

I can't seem to watch lectures online. Anyone else having this problem? 
I can't exactly watch it in person, since I'm also in CS161, which isn't 
offered online...

Ben
.

Path: shelby.stanford.edu!not-for-mail
From: "David Gobaud" <gobaudd@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 #6
Date: Sat, 20 Jan 2007 23:19:31 -0800
Lines: 15
Distribution: su
Message-ID: <eov466$k43$1@news.Stanford.EDU>
NNTP-Posting-Host: norad.stanford.edu
X-Trace: news.Stanford.EDU 1169363974 20611 128.12.81.44 (21 Jan 2007 07:19:34 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:11189

Hi,

I'm finding #6 on PS1 confusing.

It states that a packet is buffered on average every 10ms by the router. 
Does this mean a packet arrives on average every 10ms? If not, I'm having 
trouble seeing how to approach part a since we are not told the bandwidth of 
the router. Also, for b, I don't see how to calculate the average delay of a 
packet in the router. Is this the same as the queuing delay and if so, don't 
we need to know the bandwidth to calculate it?

Thank you,
David Gobaud 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: watching lectures
Date: Sun, 21 Jan 2007 00:03:33 -0800
Lines: 20
Distribution: su
Message-ID: <C1D85E55.78B7%jpettit@stanford.edu>
References: <eour2u$e8d$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169366615 25342 127.0.0.1 (21 Jan 2007 08:03:35 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: watching lectures
Thread-Index: Acc9MqUL44O0iqklEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11190

I just tried for one of my other classes, and it's not working either.  My
guess is that SCPD is having a temporary problem.

By the way, since Professor McKeown doesn't allow students to take alternate
midterms or final exams, you should make sure you won't have a conflict with
CS161.

--Justin


On 1/20/07 8:44 PM, in article eour2u$e8d$1@news.Stanford.EDU, "Benjamin
Nham" <nham@stanford.edu> wrote:

> I can't seem to watch lectures online. Anyone else having this problem?
> I can't exactly watch it in person, since I'm also in CS161, which isn't
> offered online...
> 
> Ben


.

Path: shelby.stanford.edu!not-for-mail
From: "Tom Deane" <tdeane@stanford.edu>
Newsgroups: su.class.cs244a
Subject: problem 9
Date: Sun, 21 Jan 2007 17:36:09 -0800
Lines: 18
Distribution: su
Message-ID: <ep14ee$fhn$1@news.Stanford.EDU>
NNTP-Posting-Host: amdrules.stanford.edu
X-Trace: news.Stanford.EDU 1169429774 15927 128.12.197.229 (22 Jan 2007 01:36:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:11191

Part a) iii)
    A(t) = 200 + 2t.  At t=0, we have 200 bits in the queue.  Each of those 
bits has a different queue delay: bit 0 goes out right way, whereas bit 199 
has to wait a while.  So, d(t) at t = 0 is different depending on which of 
the 200 bits you are referring to.  How do you want us to express this? 
Alternatively, we can ignore the first 199 bits and just take the worst 
delay at t = 0.

Part b)
    Is it ok to express the answer in terms of some variable (say "p") that 
represents the packet number, where "p" is an integer ranging from 0 to 
infinity?

Thanks,
Tom



.

Path: shelby.stanford.edu!not-for-mail
From: Peter Pawlowski <pawlowski@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 #9
Date: Sun, 21 Jan 2007 17:48:42 -0800
Lines: 19
Distribution: su
Message-ID: <ep155u$g41$1@news.Stanford.EDU>
NNTP-Posting-Host: piotrek.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1169430526 16513 128.12.104.53 (22 Jan 2007 01:48:46 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Unison/1.7.7
Xref: shelby.stanford.edu su.class.cs244a:11192

Hello--

Two questions on question 9 on PS1:

(1) Why is the time-average queue occupancy not a function of t? Isn't 
the point of this function to tell you the average queue occupancy from 
t = 0 until some later time t?

(2) In the discrete arrival case, does a packet enter the queue as soon 
as the first bit of the packet is recieved or when the entire packet is 
recieved? Likewise, does the packet leave the queue when the first bit 
is transmitted or when the last bit is? The basic question is: when 
working with these simplified router models, does each link have a 
local buffer of the current packet it's dealing with or are all 
operations done directly on the queue?

Thanks,
Peter

.

Path: shelby.stanford.edu!not-for-mail
From: "manj" <manj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 #7
Date: Sun, 21 Jan 2007 21:27:58 -0800
Lines: 8
Distribution: su
Message-ID: <ep1i0n$pmm$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab4082f9.stanford.edu
X-Trace: news.Stanford.EDU 1169443671 26326 171.64.130.249 (22 Jan 2007 05:27:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11193

In #7, no information has been provided for calculating the propogation 
delay.

Should we ignore propogation delay, assuming that it is negligible compared 
to the transmission time, when calculating the total time required to 
transmit the file? 


.

Path: shelby.stanford.edu!not-for-mail
From: "manj" <manj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 #6
Date: Sun, 21 Jan 2007 22:13:18 -0800
Lines: 4
Distribution: su
Message-ID: <ep1kln$rkf$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab4082f9.stanford.edu
X-Trace: news.Stanford.EDU 1169446391 28303 171.64.130.249 (22 Jan 2007 06:13:11 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11194

In #6, part b), should we assume the same average queue occupancy of 
128kbytes, even when the router drops 15% of the incoming packets? 


.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Reposted: Store-and-forward delay
Date: Mon, 22 Jan 2007 07:59:52 -0800
Lines: 55
Distribution: su
Message-ID: <ep2muv$3ov$1@news.Stanford.EDU>
References: <eosjqt$fo0$1@news.Stanford.EDU> <eotqj6$j01$1@news.Stanford.EDU> <eou19n$ohv$1@news.Stanford.EDU> <eou7ll$2m$1@news.Stanford.EDU>
NNTP-Posting-Host: jadsdesktop.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169481504 3871 128.12.134.140 (22 Jan 2007 15:58:24 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20060911)
In-Reply-To: <eou7ll$2m$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11195

David Erickson wrote:
>> David Erickson wrote:
>>> Jad Naous wrote:
>>>> Prof. McKeown said in class that the store-and-forward delay is
>>>> negligible. But isn't that delay equal to the transmission delay?
> And if
>>>> we are considering the transmission delay, shouldn't we then consider
>>>> the store-and-forward delay?
>>>>
>>>> Thanks,
>>>> Jad.
>>> The transmission delay IS the store and forward delay.  IE if you were
>>> traversing from host A to B over n links, and all the links had the same
>>> bandwidth, then you would have to consider n transmission delays
>>> (because the packet must be accumulated at each router then sent on to
>>> the next).  However if you were not accumulating the packet at each
>>> router before sending it on, IE doing a cut-through router style, then
>>> you would only consider a single transmission delay over the full route.
>>>
>>> -David
> 
> Jad Naous wrote:
>> If the packet length is L and the link rate is R, when the first bit of
>> a packet reaches the router, it takes R/L to get the full packet into
>> the router before we do anything with it. That's the store-and-forward
>> delay, right?
>>
>> And then after processing and queuing, when the first bit is ready to go
>> out on the link, it takes another R/L to put the packet back on the
>> wire, isn't that the transmission delay? So doesn't a packet experience
>> 2*R/L delays going through a router?
>>
>> Thanks,
>> Jad.
>>
> 
> Its better to think about it from the packets point of view.  Lets
> assume L is the packet size, R is the rate of all of the links in b/s.
> Then the time for the entire packet to make it from origin router to
> router 2 is the transmission delay: L/R + some Propogation delay (Prop).
>  Once at the second router I may experience some processing and queueing
> delay.  Then from router 2 to router 3 the delay is similar as from
> origin to 2, Transmission delay of L/R + Prop, and so it goes through
> each router in series until the end.
> 
> Does that make more sense?
> 
> -David

So the packet doesn't experience any delay while being read off the
wire? I thought it would since it has to be read completely before being
processed.

Thanks,
Jad.
.

Path: shelby.stanford.edu!not-for-mail
From: "Lin Kuang" <lkuang@cisco.com>
Newsgroups: su.class.cs244a
Subject: PS problem 1d
Date: Mon, 22 Jan 2007 11:42:49 -0800
Lines: 12
Distribution: su
Message-ID: <ep343p$f6o$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169494969 15576 127.0.0.1 (22 Jan 2007 19:42:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807
Xref: shelby.stanford.edu su.class.cs244a:11196

Hi TAs,

for HW problem 1d, something is not very clear to me:

do we assume the first date of class during those five years are always the
same, or they can be different day in each year?

Thank you for your input.

Lin


.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Reposted: Store-and-forward delay
Date: Mon, 22 Jan 2007 13:35:56 -0800
Lines: 62
Distribution: su
Message-ID: <ep3ao1$kos$1@news.Stanford.EDU>
References: <eosjqt$fo0$1@news.Stanford.EDU> <eotqj6$j01$1@news.Stanford.EDU> <eou19n$ohv$1@news.Stanford.EDU> <eou7ll$2m$1@news.Stanford.EDU> <ep2muv$3ov$1@news.Stanford.EDU>
NNTP-Posting-Host: seine.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169501761 21276 171.64.74.36 (22 Jan 2007 21:36:01 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.8 (X11/20060911)
In-Reply-To: <ep2muv$3ov$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11197

Jad Naous wrote:
> David Erickson wrote:
>>> David Erickson wrote:
>>>> Jad Naous wrote:
>>>>> Prof. McKeown said in class that the store-and-forward delay is
>>>>> negligible. But isn't that delay equal to the transmission delay?
>> And if
>>>>> we are considering the transmission delay, shouldn't we then consider
>>>>> the store-and-forward delay?
>>>>>
>>>>> Thanks,
>>>>> Jad.
>>>> The transmission delay IS the store and forward delay.  IE if you were
>>>> traversing from host A to B over n links, and all the links had the same
>>>> bandwidth, then you would have to consider n transmission delays
>>>> (because the packet must be accumulated at each router then sent on to
>>>> the next).  However if you were not accumulating the packet at each
>>>> router before sending it on, IE doing a cut-through router style, then
>>>> you would only consider a single transmission delay over the full route.
>>>>
>>>> -David
>> Jad Naous wrote:
>>> If the packet length is L and the link rate is R, when the first bit of
>>> a packet reaches the router, it takes R/L to get the full packet into
>>> the router before we do anything with it. That's the store-and-forward
>>> delay, right?
>>>
>>> And then after processing and queuing, when the first bit is ready to go
>>> out on the link, it takes another R/L to put the packet back on the
>>> wire, isn't that the transmission delay? So doesn't a packet experience
>>> 2*R/L delays going through a router?
>>>
>>> Thanks,
>>> Jad.
>>>
>> Its better to think about it from the packets point of view.  Lets
>> assume L is the packet size, R is the rate of all of the links in b/s.
>> Then the time for the entire packet to make it from origin router to
>> router 2 is the transmission delay: L/R + some Propogation delay (Prop).
>>  Once at the second router I may experience some processing and queueing
>> delay.  Then from router 2 to router 3 the delay is similar as from
>> origin to 2, Transmission delay of L/R + Prop, and so it goes through
>> each router in series until the end.
>>
>> Does that make more sense?
>>
>> -David
> 
> So the packet doesn't experience any delay while being read off the
> wire? I thought it would since it has to be read completely before being
> processed.
> 
> Thanks,
> Jad.

I got it, Paul explained it. My wrong assumption was that the packet has
to be dumped on the wire before it started moving. When looking at it in
terms of bits, it makes more sense.

Thanks, David.

Jad.
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 #6
Date: Mon, 22 Jan 2007 13:46:55 -0800
Lines: 9
Distribution: su
Message-ID: <ep3bcf$lbp$1@news.Stanford.EDU>
References: <eov466$k43$1@news.Stanford.EDU>
NNTP-Posting-Host: raptor10.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169502415 21881 171.64.15.50 (22 Jan 2007 21:46:55 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060427 Debian/1.7.13-0ubuntu5.10
X-Accept-Language: en
In-Reply-To: <eov466$k43$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11198

> It states that a packet is buffered on average every 10ms by the router. 
> Does this mean a packet arrives on average every 10ms? 
It isn't buffered EVERY 10ms, it is buffered FOR 10ms.

> Also, for b, I don't see how to calculate the average delay of a 
> packet in the router. Is this the same as the queuing delay and if so, don't 
> we need to know the bandwidth to calculate it?
Well, it isn't the same since we have a 15% drop rate. Is it higher or 
lower and if we didn't have the drops? :)
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 #6
Date: Mon, 22 Jan 2007 13:47:38 -0800
Lines: 4
Distribution: su
Message-ID: <ep3bdq$lbp$2@news.Stanford.EDU>
References: <ep1kln$rkf$1@news.Stanford.EDU>
NNTP-Posting-Host: raptor10.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169502458 21881 171.64.15.50 (22 Jan 2007 21:47:38 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060427 Debian/1.7.13-0ubuntu5.10
X-Accept-Language: en
In-Reply-To: <ep1kln$rkf$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11199

manj wrote:
> In #6, part b), should we assume the same average queue occupancy of 
> 128kbytes, even when the router drops 15% of the incoming packets? 
Assume that the amount of incoming data is still the same as in part a).
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problem 9
Date: Mon, 22 Jan 2007 13:51:17 -0800
Lines: 18
Distribution: su
Message-ID: <ep3bkm$lkp$1@news.Stanford.EDU>
References: <ep14ee$fhn$1@news.Stanford.EDU>
NNTP-Posting-Host: raptor10.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169502678 22169 171.64.15.50 (22 Jan 2007 21:51:18 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060427 Debian/1.7.13-0ubuntu5.10
X-Accept-Language: en
In-Reply-To: <ep14ee$fhn$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11200

Tom Deane wrote:
> Part a) iii)
>     A(t) = 200 + 2t.  At t=0, we have 200 bits in the queue.  Each of those 
> bits has a different queue delay: bit 0 goes out right way, whereas bit 199 
> has to wait a while.  So, d(t) at t = 0 is different depending on which of 
> the 200 bits you are referring to.  How do you want us to express this? 
> Alternatively, we can ignore the first 199 bits and just take the worst 
> delay at t = 0.
Making a function that does that isn't too hard is it? Please write the 
function based on time, not ignoring parts of the packets.

> 
> Part b)
>     Is it ok to express the answer in terms of some variable (say "p") that 
> represents the packet number, where "p" is an integer ranging from 0 to 
> infinity?

Big hint: I don't see why you would need p :)
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 #9
Date: Mon, 22 Jan 2007 13:55:31 -0800
Lines: 25
Distribution: su
Message-ID: <ep3bsj$lq1$1@news.Stanford.EDU>
References: <ep155u$g41$1@news.Stanford.EDU>
NNTP-Posting-Host: raptor10.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169502931 22337 171.64.15.50 (22 Jan 2007 21:55:31 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060427 Debian/1.7.13-0ubuntu5.10
X-Accept-Language: en
In-Reply-To: <ep155u$g41$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11201

Peter Pawlowski wrote:
> Hello--
> 
> Two questions on question 9 on PS1:
> 
> (1) Why is the time-average queue occupancy not a function of t? Isn't 
> the point of this function to tell you the average queue occupancy from 
> t = 0 until some later time t?
Well, X(t) is a function of t. If you are talking about X bar, then just 
take the average from time t=0 to time t=infinity.

> 
> (2) In the discrete arrival case, does a packet enter the queue as soon 
> as the first bit of the packet is recieved or when the entire packet is 
> recieved? Likewise, does the packet leave the queue when the first bit 
> is transmitted or when the last bit is? The basic question is: when 
> working with these simplified router models, does each link have a local 
> buffer of the current packet it's dealing with or are all operations 
> done directly on the queue?
Don't think too much about multiple queues, local buffers, etc.. Just 
read the preamble of the question:

"The router is a store-and-forward device, which means that arriving 
packets are completely stored before starting transmission on the 
outgoing link."
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 #7
Date: Mon, 22 Jan 2007 13:57:56 -0800
Lines: 11
Distribution: su
Message-ID: <ep3c14$lq1$2@news.Stanford.EDU>
References: <ep1i0n$pmm$1@news.Stanford.EDU>
NNTP-Posting-Host: raptor10.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169503076 22337 171.64.15.50 (22 Jan 2007 21:57:56 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060427 Debian/1.7.13-0ubuntu5.10
X-Accept-Language: en
In-Reply-To: <ep1i0n$pmm$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11202

manj wrote:
> In #7, no information has been provided for calculating the propogation 
> delay.
> 
> Should we ignore propogation delay, assuming that it is negligible compared 
> to the transmission time, when calculating the total time required to 
> transmit the file? 
> 
All you need is that:

"You are given a communication link that transmits R bits per second."
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PA1 Grading
Date: Mon, 22 Jan 2007 14:05:57 -0800
Lines: 25
Distribution: su
Message-ID: <C1DA7545.7931%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169503559 22844 127.0.0.1 (22 Jan 2007 22:05:59 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: PA1 Grading
Thread-Index: Acc+cX4HvMee5qpkEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11203

As was pointed out by some of you, there was differing information about how
PA1 was going to be graded.  Here's the official word:

    - The public grading script is worth eight points, as the grading script
and assignment indicated.  We know that some of the pages with dynamic
content were returning different results.  If the script indicates that you
failed a site, we will look at the diff and determine where the fault lies.
This should prevent problems due to spurious errors.

    - The private grading script is worth one point.  There are four tests.
If you pass all four, you will get the point.  If you pass two or three, you
will get a half point.  If you pass none or one, you will not get a point.
None of these tests use dynamic content.

    - The style portion is worth one point.  It is possible to get the full
point, a half, or zero.  We're just checking that you're following good
style.  If you don't get the full point, then all three of us will need to
sign off on it.  This should significantly reduce the variance among TAs.  A
different TA will grade your next assignment, which should help more.

Hopefully that clears things up.  Let me know if you have any more
questions.

--Justin

.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS problem 1d
Date: Mon, 22 Jan 2007 14:58:34 -0800
Lines: 9
Distribution: su
Message-ID: <ep3fiq$oti$1@news.Stanford.EDU>
References: <ep343p$f6o$1@news.Stanford.EDU>
NNTP-Posting-Host: raptor10.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169506714 25522 171.64.15.50 (22 Jan 2007 22:58:34 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060427 Debian/1.7.13-0ubuntu5.10
X-Accept-Language: en
In-Reply-To: <ep343p$f6o$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11204

> do we assume the first date of class during those five years are always the
> same, or they can be different day in each year?

Well, think about the two cases. What if the first day of class changed 
all the time? Would things change if the same student repeated? What 
about if the first day of class was on the same date each year. Would 
things change if the same student repeated?

Think about which way makes more sense.
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Class Registration
Date: Mon, 22 Jan 2007 15:20:56 -0800
Lines: 10
Distribution: su
Message-ID: <C1DA86D8.794B%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169508056 26795 127.0.0.1 (22 Jan 2007 23:20:56 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Class Registration
Thread-Index: Acc+e/ekNjvtIqpvEdui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11205

We are going to keep track of your grades with the eeclass system.  Only a
small number of students have registered with the system.  If you have not
done so yet, please do it by tomorrow.  You can register by following the
link titled "Grades & Solutions" on the front page and then clicking
"Students".

Thanks!

--Justin

.

Path: shelby.stanford.edu!myth10.Stanford.EDU!shchoi
From: Seung Hoon Choi <shchoi@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS#1 problem 9
Date: Mon, 22 Jan 2007 15:42:15 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0701221539350.16959-100000@myth10.Stanford.EDU>
NNTP-Posting-Host: myth10.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1169509336 27865 171.64.15.6 (22 Jan 2007 23:42:16 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:11206

Hi,

1. What's the unit of the function A(t)? I thought it was the number of
packets, but I don't see the size of packet in the writeup.

2. Could you define what time-average queue occupancy is?


Thanks,
-Seung

.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS#1 problem 9
Date: Mon, 22 Jan 2007 16:48:49 -0800
Lines: 14
Distribution: su
Message-ID: <ep3m1b$uv$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0701221539350.16959-100000@myth10.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169513323 991 127.0.0.1 (23 Jan 2007 00:48:43 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <Pine.LNX.4.44.0701221539350.16959-100000@myth10.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11207

Seung Hoon Choi wrote:
> Hi,
> 
> 1. What's the unit of the function A(t)? I thought it was the number of
> packets, but I don't see the size of packet in the writeup.

A(t) is the number of bits arriving at time t.

> 2. Could you define what time-average queue occupancy is?

The average queue occupancy over some time period.  In this case 0 to 
infinity.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: "Alex" <axle@sonic.net>
Newsgroups: su.class.cs244a
Subject: Re: Reposted: Store-and-forward delay
Date: Mon, 22 Jan 2007 17:24:02 -0800
Lines: 77
Distribution: su
Message-ID: <ep3o3j$2kd$1@news.Stanford.EDU>
References: <eosjqt$fo0$1@news.Stanford.EDU> <eotqj6$j01$1@news.Stanford.EDU> <eou19n$ohv$1@news.Stanford.EDU> <eou7ll$2m$1@news.Stanford.EDU> <ep2muv$3ov$1@news.Stanford.EDU> <ep3ao1$kos$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169515443 2701 127.0.0.1 (23 Jan 2007 01:24:03 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11208

Jad could you explain to us what Paul said to you about transmission delay? 
Is the transmission delay referring to the time you wait for receiving the 
whole packet before putting it on the wire, or does it refer to given the 
whole packet is already at the sender side and at the sender how long does 
it take to put it on the wire?

Alex

"Jad Naous" <jnaous@stanford.edu> wrote in message 
news:ep3ao1$kos$1@news.Stanford.EDU...
> Jad Naous wrote:
>> David Erickson wrote:
>>>> David Erickson wrote:
>>>>> Jad Naous wrote:
>>>>>> Prof. McKeown said in class that the store-and-forward delay is
>>>>>> negligible. But isn't that delay equal to the transmission delay?
>>> And if
>>>>>> we are considering the transmission delay, shouldn't we then consider
>>>>>> the store-and-forward delay?
>>>>>>
>>>>>> Thanks,
>>>>>> Jad.
>>>>> The transmission delay IS the store and forward delay.  IE if you were
>>>>> traversing from host A to B over n links, and all the links had the 
>>>>> same
>>>>> bandwidth, then you would have to consider n transmission delays
>>>>> (because the packet must be accumulated at each router then sent on to
>>>>> the next).  However if you were not accumulating the packet at each
>>>>> router before sending it on, IE doing a cut-through router style, then
>>>>> you would only consider a single transmission delay over the full 
>>>>> route.
>>>>>
>>>>> -David
>>> Jad Naous wrote:
>>>> If the packet length is L and the link rate is R, when the first bit of
>>>> a packet reaches the router, it takes R/L to get the full packet into
>>>> the router before we do anything with it. That's the store-and-forward
>>>> delay, right?
>>>>
>>>> And then after processing and queuing, when the first bit is ready to 
>>>> go
>>>> out on the link, it takes another R/L to put the packet back on the
>>>> wire, isn't that the transmission delay? So doesn't a packet experience
>>>> 2*R/L delays going through a router?
>>>>
>>>> Thanks,
>>>> Jad.
>>>>
>>> Its better to think about it from the packets point of view.  Lets
>>> assume L is the packet size, R is the rate of all of the links in b/s.
>>> Then the time for the entire packet to make it from origin router to
>>> router 2 is the transmission delay: L/R + some Propogation delay (Prop).
>>>  Once at the second router I may experience some processing and queueing
>>> delay.  Then from router 2 to router 3 the delay is similar as from
>>> origin to 2, Transmission delay of L/R + Prop, and so it goes through
>>> each router in series until the end.
>>>
>>> Does that make more sense?
>>>
>>> -David
>>
>> So the packet doesn't experience any delay while being read off the
>> wire? I thought it would since it has to be read completely before being
>> processed.
>>
>> Thanks,
>> Jad.
>
> I got it, Paul explained it. My wrong assumption was that the packet has
> to be dumped on the wire before it started moving. When looking at it in
> terms of bits, it makes more sense.
>
> Thanks, David.
>
> Jad. 


.

Path: shelby.stanford.edu!not-for-mail
From: Dinesh Gupta <dineshg@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS#1 problem 9
Date: Tue, 23 Jan 2007 01:35:46 +0000 (UTC)
Lines: 19
Distribution: su
Message-ID: <ep3opi$2t6$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0701221539350.16959-100000@myth10.Stanford.EDU> <ep3m1b$uv$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine40.stanford.edu
X-Trace: news.Stanford.EDU 1169516146 2982 171.64.15.115 (23 Jan 2007 01:35:46 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:11209

David Erickson <derickso@stanford.edu> wrote:
> Seung Hoon Choi wrote:
> > Hi,
> > 
> > 1. What's the unit of the function A(t)? I thought it was the number of
> > packets, but I don't see the size of packet in the writeup.

> A(t) is the number of bits arriving at time t.

On slide 33, it's mentioned A(t) is number of arrivals in interval [0,t] not at time t.
Please clarify.
Dinesh

> > 2. Could you define what time-average queue occupancy is?

> The average queue occupancy over some time period.  In this case 0 to 
> infinity.

> -David
.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Reposted: Store-and-forward delay
Date: Mon, 22 Jan 2007 17:41:40 -0800
Lines: 96
Distribution: su
Message-ID: <ep3p4p$3c4$1@news.Stanford.EDU>
References: <eosjqt$fo0$1@news.Stanford.EDU> <eotqj6$j01$1@news.Stanford.EDU> <eou19n$ohv$1@news.Stanford.EDU> <eou7ll$2m$1@news.Stanford.EDU> <ep2muv$3ov$1@news.Stanford.EDU> <ep3ao1$kos$1@news.Stanford.EDU> <ep3o3j$2kd$1@news.Stanford.EDU>
NNTP-Posting-Host: seine.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169516505 3460 171.64.74.36 (23 Jan 2007 01:41:45 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.8 (X11/20060911)
In-Reply-To: <ep3o3j$2kd$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11210

That's what confused me. Here's what Prof. McKeown had to say about this:

-----------------------
The first bit arrives [To the next hop] after PROP, the last bit arrives
TRANSP later. At this point, the whole packet is in the router and it
can process the packet. If the processing time is zero, it can start
putting the first bit on the outgoing link.

So.... TRANSP is paid for just once.

If the packet is stored-and-forwarded several times internally in the
switch/router, then it could be that we need several TRANSPs (but all
based on the internal rate of the router, which we don't know).
---------------------

I don't want to say much more because I might explain it incorrectly and
confuse you more. If you are confused about it, I would ask Paul.

Jad.

Alex wrote:
> Jad could you explain to us what Paul said to you about transmission delay? 
> Is the transmission delay referring to the time you wait for receiving the 
> whole packet before putting it on the wire, or does it refer to given the 
> whole packet is already at the sender side and at the sender how long does 
> it take to put it on the wire?
> 
> Alex
> 
> "Jad Naous" <jnaous@stanford.edu> wrote in message 
> news:ep3ao1$kos$1@news.Stanford.EDU...
>> Jad Naous wrote:
>>> David Erickson wrote:
>>>>> David Erickson wrote:
>>>>>> Jad Naous wrote:
>>>>>>> Prof. McKeown said in class that the store-and-forward delay is
>>>>>>> negligible. But isn't that delay equal to the transmission delay?
>>>> And if
>>>>>>> we are considering the transmission delay, shouldn't we then consider
>>>>>>> the store-and-forward delay?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Jad.
>>>>>> The transmission delay IS the store and forward delay.  IE if you were
>>>>>> traversing from host A to B over n links, and all the links had the 
>>>>>> same
>>>>>> bandwidth, then you would have to consider n transmission delays
>>>>>> (because the packet must be accumulated at each router then sent on to
>>>>>> the next).  However if you were not accumulating the packet at each
>>>>>> router before sending it on, IE doing a cut-through router style, then
>>>>>> you would only consider a single transmission delay over the full 
>>>>>> route.
>>>>>>
>>>>>> -David
>>>> Jad Naous wrote:
>>>>> If the packet length is L and the link rate is R, when the first bit of
>>>>> a packet reaches the router, it takes R/L to get the full packet into
>>>>> the router before we do anything with it. That's the store-and-forward
>>>>> delay, right?
>>>>>
>>>>> And then after processing and queuing, when the first bit is ready to 
>>>>> go
>>>>> out on the link, it takes another R/L to put the packet back on the
>>>>> wire, isn't that the transmission delay? So doesn't a packet experience
>>>>> 2*R/L delays going through a router?
>>>>>
>>>>> Thanks,
>>>>> Jad.
>>>>>
>>>> Its better to think about it from the packets point of view.  Lets
>>>> assume L is the packet size, R is the rate of all of the links in b/s.
>>>> Then the time for the entire packet to make it from origin router to
>>>> router 2 is the transmission delay: L/R + some Propogation delay (Prop).
>>>>  Once at the second router I may experience some processing and queueing
>>>> delay.  Then from router 2 to router 3 the delay is similar as from
>>>> origin to 2, Transmission delay of L/R + Prop, and so it goes through
>>>> each router in series until the end.
>>>>
>>>> Does that make more sense?
>>>>
>>>> -David
>>> So the packet doesn't experience any delay while being read off the
>>> wire? I thought it would since it has to be read completely before being
>>> processed.
>>>
>>> Thanks,
>>> Jad.
>> I got it, Paul explained it. My wrong assumption was that the packet has
>> to be dumped on the wire before it started moving. When looking at it in
>> terms of bits, it makes more sense.
>>
>> Thanks, David.
>>
>> Jad. 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS#1 problem 9
Date: Mon, 22 Jan 2007 17:48:30 -0800
Lines: 18
Distribution: su
Message-ID: <ep3ph8$3h3$3@news.Stanford.EDU>
References: <Pine.LNX.4.44.0701221539350.16959-100000@myth10.Stanford.EDU> <ep3m1b$uv$1@news.Stanford.EDU> <ep3opi$2t6$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169516904 3619 127.0.0.1 (23 Jan 2007 01:48:24 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <ep3opi$2t6$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11212

Dinesh Gupta wrote:
> David Erickson <derickso@stanford.edu> wrote:
>> Seung Hoon Choi wrote:
>>> Hi,
>>>
>>> 1. What's the unit of the function A(t)? I thought it was the number of
>>> packets, but I don't see the size of packet in the writeup.
> 
>> A(t) is the number of bits arriving at time t.
> 
> On slide 33, it's mentioned A(t) is number of arrivals in interval [0,t] not at time t.
> Please clarify.
> Dinesh

It is cumulative per what the assignment states, "cumulative arrival 
processes, A(t)".

-David
.

Path: shelby.stanford.edu!not-for-mail
From: "Alex" <axle@sonic.net>
Newsgroups: su.class.cs244a
Subject: Transmission Delay Interpretation
Date: Mon, 22 Jan 2007 18:27:45 -0800
Lines: 8
Distribution: su
Message-ID: <ep3rr2$5h0$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169519266 5664 127.0.0.1 (23 Jan 2007 02:27:46 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:11213

Is the transmission delay referring to the time you wait for receiving the
whole packet before putting it on the wire, or does it refer to given the
whole packet is already at the sender side and at the sender how long does
it take to put it on the wire?

Alex


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Transmission Delay Interpretation
Date: Mon, 22 Jan 2007 18:42:04 -0800
Lines: 14
Distribution: su
Message-ID: <ep3sll$69a$1@news.Stanford.EDU>
References: <ep3rr2$5h0$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169520117 6442 127.0.0.1 (23 Jan 2007 02:41:57 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <ep3rr2$5h0$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11214

Alex wrote:
> Is the transmission delay referring to the time you wait for receiving the
> whole packet before putting it on the wire, or does it refer to given the
> whole packet is already at the sender side and at the sender how long does
> it take to put it on the wire?
> 
> Alex
> 
> 

The transmission delay is the time it takes to put the full packet onto 
the wire.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 #6
Date: Mon, 22 Jan 2007 18:46:35 -0800
Lines: 25
Distribution: su
Message-ID: <ep3st2$6ji$1@news.Stanford.EDU>
References: <ep1kln$rkf$1@news.Stanford.EDU> <ep3bdq$lbp$2@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169520354 6770 127.0.0.1 (23 Jan 2007 02:45:54 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11215

That does not answer the question.

The effect of changing the arrival rate on average queue length depends on 
the incoming (and outgoing) process.  For instance, changing the arrival 
rate on a constant bit rate pattern modifies the length of the queue in a 
certain manner (yes, I know the manner), but lowering the bit rate on a 
Poisson process would lessen the queue length more than the constant bit 
rate process (I'd have to work that one out).  Burstiness and variance both 
affect the reaction to lessening the incoming traffic.  More variable 
traffic sees better improvement for the same drop in traffic (because it was 
much worse to begin with).

Sincerely,
Randy Jennings

The squirrels are your friends!

"Paul Tarjan (TA)" <ptarjan@stanford.edu> wrote in message 
news:ep3bdq$lbp$2@news.Stanford.EDU...
> manj wrote:
>> In #6, part b), should we assume the same average queue occupancy of 
>> 128kbytes, even when the router drops 15% of the incoming packets?
> Assume that the amount of incoming data is still the same as in part a). 


.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 #6
Date: Mon, 22 Jan 2007 19:07:33 -0800
Lines: 39
Distribution: su
Message-ID: <ep3u4c$85d$1@news.Stanford.EDU>
References: <ep1kln$rkf$1@news.Stanford.EDU> <ep3bdq$lbp$2@news.Stanford.EDU> <ep3st2$6ji$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169521612 8365 127.0.0.1 (23 Jan 2007 03:06:52 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11216

Yeah, that was a stupid comment on the constant bit rate process.  There are 
a lot of those...

If we can assume the arrival process and the departure process are Poisson, 
I am happy...

Sincerely,
Randy Jennings

The squirrels are your friends!
"Randy Jennings" <randyj@stanford.edu> wrote in message 
news:ep3st2$6ji$1@news.Stanford.EDU...
> That does not answer the question.
>
> The effect of changing the arrival rate on average queue length depends on 
> the incoming (and outgoing) process.  For instance, changing the arrival 
> rate on a constant bit rate pattern modifies the length of the queue in a 
> certain manner (yes, I know the manner), but lowering the bit rate on a 
> Poisson process would lessen the queue length more than the constant bit 
> rate process (I'd have to work that one out).  Burstiness and variance 
> both affect the reaction to lessening the incoming traffic.  More variable 
> traffic sees better improvement for the same drop in traffic (because it 
> was much worse to begin with).
>
> Sincerely,
> Randy Jennings
>
> The squirrels are your friends!
>
> "Paul Tarjan (TA)" <ptarjan@stanford.edu> wrote in message 
> news:ep3bdq$lbp$2@news.Stanford.EDU...
>> manj wrote:
>>> In #6, part b), should we assume the same average queue occupancy of 
>>> 128kbytes, even when the router drops 15% of the incoming packets?
>> Assume that the amount of incoming data is still the same as in part a).
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Tom Deane" <tdeane@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problem 9
Date: Mon, 22 Jan 2007 19:13:55 -0800
Lines: 49
Distribution: su
Message-ID: <ep3uho$8ln$1@news.Stanford.EDU>
References: <ep14ee$fhn$1@news.Stanford.EDU> <ep3bkm$lkp$1@news.Stanford.EDU>
NNTP-Posting-Host: amdrules.stanford.edu
X-Trace: news.Stanford.EDU 1169522040 8887 128.12.197.229 (23 Jan 2007 03:14:00 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:11217

Part a)
I don't see how you can express the delay d(t) at t=0 when there are 200 
different delays at t = 0.  The only way to do this would be to introduce a 
new variable representing the bit number that you are deferring to and say 
something like
d ( t ) = bit_number * some_constant   for t = 0
d ( t ) = something else, for other ts
However you mention that we need to express it in terms of time. Please 
clarify.


Part b)
"Big hint: I don't see why you would need p"

I would need P because the only way I can see of modeling this recurring 
event is to say what happens in a 1-second interval.  I don't want to say 
what happens between second 0 and second 1 because that doesn't tell me what 
happens later.  Instead, I want to say what happens between second P and 
second P+1 where P goes from 0 to infinity... or equivalently, what happens 
between the arrival of packet P and packet P+1.  Could you give me a hint as 
to your way of getting rid of this variable P?






"Paul Tarjan (TA)" <ptarjan@stanford.edu> wrote in message 
news:ep3bkm$lkp$1@news.Stanford.EDU...
> Tom Deane wrote:
>> Part a) iii)
>>     A(t) = 200 + 2t.  At t=0, we have 200 bits in the queue.  Each of 
>> those bits has a different queue delay: bit 0 goes out right way, whereas 
>> bit 199 has to wait a while.  So, d(t) at t = 0 is different depending on 
>> which of the 200 bits you are referring to.  How do you want us to 
>> express this? Alternatively, we can ignore the first 199 bits and just 
>> take the worst delay at t = 0.
> Making a function that does that isn't too hard is it? Please write the 
> function based on time, not ignoring parts of the packets.
>
>>
>> Part b)
>>     Is it ok to express the answer in terms of some variable (say "p") 
>> that represents the packet number, where "p" is an integer ranging from 0 
>> to infinity?
>
> Big hint: I don't see why you would need p :) 


.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problem 9
Date: Mon, 22 Jan 2007 19:22:32 -0800
Lines: 17
Distribution: su
Message-ID: <ep3v0f$958$1@news.Stanford.EDU>
References: <ep14ee$fhn$1@news.Stanford.EDU> <ep3bkm$lkp$1@news.Stanford.EDU> <ep3uho$8ln$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169522511 9384 127.0.0.1 (23 Jan 2007 03:21:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11218

> Part a)
> I don't see how you can express the delay d(t) at t=0 when there are 200 
> different delays at t = 0.  The only way to do this would be to introduce 
> a new variable representing the bit number that you are deferring to and 
> say something like
> d ( t ) = bit_number * some_constant   for t = 0
> d ( t ) = something else, for other ts
> However you mention that we need to express it in terms of time. Please 
> clarify.
I'd recommend looking at slide 37 of H3.  It helped me with this.

Sincerely,
Randy Jennings

The squirrels are your friends! 


.

Path: shelby.stanford.edu!not-for-mail
From: "Tom Deane" <tdeane@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problem 9
Date: Mon, 22 Jan 2007 19:29:46 -0800
Lines: 24
Distribution: su
Message-ID: <ep3vff$9ao$1@news.Stanford.EDU>
References: <ep14ee$fhn$1@news.Stanford.EDU> <ep3bkm$lkp$1@news.Stanford.EDU> <ep3uho$8ln$1@news.Stanford.EDU> <ep3v0f$958$1@news.Stanford.EDU>
NNTP-Posting-Host: amdrules.stanford.edu
X-Trace: news.Stanford.EDU 1169522991 9560 128.12.197.229 (23 Jan 2007 03:29:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
Xref: shelby.stanford.edu su.class.cs244a:11219

Slide 37 has a train of bits arriving one at a time at some given rate.  As 
opposed to this question which has 200 bits at t = 0.


"Randy Jennings" <randyj@stanford.edu> wrote in message 
news:ep3v0f$958$1@news.Stanford.EDU...
>> Part a)
>> I don't see how you can express the delay d(t) at t=0 when there are 200 
>> different delays at t = 0.  The only way to do this would be to introduce 
>> a new variable representing the bit number that you are deferring to and 
>> say something like
>> d ( t ) = bit_number * some_constant   for t = 0
>> d ( t ) = something else, for other ts
>> However you mention that we need to express it in terms of time. Please 
>> clarify.
> I'd recommend looking at slide 37 of H3.  It helped me with this.
>
> Sincerely,
> Randy Jennings
>
> The squirrels are your friends!
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 #9
Date: Mon, 22 Jan 2007 19:52:51 -0800
Lines: 23
Distribution: su
Message-ID: <ep40pa$act$1@news.Stanford.EDU>
References: <ep155u$g41$1@news.Stanford.EDU> <ep3bsj$lq1$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169524331 10653 127.0.0.1 (23 Jan 2007 03:52:11 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11220

>> (2) In the discrete arrival case, does a packet enter the queue as soon 
>> as the first bit of the packet is recieved or when the entire packet is 
>> recieved? Likewise, does the packet leave the queue when the first bit is 
>> transmitted or when the last bit is? The basic question is: when working 
>> with these simplified router models, does each link have a local buffer 
>> of the current packet it's dealing with or are all operations done 
>> directly on the queue?
> Don't think too much about multiple queues, local buffers, etc.. Just read 
> the preamble of the question:
>
> "The router is a store-and-forward device, which means that arriving 
> packets are completely stored before starting transmission on the outgoing 
> link."

I think he means should our D(t) remain in terms of bits, or should it be in 
terms of packets?  I would think in terms of bits (per slide 37).

Sincerely,
Randy Jennings

The squirrels are your friends! 


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 #9
Date: Mon, 22 Jan 2007 20:00:28 -0800
Lines: 26
Distribution: su
Message-ID: <ep418l$alf$1@news.Stanford.EDU>
References: <ep155u$g41$1@news.Stanford.EDU> <ep3bsj$lq1$1@news.Stanford.EDU> <ep40pa$act$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169524821 10927 127.0.0.1 (23 Jan 2007 04:00:21 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <ep40pa$act$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11221

Randy Jennings wrote:
>>> (2) In the discrete arrival case, does a packet enter the queue as soon 
>>> as the first bit of the packet is recieved or when the entire packet is 
>>> recieved? Likewise, does the packet leave the queue when the first bit is 
>>> transmitted or when the last bit is? The basic question is: when working 
>>> with these simplified router models, does each link have a local buffer 
>>> of the current packet it's dealing with or are all operations done 
>>> directly on the queue?
>> Don't think too much about multiple queues, local buffers, etc.. Just read 
>> the preamble of the question:
>>
>> "The router is a store-and-forward device, which means that arriving 
>> packets are completely stored before starting transmission on the outgoing 
>> link."
> 
> I think he means should our D(t) remain in terms of bits, or should it be in 
> terms of packets?  I would think in terms of bits (per slide 37).
> 
> Sincerely,
> Randy Jennings
> 
> The squirrels are your friends! 
> 

Correct.
-David
.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problem 9
Date: Mon, 22 Jan 2007 20:38:35 -0800
Lines: 30
Distribution: su
Message-ID: <ep43f1$cbc$1@news.Stanford.EDU>
References: <ep14ee$fhn$1@news.Stanford.EDU> <ep3bkm$lkp$1@news.Stanford.EDU> <ep3uho$8ln$1@news.Stanford.EDU> <ep3v0f$958$1@news.Stanford.EDU> <ep3vff$9ao$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169527073 12652 127.0.0.1 (23 Jan 2007 04:37:53 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11222

Okay.  Then look at the definition of d(t) on slide 36.

"Tom Deane" <tdeane@stanford.edu> wrote in message 
news:ep3vff$9ao$1@news.Stanford.EDU...
> Slide 37 has a train of bits arriving one at a time at some given rate. 
> As opposed to this question which has 200 bits at t = 0.
>
>
> "Randy Jennings" <randyj@stanford.edu> wrote in message 
> news:ep3v0f$958$1@news.Stanford.EDU...
>>> Part a)
>>> I don't see how you can express the delay d(t) at t=0 when there are 200 
>>> different delays at t = 0.  The only way to do this would be to 
>>> introduce a new variable representing the bit number that you are 
>>> deferring to and say something like
>>> d ( t ) = bit_number * some_constant   for t = 0
>>> d ( t ) = something else, for other ts
>>> However you mention that we need to express it in terms of time. Please 
>>> clarify.
>> I'd recommend looking at slide 37 of H3.  It helped me with this.
>>
>> Sincerely,
>> Randy Jennings
>>
>> The squirrels are your friends!
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Euijong Whang" <euijong@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Problem 9(b)(i)
Date: Mon, 22 Jan 2007 20:38:20 -0800
Lines: 13
Distribution: su
Message-ID: <ep43ge$cbu$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab404b3b.stanford.edu
X-Trace: news.Stanford.EDU 1169527118 12670 171.64.75.59 (23 Jan 2007 04:38:38 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:11223


Hi,

I wonder if I am thinking correctly about d(t) for Problem 9(b)(i).
Suppose we want to evaluate d(t) when a packet is only half stored.
Does d(t) include the time for the other half of the packet to be stored
plus the transmission time for the first half of the packet after the whole 
packet is stored?

- Steven



.

Path: shelby.stanford.edu!not-for-mail
From: "Darius Henderson" <darius.henderson@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 problem 7
Date: Mon, 22 Jan 2007 22:21:46 -0800
Lines: 9
Distribution: su
Message-ID: <ep49hs$gug$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169533308 17360 127.0.0.1 (23 Jan 2007 06:21:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:11224

problem 7 states: "consecutive packets must be separated by at least G 
seconds." just for clarification, i'm wondering if this means <each packet> 
is separated by G seconds, or if the packet is separated by G seconds <only 
if it would transmit in under G seconds otherwise>. i.e., if the transmit 
time is G/5, would the new time become t = G/5 + G, or simply t = G.

-darius 


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem 9(b)(i)
Date: Mon, 22 Jan 2007 22:30:32 -0800
Lines: 14
Distribution: su
Message-ID: <ep4a21$h4r$1@news.Stanford.EDU>
References: <ep43ge$cbu$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169533825 17563 127.0.0.1 (23 Jan 2007 06:30:25 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <ep43ge$cbu$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11225

Euijong Whang wrote:
> Hi,
> 
> I wonder if I am thinking correctly about d(t) for Problem 9(b)(i).
> Suppose we want to evaluate d(t) when a packet is only half stored.
> Does d(t) include the time for the other half of the packet to be stored
> plus the transmission time for the first half of the packet after the whole 
> packet is stored?
> 
> - Steven

You do need to take the transmission time into account.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 problem 7
Date: Mon, 22 Jan 2007 22:35:16 -0800
Lines: 13
Distribution: su
Message-ID: <ep4aat$h4r$2@news.Stanford.EDU>
References: <ep49hs$gug$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169534110 17563 127.0.0.1 (23 Jan 2007 06:35:10 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <ep49hs$gug$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11226

Darius Henderson wrote:
> problem 7 states: "consecutive packets must be separated by at least G 
> seconds." just for clarification, i'm wondering if this means <each packet> 
> is separated by G seconds, or if the packet is separated by G seconds <only 
> if it would transmit in under G seconds otherwise>. i.e., if the transmit 
> time is G/5, would the new time become t = G/5 + G, or simply t = G.
> 
> -darius 

The key phrase here is "consecutive packets", so in between every packet 
you send there must be a pause of G seconds.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Midterm Date
Date: Mon, 22 Jan 2007 23:36:34 -0800
Lines: 8
Distribution: su
Message-ID: <C1DAFB02.79A1%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169537796 20757 127.0.0.1 (23 Jan 2007 07:36:36 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Midterm Date
Thread-Index: Acc+wTTfczkk/Kq0Edui7AARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11227

Due to a scheduling conflict, the midterm has been moved back to Tuesday,
February 20.  We may move the Friday review sessions around to reflect this,
so keep an eye on the schedule.

Good luck on your problem set!

--Justin

.

Path: shelby.stanford.edu!not-for-mail
From: "Brian Thompson" <Brian.C.Thompson@Boeing.com>
Newsgroups: su.class.cs244a
Subject: Understanding sr
Date: Tue, 23 Jan 2007 22:19:26 -0800
Lines: 14
Distribution: su
Message-ID: <ep6tpg$2vj$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169619568 3059 127.0.0.1 (24 Jan 2007 06:19:28 GMT)
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.2962
Xref: shelby.stanford.edu su.class.cs244a:11228

I started to take a look at the sr program supplied and don't understand how 
it is to function.  From what I can tell if I run it by "./sr -s 
nv-1.stanford.edu -t 0"  It will show me the the route table loaded, the 
addr for eth0, eth1, and eth2, and then "REad to process packets", as 
expected from the PA2 text.  The next part suggests that if I run a 
traceroute or ping to the IP address of eth0 (171.67.71.2) in another xterm 
I should see in the sr xterm the Interfaces similiar to what is shown in the 
text.  I do not see the sr xterm display anything.  Likewise I tried using 
the -l Logfile option and ended up with an empty file.  Am I reading the 
text correctly or running the sr program correctly?

--Brian 


.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Understanding sr
Date: Tue, 23 Jan 2007 23:31:20 -0800
Lines: 20
Distribution: su
Message-ID: <ep725f$5t9$1@news.Stanford.EDU>
References: <ep6tpg$2vj$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169624047 6057 171.64.74.54 (24 Jan 2007 07:34:07 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <ep6tpg$2vj$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11229

The IP addresses in the current assignment description are out of date. 
  I'll be sending out the sr assignment topologies for everyone tonight, 
so you should be able to try things out with your own topology shortly.

Clay
Brian Thompson wrote:
> I started to take a look at the sr program supplied and don't understand how 
> it is to function.  From what I can tell if I run it by "./sr -s 
> nv-1.stanford.edu -t 0"  It will show me the the route table loaded, the 
> addr for eth0, eth1, and eth2, and then "REad to process packets", as 
> expected from the PA2 text.  The next part suggests that if I run a 
> traceroute or ping to the IP address of eth0 (171.67.71.2) in another xterm 
> I should see in the sr xterm the Interfaces similiar to what is shown in the 
> text.  I do not see the sr xterm display anything.  Likewise I tried using 
> the -l Logfile option and ended up with an empty file.  Am I reading the 
> text correctly or running the sr program correctly?
> 
> --Brian 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sr Topologies Posted
Date: Wed, 24 Jan 2007 01:08:45 -0800
Lines: 19
Distribution: su
Message-ID: <ep77s6$dt1$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169629895 14241 171.64.74.54 (24 Jan 2007 09:11:35 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
Xref: shelby.stanford.edu su.class.cs244a:11230

Topology assignments for PA 2 were just sent out.  You should have 
received an email describing your topology (including the relevant IP 
addresses) and an attached text file that you can feed to the sr client 
to set up your routing table.  Take a look at the assignment section 
called 'Test Driving the sr Stub Code' for instructions on how to verify 
that your topology is working correctly.

If you received an email about a topology but are no longer in the 
class, that's fine- if you can email ccollier@stanford.edu so that we 
know that your topology/IP assignment is available, that would be helpful.

If you are in the class but didn't get a topology assignment, email 
ccollier@stanford.edu.

Questions about the assignment itself should still be directed to the 
newsgroup.  I'll be going over the details of the assignment this Friday 
in the 11 o'clock section.

Clay
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sr Topologies Posted
Date: Wed, 24 Jan 2007 08:45:43 -0800
Lines: 52
Distribution: su
Message-ID: <ep82l2$5rk$1@news.Stanford.EDU>
References: <ep77s6$dt1$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169657314 6004 171.64.74.54 (24 Jan 2007 16:48:34 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <ep77s6$dt1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11231

Notice that the output that you will see on starting up the sr stub code 
is slightly different from what is described in the email.  What you 
will initially see will look something like this:

Loading routing table
---------------------------------------------
Destination     Gateway         Mask    Iface
192.168.128.6           192.168.128.6   255.255.255.255 eth1
192.168.128.8           192.168.128.8   255.255.255.255 eth2
0.0.0.0         172.24.74.17    0.0.0.0 eth0
---------------------------------------------
Client ccollier connecting to Server vns-2:12345
Requesting topology 154
Router interfaces:
eth0    HWaddr70:00:00:9a:00:01
         inet addr 192.168.128.4
eth1    HWaddr70:00:00:9a:00:02
         inet addr 192.168.128.5
eth2    HWaddr70:00:00:9a:00:06
         inet addr 192.168.128.7
  <-- Ready to process packets -->

Just make sure that the IP addresses are correct for your topology, and 
that when you ping one of the IP's for your router, you see a message 
like this:

*** -> Received packet of length 60

in the same window where you are running the sr router.

Clay

Clay Collier wrote:
> Topology assignments for PA 2 were just sent out.  You should have 
> received an email describing your topology (including the relevant IP 
> addresses) and an attached text file that you can feed to the sr client 
> to set up your routing table.  Take a look at the assignment section 
> called 'Test Driving the sr Stub Code' for instructions on how to verify 
> that your topology is working correctly.
> 
> If you received an email about a topology but are no longer in the 
> class, that's fine- if you can email ccollier@stanford.edu so that we 
> know that your topology/IP assignment is available, that would be helpful.
> 
> If you are in the class but didn't get a topology assignment, email 
> ccollier@stanford.edu.
> 
> Questions about the assignment itself should still be directed to the 
> newsgroup.  I'll be going over the details of the assignment this Friday 
> in the 11 o'clock section.
> 
> Clay
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sr Topologies Posted
Date: Wed, 24 Jan 2007 11:14:18 -0800
Lines: 6
Distribution: su
Message-ID: <ep8bbm$dkv$1@news.Stanford.EDU>
References: <ep77s6$dt1$1@news.Stanford.EDU> <ep82l2$5rk$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169666231 13983 171.64.74.54 (24 Jan 2007 19:17:11 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <ep82l2$5rk$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11232

One final caveat: the IPs in your assigned topologies are from a private 
block, and can only be routed to from within Stanford's network.  That 
means that in order to ping or traceroute to an IP in your topology, you 
must be logged into one of the Stanford machines.

Clay
.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sr code changes
Date: Wed, 24 Jan 2007 16:40:30 -0800
Lines: 7
Distribution: su
Message-ID: <ep8ua1$t0q$1@news.Stanford.EDU>
NNTP-Posting-Host: seine.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169685634 29722 171.64.74.36 (25 Jan 2007 00:40:34 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.8 (X11/20060911)
Xref: shelby.stanford.edu su.class.cs244a:11233

Hi,

Are all the empty functions/functions we are supposed to modify in
sr_router.c?

Thanks,
Jad.
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sr code changes
Date: Wed, 24 Jan 2007 17:19:23 -0800
Lines: 13
Distribution: su
Message-ID: <ep90ih$1cn$1@news.Stanford.EDU>
References: <ep8ua1$t0q$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169687953 1431 127.0.0.1 (25 Jan 2007 01:19:13 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <ep8ua1$t0q$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11234

Jad Naous wrote:
> Hi,
> 
> Are all the empty functions/functions we are supposed to modify in
> sr_router.c?
> 
> Thanks,
> Jad.

Yes, the only two files that you may modify are sr_router.h and 
sr_router.c, however you can add further .c/.h files to the program.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PA2 IP options
Date: Wed, 24 Jan 2007 18:16:34 -0800
Lines: 4
Distribution: su
Message-ID: <ep93u6$4ad$1@news.Stanford.EDU>
NNTP-Posting-Host: seine.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169691398 4429 171.64.74.36 (25 Jan 2007 02:16:38 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.8 (X11/20060911)
Xref: shelby.stanford.edu su.class.cs244a:11235

Are we required to implement all the IP options?

Thanks,
Jad.
.

Path: shelby.stanford.edu!not-for-mail
From: "Jin Wang" <jinwang@stanford.edu>
Newsgroups: su.class.cs244a
Subject: TA phone numbers
Date: Wed, 24 Jan 2007 21:47:29 -0500
Lines: 7
Distribution: su
Message-ID: <ep95qf$5k9$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169693328 5769 127.0.0.1 (25 Jan 2007 02:48:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
Xref: shelby.stanford.edu su.class.cs244a:11236

What phone number can remote SCPD students call to reach TA's during office
hours?  (I don't live in the Bay Area.)

Thank you,
Jin


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PA2 IP options
Date: Wed, 24 Jan 2007 18:57:32 -0800
Lines: 10
Distribution: su
Message-ID: <ep96ai$5qn$1@news.Stanford.EDU>
References: <ep93u6$4ad$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169693842 5975 127.0.0.1 (25 Jan 2007 02:57:22 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <ep93u6$4ad$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11237

Jad Naous wrote:
> Are we required to implement all the IP options?
> 
> Thanks,
> Jad.

Please see the FAQ, most questions are covered there: 
http://yuba.stanford.edu/vns/assignments/sr_faq.html

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Chun Kai Wang <chunkaiw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: IP address with switch
Date: Thu, 25 Jan 2007 03:26:47 +0000 (UTC)
Organization: Your Company
Lines: 4
Distribution: su
Message-ID: <Xns98C2C5D2F302Cchunkaiwstanfordedu@171.64.14.103>
NNTP-Posting-Host: rescomp-06-59601.stanford.edu
X-Trace: news.Stanford.EDU 1169695607 7316 128.12.22.217 (25 Jan 2007 03:26:47 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Xnews/5.04.25
Xref: shelby.stanford.edu su.class.cs244a:11238

say i have 2 computers connected to a router that connects to the outside 
world. to the outside world the 2 computers appear to have the same IP 
address... how does this work? how will the router know which computer to 
route the packet to since both of them have the same IP address...
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: IP address with switch
Date: Wed, 24 Jan 2007 20:14:37 -0800
Lines: 9
Distribution: su
Message-ID: <ep9ar3$916$1@news.Stanford.EDU>
References: <Xns98C2C5D2F302Cchunkaiwstanfordedu@171.64.14.103>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169698467 9254 127.0.0.1 (25 Jan 2007 04:14:27 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <Xns98C2C5D2F302Cchunkaiwstanfordedu@171.64.14.103>
Xref: shelby.stanford.edu su.class.cs244a:11239

Chun Kai Wang wrote:
> say i have 2 computers connected to a router that connects to the outside 
> world. to the outside world the 2 computers appear to have the same IP 
> address... how does this work? how will the router know which computer to 
> route the packet to since both of them have the same IP address...

Checkout wikipedia or the book on NAT

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Check destination MAC address?
Date: Wed, 24 Jan 2007 21:35:03 -0800
Lines: 4
Distribution: su
Message-ID: <ep9fi1$c79$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169703297 12521 128.12.194.72 (25 Jan 2007 05:34:57 GMT)
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:11240

Should I check that the destination MAC address of a received packet 
matches that of my router? Or is that already done for me?

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Trying to run tcpdump and wireshark.
Date: Wed, 24 Jan 2007 22:04:11 -0800
Lines: 31
Distribution: su
Message-ID: <ep9h8m$dir$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169705046 13915 128.12.194.72 (25 Jan 2007 06:04:06 GMT)
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:11241

How do I use tcpdump and wireshark? I copied the files over, but I can't 
seem to get them to run.

I'm logging in remotely via ssh, so maybe this only works in the lab?

myth22:~/CS244A/hw2> ls
sr_stub.tar  stub  tcpdump  wireshark

myth22:~/CS244A/hw2> tcpdump
tcpdump: Command not found.

myth22:~/CS244A/hw2> ./tcpdump
tcpdump: no suitable device found

myth22:~/CS244A/hw2> wireshark
wireshark: Command not found.

myth22:~/CS244A/hw2> ./wireshark
The program 'wireshark' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
   (Details: serial 116 error_code 3 request_code 38 minor_code 0)
   (Note to programmers: normally, X errors are reported asynchronously;
    that is, you will receive the error a while after causing it.
    To debug your program, run it with the --sync command line
    option to change this behavior. You can then get a meaningful
    backtrace from your debugger if you break on the gdk_x_error() 
function.)
myth22:~/CS244A/hw2>

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Trying to run tcpdump and wireshark.
Date: Wed, 24 Jan 2007 22:30:30 -0800
Lines: 25
Distribution: su
Message-ID: <ep9ios$elb$1@news.Stanford.EDU>
References: <ep9h8m$dir$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169706589 15019 127.0.0.1 (25 Jan 2007 06:29:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11242

Funny that the error message stated that the problem was probably a bug in 
the program (wireshark).  It could be more wrong, but not much.

Good luck figuring out tcpdump if you like.

If you want to run wireshark over an ssh connection, you need to tunnel X 
back to your machine.  There are other options, but I assume that your 
machine is Windows, and that you already have Cygwin installed on your 
machine (if not, get it).  Then see:
http://sources.redhat.com/cygwin/xfree/docs/ug/using.html

If you are not using windows and already have X running, just add the -Y 
flag to the ssh command, (there is a DISPLAY variable that needs setting, 
but it is probably already done).

However, I would recommend d/l Wireshark to your machine and copying the 
dump files over there.  I think you will find the application much more 
responsive (and it is fun to sniff your own bus sometimes anyway).

Sincerely,
Randy Jennings

The squirrels are your friends! 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Trying to run tcpdump and wireshark.
Date: Wed, 24 Jan 2007 22:43:56 -0800
Lines: 47
Distribution: su
Message-ID: <C1DD91AC.7ACB%jpettit@stanford.edu>
References: <ep9h8m$dir$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169707439 15646 127.0.0.1 (25 Jan 2007 06:43:59 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Trying to run tcpdump and wireshark.
Thread-Index: AcdATC9ibiwWQqw/EduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11243

Randy did a good job explaining wireshark.  If you want to work remotely,
you'll need to get X forwarding working.

For tcpdump, take a look at the section titled "Inspecting Packets with
tcpdump" in the assignment.  The gist of the problem is that since you
aren't root, you can't open a raw device, so it can only dump previously
saved packets.  To read packets from a file, you need the "-r" option.

--Justin
 

On 1/24/07 10:04 PM, in article ep9h8m$dir$1@news.Stanford.EDU, "Yangfan
Wang" <yfw@stanford.edu> wrote:

> How do I use tcpdump and wireshark? I copied the files over, but I can't
> seem to get them to run.
> 
> I'm logging in remotely via ssh, so maybe this only works in the lab?
> 
> myth22:~/CS244A/hw2> ls
> sr_stub.tar  stub  tcpdump  wireshark
> 
> myth22:~/CS244A/hw2> tcpdump
> tcpdump: Command not found.
> 
> myth22:~/CS244A/hw2> ./tcpdump
> tcpdump: no suitable device found
> 
> myth22:~/CS244A/hw2> wireshark
> wireshark: Command not found.
> 
> myth22:~/CS244A/hw2> ./wireshark
> The program 'wireshark' received an X Window System error.
> This probably reflects a bug in the program.
> The error was 'BadWindow (invalid Window parameter)'.
>    (Details: serial 116 error_code 3 request_code 38 minor_code 0)
>    (Note to programmers: normally, X errors are reported asynchronously;
>     that is, you will receive the error a while after causing it.
>     To debug your program, run it with the --sync command line
>     option to change this behavior. You can then get a meaningful
>     backtrace from your debugger if you break on the gdk_x_error()
> function.)
> myth22:~/CS244A/hw2>
> 
> -Yangfan


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Check destination MAC address?
Date: Wed, 24 Jan 2007 22:49:33 -0800
Lines: 9
Distribution: su
Message-ID: <ep9jtt$fbm$1@news.Stanford.EDU>
References: <ep9fi1$c79$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169707773 15734 127.0.0.1 (25 Jan 2007 06:49:33 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <ep9fi1$c79$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11244

Yangfan Wang wrote:
> Should I check that the destination MAC address of a received packet 
> matches that of my router? Or is that already done for me?
> 
> -Yangfan

I believe this is already done for you.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PA2: network byte order?
Date: Thu, 25 Jan 2007 16:31:53 -0800
Lines: 5
Distribution: su
Message-ID: <epbi5t$i4q$1@news.Stanford.EDU>
NNTP-Posting-Host: seine.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169771517 18586 171.64.74.36 (26 Jan 2007 00:31:57 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.8 (X11/20060911)
Xref: shelby.stanford.edu su.class.cs244a:11245

Are the addresses in the sr_if and the sr_rt structs in network byte
order or in host byte order?

Thanks,
Jad
.

Path: shelby.stanford.edu!not-for-mail
From: Adam Cohen <adam.cohen@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: watching lectures
Date: Thu, 25 Jan 2007 17:58:40 -0800
Lines: 20
Distribution: su
Message-ID: <epbn8j$mn1$1@news.Stanford.EDU>
References: <eour2u$e8d$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1169776723 23265 127.0.0.1 (26 Jan 2007 01:58:43 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Unison/1.7.5
Xref: shelby.stanford.edu su.class.cs244a:11246

On 2007-01-20 20:44:13 -0800, Benjamin Nham <nham@stanford.edu> said:

> I can't seem to watch lectures online. Anyone else having this problem? 
> I can't exactly watch it in person, since I'm also in CS161, which 
> isn't offered online...
> 
> Ben

The cs244a website has a link to the online classroom page, but it puts 
it in a frame, so your browser still says "cs244a.stanford.edu" in it. 
When you click the video link, it tries to open a relative address -- 
basically, a string of numbers that it expects will follow 
cetus.stanford.edu. Since cetus.stanford.edu is not in  your browser, 
it won't load. If you go directly to the Online Classroom website it 
will actually work.

At the very least, that was my problem.

AC

.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Check destination MAC address?
Date: Thu, 25 Jan 2007 23:40:21 -0800
Lines: 17
Distribution: su
Message-ID: <epcbf6$78v$1@news.Stanford.EDU>
References: <ep9fi1$c79$1@news.Stanford.EDU> <ep9jtt$fbm$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169797415 7455 171.64.74.54 (26 Jan 2007 07:43:35 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <ep9jtt$fbm$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11247

You do not need to check that the MAC address matches that of the 
router.  Ethernet frames that have other destination MAC addresses 
(other than ARP request packets, which are broadcast) should never show 
up at your router.

Clay

David Erickson wrote:
> Yangfan Wang wrote:
>> Should I check that the destination MAC address of a received packet 
>> matches that of my router? Or is that already done for me?
>>
>> -Yangfan
> 
> I believe this is already done for you.
> 
> -David
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: VNS Connectivity from the brambles
Date: Thu, 25 Jan 2007 23:48:14 -0800
Lines: 9
Distribution: su
Message-ID: <epcbtv$9dg$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169797887 9648 171.64.74.54 (26 Jan 2007 07:51:27 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
Xref: shelby.stanford.edu su.class.cs244a:11248

There were a few reports earlier today of people having trouble getting 
their router stub code to connect from the machines in the bramble 
cluster.  It turns out that there was a routing problem that was 
preventing anything from getting back to the brambles from the VNS 
machines, resulting in routers hanging at the 'Requesting topology' 
stage without ever hearing anything back.  This should be resolved now; 
if you still can't get your router to connect, please let me know.

Clay
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PA2: network byte order?
Date: Fri, 26 Jan 2007 00:03:10 -0800
Lines: 15
Distribution: su
Message-ID: <C1DEF5BE.7B8E%jpettit@stanford.edu>
References: <epbi5t$i4q$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169798591 11897 127.0.0.1 (26 Jan 2007 08:03:11 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: PA2: network byte order?
Thread-Index: AcdBIGtmqjJlAq0TEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11249

Network byte order.

--Justin


On 1/25/07 4:31 PM, in article epbi5t$i4q$1@news.Stanford.EDU, "Jad Naous"
<jnaous@stanford.edu> wrote:

> Are the addresses in the sr_if and the sr_rt structs in network byte
> order or in host byte order?
> 
> Thanks,
> Jad


.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Assignment 2 Update
Date: Fri, 26 Jan 2007 12:33:54 -0800
Lines: 18
Distribution: su
Message-ID: <epdopn$jbs$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169843831 19836 171.64.74.54 (26 Jan 2007 20:37:11 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
Xref: shelby.stanford.edu su.class.cs244a:11250

The first version of assignment 2 posted on the website incorrectly 
stated that enforcing timeouts for unreachable hosts was an optional 
part of the assignment.  It is actually required functionality (the 
confusion was caused by the fact that we linked to the version of the 
assignment that is used outside of Stanford).

Essentially, if you send out ARP requests for a host and do not hear a 
reply, an ICMP Host Unreachable message must be generated and sent by 
your router, even if no more packets arrive at the router.  You should 
state the timeout periods for ARP requests and the ARP cache in your 
README; since you can't control the OS scheduler, the timing does not 
have to be exact, but you do need to be able to guarantee that timeouts 
will be correctly noticed and reported by the router.

Additionally, slides from todays problem session have been posted on the 
website.

Clay
.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Assignment 2 Update
Date: Fri, 26 Jan 2007 16:25:39 -0800
Lines: 8
Distribution: su
Message-ID: <epe64o$1r9$1@news.Stanford.EDU>
References: <epdopn$jbs$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169857496 1897 127.0.0.1 (27 Jan 2007 00:24:56 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11251

Did the FAQ or source code change?

Sincerely,
Randy Jennings

The squirrels are your friends! 


.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ARP requests timeout value
Date: Fri, 26 Jan 2007 18:49:58 -0800
Lines: 5
Distribution: su
Message-ID: <epeeks$86l$1@news.Stanford.EDU>
NNTP-Posting-Host: seine.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169866204 8405 171.64.74.36 (27 Jan 2007 02:50:04 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.8 (X11/20060911)
Xref: shelby.stanford.edu su.class.cs244a:11252

how long should we wait before we resend a new ARP request if a reply is
not received?

Thanks,
Jad.
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Assignment 2 Update
Date: Fri, 26 Jan 2007 19:07:58 -0800
Lines: 20
Distribution: su
Message-ID: <C1E0020E.7C45%jpettit@stanford.edu>
References: <epdopn$jbs$1@news.Stanford.EDU> <epe64o$1r9$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169867282 9313 127.0.0.1 (27 Jan 2007 03:08:02 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Assignment 2 Update
Thread-Index: AcdBwFijl1W8VK2zEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11253

Nope, they're still the same.  We may need to update the FAQ as the quarter
progresses.  If so, we'll put up the date it was last updated (similar to
what we did with PA1's grading script).

--Justin


On 1/26/07 4:25 PM, in article epe64o$1r9$1@news.Stanford.EDU, "Randy
Jennings" <randyj@stanford.edu> wrote:

> Did the FAQ or source code change?
> 
> Sincerely,
> Randy Jennings
> 
> The squirrels are your friends!
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP requests timeout value
Date: Fri, 26 Jan 2007 19:15:21 -0800
Lines: 15
Distribution: su
Message-ID: <C1E003C9.7C49%jpettit@stanford.edu>
References: <epeeks$86l$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169867727 9705 127.0.0.1 (27 Jan 2007 03:15:27 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: ARP requests timeout value
Thread-Index: AcdBwWCwnw63dK20EduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11254

Anything reasonable.  One second sounds good to me.

--Justin


On 1/26/07 6:49 PM, in article epeeks$86l$1@news.Stanford.EDU, "Jad Naous"
<jnaous@stanford.edu> wrote:

> how long should we wait before we resend a new ARP request if a reply is
> not received?
> 
> Thanks,
> Jad.


.

Path: shelby.stanford.edu!not-for-mail
From: "Kevin Hart" <kevin.hart@hp.com>
Newsgroups: su.class.cs244a
Subject: Grading project 2 on myth?
Date: Sat, 27 Jan 2007 01:25:20 -0700
Lines: 8
Distribution: su
Message-ID: <epf29h$pr7$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169886321 26471 127.0.0.1 (27 Jan 2007 08:25:21 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11255

Hi,

Will you be grading project 2 on myth?

Thanks,
Kevin 


.

Path: shelby.stanford.edu!not-for-mail
From: "Matt Page" <mpage@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Timing out ARP cache entries
Date: Sat, 27 Jan 2007 13:13:03 -0800
Lines: 7
Distribution: su
Message-ID: <epgf90$f7$1@news.Stanford.EDU>
NNTP-Posting-Host: wanderlust.stanford.edu
X-Trace: news.Stanford.EDU 1169932384 487 128.12.104.45 (27 Jan 2007 21:13:04 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11256

Are we allowed to use pthreads(or another thread library) to aid timing out 
arp cache entries?

Thanks,
Matt 


.

Path: shelby.stanford.edu!paun
From: Filip Paun <paun@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Memory Allocation Contract
Date: Sat, 27 Jan 2007 13:51:59 -0800
Lines: 8
Distribution: su
Message-ID: <paun-F4A62F.13515927012007@nntp.stanford.edu>
NNTP-Posting-Host: zosomac.stanford.edu
X-Trace: news.Stanford.EDU 1169934721 2018 128.12.135.184 (27 Jan 2007 21:52:01 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: MT-NewsWatcher/3.5.2 (Intel Mac OS X)
Xref: shelby.stanford.edu su.class.cs244a:11257

   My question deals with the comments:
      /* borrowed */
      /* lent */
found next to several parameters.

   For each one, who is responsible for freeing the memory allocated for 
that parameter?  
   Thank you.
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Memory Allocation Contract
Date: Sat, 27 Jan 2007 14:08:51 -0800
Lines: 20
Distribution: su
Message-ID: <C1E10D73.7CA9%jpettit@stanford.edu>
References: <paun-F4A62F.13515927012007@nntp.stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169935734 2671 127.0.0.1 (27 Jan 2007 22:08:54 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Memory Allocation Contract
Thread-Index: AcdCX7nO+Dr4va5SEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11258

These terms are from the perspective of you as the borrower or lender of a
memory block.  So, for something borrowed, they are responsible.  For
something lent, you are.

--Justin


On 1/27/07 1:51 PM, in article paun-F4A62F.13515927012007@nntp.stanford.edu,
"Filip Paun" <paun@stanford.edu> wrote:

>    My question deals with the comments:
>       /* borrowed */
>       /* lent */
> found next to several parameters.
> 
>    For each one, who is responsible for freeing the memory allocated for
> that parameter?  
>    Thank you.


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Timing out ARP cache entries
Date: Sat, 27 Jan 2007 14:13:32 -0800
Lines: 17
Distribution: su
Message-ID: <C1E10E8C.7CAC%jpettit@stanford.edu>
References: <epgf90$f7$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169936035 2903 127.0.0.1 (27 Jan 2007 22:13:55 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Timing out ARP cache entries
Thread-Index: AcdCYGFLn7fpEq5TEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11259

Yes.  Just make sure that it compiles cleanly on the Myths.

--Justin


On 1/27/07 1:13 PM, in article epgf90$f7$1@news.Stanford.EDU, "Matt Page"
<mpage@stanford.edu> wrote:

> Are we allowed to use pthreads(or another thread library) to aid timing out
> arp cache entries?
> 
> Thanks,
> Matt 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Grading project 2 on myth?
Date: Sat, 27 Jan 2007 14:14:37 -0800
Lines: 18
Distribution: su
Message-ID: <C1E10ECD.7CAE%jpettit@stanford.edu>
References: <epf29h$pr7$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169936078 2903 127.0.0.1 (27 Jan 2007 22:14:38 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Grading project 2 on myth?
Thread-Index: AcdCYIgKxtIi4a5TEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11260

Yes.

--Justin


On 1/27/07 12:25 AM, in article epf29h$pr7$1@news.Stanford.EDU, "Kevin Hart"
<kevin.hart@hp.com> wrote:

> Hi,
> 
> Will you be grading project 2 on myth?
> 
> Thanks,
> Kevin 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Riju Kallivalappil" <riju@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Packet validation
Date: Sat, 27 Jan 2007 16:43:40 -0800
Lines: 8
Distribution: su
Message-ID: <epgrjt$931$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1169945021 9313 127.0.0.1 (28 Jan 2007 00:43:41 GMT)
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:11261

Can we assume that all packets passed to sr_handlepacket() are of the proper 
format and are destined for this router? Or do we need to do any validation 
inside sr_handlepacket()?

Thanks,
Riju 


.

Path: shelby.stanford.edu!not-for-mail
From: Raymond Thang <rlt5654@stanford.edu>
Newsgroups: su.class.cs244a
Subject: "FIXME" in sr_protocol.h
Date: Sun, 28 Jan 2007 04:20:30 -0800
Lines: 15
Distribution: su
Message-ID: <epi4ej$d33$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1169986835 13411 127.0.0.1 (28 Jan 2007 12:20:35 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
Xref: shelby.stanford.edu su.class.cs244a:11262

Any insight into this comment that I found in the file sr_protocol.h?

/* FIXME
  * ohh how lame .. how very, very lame... how can I ever go out in public
  * again?! /mc
  */
<system byte order #defines here>

I can't really tell if there is actually anything wrong with the code. 
[I don't see anything wrong, personally.]

Some clarification would be appreciated.

TIA
- Raymond
.

Path: shelby.stanford.edu!not-for-mail
From: "Darius Henderson" <darius.henderson@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running grading script
Date: Sun, 28 Jan 2007 15:07:24 -0800
Lines: 160
Distribution: su
Message-ID: <epjabj$b0v$1@news.Stanford.EDU>
References: <eoeheb$l9m$1@news.Stanford.EDU> <C1D00C6D.7506%jpettit@stanford.edu> <eoel8m$ob8$1@news.Stanford.EDU> <eorjfo$h9a$1@news.Stanford.EDU> <C1D6AA04.785A%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1170025651 11295 127.0.0.1 (28 Jan 2007 23:07:31 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:11263

Hi,

I've been fixing up little bugs in my proxy for PA4, but I still can't seeem 
to get that grading script running. The proxy never crashed on the queries 
from the script, at least from what I can see (entering the script's 
addresses in telnet works just fine). Any other possibilities for this error 
(exact same error as Alex from the post quoted below)?

"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1D6AA04.785A%jpettit@stanford.edu...
> It looks like you may be closing the socket you have listening on 32454,
> since the script is complaining that it can't connect to your proxy.  You
> may want to telnet to your proxy and manually type in the requests from 
> the
> grading script.  Is your proxy crashing on one of the queries?
>
> --Justin
>
>
> On 1/19/07 3:16 PM, in article eorjfo$h9a$1@news.Stanford.EDU, "Darius
> Henderson" <darius.henderson@stanford.edu> wrote:
>
>> I've been testing my proxy through telnet and my browsers mostly, so I 
>> just
>> started using the grading script and I've got this error too. I don't 
>> have
>> any trouble making connections through the browsers though. Anyone know 
>> some
>> reasons why this would occur only with the script or if there's a way to
>> debug my program while the script is executing?
>>
>> Thanks,
>> Darius
>>
>>
>> "Alex" <axle@sonic.net> wrote in message
>> news:eoel8m$ob8$1@news.Stanford.EDU...
>>> I gave a port in the valid range and I still see this issue. I was able 
>>> to
>>> run my proxy on that port and use telnet and do GET correctly but I'm 
>>> still
>>> having problems with the grading script.
>>>
>>> vine7:~/proj1> ./grade proxy.c 32454
>>> Binary: proxy.c
>>> Running on port 32454
>>> Traceback (most recent call last):
>>>  File "./grade", line 97, in ?
>>>    main()
>>>  File "./grade", line 42, in main
>>>    foblist.append(urllib.urlopen(url, None, proxy_map))
>>>  File
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
>>> line
>>> 82, in urlopen
>>>    return opener.open(url)
>>>  File
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
>>> line
>>> 190, in open
>>>    return getattr(self, name)(url)
>>>  File
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py", 
>>> line
>>> 313, in open_http
>>>    h.endheaders()
>>>  File
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>> line 798, in endheaders
>>>    self._send_output()
>>>  File
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>> line 679, in _send_output
>>>    self.send(msg)
>>>  File
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>> line 646, in send
>>>    self.connect()
>>>  File
>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>> line 630, in connect
>>>    raise socket.error, msg
>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>
>>> Alex
>>>
>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>> news:C1D00C6D.7506%jpettit@stanford.edu...
>>>> TCP and UDP port numbers are 16-bit values, which means the maximum 
>>>> value
>>>> is
>>>> 65535.  Try something between 1024 and 65535.  You also might want to
>>>> check
>>>> to make sure that you're checking all your socket return values and
>>>> compiler
>>>> warnings.
>>>>
>>>> --Justin
>>>>
>>>>
>>>> On 1/14/07 4:21 PM, in article eoeheb$l9m$1@news.Stanford.EDU, "Alex"
>>>> <axle@sonic.net> wrote:
>>>>
>>>>> I was trying to run the grading script on my proxy and I get the
>>>>> messages
>>>>> below. Why is this happening?
>>>>>
>>>>> vine7:~/proj1> ./grade proxy.c 98235
>>>>> Binary: proxy.c
>>>>> Running on port 98235
>>>>> Traceback (most recent call last):
>>>>>   File "./grade", line 100, in ?
>>>>>     main()
>>>>>   File "./grade", line 45, in main
>>>>>     foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>>   File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>> line 82, in urlopen
>>>>>     return opener.open(url)
>>>>>   File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>> line 190, in open
>>>>>     return getattr(self, name)(url)
>>>>>   File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>> line 313, in open_http
>>>>>     h.endheaders()
>>>>>   File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>> line
>>>>> 798, in endheaders
>>>>>     self._send_output()
>>>>>   File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>> line
>>>>> 679, in _send_output
>>>>>     self.send(msg)
>>>>>   File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>> line
>>>>> 646, in send
>>>>>     self.connect()
>>>>>   File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>> line
>>>>> 630, in connect
>>>>>     raise socket.error, msg
>>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: "FIXME" in sr_protocol.h
Date: Sun, 28 Jan 2007 16:05:50 -0800
Lines: 28
Distribution: su
Message-ID: <C1E27A5E.7CF3%jpettit@stanford.edu>
References: <epi4ej$d33$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170029156 13724 127.0.0.1 (29 Jan 2007 00:05:56 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: "FIXME" in sr_protocol.h
Thread-Index: AcdDOTveeljpCK8sEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11264

He felt that he shouldn't be using #defines to determine the endian-ness of
the system.  It would be better to figure it out dynamically.  Keep in mind
that Linux, Solaris, and Darwin (Mac OS X) are all available on platforms
with the opposite endian-ness as defined there.

--Justin


On 1/28/07 4:20 AM, in article epi4ej$d33$1@news.Stanford.EDU, "Raymond
Thang" <rlt5654@stanford.edu> wrote:

> Any insight into this comment that I found in the file sr_protocol.h?
> 
> /* FIXME
>   * ohh how lame .. how very, very lame... how can I ever go out in public
>   * again?! /mc
>   */
> <system byte order #defines here>
> 
> I can't really tell if there is actually anything wrong with the code.
> [I don't see anything wrong, personally.]
> 
> Some clarification would be appreciated.
> 
> TIA
> - Raymond


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running grading script
Date: Sun, 28 Jan 2007 16:10:12 -0800
Lines: 172
Distribution: su
Message-ID: <C1E27B64.7CF6%jpettit@stanford.edu>
References: <eoeheb$l9m$1@news.Stanford.EDU> <C1D00C6D.7506%jpettit@stanford.edu> <eoel8m$ob8$1@news.Stanford.EDU> <eorjfo$h9a$1@news.Stanford.EDU> <C1D6AA04.785A%jpettit@stanford.edu> <epjabj$b0v$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170029417 13975 127.0.0.1 (29 Jan 2007 00:10:17 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: running grading script
Thread-Index: AcdDOdgIFtaui68tEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11265

Is it possible that you are not handling HTTP/1.1 requests as defined in the
FAQ?  If you are still having trouble, I would recommend coming to office
hours, since it's hard to debug this without more information.

--Justin


On 1/28/07 3:07 PM, in article epjabj$b0v$1@news.Stanford.EDU, "Darius
Henderson" <darius.henderson@stanford.edu> wrote:

> Hi,
> 
> I've been fixing up little bugs in my proxy for PA4, but I still can't seeem
> to get that grading script running. The proxy never crashed on the queries
> from the script, at least from what I can see (entering the script's
> addresses in telnet works just fine). Any other possibilities for this error
> (exact same error as Alex from the post quoted below)?
> 
> "Justin Pettit" <jpettit@stanford.edu> wrote in message
> news:C1D6AA04.785A%jpettit@stanford.edu...
>> It looks like you may be closing the socket you have listening on 32454,
>> since the script is complaining that it can't connect to your proxy.  You
>> may want to telnet to your proxy and manually type in the requests from
>> the
>> grading script.  Is your proxy crashing on one of the queries?
>> 
>> --Justin
>> 
>> 
>> On 1/19/07 3:16 PM, in article eorjfo$h9a$1@news.Stanford.EDU, "Darius
>> Henderson" <darius.henderson@stanford.edu> wrote:
>> 
>>> I've been testing my proxy through telnet and my browsers mostly, so I
>>> just
>>> started using the grading script and I've got this error too. I don't
>>> have
>>> any trouble making connections through the browsers though. Anyone know
>>> some
>>> reasons why this would occur only with the script or if there's a way to
>>> debug my program while the script is executing?
>>> 
>>> Thanks,
>>> Darius
>>> 
>>> 
>>> "Alex" <axle@sonic.net> wrote in message
>>> news:eoel8m$ob8$1@news.Stanford.EDU...
>>>> I gave a port in the valid range and I still see this issue. I was able
>>>> to
>>>> run my proxy on that port and use telnet and do GET correctly but I'm
>>>> still
>>>> having problems with the grading script.
>>>> 
>>>> vine7:~/proj1> ./grade proxy.c 32454
>>>> Binary: proxy.c
>>>> Running on port 32454
>>>> Traceback (most recent call last):
>>>>  File "./grade", line 97, in ?
>>>>    main()
>>>>  File "./grade", line 42, in main
>>>>    foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>  File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>> line
>>>> 82, in urlopen
>>>>    return opener.open(url)
>>>>  File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>> line
>>>> 190, in open
>>>>    return getattr(self, name)(url)
>>>>  File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>> line
>>>> 313, in open_http
>>>>    h.endheaders()
>>>>  File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>> line 798, in endheaders
>>>>    self._send_output()
>>>>  File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>> line 679, in _send_output
>>>>    self.send(msg)
>>>>  File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>> line 646, in send
>>>>    self.connect()
>>>>  File
>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>> line 630, in connect
>>>>    raise socket.error, msg
>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>> 
>>>> Alex
>>>> 
>>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>>> news:C1D00C6D.7506%jpettit@stanford.edu...
>>>>> TCP and UDP port numbers are 16-bit values, which means the maximum
>>>>> value
>>>>> is
>>>>> 65535.  Try something between 1024 and 65535.  You also might want to
>>>>> check
>>>>> to make sure that you're checking all your socket return values and
>>>>> compiler
>>>>> warnings.
>>>>> 
>>>>> --Justin
>>>>> 
>>>>> 
>>>>> On 1/14/07 4:21 PM, in article eoeheb$l9m$1@news.Stanford.EDU, "Alex"
>>>>> <axle@sonic.net> wrote:
>>>>> 
>>>>>> I was trying to run the grading script on my proxy and I get the
>>>>>> messages
>>>>>> below. Why is this happening?
>>>>>> 
>>>>>> vine7:~/proj1> ./grade proxy.c 98235
>>>>>> Binary: proxy.c
>>>>>> Running on port 98235
>>>>>> Traceback (most recent call last):
>>>>>>   File "./grade", line 100, in ?
>>>>>>     main()
>>>>>>   File "./grade", line 45, in main
>>>>>>     foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>>>   File
>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>> line 82, in urlopen
>>>>>>     return opener.open(url)
>>>>>>   File
>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>> line 190, in open
>>>>>>     return getattr(self, name)(url)
>>>>>>   File
>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>> line 313, in open_http
>>>>>>     h.endheaders()
>>>>>>   File
>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>> line
>>>>>> 798, in endheaders
>>>>>>     self._send_output()
>>>>>>   File
>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>> line
>>>>>> 679, in _send_output
>>>>>>     self.send(msg)
>>>>>>   File
>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>> line
>>>>>> 646, in send
>>>>>>     self.connect()
>>>>>>   File
>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>> line
>>>>>> 630, in connect
>>>>>>     raise socket.error, msg
>>>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Dinesh Gupta <dineshg@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PA2 how to broadcast ARP request?
Date: Mon, 29 Jan 2007 00:40:24 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <epjfpo$ffn$1@news.Stanford.EDU>
NNTP-Posting-Host: vine10.stanford.edu
X-Trace: news.Stanford.EDU 1170031224 15863 171.64.15.247 (29 Jan 2007 00:40:24 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (Linux/2.6.15.7smp-secfix3 (i686))
Xref: shelby.stanford.edu su.class.cs244a:11266

Hi,

After getting an IP packet, shall we broadcast ARP req for hw addr from
all router ports or shall we get the destination port from routing table
and broadcast from only that particular port? If we broadcast from the
particular interface then is it possible to not get reply? Because ip
addr is correct and application servers running so no way we won't get
it!

Thanks,
Dinesh
.

Path: shelby.stanford.edu!not-for-mail
From: "Darius Henderson" <darius.henderson@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running grading script
Date: Sun, 28 Jan 2007 17:34:04 -0800
Lines: 200
Distribution: su
Message-ID: <epjiuj$i52$1@news.Stanford.EDU>
References: <eoeheb$l9m$1@news.Stanford.EDU> <C1D00C6D.7506%jpettit@stanford.edu> <eoel8m$ob8$1@news.Stanford.EDU> <eorjfo$h9a$1@news.Stanford.EDU> <C1D6AA04.785A%jpettit@stanford.edu> <epjabj$b0v$1@news.Stanford.EDU> <C1E27B64.7CF6%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1170034451 18594 127.0.0.1 (29 Jan 2007 01:34:11 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:11267

Hi,

I think narrowed down the problem in my code to this one snippet:

if((new_sock = accept(sock_num, (struct sockaddr *)&addr, &addr_size)) >= 0)
    printf("\nIncoming connection from %s...\n", inet_ntoa(addr.sin_addr));
else printf("Invalid socket given: %d\n", new_sock);

The grading script gets here, to the accept call, but never makes it to 
either of printfs. The fact that I can connect just fine from my computer 
makes me think the accept call and the parameters are okay, so I have no 
idea why the script keeps saying "connection refused." Hope this information 
helps any, if not I'll just go to office hours.

Thanks,
Darius

"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1E27B64.7CF6%jpettit@stanford.edu...
> Is it possible that you are not handling HTTP/1.1 requests as defined in 
> the
> FAQ?  If you are still having trouble, I would recommend coming to office
> hours, since it's hard to debug this without more information.
>
> --Justin
>
>
> On 1/28/07 3:07 PM, in article epjabj$b0v$1@news.Stanford.EDU, "Darius
> Henderson" <darius.henderson@stanford.edu> wrote:
>
>> Hi,
>>
>> I've been fixing up little bugs in my proxy for PA4, but I still can't 
>> seeem
>> to get that grading script running. The proxy never crashed on the 
>> queries
>> from the script, at least from what I can see (entering the script's
>> addresses in telnet works just fine). Any other possibilities for this 
>> error
>> (exact same error as Alex from the post quoted below)?
>>
>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>> news:C1D6AA04.785A%jpettit@stanford.edu...
>>> It looks like you may be closing the socket you have listening on 32454,
>>> since the script is complaining that it can't connect to your proxy. 
>>> You
>>> may want to telnet to your proxy and manually type in the requests from
>>> the
>>> grading script.  Is your proxy crashing on one of the queries?
>>>
>>> --Justin
>>>
>>>
>>> On 1/19/07 3:16 PM, in article eorjfo$h9a$1@news.Stanford.EDU, "Darius
>>> Henderson" <darius.henderson@stanford.edu> wrote:
>>>
>>>> I've been testing my proxy through telnet and my browsers mostly, so I
>>>> just
>>>> started using the grading script and I've got this error too. I don't
>>>> have
>>>> any trouble making connections through the browsers though. Anyone know
>>>> some
>>>> reasons why this would occur only with the script or if there's a way 
>>>> to
>>>> debug my program while the script is executing?
>>>>
>>>> Thanks,
>>>> Darius
>>>>
>>>>
>>>> "Alex" <axle@sonic.net> wrote in message
>>>> news:eoel8m$ob8$1@news.Stanford.EDU...
>>>>> I gave a port in the valid range and I still see this issue. I was 
>>>>> able
>>>>> to
>>>>> run my proxy on that port and use telnet and do GET correctly but I'm
>>>>> still
>>>>> having problems with the grading script.
>>>>>
>>>>> vine7:~/proj1> ./grade proxy.c 32454
>>>>> Binary: proxy.c
>>>>> Running on port 32454
>>>>> Traceback (most recent call last):
>>>>>  File "./grade", line 97, in ?
>>>>>    main()
>>>>>  File "./grade", line 42, in main
>>>>>    foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>>  File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>> line
>>>>> 82, in urlopen
>>>>>    return opener.open(url)
>>>>>  File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>> line
>>>>> 190, in open
>>>>>    return getattr(self, name)(url)
>>>>>  File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>> line
>>>>> 313, in open_http
>>>>>    h.endheaders()
>>>>>  File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>> line 798, in endheaders
>>>>>    self._send_output()
>>>>>  File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>> line 679, in _send_output
>>>>>    self.send(msg)
>>>>>  File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>> line 646, in send
>>>>>    self.connect()
>>>>>  File
>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>> line 630, in connect
>>>>>    raise socket.error, msg
>>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>>>
>>>>> Alex
>>>>>
>>>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>>>> news:C1D00C6D.7506%jpettit@stanford.edu...
>>>>>> TCP and UDP port numbers are 16-bit values, which means the maximum
>>>>>> value
>>>>>> is
>>>>>> 65535.  Try something between 1024 and 65535.  You also might want to
>>>>>> check
>>>>>> to make sure that you're checking all your socket return values and
>>>>>> compiler
>>>>>> warnings.
>>>>>>
>>>>>> --Justin
>>>>>>
>>>>>>
>>>>>> On 1/14/07 4:21 PM, in article eoeheb$l9m$1@news.Stanford.EDU, "Alex"
>>>>>> <axle@sonic.net> wrote:
>>>>>>
>>>>>>> I was trying to run the grading script on my proxy and I get the
>>>>>>> messages
>>>>>>> below. Why is this happening?
>>>>>>>
>>>>>>> vine7:~/proj1> ./grade proxy.c 98235
>>>>>>> Binary: proxy.c
>>>>>>> Running on port 98235
>>>>>>> Traceback (most recent call last):
>>>>>>>   File "./grade", line 100, in ?
>>>>>>>     main()
>>>>>>>   File "./grade", line 45, in main
>>>>>>>     foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>>>>   File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>> line 82, in urlopen
>>>>>>>     return opener.open(url)
>>>>>>>   File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>> line 190, in open
>>>>>>>     return getattr(self, name)(url)
>>>>>>>   File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>> line 313, in open_http
>>>>>>>     h.endheaders()
>>>>>>>   File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>> line
>>>>>>> 798, in endheaders
>>>>>>>     self._send_output()
>>>>>>>   File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>> line
>>>>>>> 679, in _send_output
>>>>>>>     self.send(msg)
>>>>>>>   File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>> line
>>>>>>> 646, in send
>>>>>>>     self.connect()
>>>>>>>   File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>> line
>>>>>>> 630, in connect
>>>>>>>     raise socket.error, msg
>>>>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running grading script
Date: Sun, 28 Jan 2007 17:54:07 -0800
Lines: 216
Distribution: su
Message-ID: <C1E293BF.7CFD%jpettit@stanford.edu>
References: <eoeheb$l9m$1@news.Stanford.EDU> <C1D00C6D.7506%jpettit@stanford.edu> <eoel8m$ob8$1@news.Stanford.EDU> <eorjfo$h9a$1@news.Stanford.EDU> <C1D6AA04.785A%jpettit@stanford.edu> <epjabj$b0v$1@news.Stanford.EDU> <C1E27B64.7CF6%jpettit@stanford.edu> <epjiuj$i52$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170035651 19381 127.0.0.1 (29 Jan 2007 01:54:11 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: running grading script
Thread-Index: AcdDSFximu6dNK87EduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11268

Did you set "addr_size" before you call accept()?  You should have a line
like the following before your call to accept():

    addr_size = sizeof(addr);

The third argument is used to both pass something in and to retrieve
something.

--Justin


On 1/28/07 5:34 PM, in article epjiuj$i52$1@news.Stanford.EDU, "Darius
Henderson" <darius.henderson@stanford.edu> wrote:

> Hi,
> 
> I think narrowed down the problem in my code to this one snippet:
> 
> if((new_sock = accept(sock_num, (struct sockaddr *)&addr, &addr_size)) >= 0)
>     printf("\nIncoming connection from %s...\n", inet_ntoa(addr.sin_addr));
> else printf("Invalid socket given: %d\n", new_sock);
> 
> The grading script gets here, to the accept call, but never makes it to
> either of printfs. The fact that I can connect just fine from my computer
> makes me think the accept call and the parameters are okay, so I have no
> idea why the script keeps saying "connection refused." Hope this information
> helps any, if not I'll just go to office hours.
> 
> Thanks,
> Darius
> 
> "Justin Pettit" <jpettit@stanford.edu> wrote in message
> news:C1E27B64.7CF6%jpettit@stanford.edu...
>> Is it possible that you are not handling HTTP/1.1 requests as defined in
>> the
>> FAQ?  If you are still having trouble, I would recommend coming to office
>> hours, since it's hard to debug this without more information.
>> 
>> --Justin
>> 
>> 
>> On 1/28/07 3:07 PM, in article epjabj$b0v$1@news.Stanford.EDU, "Darius
>> Henderson" <darius.henderson@stanford.edu> wrote:
>> 
>>> Hi,
>>> 
>>> I've been fixing up little bugs in my proxy for PA4, but I still can't
>>> seeem
>>> to get that grading script running. The proxy never crashed on the
>>> queries
>>> from the script, at least from what I can see (entering the script's
>>> addresses in telnet works just fine). Any other possibilities for this
>>> error
>>> (exact same error as Alex from the post quoted below)?
>>> 
>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>> news:C1D6AA04.785A%jpettit@stanford.edu...
>>>> It looks like you may be closing the socket you have listening on 32454,
>>>> since the script is complaining that it can't connect to your proxy.
>>>> You
>>>> may want to telnet to your proxy and manually type in the requests from
>>>> the
>>>> grading script.  Is your proxy crashing on one of the queries?
>>>> 
>>>> --Justin
>>>> 
>>>> 
>>>> On 1/19/07 3:16 PM, in article eorjfo$h9a$1@news.Stanford.EDU, "Darius
>>>> Henderson" <darius.henderson@stanford.edu> wrote:
>>>> 
>>>>> I've been testing my proxy through telnet and my browsers mostly, so I
>>>>> just
>>>>> started using the grading script and I've got this error too. I don't
>>>>> have
>>>>> any trouble making connections through the browsers though. Anyone know
>>>>> some
>>>>> reasons why this would occur only with the script or if there's a way
>>>>> to
>>>>> debug my program while the script is executing?
>>>>> 
>>>>> Thanks,
>>>>> Darius
>>>>> 
>>>>> 
>>>>> "Alex" <axle@sonic.net> wrote in message
>>>>> news:eoel8m$ob8$1@news.Stanford.EDU...
>>>>>> I gave a port in the valid range and I still see this issue. I was
>>>>>> able
>>>>>> to
>>>>>> run my proxy on that port and use telnet and do GET correctly but I'm
>>>>>> still
>>>>>> having problems with the grading script.
>>>>>> 
>>>>>> vine7:~/proj1> ./grade proxy.c 32454
>>>>>> Binary: proxy.c
>>>>>> Running on port 32454
>>>>>> Traceback (most recent call last):
>>>>>>  File "./grade", line 97, in ?
>>>>>>    main()
>>>>>>  File "./grade", line 42, in main
>>>>>>    foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>>>  File
>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>> line
>>>>>> 82, in urlopen
>>>>>>    return opener.open(url)
>>>>>>  File
>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>> line
>>>>>> 190, in open
>>>>>>    return getattr(self, name)(url)
>>>>>>  File
>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>> line
>>>>>> 313, in open_http
>>>>>>    h.endheaders()
>>>>>>  File
>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>> line 798, in endheaders
>>>>>>    self._send_output()
>>>>>>  File
>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>> line 679, in _send_output
>>>>>>    self.send(msg)
>>>>>>  File
>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>> line 646, in send
>>>>>>    self.connect()
>>>>>>  File
>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>> line 630, in connect
>>>>>>    raise socket.error, msg
>>>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>>>> 
>>>>>> Alex
>>>>>> 
>>>>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>>>>> news:C1D00C6D.7506%jpettit@stanford.edu...
>>>>>>> TCP and UDP port numbers are 16-bit values, which means the maximum
>>>>>>> value
>>>>>>> is
>>>>>>> 65535.  Try something between 1024 and 65535.  You also might want to
>>>>>>> check
>>>>>>> to make sure that you're checking all your socket return values and
>>>>>>> compiler
>>>>>>> warnings.
>>>>>>> 
>>>>>>> --Justin
>>>>>>> 
>>>>>>> 
>>>>>>> On 1/14/07 4:21 PM, in article eoeheb$l9m$1@news.Stanford.EDU, "Alex"
>>>>>>> <axle@sonic.net> wrote:
>>>>>>> 
>>>>>>>> I was trying to run the grading script on my proxy and I get the
>>>>>>>> messages
>>>>>>>> below. Why is this happening?
>>>>>>>> 
>>>>>>>> vine7:~/proj1> ./grade proxy.c 98235
>>>>>>>> Binary: proxy.c
>>>>>>>> Running on port 98235
>>>>>>>> Traceback (most recent call last):
>>>>>>>>   File "./grade", line 100, in ?
>>>>>>>>     main()
>>>>>>>>   File "./grade", line 45, in main
>>>>>>>>     foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>>>>>   File
>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>>> line 82, in urlopen
>>>>>>>>     return opener.open(url)
>>>>>>>>   File
>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>>> line 190, in open
>>>>>>>>     return getattr(self, name)(url)
>>>>>>>>   File
>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>>> line 313, in open_http
>>>>>>>>     h.endheaders()
>>>>>>>>   File
>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>>> line
>>>>>>>> 798, in endheaders
>>>>>>>>     self._send_output()
>>>>>>>>   File
>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>>> line
>>>>>>>> 679, in _send_output
>>>>>>>>     self.send(msg)
>>>>>>>>   File
>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>>> line
>>>>>>>> 646, in send
>>>>>>>>     self.connect()
>>>>>>>>   File
>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>>> line
>>>>>>>> 630, in connect
>>>>>>>>     raise socket.error, msg
>>>>>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running grading script
Date: Sun, 28 Jan 2007 18:14:37 -0800
Lines: 234
Distribution: su
Message-ID: <C1E2988D.7D02%jpettit@stanford.edu>
References: <eoeheb$l9m$1@news.Stanford.EDU> <C1D00C6D.7506%jpettit@stanford.edu> <eoel8m$ob8$1@news.Stanford.EDU> <eorjfo$h9a$1@news.Stanford.EDU> <C1D6AA04.785A%jpettit@stanford.edu> <epjabj$b0v$1@news.Stanford.EDU> <C1E27B64.7CF6%jpettit@stanford.edu> <epjiuj$i52$1@news.Stanford.EDU> <C1E293BF.7CFD%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170036881 20220 127.0.0.1 (29 Jan 2007 02:14:41 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: running grading script
Thread-Index: AcdDSFximu6dNK87EduZHwARJDbi7gAAt0gV
Xref: shelby.stanford.edu su.class.cs244a:11269

Sorry, I was talking to somebody while writing that last sentence, so it
wasn't very clear.  Here's what the accept() man page has to say:

    The addrlen is a value-result parameter; it should initially
    contain the amount of space pointed to by addr; on return
    it will contain the actual length (in bytes) of the address
    returned.

This is an easy thing to miss.  I've been stung by it myself.

--Justin


On 1/28/07 5:54 PM, in article C1E293BF.7CFD%jpettit@stanford.edu, "Justin
Pettit" <jpettit@stanford.edu> wrote:

> Did you set "addr_size" before you call accept()?  You should have a line
> like the following before your call to accept():
> 
>     addr_size = sizeof(addr);
> 
> The third argument is used to both pass something in and to retrieve
> something.
> 
> --Justin
> 
> 
> On 1/28/07 5:34 PM, in article epjiuj$i52$1@news.Stanford.EDU, "Darius
> Henderson" <darius.henderson@stanford.edu> wrote:
> 
>> Hi,
>> 
>> I think narrowed down the problem in my code to this one snippet:
>> 
>> if((new_sock = accept(sock_num, (struct sockaddr *)&addr, &addr_size)) >= 0)
>>     printf("\nIncoming connection from %s...\n", inet_ntoa(addr.sin_addr));
>> else printf("Invalid socket given: %d\n", new_sock);
>> 
>> The grading script gets here, to the accept call, but never makes it to
>> either of printfs. The fact that I can connect just fine from my computer
>> makes me think the accept call and the parameters are okay, so I have no
>> idea why the script keeps saying "connection refused." Hope this information
>> helps any, if not I'll just go to office hours.
>> 
>> Thanks,
>> Darius
>> 
>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>> news:C1E27B64.7CF6%jpettit@stanford.edu...
>>> Is it possible that you are not handling HTTP/1.1 requests as defined in
>>> the
>>> FAQ?  If you are still having trouble, I would recommend coming to office
>>> hours, since it's hard to debug this without more information.
>>> 
>>> --Justin
>>> 
>>> 
>>> On 1/28/07 3:07 PM, in article epjabj$b0v$1@news.Stanford.EDU, "Darius
>>> Henderson" <darius.henderson@stanford.edu> wrote:
>>> 
>>>> Hi,
>>>> 
>>>> I've been fixing up little bugs in my proxy for PA4, but I still can't
>>>> seeem
>>>> to get that grading script running. The proxy never crashed on the
>>>> queries
>>>> from the script, at least from what I can see (entering the script's
>>>> addresses in telnet works just fine). Any other possibilities for this
>>>> error
>>>> (exact same error as Alex from the post quoted below)?
>>>> 
>>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>>> news:C1D6AA04.785A%jpettit@stanford.edu...
>>>>> It looks like you may be closing the socket you have listening on 32454,
>>>>> since the script is complaining that it can't connect to your proxy.
>>>>> You
>>>>> may want to telnet to your proxy and manually type in the requests from
>>>>> the
>>>>> grading script.  Is your proxy crashing on one of the queries?
>>>>> 
>>>>> --Justin
>>>>> 
>>>>> 
>>>>> On 1/19/07 3:16 PM, in article eorjfo$h9a$1@news.Stanford.EDU, "Darius
>>>>> Henderson" <darius.henderson@stanford.edu> wrote:
>>>>> 
>>>>>> I've been testing my proxy through telnet and my browsers mostly, so I
>>>>>> just
>>>>>> started using the grading script and I've got this error too. I don't
>>>>>> have
>>>>>> any trouble making connections through the browsers though. Anyone know
>>>>>> some
>>>>>> reasons why this would occur only with the script or if there's a way
>>>>>> to
>>>>>> debug my program while the script is executing?
>>>>>> 
>>>>>> Thanks,
>>>>>> Darius
>>>>>> 
>>>>>> 
>>>>>> "Alex" <axle@sonic.net> wrote in message
>>>>>> news:eoel8m$ob8$1@news.Stanford.EDU...
>>>>>>> I gave a port in the valid range and I still see this issue. I was
>>>>>>> able
>>>>>>> to
>>>>>>> run my proxy on that port and use telnet and do GET correctly but I'm
>>>>>>> still
>>>>>>> having problems with the grading script.
>>>>>>> 
>>>>>>> vine7:~/proj1> ./grade proxy.c 32454
>>>>>>> Binary: proxy.c
>>>>>>> Running on port 32454
>>>>>>> Traceback (most recent call last):
>>>>>>>  File "./grade", line 97, in ?
>>>>>>>    main()
>>>>>>>  File "./grade", line 42, in main
>>>>>>>    foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>>>>  File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>> line
>>>>>>> 82, in urlopen
>>>>>>>    return opener.open(url)
>>>>>>>  File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>> line
>>>>>>> 190, in open
>>>>>>>    return getattr(self, name)(url)
>>>>>>>  File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>> line
>>>>>>> 313, in open_http
>>>>>>>    h.endheaders()
>>>>>>>  File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>> line 798, in endheaders
>>>>>>>    self._send_output()
>>>>>>>  File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>> line 679, in _send_output
>>>>>>>    self.send(msg)
>>>>>>>  File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>> line 646, in send
>>>>>>>    self.connect()
>>>>>>>  File
>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>> line 630, in connect
>>>>>>>    raise socket.error, msg
>>>>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>>>>> 
>>>>>>> Alex
>>>>>>> 
>>>>>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>>>>>> news:C1D00C6D.7506%jpettit@stanford.edu...
>>>>>>>> TCP and UDP port numbers are 16-bit values, which means the maximum
>>>>>>>> value
>>>>>>>> is
>>>>>>>> 65535.  Try something between 1024 and 65535.  You also might want to
>>>>>>>> check
>>>>>>>> to make sure that you're checking all your socket return values and
>>>>>>>> compiler
>>>>>>>> warnings.
>>>>>>>> 
>>>>>>>> --Justin
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On 1/14/07 4:21 PM, in article eoeheb$l9m$1@news.Stanford.EDU, "Alex"
>>>>>>>> <axle@sonic.net> wrote:
>>>>>>>> 
>>>>>>>>> I was trying to run the grading script on my proxy and I get the
>>>>>>>>> messages
>>>>>>>>> below. Why is this happening?
>>>>>>>>> 
>>>>>>>>> vine7:~/proj1> ./grade proxy.c 98235
>>>>>>>>> Binary: proxy.c
>>>>>>>>> Running on port 98235
>>>>>>>>> Traceback (most recent call last):
>>>>>>>>>   File "./grade", line 100, in ?
>>>>>>>>>     main()
>>>>>>>>>   File "./grade", line 45, in main
>>>>>>>>>     foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>>>>>>   File
>>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>>>> line 82, in urlopen
>>>>>>>>>     return opener.open(url)
>>>>>>>>>   File
>>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>>>> line 190, in open
>>>>>>>>>     return getattr(self, name)(url)
>>>>>>>>>   File
>>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>>>> line 313, in open_http
>>>>>>>>>     h.endheaders()
>>>>>>>>>   File
>>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>>>> line
>>>>>>>>> 798, in endheaders
>>>>>>>>>     self._send_output()
>>>>>>>>>   File
>>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>>>> line
>>>>>>>>> 679, in _send_output
>>>>>>>>>     self.send(msg)
>>>>>>>>>   File
>>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>>>> line
>>>>>>>>> 646, in send
>>>>>>>>>     self.connect()
>>>>>>>>>   File
>>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>>>> line
>>>>>>>>> 630, in connect
>>>>>>>>>     raise socket.error, msg
>>>>>>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Packet validation
Date: Sun, 28 Jan 2007 19:35:54 -0800
Lines: 17
Distribution: su
Message-ID: <epjq2s$n62$1@news.Stanford.EDU>
References: <epgrjt$931$1@news.Stanford.EDU>
NNTP-Posting-Host: paulinator.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170041756 23746 128.12.133.106 (29 Jan 2007 03:35:56 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <epgrjt$931$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11270

Do as much checking as you can. You will have to inspect most of the 
fields of all the packets anyways, right? Just check for crazy values as 
you go through the read procedures.

Remember, your routers are live on the Internet, so you will get all 
sorts of crazy traffic since you are accessible from any computer on the 
net.

Riju Kallivalappil wrote:
> Can we assume that all packets passed to sr_handlepacket() are of the proper 
> format and are destined for this router? Or do we need to do any validation 
> inside sr_handlepacket()?
> 
> Thanks,
> Riju 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PA2 how to broadcast ARP request?
Date: Sun, 28 Jan 2007 19:41:42 -0800
Lines: 20
Distribution: su
Message-ID: <epjqdn$ne3$1@news.Stanford.EDU>
References: <epjfpo$ffn$1@news.Stanford.EDU>
NNTP-Posting-Host: paulinator.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170042103 24003 128.12.133.106 (29 Jan 2007 03:41:43 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <epjfpo$ffn$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11271

What if I'm pinging a machine that isn't on and isn't in your arp table 
what will you do? You won't know the machine isn't on until you send 
your arp packet, right? So, there is always a chance that the arp won't 
get a reply.

As for where the computer is, you can assume that the routing table is 
correct.

Dinesh Gupta wrote:
> Hi,
> 
> After getting an IP packet, shall we broadcast ARP req for hw addr from
> all router ports or shall we get the destination port from routing table
> and broadcast from only that particular port? If we broadcast from the
> particular interface then is it possible to not get reply? Because ip
> addr is correct and application servers running so no way we won't get
> it!
> 
> Thanks,
> Dinesh
.

Path: shelby.stanford.edu!myth13.Stanford.EDU!ryanchen
From: Ryan Chen <ryanchen@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Turn off all printf for PA2?
Date: Sun, 28 Jan 2007 19:44:13 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.LNX.4.44.0701281942290.306-100000@myth13.Stanford.EDU>
NNTP-Posting-Host: myth13.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1170042255 24076 171.64.15.2 (29 Jan 2007 03:44:15 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:11272

In the original stub code provided, the printf("*** -> Received packet of
length %d \n", len); is not in a DEBUGGING bracket of any sort. When we
submit our submission, should all printf be turned off?

Also, there are other things being displayed on the terminal. In general, what output
should we keep and what should we turn off? Thanks.

.

Path: shelby.stanford.edu!not-for-mail
From: "Riju Kallivalappil" <riju@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Broadcast packets
Date: Sun, 28 Jan 2007 20:05:33 -0800
Lines: 6
Distribution: su
Message-ID: <epjrqe$o9k$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170043534 24884 127.0.0.1 (29 Jan 2007 04:05:34 GMT)
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:11273

Do we need to handle IP broadcast packets?

Thanks,
Riju 


.

Path: shelby.stanford.edu!not-for-mail
From: "Riju Kallivalappil" <riju@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Non TCP/UDP packets
Date: Sun, 28 Jan 2007 20:08:36 -0800
Lines: 8
Distribution: su
Message-ID: <epjs04$oeq$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170043716 25050 127.0.0.1 (29 Jan 2007 04:08:36 GMT)
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:11274

What should we do if we receive a packet that is not TCP or UDP and is 
destined for one of the router interfaces? Can we silently discard such 
packets?

Thanks,
Riju 


.

Path: shelby.stanford.edu!not-for-mail
From: "Darius Henderson" <darius.henderson@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: running grading script
Date: Sun, 28 Jan 2007 20:41:53 -0800
Lines: 267
Distribution: su
Message-ID: <epjtuo$pps$1@news.Stanford.EDU>
References: <eoeheb$l9m$1@news.Stanford.EDU> <C1D00C6D.7506%jpettit@stanford.edu> <eoel8m$ob8$1@news.Stanford.EDU> <eorjfo$h9a$1@news.Stanford.EDU> <C1D6AA04.785A%jpettit@stanford.edu> <epjabj$b0v$1@news.Stanford.EDU> <C1E27B64.7CF6%jpettit@stanford.edu> <epjiuj$i52$1@news.Stanford.EDU> <C1E293BF.7CFD%jpettit@stanford.edu> <C1E2988D.7D02%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1170045720 26428 127.0.0.1 (29 Jan 2007 04:42:00 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
Xref: shelby.stanford.edu su.class.cs244a:11275

Hi,

Thanks for the help, but after doublechecking the parameters to accept(), 
I'm still having the problem. The addrlen parameter is correctly initialized 
to sizeof(struct sockaddr), and the value always ends up as 16 (even after 
accept() returns the actual length), so I don't think is the problem. I'm 
going to try Paul's office hours tomorrow though.

Thanks,
Darius

"Justin Pettit" <jpettit@stanford.edu> wrote in message 
news:C1E2988D.7D02%jpettit@stanford.edu...
> Sorry, I was talking to somebody while writing that last sentence, so it
> wasn't very clear.  Here's what the accept() man page has to say:
>
>    The addrlen is a value-result parameter; it should initially
>    contain the amount of space pointed to by addr; on return
>    it will contain the actual length (in bytes) of the address
>    returned.
>
> This is an easy thing to miss.  I've been stung by it myself.
>
> --Justin
>
>
> On 1/28/07 5:54 PM, in article C1E293BF.7CFD%jpettit@stanford.edu, "Justin
> Pettit" <jpettit@stanford.edu> wrote:
>
>> Did you set "addr_size" before you call accept()?  You should have a line
>> like the following before your call to accept():
>>
>>     addr_size = sizeof(addr);
>>
>> The third argument is used to both pass something in and to retrieve
>> something.
>>
>> --Justin
>>
>>
>> On 1/28/07 5:34 PM, in article epjiuj$i52$1@news.Stanford.EDU, "Darius
>> Henderson" <darius.henderson@stanford.edu> wrote:
>>
>>> Hi,
>>>
>>> I think narrowed down the problem in my code to this one snippet:
>>>
>>> if((new_sock = accept(sock_num, (struct sockaddr *)&addr, &addr_size)) 
>>>  >= 0)
>>>     printf("\nIncoming connection from %s...\n", 
>>> inet_ntoa(addr.sin_addr));
>>> else printf("Invalid socket given: %d\n", new_sock);
>>>
>>> The grading script gets here, to the accept call, but never makes it to
>>> either of printfs. The fact that I can connect just fine from my 
>>> computer
>>> makes me think the accept call and the parameters are okay, so I have no
>>> idea why the script keeps saying "connection refused." Hope this 
>>> information
>>> helps any, if not I'll just go to office hours.
>>>
>>> Thanks,
>>> Darius
>>>
>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>> news:C1E27B64.7CF6%jpettit@stanford.edu...
>>>> Is it possible that you are not handling HTTP/1.1 requests as defined 
>>>> in
>>>> the
>>>> FAQ?  If you are still having trouble, I would recommend coming to 
>>>> office
>>>> hours, since it's hard to debug this without more information.
>>>>
>>>> --Justin
>>>>
>>>>
>>>> On 1/28/07 3:07 PM, in article epjabj$b0v$1@news.Stanford.EDU, "Darius
>>>> Henderson" <darius.henderson@stanford.edu> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I've been fixing up little bugs in my proxy for PA4, but I still can't
>>>>> seeem
>>>>> to get that grading script running. The proxy never crashed on the
>>>>> queries
>>>>> from the script, at least from what I can see (entering the script's
>>>>> addresses in telnet works just fine). Any other possibilities for this
>>>>> error
>>>>> (exact same error as Alex from the post quoted below)?
>>>>>
>>>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>>>> news:C1D6AA04.785A%jpettit@stanford.edu...
>>>>>> It looks like you may be closing the socket you have listening on 
>>>>>> 32454,
>>>>>> since the script is complaining that it can't connect to your proxy.
>>>>>> You
>>>>>> may want to telnet to your proxy and manually type in the requests 
>>>>>> from
>>>>>> the
>>>>>> grading script.  Is your proxy crashing on one of the queries?
>>>>>>
>>>>>> --Justin
>>>>>>
>>>>>>
>>>>>> On 1/19/07 3:16 PM, in article eorjfo$h9a$1@news.Stanford.EDU, 
>>>>>> "Darius
>>>>>> Henderson" <darius.henderson@stanford.edu> wrote:
>>>>>>
>>>>>>> I've been testing my proxy through telnet and my browsers mostly, so 
>>>>>>> I
>>>>>>> just
>>>>>>> started using the grading script and I've got this error too. I 
>>>>>>> don't
>>>>>>> have
>>>>>>> any trouble making connections through the browsers though. Anyone 
>>>>>>> know
>>>>>>> some
>>>>>>> reasons why this would occur only with the script or if there's a 
>>>>>>> way
>>>>>>> to
>>>>>>> debug my program while the script is executing?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Darius
>>>>>>>
>>>>>>>
>>>>>>> "Alex" <axle@sonic.net> wrote in message
>>>>>>> news:eoel8m$ob8$1@news.Stanford.EDU...
>>>>>>>> I gave a port in the valid range and I still see this issue. I was
>>>>>>>> able
>>>>>>>> to
>>>>>>>> run my proxy on that port and use telnet and do GET correctly but 
>>>>>>>> I'm
>>>>>>>> still
>>>>>>>> having problems with the grading script.
>>>>>>>>
>>>>>>>> vine7:~/proj1> ./grade proxy.c 32454
>>>>>>>> Binary: proxy.c
>>>>>>>> Running on port 32454
>>>>>>>> Traceback (most recent call last):
>>>>>>>>  File "./grade", line 97, in ?
>>>>>>>>    main()
>>>>>>>>  File "./grade", line 42, in main
>>>>>>>>    foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>>>>>  File
>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>>> line
>>>>>>>> 82, in urlopen
>>>>>>>>    return opener.open(url)
>>>>>>>>  File
>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>>> line
>>>>>>>> 190, in open
>>>>>>>>    return getattr(self, name)(url)
>>>>>>>>  File
>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>>> line
>>>>>>>> 313, in open_http
>>>>>>>>    h.endheaders()
>>>>>>>>  File
>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>>> line 798, in endheaders
>>>>>>>>    self._send_output()
>>>>>>>>  File
>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>>> line 679, in _send_output
>>>>>>>>    self.send(msg)
>>>>>>>>  File
>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>>> line 646, in send
>>>>>>>>    self.connect()
>>>>>>>>  File
>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>>> line 630, in connect
>>>>>>>>    raise socket.error, msg
>>>>>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>>>>>>
>>>>>>>> Alex
>>>>>>>>
>>>>>>>> "Justin Pettit" <jpettit@stanford.edu> wrote in message
>>>>>>>> news:C1D00C6D.7506%jpettit@stanford.edu...
>>>>>>>>> TCP and UDP port numbers are 16-bit values, which means the 
>>>>>>>>> maximum
>>>>>>>>> value
>>>>>>>>> is
>>>>>>>>> 65535.  Try something between 1024 and 65535.  You also might want 
>>>>>>>>> to
>>>>>>>>> check
>>>>>>>>> to make sure that you're checking all your socket return values 
>>>>>>>>> and
>>>>>>>>> compiler
>>>>>>>>> warnings.
>>>>>>>>>
>>>>>>>>> --Justin
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 1/14/07 4:21 PM, in article eoeheb$l9m$1@news.Stanford.EDU, 
>>>>>>>>> "Alex"
>>>>>>>>> <axle@sonic.net> wrote:
>>>>>>>>>
>>>>>>>>>> I was trying to run the grading script on my proxy and I get the
>>>>>>>>>> messages
>>>>>>>>>> below. Why is this happening?
>>>>>>>>>>
>>>>>>>>>> vine7:~/proj1> ./grade proxy.c 98235
>>>>>>>>>> Binary: proxy.c
>>>>>>>>>> Running on port 98235
>>>>>>>>>> Traceback (most recent call last):
>>>>>>>>>>   File "./grade", line 100, in ?
>>>>>>>>>>     main()
>>>>>>>>>>   File "./grade", line 45, in main
>>>>>>>>>>     foblist.append(urllib.urlopen(url, None, proxy_map))
>>>>>>>>>>   File
>>>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>>>>> line 82, in urlopen
>>>>>>>>>>     return opener.open(url)
>>>>>>>>>>   File
>>>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>>>>> line 190, in open
>>>>>>>>>>     return getattr(self, name)(url)
>>>>>>>>>>   File
>>>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/urllib.py",
>>>>>>>>>> line 313, in open_http
>>>>>>>>>>     h.endheaders()
>>>>>>>>>>   File
>>>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>>>>> line
>>>>>>>>>> 798, in endheaders
>>>>>>>>>>     self._send_output()
>>>>>>>>>>   File
>>>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>>>>> line
>>>>>>>>>> 679, in _send_output
>>>>>>>>>>     self.send(msg)
>>>>>>>>>>   File
>>>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>>>>> line
>>>>>>>>>> 646, in send
>>>>>>>>>>     self.connect()
>>>>>>>>>>   File
>>>>>>>>>> "/afs/.ir/pubsw/Languages/python-2.4.3/@sys/lib/python2.4/httplib.py",
>>>>>>>>>> line
>>>>>>>>>> 630, in connect
>>>>>>>>>>     raise socket.error, msg
>>>>>>>>>> IOError: [Errno socket error] (111, 'Connection refused')
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Riju Kallivalappil" <riju@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Loopback address
Date: Sun, 28 Jan 2007 23:30:24 -0800
Lines: 4
Distribution: su
Message-ID: <epk7qh$39e$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170055825 3374 127.0.0.1 (29 Jan 2007 07:30:25 GMT)
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:11276

In the router, do we need to handle IP packets with a loopback address in 
the source or destination address field? 


.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: How to use gdb with router?
Date: Sun, 28 Jan 2007 23:43:02 -0800
Lines: 16
Distribution: su
Message-ID: <epk8i6$3n5$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170056582 3813 128.12.194.72 (29 Jan 2007 07:43:02 GMT)
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:11277

What is the proper way to run gdb on our router code?

Here's what I'm getting right now:

myth16:~/CS244A/hw2/stub> gdb ./sr --args -t <my topology> -r rtable
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
....

(gdb) start
No symbol table loaded.  Use the "file" command.
(gdb)

And yes, I have "-g" as a compiler flag in my Makefile.

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Running out of disk quota.
Date: Mon, 29 Jan 2007 02:43:50 -0800
Lines: 4
Distribution: su
Message-ID: <epkj56$f3d$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170067430 15469 128.12.194.72 (29 Jan 2007 10:43:50 GMT)
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:11278

Can we get some disk quota allocated for this class? The default 200MB 
limit is killing me. :p

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Turn off all printf for PA2?
Date: Mon, 29 Jan 2007 10:50:27 -0800
Lines: 12
Distribution: su
Message-ID: <eplfll$do2$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0701281942290.306-100000@myth13.Stanford.EDU>
NNTP-Posting-Host: paulinator.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170096629 14082 128.12.133.106 (29 Jan 2007 18:50:29 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <Pine.LNX.4.44.0701281942290.306-100000@myth13.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11279

Please don't have anything printing when you hand in your assignments. 
Those prints are just there to get you started. We didn't want to 
surround them with our DEBUG removal scheme in case you like yours more.

Ryan Chen wrote:
> In the original stub code provided, the printf("*** -> Received packet of
> length %d \n", len); is not in a DEBUGGING bracket of any sort. When we
> submit our submission, should all printf be turned off?
> 
> Also, there are other things being displayed on the terminal. In general, what output
> should we keep and what should we turn off? Thanks.
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Broadcast packets
Date: Mon, 29 Jan 2007 10:52:13 -0800
Lines: 10
Distribution: su
Message-ID: <eplfov$do2$2@news.Stanford.EDU>
References: <epjrqe$o9k$1@news.Stanford.EDU>
NNTP-Posting-Host: paulinator.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170096735 14082 128.12.133.106 (29 Jan 2007 18:52:15 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <epjrqe$o9k$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11280

Do you mean multicast? Those you don't have to deal with.

Riju Kallivalappil wrote:
> Do we need to handle IP broadcast packets?
> 
> Thanks,
> Riju 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Non TCP/UDP packets
Date: Mon, 29 Jan 2007 10:52:57 -0800
Lines: 12
Distribution: su
Message-ID: <eplfqb$do2$3@news.Stanford.EDU>
References: <epjs04$oeq$1@news.Stanford.EDU>
NNTP-Posting-Host: paulinator.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170096779 14082 128.12.133.106 (29 Jan 2007 18:52:59 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <epjs04$oeq$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11281

You are an IP router. Don't even care what is inside it. That is the 
beauty of protocol encapsulation.

Riju Kallivalappil wrote:
> What should we do if we receive a packet that is not TCP or UDP and is 
> destined for one of the router interfaces? Can we silently discard such 
> packets?
> 
> Thanks,
> Riju 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Loopback address
Date: Mon, 29 Jan 2007 10:53:52 -0800
Lines: 8
Distribution: su
Message-ID: <eplfs1$do2$4@news.Stanford.EDU>
References: <epk7qh$39e$1@news.Stanford.EDU>
NNTP-Posting-Host: paulinator.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170096833 14082 128.12.133.106 (29 Jan 2007 18:53:53 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <epk7qh$39e$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11282

If it doesn't match your routing table, then don't route it. The RFC 
says IPs shouldn't ever be routed (private addresses).

Riju Kallivalappil wrote:
> In the router, do we need to handle IP packets with a loopback address in 
> the source or destination address field? 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: How to use gdb with router?
Date: Mon, 29 Jan 2007 10:54:36 -0800
Lines: 19
Distribution: su
Message-ID: <eplfte$do2$5@news.Stanford.EDU>
References: <epk8i6$3n5$1@news.Stanford.EDU>
NNTP-Posting-Host: paulinator.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170096878 14082 128.12.133.106 (29 Jan 2007 18:54:38 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <epk8i6$3n5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11283

I think the command is "run" instead of "start".

Yangfan Wang wrote:
> What is the proper way to run gdb on our router code?
> 
> Here's what I'm getting right now:
> 
> myth16:~/CS244A/hw2/stub> gdb ./sr --args -t <my topology> -r rtable
> GNU gdb 6.3
> Copyright 2004 Free Software Foundation, Inc.
> ...
> 
> (gdb) start
> No symbol table loaded.  Use the "file" command.
> (gdb)
> 
> And yes, I have "-g" as a compiler flag in my Makefile.
> 
> -Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Running out of disk quota.
Date: Mon, 29 Jan 2007 10:55:40 -0800
Lines: 9
Distribution: su
Message-ID: <eplfve$do2$6@news.Stanford.EDU>
References: <epkj56$f3d$1@news.Stanford.EDU>
NNTP-Posting-Host: paulinator.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170096942 14082 128.12.133.106 (29 Jan 2007 18:55:42 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <epkj56$f3d$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11284

We did put in a request for adding 500 MB for the students. Are you 
enrolled in the class via axess? I'll talk to the other TAs and Nick 
about this.

Yangfan Wang wrote:
> Can we get some disk quota allocated for this class? The default 200MB 
> limit is killing me. :p
> 
> -Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: "Riju Kallivalappil" <riju@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Broadcast packets
Date: Mon, 29 Jan 2007 11:49:04 -0800
Lines: 15
Distribution: su
Message-ID: <eplj3i$h26$1@news.Stanford.EDU>
References: <epjrqe$o9k$1@news.Stanford.EDU> <eplfov$do2$2@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170100146 17478 127.0.0.1 (29 Jan 2007 19:49:06 GMT)
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:11285

I meant broadcast. What should I do if I receive a packet with an IP 
broadcast address as the destination address?

"Paul Tarjan (TA)" <ptarjan@stanford.edu> wrote in message 
news:eplfov$do2$2@news.Stanford.EDU...
> Do you mean multicast? Those you don't have to deal with.
>
> Riju Kallivalappil wrote:
>> Do we need to handle IP broadcast packets?
>>
>> Thanks,
>> Riju
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Riju Kallivalappil" <riju@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Non TCP/UDP packets
Date: Mon, 29 Jan 2007 11:52:30 -0800
Lines: 18
Distribution: su
Message-ID: <eplja0$h81$1@news.Stanford.EDU>
References: <epjs04$oeq$1@news.Stanford.EDU> <eplfqb$do2$3@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170100353 17665 127.0.0.1 (29 Jan 2007 19:52:33 GMT)
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:11286

I think it should care about what is inside if the packet's destination IP 
is one of the router interfaces. How else can it return an ICMP Port 
Unreachable message?

"Paul Tarjan (TA)" <ptarjan@stanford.edu> wrote in message 
news:eplfqb$do2$3@news.Stanford.EDU...
> You are an IP router. Don't even care what is inside it. That is the 
> beauty of protocol encapsulation.
>
> Riju Kallivalappil wrote:
>> What should we do if we receive a packet that is not TCP or UDP and is 
>> destined for one of the router interfaces? Can we silently discard such 
>> packets?
>>
>> Thanks,
>> Riju 


.

Path: shelby.stanford.edu!not-for-mail
From: "Riju Kallivalappil" <riju@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Loopback address
Date: Mon, 29 Jan 2007 11:59:25 -0800
Lines: 15
Distribution: su
Message-ID: <epljnu$hgi$1@news.Stanford.EDU>
References: <epk7qh$39e$1@news.Stanford.EDU> <eplfs1$do2$4@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170100798 17938 127.0.0.1 (29 Jan 2007 19:59:58 GMT)
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:11287

I understand that it should not be routed. But, it could be delivered 
locally if it's received on the loopback interface? Since we don't have any 
layer above to receive a locally delivered packet, we could drop it 
silently. Or we could return an ICMP error message. I'm not sure.

"Paul Tarjan (TA)" <ptarjan@stanford.edu> wrote in message 
news:eplfs1$do2$4@news.Stanford.EDU...
> If it doesn't match your routing table, then don't route it. The RFC says 
> IPs shouldn't ever be routed (private addresses).
>
> Riju Kallivalappil wrote:
>> In the router, do we need to handle IP packets with a loopback address in 
>> the source or destination address field? 


.

Path: shelby.stanford.edu!not-for-mail
From: Dinesh Gupta <dineshg@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PA2 how to broadcast ARP request?
Date: Mon, 29 Jan 2007 20:27:09 +0000 (UTC)
Lines: 30
Distribution: su
Message-ID: <epllat$ipd$1@news.Stanford.EDU>
References: <epjfpo$ffn$1@news.Stanford.EDU> <epjqdn$ne3$1@news.Stanford.EDU>
NNTP-Posting-Host: vine10.stanford.edu
X-Trace: news.Stanford.EDU 1170102429 19245 171.64.15.247 (29 Jan 2007 20:27:09 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (Linux/2.6.15.7smp-secfix3 (i686))
Xref: shelby.stanford.edu su.class.cs244a:11288

HI Paul,

Thanks for the explaination.
In this case how can we test it. How can we shut down these m/cs for testing
purpose. 

Thanks,
Dinesh

"Paul Tarjan (TA)" <ptarjan@stanford.edu> wrote:
> What if I'm pinging a machine that isn't on and isn't in your arp table 
> what will you do? You won't know the machine isn't on until you send 
> your arp packet, right? So, there is always a chance that the arp won't 
> get a reply.

> As for where the computer is, you can assume that the routing table is 
> correct.

> Dinesh Gupta wrote:
> > Hi,
> > 
> > After getting an IP packet, shall we broadcast ARP req for hw addr from
> > all router ports or shall we get the destination port from routing table
> > and broadcast from only that particular port? If we broadcast from the
> > particular interface then is it possible to not get reply? Because ip
> > addr is correct and application servers running so no way we won't get
> > it!
> > 
> > Thanks,
> > Dinesh
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Broadcast packets
Date: Mon, 29 Jan 2007 13:28:21 -0800
Lines: 7
Distribution: su
Message-ID: <eplotl$m93$1@news.Stanford.EDU>
References: <epjrqe$o9k$1@news.Stanford.EDU> <eplfov$do2$2@news.Stanford.EDU> <eplj3i$h26$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170106101 22819 127.0.0.1 (29 Jan 2007 21:28:21 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eplj3i$h26$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11289

Riju Kallivalappil wrote:
> I meant broadcast. What should I do if I receive a packet with an IP 
> broadcast address as the destination address?

Just go ahead and drop it.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Loopback address
Date: Mon, 29 Jan 2007 13:30:13 -0800
Lines: 10
Distribution: su
Message-ID: <eplp15$m93$2@news.Stanford.EDU>
References: <epk7qh$39e$1@news.Stanford.EDU> <eplfs1$do2$4@news.Stanford.EDU> <epljnu$hgi$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170106213 22819 127.0.0.1 (29 Jan 2007 21:30:13 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <epljnu$hgi$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11290

Riju Kallivalappil wrote:
> I understand that it should not be routed. But, it could be delivered 
> locally if it's received on the loopback interface? Since we don't have any 
> layer above to receive a locally delivered packet, we could drop it 
> silently. Or we could return an ICMP error message. I'm not sure.
> 

Just drop it.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Neelima Balakrishnan <bneelima@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Problem with wireshark
Date: Mon, 29 Jan 2007 16:16:58 -0800
Lines: 30
Distribution: su
Message-ID: <epm2pe$2nr$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170116206 2811 127.0.0.1 (30 Jan 2007 00:16:46 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
Xref: shelby.stanford.edu su.class.cs244a:11291

Hi,

When I run wireshark and and start the capture, I get the following error:
../wireshark
/afs/ir.stanford.edu/users/b/n/bneelima/CS244a/./dumpcap: line 87: cd: 
/usr/class/cs244a/wireshark-0.99.4-jdp: No such file or directory
gcc: capture-pcap-util-unix.o: No such file or directory
gcc: capture_opts.o: No such file or directory
gcc: capture_loop.o: No such file or directory
gcc: capture-pcap-util.o: No such file or directory
gcc: capture_stop_conditions.o: No such file or directory
gcc: clopts_common.o: No such file or directory
gcc: conditions.o: No such file or directory
gcc: dumpcap.o: No such file or directory
gcc: pcapio.o: No such file or directory
gcc: ringbuffer.o: No such file or directory
gcc: sync_pipe_write.o: No such file or directory
gcc: tempfile.o: No such file or directory
gcc: version_info.o: No such file or directory
gcc: unicode-utils.o: No such file or directory
gcc: wiretap/.libs/libwiretap.so: No such file or directory

Looks like it is trying to change the directory to 
/usr/class/cs244a/wireshark-0.99.4-jdp while the actual directory there 
seems to be - /usr/class/cs244a/wireshark-0.99.4/

Am I doing something wrong here?

Thanks
Neelima
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem with wireshark
Date: Mon, 29 Jan 2007 16:27:31 -0800
Lines: 12
Distribution: su
Message-ID: <C1E3D0F3.7DA7%jpettit@stanford.edu>
References: <epm2pe$2nr$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170116856 3451 127.0.0.1 (30 Jan 2007 00:27:36 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Problem with wireshark
Thread-Index: AcdEBW29rJI5q6/4EduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11292

> When I run wireshark and and start the capture, I get the following error:
> ./wireshark
> 
> Am I doing something wrong here?

Try running it with the absolute path:

    /usr/class/cs244a/bin/wireshark

--Justin


.

Path: shelby.stanford.edu!not-for-mail
From: Neelima Balakrishnan <bneelima@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem with wireshark
Date: Mon, 29 Jan 2007 16:38:07 -0800
Lines: 19
Distribution: su
Message-ID: <epm412$3qr$1@news.Stanford.EDU>
References: <epm2pe$2nr$1@news.Stanford.EDU> <C1E3D0F3.7DA7%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170117475 3931 127.0.0.1 (30 Jan 2007 00:37:55 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <C1E3D0F3.7DA7%jpettit@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:11293

On doing that getting an error saying Child process exited.
"Couldn't run /usr/class/cs244a/bin/dumpcap in child process: No such 
file or directory"

Neelima

Justin Pettit wrote:
>> When I run wireshark and and start the capture, I get the following error:
>> ./wireshark
>>
>> Am I doing something wrong here?
> 
> Try running it with the absolute path:
> 
>     /usr/class/cs244a/bin/wireshark
> 
> --Justin
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem with wireshark
Date: Mon, 29 Jan 2007 16:56:01 -0800
Lines: 30
Distribution: su
Message-ID: <C1E3D7A1.7DB0%jpettit@stanford.edu>
References: <epm2pe$2nr$1@news.Stanford.EDU> <C1E3D0F3.7DA7%jpettit@stanford.edu> <epm412$3qr$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170118563 4910 127.0.0.1 (30 Jan 2007 00:56:03 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Problem with wireshark
Thread-Index: AcdECWj6p2N0zq/8EduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11294

It looks like you are trying to run the actual dump file.  Run Wireshark
like I mentioned and then load the dump file.

--Justin


On 1/29/07 4:38 PM, in article epm412$3qr$1@news.Stanford.EDU, "Neelima
Balakrishnan" <bneelima@stanford.edu> wrote:

> On doing that getting an error saying Child process exited.
> "Couldn't run /usr/class/cs244a/bin/dumpcap in child process: No such
> file or directory"
> 
> Neelima
> 
> Justin Pettit wrote:
>>> When I run wireshark and and start the capture, I get the following error:
>>> ./wireshark
>>> 
>>> Am I doing something wrong here?
>> 
>> Try running it with the absolute path:
>> 
>>     /usr/class/cs244a/bin/wireshark
>> 
>> --Justin
>> 
>> 


.

Path: shelby.stanford.edu!not-for-mail
From: Jin Wang <jinwang@stanford.edu>
Newsgroups: su.class.cs244a
Subject: working sample
Date: Mon, 29 Jan 2007 21:14:13 -0500
Lines: 8
Distribution: su
Message-ID: <epm9oa$8fu$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170123338 8702 127.0.0.1 (30 Jan 2007 02:15:38 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.5 (X11/20060728)
Xref: shelby.stanford.edu su.class.cs244a:11295

Topology 2 was mentioned as a sample topology in the assignment, but I 
don't think it's working.

Is there a working sample topology we can use (ping/traceroute/ftp...) 
for reference?

Thanks,
Jin
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: working sample
Date: Mon, 29 Jan 2007 19:26:12 -0800
Lines: 25
Distribution: su
Message-ID: <epme3u$bmj$1@news.Stanford.EDU>
References: <epm9oa$8fu$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170127806 11987 171.64.74.54 (30 Jan 2007 03:30:06 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <epm9oa$8fu$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11296

There is a working demo on topology 2, but the IP addresses listed in 
the assignment are likely incorrect.  Here are the correct IPs for the 
demo router:

Router IPs:
eth0: 171.67.71.20
eth1: 171.67.71.21
eth2: 171.67.71.23

Application Servers:
Ap Server 1: 171.67.71.22
Ap Server 2: 171.67.71.24

Clay


Jin Wang wrote:
> Topology 2 was mentioned as a sample topology in the assignment, but I 
> don't think it's working.
> 
> Is there a working sample topology we can use (ping/traceroute/ftp...) 
> for reference?
> 
> Thanks,
> Jin
.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: "FIXME" in sr_protocol.h
Date: Mon, 29 Jan 2007 10:21:54 -0800
Lines: 43
Distribution: su
Message-ID: <epmk6h$g0c$1@news.Stanford.EDU>
References: <epi4ej$d33$1@news.Stanford.EDU> <C1E27A5E.7CF3%jpettit@stanford.edu>
X-Trace: news.Stanford.EDU 1170134033 16396 127.0.0.1 (30 Jan 2007 05:13:53 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11297

Expecting to have anywhere close to reasonable performance and finding out
the endianness dynamically is rather ridiculous and publicly mockable.

Sincerely,
Randy Jennings

The squirrels are your friends!
"Justin Pettit" <jpettit@stanford.edu> wrote in message
news:C1E27A5E.7CF3%jpettit@stanford.edu...
> He felt that he shouldn't be using #defines to determine the endian-ness
> of
> the system.  It would be better to figure it out dynamically.  Keep in
> mind
> that Linux, Solaris, and Darwin (Mac OS X) are all available on platforms
> with the opposite endian-ness as defined there.
>
> --Justin
>
>
> On 1/28/07 4:20 AM, in article epi4ej$d33$1@news.Stanford.EDU, "Raymond
> Thang" <rlt5654@stanford.edu> wrote:
>
>> Any insight into this comment that I found in the file sr_protocol.h?
>>
>> /* FIXME
>>   * ohh how lame .. how very, very lame... how can I ever go out in
>> public
>>   * again?! /mc
>>   */
>> <system byte order #defines here>
>>
>> I can't really tell if there is actually anything wrong with the code.
>> [I don't see anything wrong, personally.]
>>
>> Some clarification would be appreciated.
>>
>> TIA
>> - Raymond
>
>



.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PA#2: sanity checks on the FAQ
Date: Mon, 29 Jan 2007 21:13:07 -0800
Lines: 12
Distribution: su
Message-ID: <epmk6i$g0c$2@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170134034 16396 127.0.0.1 (30 Jan 2007 05:13:54 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11298

"You should also discard packets that are obviously corrupted e.g. if the IP 
version is not IPv4, if the packet length is negative or above the Ethernet 
MTU etc."

How does one get a negative packet length?

Sincerely,
Randy Jennings

The squirrels are your friends! 


.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem with wireshark
Date: Mon, 29 Jan 2007 21:49:58 -0800
Lines: 35
Distribution: su
Message-ID: <epmma7$hn5$1@news.Stanford.EDU>
References: <epm2pe$2nr$1@news.Stanford.EDU> <C1E3D0F3.7DA7%jpettit@stanford.edu> <epm412$3qr$1@news.Stanford.EDU> <C1E3D7A1.7DB0%jpettit@stanford.edu>
NNTP-Posting-Host: paulinator.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170136199 18149 128.12.133.106 (30 Jan 2007 05:49:59 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <C1E3D7A1.7DB0%jpettit@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:11299

You can also use JEthereal. It is a java applet that can read your pcap 
files and lets you examine them.

http://yuba.stanford.edu/JEthereal/

Justin Pettit wrote:
> It looks like you are trying to run the actual dump file.  Run Wireshark
> like I mentioned and then load the dump file.
> 
> --Justin
> 
> 
> On 1/29/07 4:38 PM, in article epm412$3qr$1@news.Stanford.EDU, "Neelima
> Balakrishnan" <bneelima@stanford.edu> wrote:
> 
>> On doing that getting an error saying Child process exited.
>> "Couldn't run /usr/class/cs244a/bin/dumpcap in child process: No such
>> file or directory"
>>
>> Neelima
>>
>> Justin Pettit wrote:
>>>> When I run wireshark and and start the capture, I get the following error:
>>>> ./wireshark
>>>>
>>>> Am I doing something wrong here?
>>> Try running it with the absolute path:
>>>
>>>     /usr/class/cs244a/bin/wireshark
>>>
>>> --Justin
>>>
>>>
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Page <mpage@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Accepting ARP replies
Date: Mon, 29 Jan 2007 22:09:26 -0800
Lines: 7
Distribution: su
Message-ID: <epmnem$iea$1@news.Stanford.EDU>
NNTP-Posting-Host: wanderlust.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170137366 18890 128.12.104.61 (30 Jan 2007 06:09:26 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20060313)
Xref: shelby.stanford.edu su.class.cs244a:11300

Do we need to maintain a list of arp requests that we've transmitted? 
Suppose we receive an arp reply for which for did not send an arp 
request? I'm assuming normally we would discard the packet, but can we 
assume that this wont happen?

Thanks,
Matt
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PA#2: sanity checks on the FAQ
Date: Mon, 29 Jan 2007 22:39:48 -0800
Lines: 12
Distribution: su
Message-ID: <epmp7d$jn0$1@news.Stanford.EDU>
References: <epmk6i$g0c$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170139181 20192 127.0.0.1 (30 Jan 2007 06:39:41 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <epmk6i$g0c$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11301

Randy Jennings wrote:
> "You should also discard packets that are obviously corrupted e.g. if the IP 
> version is not IPv4, if the packet length is negative or above the Ethernet 
> MTU etc."
> 
> How does one get a negative packet length?

I would assume if the length of the packet reported by handlepacket was 
negative.. however I don't believe that this should ever happen.  But if 
its in the FAQ maybe you should check for it =)

-David
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Accepting ARP replies
Date: Mon, 29 Jan 2007 22:42:05 -0800
Lines: 14
Distribution: su
Message-ID: <epmpbm$jn0$2@news.Stanford.EDU>
References: <epmnem$iea$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170139318 20192 127.0.0.1 (30 Jan 2007 06:41:58 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <epmnem$iea$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11302

Matt Page wrote:
> Do we need to maintain a list of arp requests that we've transmitted? 
> Suppose we receive an arp reply for which for did not send an arp 
> request? I'm assuming normally we would discard the packet, but can we 
> assume that this wont happen?
> 
> Thanks,
> Matt

For timeout purposes you should already be maintaining a list of who you 
have sent ARP requests for, so I would say you should check that when 
you get a reply that it is a reply for a request you have sent.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: "FIXME" in sr_protocol.h
Date: Mon, 29 Jan 2007 23:22:10 -0800
Lines: 53
Distribution: su
Message-ID: <C1E43222.7DCC%jpettit@stanford.edu>
References: <epi4ej$d33$1@news.Stanford.EDU> <C1E27A5E.7CF3%jpettit@stanford.edu> <epmk6h$g0c$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170141735 22120 127.0.0.1 (30 Jan 2007 07:22:15 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: "FIXME" in sr_protocol.h
Thread-Index: AcdEP1rHmWl7xrAyEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11303

No kidding, but you can do it at compile time with a configure script.

--Justin


On 1/29/07 10:21 AM, in article epmk6h$g0c$1@news.Stanford.EDU, "Randy
Jennings" <randyj@stanford.edu> wrote:

> Expecting to have anywhere close to reasonable performance and finding out
> the endianness dynamically is rather ridiculous and publicly mockable.
> 
> Sincerely,
> Randy Jennings
> 
> The squirrels are your friends!
> "Justin Pettit" <jpettit@stanford.edu> wrote in message
> news:C1E27A5E.7CF3%jpettit@stanford.edu...
>> He felt that he shouldn't be using #defines to determine the endian-ness
>> of
>> the system.  It would be better to figure it out dynamically.  Keep in
>> mind
>> that Linux, Solaris, and Darwin (Mac OS X) are all available on platforms
>> with the opposite endian-ness as defined there.
>> 
>> --Justin
>> 
>> 
>> On 1/28/07 4:20 AM, in article epi4ej$d33$1@news.Stanford.EDU, "Raymond
>> Thang" <rlt5654@stanford.edu> wrote:
>> 
>>> Any insight into this comment that I found in the file sr_protocol.h?
>>> 
>>> /* FIXME
>>>   * ohh how lame .. how very, very lame... how can I ever go out in
>>> public
>>>   * again?! /mc
>>>   */
>>> <system byte order #defines here>
>>> 
>>> I can't really tell if there is actually anything wrong with the code.
>>> [I don't see anything wrong, personally.]
>>> 
>>> Some clarification would be appreciated.
>>> 
>>> TIA
>>> - Raymond
>> 
>> 
> 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: "Paul Tarjan (TA)" <ptarjan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Non TCP/UDP packets
Date: Mon, 29 Jan 2007 23:50:53 -0800
Lines: 26
Distribution: su
Message-ID: <epmt2g$mk2$1@news.Stanford.EDU>
References: <epjs04$oeq$1@news.Stanford.EDU> <eplfqb$do2$3@news.Stanford.EDU> <eplja0$h81$1@news.Stanford.EDU>
NNTP-Posting-Host: paralax.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170143120 23170 172.24.74.102 (30 Jan 2007 07:45:20 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070103)
In-Reply-To: <eplja0$h81$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11304

Sorry, I missed the part about it being to the router interfaces.

I think there is an ICMP Protocol Unknown response. Just send that one 
if there is one, if not, pick some other ICMP message, but you should 
respond telling the other machine that you don't understand whatever 
they are trying to talk to you about.

Riju Kallivalappil wrote:
> I think it should care about what is inside if the packet's destination IP 
> is one of the router interfaces. How else can it return an ICMP Port 
> Unreachable message?
> 
> "Paul Tarjan (TA)" <ptarjan@stanford.edu> wrote in message 
> news:eplfqb$do2$3@news.Stanford.EDU...
>> You are an IP router. Don't even care what is inside it. That is the 
>> beauty of protocol encapsulation.
>>
>> Riju Kallivalappil wrote:
>>> What should we do if we receive a packet that is not TCP or UDP and is 
>>> destined for one of the router interfaces? Can we silently discard such 
>>> packets?
>>>
>>> Thanks,
>>> Riju 
> 
> 
.

Path: shelby.stanford.edu!myth20.Stanford.EDU!ryanchen
From: Ryan Chen <ryanchen@stanford.edu>
Newsgroups: su.class.cs244a
Subject: [PA2] sr_init() before sr_read_from_server()?
Date: Tue, 30 Jan 2007 00:10:36 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.LNX.4.44.0701300002500.17562-100000@myth20.Stanford.EDU>
NNTP-Posting-Host: myth20.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1170144638 27815 171.64.15.38 (30 Jan 2007 08:10:38 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:11305


It seems somewhat logical to me that in sr_init() I should be able to
know/store my router's physical MAC address so that later when I ARP reply
whoever I can package that into an ARP reply.

However, in the stub code, sr_read_from_server contains a portion of the
code that gets this particular hardware information, namely, the VNSHWINFO
case statement, and this won't call the student's sr_handlepacket(). So it
seems to me that I won't be able to store my router's MAC address until
the first time sr_handlepacket is called in which I will need to look it
up in the sr instance...

Is this correct or am I thinking wrong? Thanks.

.

Path: shelby.stanford.edu!not-for-mail
From: Peter Pawlowski <pawlowski@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ARP timeouts
Date: Tue, 30 Jan 2007 00:56:33 -0800
Lines: 10
Distribution: su
Message-ID: <epn181$ub$1@news.Stanford.EDU>
NNTP-Posting-Host: piotrek.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1170147393 971 128.12.104.53 (30 Jan 2007 08:56:33 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Unison/1.7.7
Xref: shelby.stanford.edu su.class.cs244a:11306

Hi--

The class FAQ recommends an ARP cache timeout on the order of 15 
seconds. Stevens recommends ones on the other of 20 minutes. Is this 
simply indicative of the fact that no one can agree what the correct 
value is, or is there rationale for using a shorter time period in VNS?

Cheers,
Peter

.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP timeouts
Date: Tue, 30 Jan 2007 01:10:33 -0800
Lines: 21
Distribution: su
Message-ID: <C1E44B89.7DDB%jpettit@stanford.edu>
References: <epn181$ub$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170148237 1789 127.0.0.1 (30 Jan 2007 09:10:37 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: ARP timeouts
Thread-Index: AcdETn7evTrNerBBEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11307

I think the short timeout in VNS is more a function of easing our testing.
20 minutes is common in real systems.

--Justin


On 1/30/07 12:56 AM, in article epn181$ub$1@news.Stanford.EDU, "Peter
Pawlowski" <pawlowski@stanford.edu> wrote:

> Hi--
> 
> The class FAQ recommends an ARP cache timeout on the order of 15
> seconds. Stevens recommends ones on the other of 20 minutes. Is this
> simply indicative of the fact that no one can agree what the correct
> value is, or is there rationale for using a shorter time period in VNS?
> 
> Cheers,
> Peter
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Matt Page <mpage@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Sleep()
Date: Tue, 30 Jan 2007 03:40:45 -0800
Lines: 7
Distribution: su
Message-ID: <epnart$7o9$1@news.Stanford.EDU>
NNTP-Posting-Host: wanderlust.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170157245 7945 128.12.104.61 (30 Jan 2007 11:40:45 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20060313)
Xref: shelby.stanford.edu su.class.cs244a:11308

I'm tired and can't remember if sleep() forces a context switch or not 
(ie doesn't busy wait and is thus suitable for use inside my arp cache 
timeout thread). Man and Info aren't particularly helpful. Someone help 
a brother out.

Thanks,
Matt
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Sleep()
Date: Tue, 30 Jan 2007 09:50:02 -0800
Lines: 18
Distribution: su
Message-ID: <C1E4C54A.7DF5%jpettit@stanford.edu>
References: <epnart$7o9$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170179409 29487 127.0.0.1 (30 Jan 2007 17:50:09 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Sleep()
Thread-Index: AcdElxEKT9yIsbCKEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11309

It doesn't busy wait, but that particular thread of execution can't do
anything until the time has elapsed.  Any other threads/process are not
affected by the sleep and will execute.

--Justin

On 1/30/07 3:40 AM, in article epnart$7o9$1@news.Stanford.EDU, "Matt Page"
<mpage@stanford.edu> wrote:

> I'm tired and can't remember if sleep() forces a context switch or not
> (ie doesn't busy wait and is thus suitable for use inside my arp cache
> timeout thread). Man and Info aren't particularly helpful. Someone help
> a brother out.
> 
> Thanks,
> Matt


.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: [PA2] sr_init() before sr_read_from_server()?
Date: Tue, 30 Jan 2007 12:56:34 -0800
Lines: 22
Distribution: su
Message-ID: <epoblk$92t$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0701300002500.17562-100000@myth20.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170190837 9309 171.64.74.54 (30 Jan 2007 21:00:37 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <Pine.LNX.4.44.0701300002500.17562-100000@myth20.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11310

You really don't need to do anything special to store the MAC addresses 
for the router- the stub code ensures that these fields are initialized 
before sr_handlepacket() is called the first time.  At that point, you 
need to look up the correct interface in the sr instance's interface 
list and retrieve the correct MAC address- remember that you could get 
an ARP request/reply for any of the router's three network interfaces.

Clay
Ryan Chen wrote:
> It seems somewhat logical to me that in sr_init() I should be able to
> know/store my router's physical MAC address so that later when I ARP reply
> whoever I can package that into an ARP reply.
> 
> However, in the stub code, sr_read_from_server contains a portion of the
> code that gets this particular hardware information, namely, the VNSHWINFO
> case statement, and this won't call the student's sr_handlepacket(). So it
> seems to me that I won't be able to store my router's MAC address until
> the first time sr_handlepacket is called in which I will need to look it
> up in the sr instance...
> 
> Is this correct or am I thinking wrong? Thanks.
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 solutions
Date: Tue, 30 Jan 2007 15:07:23 -0800
Lines: 6
Distribution: su
Message-ID: <epoj3e$f31$1@news.Stanford.EDU>
NNTP-Posting-Host: seine.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170198446 15457 171.64.74.36 (30 Jan 2007 23:07:26 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.8 (X11/20060911)
Xref: shelby.stanford.edu su.class.cs244a:11311

Hi,

Where can I find PS1 solutions?

Thanks,
Jad
.

Path: shelby.stanford.edu!not-for-mail
From: "Matt Page" <mpage@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Cache timeout strategy
Date: Tue, 30 Jan 2007 17:30:39 -0800
Lines: 17
Distribution: su
Message-ID: <eporg2$lr0$1@news.Stanford.EDU>
NNTP-Posting-Host: wanderlust.stanford.edu
X-Trace: news.Stanford.EDU 1170207042 22368 128.12.104.45 (31 Jan 2007 01:30:42 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11312

Is it better to have a single thread that checks the arp cache every 15 
seconds
 and times out entries or to spawn a new thread any time an entry is added 
that
 sleeps for 15 seconds and then removes it from the cache?

A single thread wouldn't be able to *strictly* enforce the 15 second timeout
policy as an entry added right after the timeout thread ran would stay in 
the
cache for close to twice the timeout period.

How strictly must we enforce the timeout period?

Thanks,
Matt 


.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PA#2: sanity checks on the FAQ
Date: Tue, 30 Jan 2007 17:56:49 -0800
Lines: 28
Distribution: su
Message-ID: <eposvl$nav$1@news.Stanford.EDU>
References: <epmk6i$g0c$2@news.Stanford.EDU> <epmp7d$jn0$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170208565 23903 127.0.0.1 (31 Jan 2007 01:56:05 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11313

It's sent in as an unsigned int.  Yes, we could range check it, but when I 
check if an unsigned int is less than zero, it tells me I am doing something 
rather stupid.  I do not see how someone could sanely consider the length 
field in the IP header as anything but unsigned.

I don't get it.

Sincerely,
Randy Jennings

The squirrels are your friends!

"David Erickson" <derickso@stanford.edu> wrote in message 
news:epmp7d$jn0$1@news.Stanford.EDU...
> Randy Jennings wrote:
>> "You should also discard packets that are obviously corrupted e.g. if the 
>> IP version is not IPv4, if the packet length is negative or above the 
>> Ethernet MTU etc."
>>
>> How does one get a negative packet length?
>
> I would assume if the length of the packet reported by handlepacket was 
> negative.. however I don't believe that this should ever happen.  But if 
> its in the FAQ maybe you should check for it =)
>
> -David 


.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Cache timeout strategy
Date: Tue, 30 Jan 2007 20:14:22 -0800
Lines: 23
Distribution: su
Message-ID: <epp5ak$su9$1@news.Stanford.EDU>
References: <eporg2$lr0$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170217108 29641 171.64.74.54 (31 Jan 2007 04:18:28 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <eporg2$lr0$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11314

Either strategy is acceptable- the 15 second timeout for ARP cache 
entries is meant as a guideline for your expiration strategy and settings.

Clay

Matt Page wrote:
> Is it better to have a single thread that checks the arp cache every 15 
> seconds
>  and times out entries or to spawn a new thread any time an entry is added 
> that
>  sleeps for 15 seconds and then removes it from the cache?
> 
> A single thread wouldn't be able to *strictly* enforce the 15 second timeout
> policy as an entry added right after the timeout thread ran would stay in 
> the
> cache for close to twice the timeout period.
> 
> How strictly must we enforce the timeout period?
> 
> Thanks,
> Matt 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Spawning new threads.
Date: Tue, 30 Jan 2007 20:27:06 -0800
Lines: 7
Distribution: su
Message-ID: <epp5qm$15$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170217623 37 128.12.194.72 (31 Jan 2007 04:27:03 GMT)
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:11315

Where can I find a good resource on learning how to spawn new threads in 
  Unix?

We learned the theory in CS140, but a quick review and some practical 
details on threads in Unix would be very helpful.

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Running out of disk quota.
Date: Tue, 30 Jan 2007 20:28:10 -0800
Lines: 15
Distribution: su
Message-ID: <epp5sm$15$2@news.Stanford.EDU>
References: <epkj56$f3d$1@news.Stanford.EDU> <eplfve$do2$6@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170217687 37 128.12.194.72 (31 Jan 2007 04:28:07 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eplfve$do2$6@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11316

Yep, I'm in the class.

-Yangfan

Paul Tarjan (TA) wrote:
> We did put in a request for adding 500 MB for the students. Are you 
> enrolled in the class via axess? I'll talk to the other TAs and Nick 
> about this.
> 
> Yangfan Wang wrote:
> 
>> Can we get some disk quota allocated for this class? The default 200MB 
>> limit is killing me. :p
>>
>> -Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Non TCP/UDP packets
Date: Tue, 30 Jan 2007 21:17:17 -0800
Lines: 36
Distribution: su
Message-ID: <epp8nh$221$1@news.Stanford.EDU>
References: <epjs04$oeq$1@news.Stanford.EDU> <eplfqb$do2$3@news.Stanford.EDU> <eplja0$h81$1@news.Stanford.EDU> <epmt2g$mk2$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170220593 2113 127.0.0.1 (31 Jan 2007 05:16:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11317

That is contrary to the FAQ answer on what ICMP messages we have to 
generate.  Does the newsgroup (post by a TA, of course) or the FAQ take 
precedence?

Sincerely,
Randy Jennings

The squirrels are your friends!
"Paul Tarjan (TA)" <ptarjan@stanford.edu> wrote in message 
news:epmt2g$mk2$1@news.Stanford.EDU...
> Sorry, I missed the part about it being to the router interfaces.
>
> I think there is an ICMP Protocol Unknown response. Just send that one if 
> there is one, if not, pick some other ICMP message, but you should respond 
> telling the other machine that you don't understand whatever they are 
> trying to talk to you about.
>
> Riju Kallivalappil wrote:
>> I think it should care about what is inside if the packet's destination 
>> IP is one of the router interfaces. How else can it return an ICMP Port 
>> Unreachable message?
>>
>> "Paul Tarjan (TA)" <ptarjan@stanford.edu> wrote in message 
>> news:eplfqb$do2$3@news.Stanford.EDU...
>>> You are an IP router. Don't even care what is inside it. That is the 
>>> beauty of protocol encapsulation.
>>>
>>> Riju Kallivalappil wrote:
>>>> What should we do if we receive a packet that is not TCP or UDP and is 
>>>> destined for one of the router interfaces? Can we silently discard such 
>>>> packets?
>>>>
>>>> Thanks,
>>>> Riju
>> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Accepting ARP replies
Date: Tue, 30 Jan 2007 21:19:45 -0800
Lines: 26
Distribution: su
Message-ID: <epp8s4$24d$1@news.Stanford.EDU>
References: <epmnem$iea$1@news.Stanford.EDU> <epmpbm$jn0$2@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170220741 2189 127.0.0.1 (31 Jan 2007 05:19:01 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11318

Whether you have record of sending the ARP request determines if you will be 
sending a packet because of the response, but should you put the IP-MAC in 
your arp cache?  I can see arguments both ways...

Sincerely,
Randy Jennings

The squirrels are your friends!
"David Erickson" <derickso@stanford.edu> wrote in message 
news:epmpbm$jn0$2@news.Stanford.EDU...
> Matt Page wrote:
>> Do we need to maintain a list of arp requests that we've transmitted? 
>> Suppose we receive an arp reply for which for did not send an arp 
>> request? I'm assuming normally we would discard the packet, but can we 
>> assume that this wont happen?
>>
>> Thanks,
>> Matt
>
> For timeout purposes you should already be maintaining a list of who you 
> have sent ARP requests for, so I would say you should check that when you 
> get a reply that it is a reply for a request you have sent.
>
> -David 


.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Spawning new threads.
Date: Tue, 30 Jan 2007 21:14:15 -0800
Lines: 11
Distribution: su
Message-ID: <epp8qt$1u5$1@news.Stanford.EDU>
References: <epp5qm$15$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170220746 1989 171.64.74.54 (31 Jan 2007 05:19:06 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <epp5qm$15$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11319

'man pthreads' is a good place to start.

Clay
Yangfan Wang wrote:
> Where can I find a good resource on learning how to spawn new threads in 
>  Unix?
> 
> We learned the theory in CS140, but a quick review and some practical 
> details on threads in Unix would be very helpful.
> 
> -Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Cache timeout strategy
Date: Tue, 30 Jan 2007 21:23:49 -0800
Lines: 30
Distribution: su
Message-ID: <epp93p$2cg$1@news.Stanford.EDU>
References: <eporg2$lr0$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170220985 2448 127.0.0.1 (31 Jan 2007 05:23:05 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11320

There is another strategy.  When the timeout thread goes back to sleep, it 
can adjust the sleep time based on the request that is the closest to timing 
out.  (I think this adjustable timeout is common practice on select loops 
with timeouts.)

Sincerely,
Randy Jennings

The squirrels are your friends!
"Matt Page" <mpage@stanford.edu> wrote in message 
news:eporg2$lr0$1@news.Stanford.EDU...
> Is it better to have a single thread that checks the arp cache every 15 
> seconds
> and times out entries or to spawn a new thread any time an entry is added 
> that
> sleeps for 15 seconds and then removes it from the cache?
>
> A single thread wouldn't be able to *strictly* enforce the 15 second 
> timeout
> policy as an entry added right after the timeout thread ran would stay in 
> the
> cache for close to twice the timeout period.
>
> How strictly must we enforce the timeout period?
>
> Thanks,
> Matt
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Accepting ARP replies
Date: Tue, 30 Jan 2007 22:54:47 -0800
Lines: 40
Distribution: su
Message-ID: <C1E57D37.7E48%jpettit@stanford.edu>
References: <epmnem$iea$1@news.Stanford.EDU> <epmpbm$jn0$2@news.Stanford.EDU> <epp8s4$24d$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170226490 6509 127.0.0.1 (31 Jan 2007 06:54:50 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Accepting ARP replies
Thread-Index: AcdFBLHj8EVrYLD3EduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11321

There are obvious performance advantages to caching information that you may
not have requested.  However, most modern systems do not accept these for
security reasons.  There are a number of very serious ARP and DNS poisoning
attacks that were a big deal a few years ago.  By flooding the network with
fake responses, the attacker can redirect traffic to his/her system.

--Justin


On 1/30/07 9:19 PM, in article epp8s4$24d$1@news.Stanford.EDU, "Randy
Jennings" <randyj@stanford.edu> wrote:

> Whether you have record of sending the ARP request determines if you will be
> sending a packet because of the response, but should you put the IP-MAC in
> your arp cache?  I can see arguments both ways...
> 
> Sincerely,
> Randy Jennings
> 
> The squirrels are your friends!
> "David Erickson" <derickso@stanford.edu> wrote in message
> news:epmpbm$jn0$2@news.Stanford.EDU...
>> Matt Page wrote:
>>> Do we need to maintain a list of arp requests that we've transmitted?
>>> Suppose we receive an arp reply for which for did not send an arp
>>> request? I'm assuming normally we would discard the packet, but can we
>>> assume that this wont happen?
>>> 
>>> Thanks,
>>> Matt
>> 
>> For timeout purposes you should already be maintaining a list of who you
>> have sent ARP requests for, so I would say you should check that when you
>> get a reply that it is a reply for a request you have sent.
>> 
>> -David 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Non TCP/UDP packets
Date: Tue, 30 Jan 2007 23:03:26 -0800
Lines: 48
Distribution: su
Message-ID: <C1E57F3E.7E4C%jpettit@stanford.edu>
References: <epjs04$oeq$1@news.Stanford.EDU> <eplfqb$do2$3@news.Stanford.EDU> <eplja0$h81$1@news.Stanford.EDU> <epmt2g$mk2$1@news.Stanford.EDU> <epp8nh$221$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170227009 6990 127.0.0.1 (31 Jan 2007 07:03:29 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Non TCP/UDP packets
Thread-Index: AcdFBec8JbypiLD5EduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11322

Paul responded with what a router should generate in that circumstance.  The
FAQ specifies what your project must support.  I think you're safe in either
case. 

--Justin


On 1/30/07 9:17 PM, in article epp8nh$221$1@news.Stanford.EDU, "Randy
Jennings" <randyj@stanford.edu> wrote:

> That is contrary to the FAQ answer on what ICMP messages we have to
> generate.  Does the newsgroup (post by a TA, of course) or the FAQ take
> precedence?
> 
> Sincerely,
> Randy Jennings
> 
> The squirrels are your friends!
> "Paul Tarjan (TA)" <ptarjan@stanford.edu> wrote in message
> news:epmt2g$mk2$1@news.Stanford.EDU...
>> Sorry, I missed the part about it being to the router interfaces.
>> 
>> I think there is an ICMP Protocol Unknown response. Just send that one if
>> there is one, if not, pick some other ICMP message, but you should respond
>> telling the other machine that you don't understand whatever they are
>> trying to talk to you about.
>> 
>> Riju Kallivalappil wrote:
>>> I think it should care about what is inside if the packet's destination
>>> IP is one of the router interfaces. How else can it return an ICMP Port
>>> Unreachable message?
>>> 
>>> "Paul Tarjan (TA)" <ptarjan@stanford.edu> wrote in message
>>> news:eplfqb$do2$3@news.Stanford.EDU...
>>>> You are an IP router. Don't even care what is inside it. That is the
>>>> beauty of protocol encapsulation.
>>>> 
>>>> Riju Kallivalappil wrote:
>>>>> What should we do if we receive a packet that is not TCP or UDP and is
>>>>> destined for one of the router interfaces? Can we silently discard such
>>>>> packets?
>>>>> 
>>>>> Thanks,
>>>>> Riju
>>> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 solutions
Date: Tue, 30 Jan 2007 23:17:57 -0800
Lines: 11
Distribution: su
Message-ID: <eppg3a$7km$1@news.Stanford.EDU>
References: <epoj3e$f31$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170228162 7830 171.64.74.54 (31 Jan 2007 07:22:42 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <epoj3e$f31$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11323

The TAs are putting together a solution set.  We'll let you know when 
it's made available.

Clay
Jad Naous wrote:
> Hi,
> 
> Where can I find PS1 solutions?
> 
> Thanks,
> Jad
.

Path: shelby.stanford.edu!not-for-mail
From: Peter Pawlowski <pawlowski@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ICMP reply assumption
Date: Tue, 30 Jan 2007 23:27:29 -0800
Lines: 13
Distribution: su
Message-ID: <eppgd1$7pa$1@news.Stanford.EDU>
NNTP-Posting-Host: piotrek.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1170228449 7978 128.12.104.53 (31 Jan 2007 07:27:29 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Unison/1.7.7
Xref: shelby.stanford.edu su.class.cs244a:11324

Hello--

Is it safe to assume that if we recieve a packet from a certain host 
over a certain interface, and that packet warrants an ICMP response 
(for whatever reason), that is it safe to send that response over the 
interface on which it was recieved via the router which send it to us? 
Or, should we do a full route/ARP lookup for every outgoing case, 
regardless of such insight (because perhaps routes are not always 
transative)?

Thanks!
Peter

.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Byte ordering in struct sr_if.
Date: Tue, 30 Jan 2007 23:50:15 -0800
Lines: 9
Distribution: su
Message-ID: <epphnj$8ut$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170229811 9181 128.12.194.72 (31 Jan 2007 07:50:11 GMT)
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:11325

Um, why are the IP addresses in the list of interfaces in network byte 
order? This is very counter-intuitive for me.

Also, what about the rest of the data in the interface table? The 
routing table?

Or, am I doing something very screwy with my code?

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Byte ordering in struct sr_if.
Date: Wed, 31 Jan 2007 00:14:59 -0800
Lines: 14
Distribution: su
Message-ID: <eppj5v$dk9$1@news.Stanford.EDU>
References: <epphnj$8ut$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170231295 13961 128.12.194.72 (31 Jan 2007 08:14:55 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <epphnj$8ut$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11326

Or perhaps the structs in sr_protocol.h is doing the conversions for me?

-Yangfan

Yangfan Wang wrote:
> Um, why are the IP addresses in the list of interfaces in network byte 
> order? This is very counter-intuitive for me.
> 
> Also, what about the rest of the data in the interface table? The 
> routing table?
> 
> Or, am I doing something very screwy with my code?
> 
> -Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Byte ordering in struct sr_if.
Date: Wed, 31 Jan 2007 00:29:44 -0800
Lines: 21
Distribution: su
Message-ID: <eppk1j$e7q$1@news.Stanford.EDU>
References: <epphnj$8ut$1@news.Stanford.EDU> <eppj5v$dk9$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170232180 14586 128.12.194.72 (31 Jan 2007 08:29:40 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eppj5v$dk9$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11327

Never mind. Those are 8-bit values, which appearantly don't get affected 
by byte ordering.

-Yangfan

Yangfan Wang wrote:
> Or perhaps the structs in sr_protocol.h is doing the conversions for me?
> 
> -Yangfan
> 
> Yangfan Wang wrote:
> 
>> Um, why are the IP addresses in the list of interfaces in network byte 
>> order? This is very counter-intuitive for me.
>>
>> Also, what about the rest of the data in the interface table? The 
>> routing table?
>>
>> Or, am I doing something very screwy with my code?
>>
>> -Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Cache timeout strategy
Date: Wed, 31 Jan 2007 01:24:34 -0800
Lines: 34
Distribution: su
Message-ID: <eppn5k$g78$1@news.Stanford.EDU>
References: <eporg2$lr0$1@news.Stanford.EDU> <epp93p$2cg$1@news.Stanford.EDU>
NNTP-Posting-Host: jadsdesktop.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170235380 16616 128.12.134.140 (31 Jan 2007 09:23:00 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20060911)
In-Reply-To: <epp93p$2cg$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11328

Or you can make the thread sleep for a second or two instead of the full
15 seconds.

Randy Jennings wrote:
> There is another strategy.  When the timeout thread goes back to sleep, it 
> can adjust the sleep time based on the request that is the closest to timing 
> out.  (I think this adjustable timeout is common practice on select loops 
> with timeouts.)
> 
> Sincerely,
> Randy Jennings
> 
> The squirrels are your friends!
> "Matt Page" <mpage@stanford.edu> wrote in message 
> news:eporg2$lr0$1@news.Stanford.EDU...
>> Is it better to have a single thread that checks the arp cache every 15 
>> seconds
>> and times out entries or to spawn a new thread any time an entry is added 
>> that
>> sleeps for 15 seconds and then removes it from the cache?
>>
>> A single thread wouldn't be able to *strictly* enforce the 15 second 
>> timeout
>> policy as an entry added right after the timeout thread ran would stay in 
>> the
>> cache for close to twice the timeout period.
>>
>> How strictly must we enforce the timeout period?
>>
>> Thanks,
>> Matt
>>
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Byte ordering in struct sr_if.
Date: Wed, 31 Jan 2007 01:28:04 -0800
Lines: 27
Distribution: su
Message-ID: <eppnms$ge7$1@news.Stanford.EDU>
References: <epphnj$8ut$1@news.Stanford.EDU> <eppj5v$dk9$1@news.Stanford.EDU> <eppk1j$e7q$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170235932 16839 171.64.74.54 (31 Jan 2007 09:32:12 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <eppk1j$e7q$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11329

Exactly.  Byte ordering refers to which byte in a 16 or 32 bit integer 
contains the most significant and least significant bits- an 8-bit value 
thus isn't effected by byte ordering issues.

Clay
Yangfan Wang wrote:
> Never mind. Those are 8-bit values, which appearantly don't get affected 
> by byte ordering.
> 
> -Yangfan
> 
> Yangfan Wang wrote:
>> Or perhaps the structs in sr_protocol.h is doing the conversions for me?
>>
>> -Yangfan
>>
>> Yangfan Wang wrote:
>>
>>> Um, why are the IP addresses in the list of interfaces in network 
>>> byte order? This is very counter-intuitive for me.
>>>
>>> Also, what about the rest of the data in the interface table? The 
>>> routing table?
>>>
>>> Or, am I doing something very screwy with my code?
>>>
>>> -Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Byte ordering in struct sr_if.
Date: Wed, 31 Jan 2007 01:34:49 -0800
Lines: 35
Distribution: su
Message-ID: <eppnrl$gjg$1@news.Stanford.EDU>
References: <epphnj$8ut$1@news.Stanford.EDU> <eppj5v$dk9$1@news.Stanford.EDU> <eppk1j$e7q$1@news.Stanford.EDU> <eppnms$ge7$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170236085 17008 128.12.194.72 (31 Jan 2007 09:34:45 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eppnms$ge7$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11330

Hmm, but the IP addresses are 32 bits though. The IP values in the 
interface table appear to be in network byte order. Or is it just me?

-Yangfan

Clay Collier wrote:
> Exactly.  Byte ordering refers to which byte in a 16 or 32 bit integer 
> contains the most significant and least significant bits- an 8-bit value 
> thus isn't effected by byte ordering issues.
> 
> Clay
> Yangfan Wang wrote:
> 
>> Never mind. Those are 8-bit values, which appearantly don't get 
>> affected by byte ordering.
>>
>> -Yangfan
>>
>> Yangfan Wang wrote:
>>
>>> Or perhaps the structs in sr_protocol.h is doing the conversions for me?
>>>
>>> -Yangfan
>>>
>>> Yangfan Wang wrote:
>>>
>>>> Um, why are the IP addresses in the list of interfaces in network 
>>>> byte order? This is very counter-intuitive for me.
>>>>
>>>> Also, what about the rest of the data in the interface table? The 
>>>> routing table?
>>>>
>>>> Or, am I doing something very screwy with my code?
>>>>
>>>> -Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Peter Pawlowski <pawlowski@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Byte ordering in struct sr_if.
Date: Wed, 31 Jan 2007 01:41:02 -0800
Lines: 44
Distribution: su
Message-ID: <eppo7e$grj$1@news.Stanford.EDU>
References: <epphnj$8ut$1@news.Stanford.EDU> <eppj5v$dk9$1@news.Stanford.EDU> <eppk1j$e7q$1@news.Stanford.EDU> <eppnms$ge7$1@news.Stanford.EDU> <eppnrl$gjg$1@news.Stanford.EDU>
NNTP-Posting-Host: piotrek.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1170236462 17267 128.12.104.53 (31 Jan 2007 09:41:02 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Unison/1.7.7
Xref: shelby.stanford.edu su.class.cs244a:11331

They're in network byte order. There's a previous posting about this.

Cheers,
Peter

On 2007-01-31 01:34:49 -0800, Yangfan Wang <yfw@stanford.edu> said:

> Hmm, but the IP addresses are 32 bits though. The IP values in the 
> interface table appear to be in network byte order. Or is it just me?
> 
> -Yangfan
> 
> Clay Collier wrote:
>> Exactly.  Byte ordering refers to which byte in a 16 or 32 bit integer 
>> contains the most significant and least significant bits- an 8-bit 
>> value thus isn't effected by byte ordering issues.
>> 
>> Clay
>> Yangfan Wang wrote:
>> 
>>> Never mind. Those are 8-bit values, which appearantly don't get 
>>> affected by byte ordering.
>>> 
>>> -Yangfan
>>> 
>>> Yangfan Wang wrote:
>>> 
>>>> Or perhaps the structs in sr_protocol.h is doing the conversions for me?
>>>> 
>>>> -Yangfan
>>>> 
>>>> Yangfan Wang wrote:
>>>> 
>>>>> Um, why are the IP addresses in the list of interfaces in network byte 
>>>>> order? This is very counter-intuitive for me.
>>>>> 
>>>>> Also, what about the rest of the data in the interface table? The 
>>>>> routing table?
>>>>> 
>>>>> Or, am I doing something very screwy with my code?
>>>>> 
>>>>> -Yangfan


.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Still getting bad checksum in ICMP
Date: Wed, 31 Jan 2007 01:41:06 -0800
Lines: 17
Distribution: su
Message-ID: <eppo7e$gs7$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170236462 17287 128.12.194.72 (31 Jan 2007 09:41:02 GMT)
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:11332

 From the FAQ:

"Ethereal reports that the ICMP checksums generated by the unix ping 
application are wrong. What is going on!?

The stub code only saves the first 96 bytes of the packets it receives 
and the generated ICMP packets are 98 bytes, hence Ethereal's checksum 
does not take into account the last 2 bytes. The latest version of the 
stub code has the packet dump length increased to 100 bytes. You may 
also modify sr_router.h to increase PACKET_DUMP_SIZE yourself."

It appears that my sr_router.h had its PACKET_DUMP_SIZE increased to 
1024, but Wireshark is still telling me that the ICMP checksum is incorrect.

I do need to check this checksum, right?

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP reply assumption
Date: Wed, 31 Jan 2007 01:37:09 -0800
Lines: 24
Distribution: su
Message-ID: <eppo80$gsd$1@news.Stanford.EDU>
References: <eppgd1$7pa$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170236480 17293 171.64.74.54 (31 Jan 2007 09:41:20 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <eppgd1$7pa$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11333

It's probably a better idea to treat all of the outgoing packets the 
same and run them through the routing table lookup- ARP cache - ARP 
request process rather than pull information from the link layer up in 
as inputs to the ICMP protocol.  While it's not really an issue in the 
specific topologies that you have for this assignment, it is certainly 
possible to have a temporary or permanent asymmetric route between two 
hosts.

Clay

Peter Pawlowski wrote:
> Hello--
> 
> Is it safe to assume that if we recieve a packet from a certain host 
> over a certain interface, and that packet warrants an ICMP response (for 
> whatever reason), that is it safe to send that response over the 
> interface on which it was recieved via the router which send it to us? 
> Or, should we do a full route/ARP lookup for every outgoing case, 
> regardless of such insight (because perhaps routes are not always 
> transative)?
> 
> Thanks!
> Peter
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PA2 how to broadcast ARP request?
Date: Wed, 31 Jan 2007 01:54:10 -0800
Lines: 38
Distribution: su
Message-ID: <eppp7q$hct$1@news.Stanford.EDU>
References: <epjfpo$ffn$1@news.Stanford.EDU> <epjqdn$ne3$1@news.Stanford.EDU> <epllat$ipd$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170237501 17821 171.64.74.54 (31 Jan 2007 09:58:21 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <epllat$ipd$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11334

Coming up with a method to test unreachable hosts is part of your task 
for this assignment.  It's entirely possible to ensure that your router 
will send out ARP requests that it never hears replies to without 
needing to be able to do anything to any machine in your topology other 
than your router.

Clay
Dinesh Gupta wrote:
> HI Paul,
> 
> Thanks for the explaination.
> In this case how can we test it. How can we shut down these m/cs for testing
> purpose. 
> 
> Thanks,
> Dinesh
> 
> "Paul Tarjan (TA)" <ptarjan@stanford.edu> wrote:
>> What if I'm pinging a machine that isn't on and isn't in your arp table 
>> what will you do? You won't know the machine isn't on until you send 
>> your arp packet, right? So, there is always a chance that the arp won't 
>> get a reply.
> 
>> As for where the computer is, you can assume that the routing table is 
>> correct.
> 
>> Dinesh Gupta wrote:
>>> Hi,
>>>
>>> After getting an IP packet, shall we broadcast ARP req for hw addr from
>>> all router ports or shall we get the destination port from routing table
>>> and broadcast from only that particular port? If we broadcast from the
>>> particular interface then is it possible to not get reply? Because ip
>>> addr is correct and application servers running so no way we won't get
>>> it!
>>>
>>> Thanks,
>>> Dinesh
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Still getting bad checksum in ICMP
Date: Wed, 31 Jan 2007 12:49:59 -0800
Lines: 24
Distribution: su
Message-ID: <epqvdk$nb9$1@news.Stanford.EDU>
References: <eppo7e$gs7$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170276596 23913 127.0.0.1 (31 Jan 2007 20:49:56 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eppo7e$gs7$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11335

Yangfan Wang wrote:
>  From the FAQ:
> 
> "Ethereal reports that the ICMP checksums generated by the unix ping 
> application are wrong. What is going on!?
> 
> The stub code only saves the first 96 bytes of the packets it receives 
> and the generated ICMP packets are 98 bytes, hence Ethereal's checksum 
> does not take into account the last 2 bytes. The latest version of the 
> stub code has the packet dump length increased to 100 bytes. You may 
> also modify sr_router.h to increase PACKET_DUMP_SIZE yourself."
> 
> It appears that my sr_router.h had its PACKET_DUMP_SIZE increased to 
> 1024, but Wireshark is still telling me that the ICMP checksum is 
> incorrect.
> 
> I do need to check this checksum, right?
> 
> -Yangfan

The ICMP replies you create do need to pass the checksum test otherwise 
they may not be accepted by the host that sent the original packet.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP reply assumption
Date: Wed, 31 Jan 2007 12:53:00 -0800
Lines: 40
Distribution: su
Message-ID: <epqvhv$nk0$1@news.Stanford.EDU>
References: <eppgd1$7pa$1@news.Stanford.EDU> <eppo80$gsd$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170276736 24192 127.0.0.1 (31 Jan 2007 20:52:16 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11336

I thought that the Ethernet source address was included in the packet for 
just this reason...  You can still run the packet through the regular 
routing table lookup/ARP cache, just put the link address in your ARP cache 
before you do so.  Are you saying that we should only do so for IP's on the 
same network as us?  That makes partial sense to me.

Justin raised an important security concern, but if you are just going to 
send out an ARP anyway, the same malicious person sending the packet would 
just respond to the ARP also.

Sincerely,
Randy Jennings

"Clay Collier" <ccollier@stanford.edu> wrote in message 
news:eppo80$gsd$1@news.Stanford.EDU...
> It's probably a better idea to treat all of the outgoing packets the same 
> and run them through the routing table lookup- ARP cache - ARP request 
> process rather than pull information from the link layer up in as inputs 
> to the ICMP protocol.  While it's not really an issue in the specific 
> topologies that you have for this assignment, it is certainly possible to 
> have a temporary or permanent asymmetric route between two hosts.
>
> Clay
>
> Peter Pawlowski wrote:
>> Hello--
>>
>> Is it safe to assume that if we recieve a packet from a certain host over 
>> a certain interface, and that packet warrants an ICMP response (for 
>> whatever reason), that is it safe to send that response over the 
>> interface on which it was recieved via the router which send it to us? 
>> Or, should we do a full route/ARP lookup for every outgoing case, 
>> regardless of such insight (because perhaps routes are not always 
>> transative)?
>>
>> Thanks!
>> Peter
>> 


.

Path: shelby.stanford.edu!not-for-mail
From: Clay Collier <ccollier@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP reply assumption
Date: Wed, 31 Jan 2007 14:57:25 -0800
Lines: 71
Distribution: su
Message-ID: <epr74p$3so$1@news.Stanford.EDU>
References: <eppgd1$7pa$1@news.Stanford.EDU> <eppo80$gsd$1@news.Stanford.EDU> <epqvhv$nk0$1@news.Stanford.EDU>
NNTP-Posting-Host: tybalt.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170284505 3992 171.64.74.54 (31 Jan 2007 23:01:45 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070102)
In-Reply-To: <epqvhv$nk0$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11337

In regards to the unsolicited ARP issue: a solicited ARP reply COULD 
contain bad information, but since there's nothing in the ARP protocol 
that calls for someone to send out unsolicited ARP replies if you 
receive an unsolicited ARP reply, you already know something funny is 
going on.

Regarding the routing issue- if you use the ethernet header to route 
packets back rather than consulting the routing table, you can end up in 
a situation where the router is ignoring the routing table- which may 
lead to worse routes, or could just be a pain to diagnose.

Consider this topology:

  /B\
A   D
  \C/

A's routing table says 'send packets to D via B'
D's routing table says 'send packets to A via C'

Now, if you ignore the routing table and just look at the ethernet 
header, A is going to attempt to send packets to D via C rather than B. 
  If the links are directionally asymetric in some way- in terms of 
upload vs. download speeds (think cable modems), filtering (host C may 
be configured to block packets from reaching D), then you may end up in 
a situation where your packets are traversing what you already know is a 
less optimal route, or aren't reaching the intended destination at all.

Clay

Randy Jennings wrote:
> I thought that the Ethernet source address was included in the packet for 
> just this reason...  You can still run the packet through the regular 
> routing table lookup/ARP cache, just put the link address in your ARP cache 
> before you do so.  Are you saying that we should only do so for IP's on the 
> same network as us?  That makes partial sense to me.
> 
> Justin raised an important security concern, but if you are just going to 
> send out an ARP anyway, the same malicious person sending the packet would 
> just respond to the ARP also.
> 
> Sincerely,
> Randy Jennings
> 
> "Clay Collier" <ccollier@stanford.edu> wrote in message 
> news:eppo80$gsd$1@news.Stanford.EDU...
>> It's probably a better idea to treat all of the outgoing packets the same 
>> and run them through the routing table lookup- ARP cache - ARP request 
>> process rather than pull information from the link layer up in as inputs 
>> to the ICMP protocol.  While it's not really an issue in the specific 
>> topologies that you have for this assignment, it is certainly possible to 
>> have a temporary or permanent asymmetric route between two hosts.
>>
>> Clay
>>
>> Peter Pawlowski wrote:
>>> Hello--
>>>
>>> Is it safe to assume that if we recieve a packet from a certain host over 
>>> a certain interface, and that packet warrants an ICMP response (for 
>>> whatever reason), that is it safe to send that response over the 
>>> interface on which it was recieved via the router which send it to us? 
>>> Or, should we do a full route/ARP lookup for every outgoing case, 
>>> regardless of such insight (because perhaps routes are not always 
>>> transative)?
>>>
>>> Thanks!
>>> Peter
>>>
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Riju Kallivalappil" <riju@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP reply assumption
Date: Wed, 31 Jan 2007 16:29:55 -0800
Lines: 76
Distribution: su
Message-ID: <eprca6$7t7$1@news.Stanford.EDU>
References: <eppgd1$7pa$1@news.Stanford.EDU> <eppo80$gsd$1@news.Stanford.EDU> <epqvhv$nk0$1@news.Stanford.EDU> <epr74p$3so$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170289798 8103 127.0.0.1 (1 Feb 2007 00:29:58 GMT)
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:11338

On a similar note, is it ok to cache the MAC maddress of the sender when we 
receive an ARP request?

"Clay Collier" <ccollier@stanford.edu> wrote in message 
news:epr74p$3so$1@news.Stanford.EDU...
> In regards to the unsolicited ARP issue: a solicited ARP reply COULD 
> contain bad information, but since there's nothing in the ARP protocol 
> that calls for someone to send out unsolicited ARP replies if you receive 
> an unsolicited ARP reply, you already know something funny is going on.
>
> Regarding the routing issue- if you use the ethernet header to route 
> packets back rather than consulting the routing table, you can end up in a 
> situation where the router is ignoring the routing table- which may lead 
> to worse routes, or could just be a pain to diagnose.
>
> Consider this topology:
>
>  /B\
> A   D
>  \C/
>
> A's routing table says 'send packets to D via B'
> D's routing table says 'send packets to A via C'
>
> Now, if you ignore the routing table and just look at the ethernet header, 
> A is going to attempt to send packets to D via C rather than B. If the 
> links are directionally asymetric in some way- in terms of upload vs. 
> download speeds (think cable modems), filtering (host C may be configured 
> to block packets from reaching D), then you may end up in a situation 
> where your packets are traversing what you already know is a less optimal 
> route, or aren't reaching the intended destination at all.
>
> Clay
>
> Randy Jennings wrote:
>> I thought that the Ethernet source address was included in the packet for 
>> just this reason...  You can still run the packet through the regular 
>> routing table lookup/ARP cache, just put the link address in your ARP 
>> cache before you do so.  Are you saying that we should only do so for 
>> IP's on the same network as us?  That makes partial sense to me.
>>
>> Justin raised an important security concern, but if you are just going to 
>> send out an ARP anyway, the same malicious person sending the packet 
>> would just respond to the ARP also.
>>
>> Sincerely,
>> Randy Jennings
>>
>> "Clay Collier" <ccollier@stanford.edu> wrote in message 
>> news:eppo80$gsd$1@news.Stanford.EDU...
>>> It's probably a better idea to treat all of the outgoing packets the 
>>> same and run them through the routing table lookup- ARP cache - ARP 
>>> request process rather than pull information from the link layer up in 
>>> as inputs to the ICMP protocol.  While it's not really an issue in the 
>>> specific topologies that you have for this assignment, it is certainly 
>>> possible to have a temporary or permanent asymmetric route between two 
>>> hosts.
>>>
>>> Clay
>>>
>>> Peter Pawlowski wrote:
>>>> Hello--
>>>>
>>>> Is it safe to assume that if we recieve a packet from a certain host 
>>>> over a certain interface, and that packet warrants an ICMP response 
>>>> (for whatever reason), that is it safe to send that response over the 
>>>> interface on which it was recieved via the router which send it to us? 
>>>> Or, should we do a full route/ARP lookup for every outgoing case, 
>>>> regardless of such insight (because perhaps routes are not always 
>>>> transative)?
>>>>
>>>> Thanks!
>>>> Peter
>>>>
>> 

.

Path: shelby.stanford.edu!not-for-mail
From: Dinesh Gupta <dineshg@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: How to link pthread
Date: Thu, 1 Feb 2007 02:01:29 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <eprhlp$em9$1@news.Stanford.EDU>
NNTP-Posting-Host: myth27.stanford.edu
X-Trace: news.Stanford.EDU 1170295289 15049 171.64.15.42 (1 Feb 2007 02:01:29 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (Linux/2.6.17.13smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:11339

Hi,

Make is returning undefined reference to pthread_create.

Can someone let me know how to link it.

Thanks,
Dinesh
.

Path: shelby.stanford.edu!not-for-mail
From: Dinesh Gupta <dineshg@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: How to link pthread
Date: Thu, 1 Feb 2007 02:07:08 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <epri0c$evd$1@news.Stanford.EDU>
References: <eprhlp$em9$1@news.Stanford.EDU>
NNTP-Posting-Host: myth27.stanford.edu
X-Trace: news.Stanford.EDU 1170295628 15341 171.64.15.42 (1 Feb 2007 02:07:08 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (Linux/2.6.17.13smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:11340

HI,

Figured this out...

Dinesh

Dinesh Gupta <dineshg@stanford.edu> wrote:
> Hi,

> Make is returning undefined reference to pthread_create.

> Can someone let me know how to link it.

> Thanks,
> Dinesh
.

Path: shelby.stanford.edu!not-for-mail
From: Dinesh Gupta <dineshg@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: arp requests
Date: Thu, 1 Feb 2007 05:18:10 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <eprt6i$pok$1@news.Stanford.EDU>
NNTP-Posting-Host: myth27.stanford.edu
X-Trace: news.Stanford.EDU 1170307090 26388 171.64.15.42 (1 Feb 2007 05:18:10 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (Linux/2.6.17.13smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:11341

Hi,

Do we need to send 5 continous ARP requests and wait for 5-7 seconds or
send one ARP req then wait then send another one, wait and so on, totalling 5-7
secs.

Thanks,
Dinesh
.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP reply assumption
Date: Wed, 31 Jan 2007 21:24:18 -0800
Lines: 83
Distribution: su
Message-ID: <eprtgl$qel$1@news.Stanford.EDU>
References: <eppgd1$7pa$1@news.Stanford.EDU> <eppo80$gsd$1@news.Stanford.EDU> <epqvhv$nk0$1@news.Stanford.EDU> <epr74p$3so$1@news.Stanford.EDU> <eprca6$7t7$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170307413 27093 127.0.0.1 (1 Feb 2007 05:23:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11342

Sounds like no (although, I await answering my question about if the IP is 
in the same network).

"Riju Kallivalappil" <riju@stanford.edu> wrote in message 
news:eprca6$7t7$1@news.Stanford.EDU...
> On a similar note, is it ok to cache the MAC maddress of the sender when 
> we receive an ARP request?
>
> "Clay Collier" <ccollier@stanford.edu> wrote in message 
> news:epr74p$3so$1@news.Stanford.EDU...
>> In regards to the unsolicited ARP issue: a solicited ARP reply COULD 
>> contain bad information, but since there's nothing in the ARP protocol 
>> that calls for someone to send out unsolicited ARP replies if you receive 
>> an unsolicited ARP reply, you already know something funny is going on.
>>
>> Regarding the routing issue- if you use the ethernet header to route 
>> packets back rather than consulting the routing table, you can end up in 
>> a situation where the router is ignoring the routing table- which may 
>> lead to worse routes, or could just be a pain to diagnose.
>>
>> Consider this topology:
>>
>>  /B\
>> A   D
>>  \C/
>>
>> A's routing table says 'send packets to D via B'
>> D's routing table says 'send packets to A via C'
>>
>> Now, if you ignore the routing table and just look at the ethernet 
>> header, A is going to attempt to send packets to D via C rather than B. 
>> If the links are directionally asymetric in some way- in terms of upload 
>> vs. download speeds (think cable modems), filtering (host C may be 
>> configured to block packets from reaching D), then you may end up in a 
>> situation where your packets are traversing what you already know is a 
>> less optimal route, or aren't reaching the intended destination at all.
>>
>> Clay
>>
>> Randy Jennings wrote:
>>> I thought that the Ethernet source address was included in the packet 
>>> for just this reason...  You can still run the packet through the 
>>> regular routing table lookup/ARP cache, just put the link address in 
>>> your ARP cache before you do so.  Are you saying that we should only do 
>>> so for IP's on the same network as us?  That makes partial sense to me.
>>>
>>> Justin raised an important security concern, but if you are just going 
>>> to send out an ARP anyway, the same malicious person sending the packet 
>>> would just respond to the ARP also.
>>>
>>> Sincerely,
>>> Randy Jennings
>>>
>>> "Clay Collier" <ccollier@stanford.edu> wrote in message 
>>> news:eppo80$gsd$1@news.Stanford.EDU...
>>>> It's probably a better idea to treat all of the outgoing packets the 
>>>> same and run them through the routing table lookup- ARP cache - ARP 
>>>> request process rather than pull information from the link layer up in 
>>>> as inputs to the ICMP protocol.  While it's not really an issue in the 
>>>> specific topologies that you have for this assignment, it is certainly 
>>>> possible to have a temporary or permanent asymmetric route between two 
>>>> hosts.
>>>>
>>>> Clay
>>>>
>>>> Peter Pawlowski wrote:
>>>>> Hello--
>>>>>
>>>>> Is it safe to assume that if we recieve a packet from a certain host 
>>>>> over a certain interface, and that packet warrants an ICMP response 
>>>>> (for whatever reason), that is it safe to send that response over the 
>>>>> interface on which it was recieved via the router which send it to us? 
>>>>> Or, should we do a full route/ARP lookup for every outgoing case, 
>>>>> regardless of such insight (because perhaps routes are not always 
>>>>> transative)?
>>>>>
>>>>> Thanks!
>>>>> Peter
>>>>>
>>>
> 


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: arp requests
Date: Wed, 31 Jan 2007 21:24:35 -0800
Lines: 15
Distribution: su
Message-ID: <eprti8$qan$1@news.Stanford.EDU>
References: <eprt6i$pok$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170307464 26967 127.0.0.1 (1 Feb 2007 05:24:24 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eprt6i$pok$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11343

Dinesh Gupta wrote:
> Hi,
> 
> Do we need to send 5 continous ARP requests and wait for 5-7 seconds or
> send one ARP req then wait then send another one, wait and so on, totalling 5-7
> secs.
> 
> Thanks,
> Dinesh

You should have sent 5 arp requests by the time you send the icmp host 
unreachable which should occur 5-7 seconds after the time you send the 
first request.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP reply assumption
Date: Wed, 31 Jan 2007 21:27:49 -0800
Lines: 81
Distribution: su
Message-ID: <eprtn8$qlp$1@news.Stanford.EDU>
References: <eppgd1$7pa$1@news.Stanford.EDU> <eppo80$gsd$1@news.Stanford.EDU> <epqvhv$nk0$1@news.Stanford.EDU> <epr74p$3so$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170307624 27321 127.0.0.1 (1 Feb 2007 05:27:04 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11344

I can see what you are saying.  That is why I was wondering if it would be 
okay to stick it in your cache if you checked the IP prefix and saw it was 
in your same network (subnet) (as that should not go through a router)?

Also, I think my scheme would work regardless, as I check the route table 
before firing off the packet.  However, it could displace a useful entry... 
Not the best thing to do, but functionality is not impaired.

Sincerely,
Randy Jennings

The squirrels are your friends!
"Clay Collier" <ccollier@stanford.edu> wrote in message 
news:epr74p$3so$1@news.Stanford.EDU...
>
> Regarding the routing issue- if you use the ethernet header to route 
> packets back rather than consulting the routing table, you can end up in a 
> situation where the router is ignoring the routing table- which may lead 
> to worse routes, or could just be a pain to diagnose.
>
> Consider this topology:
>
>  /B\
> A   D
>  \C/
>
> A's routing table says 'send packets to D via B'
> D's routing table says 'send packets to A via C'
>
> Now, if you ignore the routing table and just look at the ethernet header, 
> A is going to attempt to send packets to D via C rather than B. If the 
> links are directionally asymetric in some way- in terms of upload vs. 
> download speeds (think cable modems), filtering (host C may be configured 
> to block packets from reaching D), then you may end up in a situation 
> where your packets are traversing what you already know is a less optimal 
> route, or aren't reaching the intended destination at all.
>
> Clay
>
> Randy Jennings wrote:
>> I thought that the Ethernet source address was included in the packet for 
>> just this reason...  You can still run the packet through the regular 
>> routing table lookup/ARP cache, just put the link address in your ARP 
>> cache before you do so.  Are you saying that we should only do so for 
>> IP's on the same network as us?  That makes partial sense to me.
>>
>> Justin raised an important security concern, but if you are just going to 
>> send out an ARP anyway, the same malicious person sending the packet 
>> would just respond to the ARP also.
>>
>> Sincerely,
>> Randy Jennings
>>
>> "Clay Collier" <ccollier@stanford.edu> wrote in message 
>> news:eppo80$gsd$1@news.Stanford.EDU...
>>> It's probably a better idea to treat all of the outgoing packets the 
>>> same and run them through the routing table lookup- ARP cache - ARP 
>>> request process rather than pull information from the link layer up in 
>>> as inputs to the ICMP protocol.  While it's not really an issue in the 
>>> specific topologies that you have for this assignment, it is certainly 
>>> possible to have a temporary or permanent asymmetric route between two 
>>> hosts.
>>>
>>> Clay
>>>
>>> Peter Pawlowski wrote:
>>>> Hello--
>>>>
>>>> Is it safe to assume that if we recieve a packet from a certain host 
>>>> over a certain interface, and that packet warrants an ICMP response 
>>>> (for whatever reason), that is it safe to send that response over the 
>>>> interface on which it was recieved via the router which send it to us? 
>>>> Or, should we do a full route/ARP lookup for every outgoing case, 
>>>> regardless of such insight (because perhaps routes are not always 
>>>> transative)?
>>>>
>>>> Thanks!
>>>> Peter
>>>>
>> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: arp requests
Date: Wed, 31 Jan 2007 21:29:41 -0800
Lines: 20
Distribution: su
Message-ID: <eprtqo$qov$1@news.Stanford.EDU>
References: <eprt6i$pok$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170307736 27423 127.0.0.1 (1 Feb 2007 05:28:56 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11345

Considering that all the requests contain exactly the same information, why 
would you want to send them all at the same time?

Sincerely,
Randy Jennings

The squirrels are your friends!
"Dinesh Gupta" <dineshg@Stanford.EDU> wrote in message 
news:eprt6i$pok$1@news.Stanford.EDU...
> Hi,
>
> Do we need to send 5 continous ARP requests and wait for 5-7 seconds or
> send one ARP req then wait then send another one, wait and so on, 
> totalling 5-7
> secs.
>
> Thanks,
> Dinesh 


.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP reply assumption
Date: Wed, 31 Jan 2007 21:30:59 -0800
Lines: 9
Distribution: su
Message-ID: <eprtu9$qan$2@news.Stanford.EDU>
References: <eppgd1$7pa$1@news.Stanford.EDU> <eppo80$gsd$1@news.Stanford.EDU> <epqvhv$nk0$1@news.Stanford.EDU> <epr74p$3so$1@news.Stanford.EDU> <eprca6$7t7$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170307849 26967 127.0.0.1 (1 Feb 2007 05:30:49 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eprca6$7t7$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11346

Riju Kallivalappil wrote:
> On a similar note, is it ok to cache the MAC maddress of the sender when we 
> receive an ARP request?

I would say no, when the destination then sends a packet back through 
your router towards the sender it should send out an arp request in that 
direction to find the next MAC of the next hop.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: "Randy Jennings" <randyj@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP reply assumption
Date: Wed, 31 Jan 2007 21:41:31 -0800
Lines: 19
Distribution: su
Message-ID: <eprugu$rij$1@news.Stanford.EDU>
References: <eppgd1$7pa$1@news.Stanford.EDU> <eppo80$gsd$1@news.Stanford.EDU> <epqvhv$nk0$1@news.Stanford.EDU> <epr74p$3so$1@news.Stanford.EDU> <eprca6$7t7$1@news.Stanford.EDU> <eprtu9$qan$2@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1170308446 28243 127.0.0.1 (1 Feb 2007 05:40:46 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: shelby.stanford.edu su.class.cs244a:11347


"David Erickson" <derickso@stanford.edu> wrote in message 
news:eprtu9$qan$2@news.Stanford.EDU...
> Riju Kallivalappil wrote:
>> On a similar note, is it ok to cache the MAC maddress of the sender when 
>> we receive an ARP request?
>
> I would say no, when the destination then sends a packet back through your 
> router towards the sender it should send out an arp request in that 
> direction to find the next MAC of the next hop.
Wouldn't the ARP have the IP of the router, which would be on the same 
subnet as you?

Sincerely,
Randy Jennings

The squirrels are your friends! 


.

Path: shelby.stanford.edu!not-for-mail
From: Dinesh Gupta <dineshg@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: arp requests
Date: Thu, 1 Feb 2007 05:43:09 +0000 (UTC)
Lines: 30
Distribution: su
Message-ID: <epruld$rbq$1@news.Stanford.EDU>
References: <eprt6i$pok$1@news.Stanford.EDU> <eprtqo$qov$1@news.Stanford.EDU>
NNTP-Posting-Host: myth27.stanford.edu
X-Trace: news.Stanford.EDU 1170308589 28026 171.64.15.42 (1 Feb 2007 05:43:09 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (Linux/2.6.17.13smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:11348

Hi: Randy,

I thought we are sending multiple requests to make sure that host is
unreachable and it's not loss due to link. For sure all these packets
will contain the same data. Don't understand your point of view.

Thanks,
Dinesh

Randy Jennings <randyj@stanford.edu> wrote:
> Considering that all the requests contain exactly the same information, why 
> would you want to send them all at the same time?

> Sincerely,
> Randy Jennings

> The squirrels are your friends!
> "Dinesh Gupta" <dineshg@Stanford.EDU> wrote in message 
> news:eprt6i$pok$1@news.Stanford.EDU...
> > Hi,
> >
> > Do we need to send 5 continous ARP requests and wait for 5-7 seconds or
> > send one ARP req then wait then send another one, wait and so on, 
> > totalling 5-7
> > secs.
> >
> > Thanks,
> > Dinesh 


.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: arp requests
Date: Wed, 31 Jan 2007 21:59:29 -0800
Lines: 34
Distribution: su
Message-ID: <eprvjr$sj9$1@news.Stanford.EDU>
References: <eprt6i$pok$1@news.Stanford.EDU> <eprti8$qan$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170309563 29289 128.12.194.72 (1 Feb 2007 05:59:23 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <eprti8$qan$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11349

I only send ARP requests on an ARP cache miss, right?

Also, is it okay to simply drop the packet on the first time there is a 
cache miss for each IP address? (I'd then send an ARP request for the 
corresponding MAC address and hopefully have the cache entry for it the 
next time a packet arrives.)

Or do I always have to send up to five ARP requests, and forward the 
packet if I get a valid ARP reply, and only send host unreachable after 
I'm fairly sure that the link is down? If this is the case, I'm not sure 
how to structure my code, since there is no way to receive another 
packet inside the handle_packet code.

-Yangfan

David Erickson wrote:
> Dinesh Gupta wrote:
> 
>> Hi,
>>
>> Do we need to send 5 continous ARP requests and wait for 5-7 seconds or
>> send one ARP req then wait then send another one, wait and so on, 
>> totalling 5-7
>> secs.
>>
>> Thanks,
>> Dinesh
> 
> 
> You should have sent 5 arp requests by the time you send the icmp host 
> unreachable which should occur 5-7 seconds after the time you send the 
> first request.
> 
> -David
.

Path: shelby.stanford.edu!not-for-mail
From: Greg Nelson <grourk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP reply assumption
Date: Wed, 31 Jan 2007 22:14:03 -0800
Lines: 20
Distribution: su
Message-ID: <eps0fa$6e$1@news.Stanford.EDU>
References: <eppgd1$7pa$1@news.Stanford.EDU> <eppo80$gsd$1@news.Stanford.EDU> <epqvhv$nk0$1@news.Stanford.EDU> <epr74p$3so$1@news.Stanford.EDU> <eprca6$7t7$1@news.Stanford.EDU> <eprtu9$qan$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170310442 206 127.0.0.1 (1 Feb 2007 06:14:02 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20070104)
In-Reply-To: <eprtu9$qan$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11350

David Erickson wrote:
> Riju Kallivalappil wrote:
>> On a similar note, is it ok to cache the MAC maddress of the sender 
>> when we receive an ARP request?
> 
> I would say no, when the destination then sends a packet back through 
> your router towards the sender it should send out an arp request in that 
> direction to find the next MAC of the next hop.
> 
> -David

I think the rfc for arp linked from the homework (rfc 826) says different:

"Notice that the <protocol type, sender protocol address, sender
hardware address> triplet is merged into the table before the
opcode is looked at.  This is on the assumption that communcation
is bidirectional; if A has some reason to talk to B, then B will
probably have some reason to talk to A."

Greg
.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Questions on computing checksum.
Date: Wed, 31 Jan 2007 22:27:51 -0800
Lines: 14
Distribution: su
Message-ID: <eps190$rq$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170311265 890 128.12.194.72 (1 Feb 2007 06:27:45 GMT)
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:11351

Okay, a few questions on computing checksum, since I'm not doing them 
correctly... :p

1. An IP checksum computes the sum over the IP header only, but an ICMP 
checksum computes it over both the ICMP header and its entire body (the 
rest of the IP packet's data portion), right?

2. Does the cheskum algorithm treat 8-bit fields differently? For 
example, if it sees two consecutive 8-bit fields, will it add them to 
the sum separately or as one 16-bit field?

Thanks.

-Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: Matt Page <mpage@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ARP cache per interface?
Date: Wed, 31 Jan 2007 22:40:53 -0800
Lines: 5
Distribution: su
Message-ID: <eps21l$1bm$1@news.Stanford.EDU>
NNTP-Posting-Host: wanderlust.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170312054 1398 128.12.104.61 (1 Feb 2007 06:40:54 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20060313)
Xref: shelby.stanford.edu su.class.cs244a:11352

Not that it matters, but in an actual router is there typically an arp 
cache for each interface or just a single cache for all interfaces?

Thanks,
Matt
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP cache per interface?
Date: Thu, 01 Feb 2007 00:58:11 -0800
Lines: 36
Distribution: su
Message-ID: <C1E6EBA3.7EC1%jpettit@stanford.edu>
References: <eps21l$1bm$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170320295 13968 127.0.0.1 (1 Feb 2007 08:58:15 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: ARP cache per interface?
Thread-Index: AcdF3xltV8lkWrHSEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11353

On most systems, you can run "arp -a" to dump out the arp cache:

[jpettit@myth4 ~] arp -a
afssvr22.Stanford.EDU (171.64.17.22) at 00:D0:05:5D:27:FC [ether] on eth0
caribou.Stanford.EDU (171.64.7.55) at 00:D0:05:5D:27:FC [ether] on eth0
cicci.Stanford.EDU (171.64.7.121) at 00:D0:05:5D:27:FC [ether] on eth0
myth2.Stanford.EDU (171.64.15.175) at 00:0F:1F:92:B3:56 [ether] on eth0
myth3.Stanford.EDU (171.64.15.178) at 00:0F:1F:84:7B:94 [ether] on eth0
....

So, it looks like its tied to a particular interface.  Also, notice that the
MAC address is the same for most of these IP addresses, with the sole
exception of two Myth systems.  The reason is that the non-Myth systems need
to go through a router, which is providing its MAC address (the one that
ends in 27:FC).  While the Myth systems are supplying their own actual
hardware addresses.

You can find a lot of interesting information on these Linux systems.
Here's a couple of other ones that might be useful for this assignment:

    ifconfig -a          # Print information about the interfaces
    netstat -rn         # Print the routing table

--Justin


On 1/31/07 10:40 PM, in article eps21l$1bm$1@news.Stanford.EDU, "Matt Page"
<mpage@stanford.edu> wrote:

> Not that it matters, but in an actual router is there typically an arp
> cache for each interface or just a single cache for all interfaces?
> 
> Thanks,
> Matt


.

Path: shelby.stanford.edu!not-for-mail
From: Matt Page <mpage@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Default Route...
Date: Thu, 01 Feb 2007 00:59:58 -0800
Lines: 5
Distribution: su
Message-ID: <epsa6g$dms$1@news.Stanford.EDU>
NNTP-Posting-Host: wanderlust.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170320400 14044 128.12.104.61 (1 Feb 2007 09:00:00 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5 (X11/20060313)
Xref: shelby.stanford.edu su.class.cs244a:11354

Given the presence of a default route, how can we determine if a packet 
has an unknown next hop address?

Thanks,
Matt
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: arp requests
Date: Thu, 01 Feb 2007 01:21:20 -0800
Lines: 17
Distribution: su
Message-ID: <C1E6F110.7EC6%jpettit@stanford.edu>
References: <eprt6i$pok$1@news.Stanford.EDU> <eprti8$qan$1@news.Stanford.EDU> <eprvjr$sj9$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170321686 15649 127.0.0.1 (1 Feb 2007 09:21:26 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: arp requests
Thread-Index: AcdF4lVWlAlvPrHVEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11355

> I only send ARP requests on an ARP cache miss, right?

Correct.

> Also, is it okay to simply drop the packet on the first time there is a
> cache miss for each IP address? (I'd then send an ARP request for the
> corresponding MAC address and hopefully have the cache entry for it the
> next time a packet arrives.)

That wouldn't be very nice to the poor source that took the time to generate
the packet.  No, you must hold onto the packet until you decide what to do
with it.  If you don't get an ARP reply, you'll use the IP header and first
64-bytes of data into unreachable message.

--Justin


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: arp requests
Date: Thu, 01 Feb 2007 01:28:07 -0800
Lines: 41
Distribution: su
Message-ID: <C1E6F2A7.7EC7%jpettit@stanford.edu>
References: <eprt6i$pok$1@news.Stanford.EDU> <eprtqo$qov$1@news.Stanford.EDU> <epruld$rbq$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170322091 16000 127.0.0.1 (1 Feb 2007 09:28:11 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: arp requests
Thread-Index: AcdF40fthsS+uLHWEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11356

Just send one ARP request at a time spaced out by (approximately) a second
until you hear a response or you've sent five of them.

--Justin


On 1/31/07 9:43 PM, in article epruld$rbq$1@news.Stanford.EDU, "Dinesh
Gupta" <dineshg@Stanford.EDU> wrote:

> Hi: Randy,
> 
> I thought we are sending multiple requests to make sure that host is
> unreachable and it's not loss due to link. For sure all these packets
> will contain the same data. Don't understand your point of view.
> 
> Thanks,
> Dinesh
> 
> Randy Jennings <randyj@stanford.edu> wrote:
>> Considering that all the requests contain exactly the same information, why
>> would you want to send them all at the same time?
> 
>> Sincerely,
>> Randy Jennings
> 
>> The squirrels are your friends!
>> "Dinesh Gupta" <dineshg@Stanford.EDU> wrote in message
>> news:eprt6i$pok$1@news.Stanford.EDU...
>>> Hi,
>>> 
>>> Do we need to send 5 continous ARP requests and wait for 5-7 seconds or
>>> send one ARP req then wait then send another one, wait and so on,
>>> totalling 5-7
>>> secs.
>>> 
>>> Thanks,
>>> Dinesh 
> 
> 


.

Path: shelby.stanford.edu!not-for-mail
From: Yangfan Wang <yfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Spawning new threads.
Date: Thu, 01 Feb 2007 02:00:31 -0800
Lines: 19
Distribution: su
Message-ID: <epsdno$hde$1@news.Stanford.EDU>
References: <epp5qm$15$1@news.Stanford.EDU> <epp8qt$1u5$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-06-80386.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170324025 17838 128.12.194.72 (1 Feb 2007 10:00:25 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <epp8qt$1u5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11357

Where are the pthread man pages? For example, pthread_mutex_lock looks 
interesting, but calling man on it doesn't work. "man pthreads" refers 
to Pthreads manual pages.

- Yangfan

Clay Collier wrote:
> 'man pthreads' is a good place to start.
> 
> Clay
> Yangfan Wang wrote:
> 
>> Where can I find a good resource on learning how to spawn new threads 
>> in  Unix?
>>
>> We learned the theory in CS140, but a quick review and some practical 
>> details on threads in Unix would be very helpful.
>>
>> -Yangfan
.

Path: shelby.stanford.edu!not-for-mail
From: David Erickson <derickso@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Questions on computing checksum.
Date: Thu, 01 Feb 2007 03:45:31 -0800
Lines: 18
Distribution: su
Message-ID: <epsjsr$mpg$1@news.Stanford.EDU>
References: <eps190$rq$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170330331 23344 127.0.0.1 (1 Feb 2007 11:45:31 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <eps190$rq$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:11358

Yangfan Wang wrote:
> Okay, a few questions on computing checksum, since I'm not doing them 
> correctly... :p
> 
> 1. An IP checksum computes the sum over the IP header only, but an ICMP 
> checksum computes it over both the ICMP header and its entire body (the 
> rest of the IP packet's data portion), right?

The ICMP checksum is over the ICMP header information and the ICMP 
packet's body, however be careful what you put in the ICMP packet's body.

> 2. Does the cheskum algorithm treat 8-bit fields differently? For 
> example, if it sees two consecutive 8-bit fields, will it add them to 
> the sum separately or as one 16-bit field?

It treats them as a single 16 bit field.

-David
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Spawning new threads.
Date: Thu, 01 Feb 2007 09:40:08 -0800
Lines: 35
Distribution: su
Message-ID: <C1E765F8.7EDA%jpettit@stanford.edu>
References: <epp5qm$15$1@news.Stanford.EDU> <epp8qt$1u5$1@news.Stanford.EDU> <epsdno$hde$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170351613 12625 127.0.0.1 (1 Feb 2007 17:40:13 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Spawning new threads.
Thread-Index: AcdGKAPQQqq6KLIbEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11359

I'm not sure why they're not found on our Linux systems.  There are some
Linux online man pages that cover the material, such as:

    http://www.die.net/doc/linux/man/man3/pthread_mutex_lock.3.html

The Elaines have them, but they are Solaris, so there may be some subtle
differences.

--Justin


On 2/1/07 2:00 AM, in article epsdno$hde$1@news.Stanford.EDU, "Yangfan Wang"
<yfw@stanford.edu> wrote:

> Where are the pthread man pages? For example, pthread_mutex_lock looks
> interesting, but calling man on it doesn't work. "man pthreads" refers
> to Pthreads manual pages.
> 
> - Yangfan
> 
> Clay Collier wrote:
>> 'man pthreads' is a good place to start.
>> 
>> Clay
>> Yangfan Wang wrote:
>> 
>>> Where can I find a good resource on learning how to spawn new threads
>>> in  Unix?
>>> 
>>> We learned the theory in CS140, but a quick review and some practical
>>> details on threads in Unix would be very helpful.
>>> 
>>> -Yangfan


.

Path: shelby.stanford.edu!not-for-mail
From: Neelima Balakrishnan <bneelima@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: arp requests
Date: Thu, 01 Feb 2007 09:46:16 -0800
Lines: 24
Distribution: su
Message-ID: <ept914$cd7$1@news.Stanford.EDU>
References: <eprt6i$pok$1@news.Stanford.EDU> <eprti8$qan$1@news.Stanford.EDU> <eprvjr$sj9$1@news.Stanford.EDU> <C1E6F110.7EC6%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170351972 12711 127.0.0.1 (1 Feb 2007 17:46:12 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <C1E6F110.7EC6%jpettit@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:11360

Jut a clarification... Is it not the first 8 bytes i.e. the first 64 
bits of the data in the IP datagram that must be sent back in the 
unreachable message?

Neelima

Justin Pettit wrote:
>> I only send ARP requests on an ARP cache miss, right?
> 
> Correct.
> 
>> Also, is it okay to simply drop the packet on the first time there is a
>> cache miss for each IP address? (I'd then send an ARP request for the
>> corresponding MAC address and hopefully have the cache entry for it the
>> next time a packet arrives.)
> 
> That wouldn't be very nice to the poor source that took the time to generate
> the packet.  No, you must hold onto the packet until you decide what to do
> with it.  If you don't get an ARP reply, you'll use the IP header and first
> 64-bytes of data into unreachable message.
> 
> --Justin
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Default Route...
Date: Thu, 01 Feb 2007 09:46:22 -0800
Lines: 18
Distribution: su
Message-ID: <C1E7676E.7EDE%jpettit@stanford.edu>
References: <epsa6g$dms$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170351984 12878 127.0.0.1 (1 Feb 2007 17:46:24 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: Default Route...
Thread-Index: AcdGKOK8ITyez7IcEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11361

The only case I can think of is when the packet's destination is in the
router's collision domain, but it couldn't determine the destination's
hardware address.  This could happen because no machine has that IP address
or the one that does is down.

--Justin


On 2/1/07 12:59 AM, in article epsa6g$dms$1@news.Stanford.EDU, "Matt Page"
<mpage@stanford.edu> wrote:

> Given the presence of a default route, how can we determine if a packet
> has an unknown next hop address?
> 
> Thanks,
> Matt


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: arp requests
Date: Thu, 01 Feb 2007 09:48:34 -0800
Lines: 35
Distribution: su
Message-ID: <C1E767F2.7EE1%jpettit@stanford.edu>
References: <eprt6i$pok$1@news.Stanford.EDU> <eprti8$qan$1@news.Stanford.EDU> <eprvjr$sj9$1@news.Stanford.EDU> <C1E6F110.7EC6%jpettit@stanford.edu> <ept914$cd7$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170352118 12939 127.0.0.1 (1 Feb 2007 17:48:38 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: arp requests
Thread-Index: AcdGKTFqcCjSLLIcEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11362

Whoops, you are correct!  I need to be more careful when I'm replying late
at night.  Thanks for catching that!

--Justin


On 2/1/07 9:46 AM, in article ept914$cd7$1@news.Stanford.EDU, "Neelima
Balakrishnan" <bneelima@stanford.edu> wrote:

> Jut a clarification... Is it not the first 8 bytes i.e. the first 64
> bits of the data in the IP datagram that must be sent back in the
> unreachable message?
> 
> Neelima
> 
> Justin Pettit wrote:
>>> I only send ARP requests on an ARP cache miss, right?
>> 
>> Correct.
>> 
>>> Also, is it okay to simply drop the packet on the first time there is a
>>> cache miss for each IP address? (I'd then send an ARP request for the
>>> corresponding MAC address and hopefully have the cache entry for it the
>>> next time a packet arrives.)
>> 
>> That wouldn't be very nice to the poor source that took the time to generate
>> the packet.  No, you must hold onto the packet until you decide what to do
>> with it.  If you don't get an ARP reply, you'll use the IP header and first
>> 64-bytes of data into unreachable message.
>> 
>> --Justin
>> 
>> 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Scores
Date: Thu, 01 Feb 2007 09:58:50 -0800
Lines: 14
Distribution: su
Message-ID: <C1E76A5A.7EE6%jpettit@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170352730 13407 127.0.0.1 (1 Feb 2007 17:58:50 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: PS1 Scores
Thread-Index: AcdGKqCU3uYeVbIdEduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11363

The first problem set was returned on Tuesday and the scores have been
entered into eeclass.  The score average was 53.42 with a standard deviation
of 9.47.  The highest score was 68 out of 69 possible points.

If you were not in class on Tuesday, they have been placed into the CS244A
filing cabinet on the third floor.  The SCPD submissions that had a routing
form have been sent back to SCPD, so you should receive them in the next
couple of days.

We are in the process of generating a solution set and should have that up
in the next day or two.

--Justin

.

Path: shelby.stanford.edu!not-for-mail
From: Dinesh Gupta <dineshg@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PA2 due date
Date: Thu, 1 Feb 2007 19:15:04 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <epte7o$gls$1@news.Stanford.EDU>
NNTP-Posting-Host: myth27.stanford.edu
X-Trace: news.Stanford.EDU 1170357304 17084 171.64.15.42 (1 Feb 2007 19:15:04 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (Linux/2.6.17.13smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:11364

Hi,

PA2 due date is this Friday or next Friday?

Thanks,
Dinesh
.

Path: shelby.stanford.edu!not-for-mail
From: Dinesh Gupta <dineshg@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: arp requests
Date: Thu, 1 Feb 2007 19:21:40 +0000 (UTC)
Lines: 44
Distribution: su
Message-ID: <eptek4$h12$1@news.Stanford.EDU>
References: <eprt6i$pok$1@news.Stanford.EDU> <eprtqo$qov$1@news.Stanford.EDU> <epruld$rbq$1@news.Stanford.EDU> <C1E6F2A7.7EC7%jpettit@stanford.edu>
NNTP-Posting-Host: myth27.stanford.edu
X-Trace: news.Stanford.EDU 1170357700 17442 171.64.15.42 (1 Feb 2007 19:21:40 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (Linux/2.6.17.13smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:11365

Thanks for clarifying this!

Justin Pettit <jpettit@stanford.edu> wrote:
> Just send one ARP request at a time spaced out by (approximately) a second
> until you hear a response or you've sent five of them.

> --Justin


> On 1/31/07 9:43 PM, in article epruld$rbq$1@news.Stanford.EDU, "Dinesh
> Gupta" <dineshg@Stanford.EDU> wrote:

> > Hi: Randy,
> > 
> > I thought we are sending multiple requests to make sure that host is
> > unreachable and it's not loss due to link. For sure all these packets
> > will contain the same data. Don't understand your point of view.
> > 
> > Thanks,
> > Dinesh
> > 
> > Randy Jennings <randyj@stanford.edu> wrote:
> >> Considering that all the requests contain exactly the same information, why
> >> would you want to send them all at the same time?
> > 
> >> Sincerely,
> >> Randy Jennings
> > 
> >> The squirrels are your friends!
> >> "Dinesh Gupta" <dineshg@Stanford.EDU> wrote in message
> >> news:eprt6i$pok$1@news.Stanford.EDU...
> >>> Hi,
> >>> 
> >>> Do we need to send 5 continous ARP requests and wait for 5-7 seconds or
> >>> send one ARP req then wait then send another one, wait and so on,
> >>> totalling 5-7
> >>> secs.
> >>> 
> >>> Thanks,
> >>> Dinesh 
> > 
> > 


.

Path: shelby.stanford.edu!not-for-mail
From: Justin Pettit <jpettit@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PA2 due date
Date: Thu, 01 Feb 2007 13:46:44 -0800
Lines: 18
Distribution: su
Message-ID: <C1E79FC4.7F02%jpettit@stanford.edu>
References: <epte7o$gls$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170366406 26081 127.0.0.1 (1 Feb 2007 21:46:46 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Microsoft-Entourage/11.3.3.061214
Thread-Topic: PA2 due date
Thread-Index: AcdGSnbrtUHnzLI9EduZHwARJDbi7g==
Xref: shelby.stanford.edu su.class.cs244a:11366

Next Friday.  The programming assignment due dates are in the second to last
column of the following page:

    http://www.stanford.edu/class/cs244a/timetable.html

--Justin

On 2/1/07 11:15 AM, in article epte7o$gls$1@news.Stanford.EDU, "Dinesh
Gupta" <dineshg@Stanford.EDU> wrote:

> Hi,
> 
> PA2 due date is this Friday or next Friday?
> 
> Thanks,
> Dinesh


.

Path: shelby.stanford.edu!not-for-mail
From: Neelima Balakrishnan <bneelima@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Doubt regarding ICMP error messages
Date: Thu, 01 Feb 2007 18:42:28 -0800
Lines: 24
Distribution: su
Message-ID: <epu8eh$fe9$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170384145 15817 127.0.0.1 (2 Feb 2007 02:42:25 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
Xref: shelby.stanford.edu su.class.cs244a:11367

Hi,

I had a question about handling ICMP timeout and port unreachable messages.

When we receive an IP packet, should we not do the sanity checks on it 
first(including TTL expired) before decoding and checking the protocol 
type of the data it is carrying?

In that case if we get a TCP/UDP packet addressed to one of the router 
interface with TTL = 1 before decrementing, what should the ICMP error 
message sent back be? (timeout or port unreachable?) If we send out ICMP 
timeout error message, then in traceroute the display might indicate 
"!A" annotation indicating that it got a Timeout message instead of Port 
Unreachable message.

This happens because the TTL is 1 by the time the packet reaches us and 
as per the FAQ, if the TTL is 1 or 0 before decrementing, then a ICMP 
timeout error message should be sent out.

So the question is - What should be the correct/expected behavior in 
this scenario?

Thanks
Neelima
.

Path: shelby.stanford.edu!not-for-mail
From: Jad Naous <jnaous@stanford.edu>
Newsgroups: su.class.cs244a
Subject: arp cache timeouts
Date: Thu, 01 Feb 2007 20:22:37 -0800
Lines: 5
Distribution: su
Message-ID: <epue7e$kfu$1@news.Stanford.EDU>
NNTP-Posting-Host: jadsdesktop.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1170390062 20990 128.12.134.140 (2 Feb 2007 04:21:02 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Thunderbird 1.5.0.9 (X11/20060911)
Xref: shelby.stanford.edu su.class.cs244a:11368

If the ip/mac combo is