su.class.cs244a



Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Welcome to cs244a
Date: Tue, 30 Dec 2003 15:24:07 -0800
Lines: 22
Distribution: su
Message-ID: <Pine.LNX.4.44.0312301505380.16978-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1072826652 2793 171.64.66.201 (30 Dec 2003 23:24:12 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:4950


 Welcome to the cs244a newsgroup!  The purpose of this newsgroup is to provide
 a forum for students to post questions and to receive feedback from the TAs or
 other students.  We (the TAs) tightly monitor this newsgroup and will respond
 to all questions within 24 hours.  Please be sure to read the newsgroup
 regularly as class updates are posted here periodically.

 In addition to the newsgroup you should read the class web page.

 http://www.stanford.edu/class/cs244a/

 The website includes a number of FAQs for the class:

 http://www.stanford.edu/class/cs244a/faq.html

 Which you should consult before posting to the newsgroup.

 Again, any questions you have, please post them here and we look forward to an
 exciting quarter!

 - The CS244a Staff

.

Path: shelby.stanford.edu!not-for-mail
From: Duggan John Dieterly <dieterly@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Local Host IP Address on Linux
Date: Sun, 4 Jan 2004 21:55:51 +0000 (UTC)
Lines: 95
Distribution: su
Message-ID: <bta257$3p4$1@news.Stanford.EDU>
NNTP-Posting-Host: saga19.stanford.edu
X-Trace: news.Stanford.EDU 1073253351 3876 171.64.15.149 (4 Jan 2004 21:55:51 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:4951

Hi-

I've been working on assignment 1 (trying to get a jump on it).  I'm working remotely,
so I have to use machines other than the Stanford Hosts because of my remote situation.
In particular, I use linux 2.4.22 of the debian distro.

In doing assignment 1, I have noticed that the meat of the work is in learning how to use
the sockets api correctly.  I have tried to create a test program to create a control
connection and a data connection with an ftp server.  I'm running into problems with
creating the data connection.  In order to create the data connection, the local hosts's 
IP address and port must be sent to the ftp server.  I can get the ephemeral port number 
using getsockname, but I can't seem to consistently get the IP address.  Here is the 
code in question:

int main (int argc, char *argv[]) {

  int sfd, cfd, sl, cl;
  struct sockaddr_in addr, caddr;
  char port[256];
  struct e {
    unsigned char a;
    unsigned char b;
  };

  union  {
    unsigned short c;
    struct e d;
  } x;

 
  char ip[256];
  char hostname[256];
  struct hostent *host;
  char *ptr;
	
  if ( (sfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) printf ("E");
  bzero((char*) &addr, sizeof(addr));
  addr.sin_family = AF_INET;
  addr.sin_port = htons(0);
  addr.sin_addr.s_addr = htonl(INADDR_ANY);

  if ( (bind(sfd, (struct sockaddr *) &addr, sizeof(struct sockaddr))) < 0) printf ("E");

  sl =  sizeof(struct sockaddr);
  getsockname(sfd, (struct sockaddr *) &addr, &sl);
  sprintf(port, "%d", ntohs(addr.sin_port));
  printf("port = %s\n", port);
 
  /* This didn't work; early attempt */ 
  sprintf(ip, "%s", ntohl(addr.sin_addr.s_addr));
  printf("ip = %s\n", ip);

  x.c = ntohs(addr.sin_port);
  printf("low bits = %u\n", x.d.a);
  printf("high bits = %u\n", x.d.b);


  /* This doesn't work */
  printf("ip address = %s\n", inet_ntoa(addr.sin_addr));

  /* This works on cygwin and sun but not on my linux machine that uses dhcp */
  gethostname(hostname, 256);
  if ( (host = gethostbyname(hostname)) < 0) perror("E: gethostbyname");
  printf("ip address = %s\n", inet_ntoa(*( (struct in_addr*) (host->h_addr_list[0]))));

  /* Ignore this; early attempts */
  printf("hostname = %s\n", hostname);
  ptr = host->h_addr;
  while (*ptr) {
    printf("ip address = %d\n", *ptr);
    ptr++;
  }


This works on the Stanford hosts and my pc using cygwin.  But, when I try to run this on my
linux host it gives me the following results:

port = 32787
ip = (null)
low bits = 19
high bits = 128
ip address = 0.0.0.0
hostname = icebox1.dieterly.com
ip address = 127
ip address = 127.0.0.1

The port info is correct, but the IP Address is always the loopback address.  

I've tried every possible configuration I can think of in /etc/hosts and /etc/network/interfaces, 
but nothing seems to work.  I've also tried to find a sockets function that will return the
dhcp IP Address that my pc running linux uses, but to no avail.  Since this seems to work 
on the Stanford hosts, I guess that I could just use it and not worry about it not working
on linux, but that doesn't seem very satisfactory to me.

Thanks for any help that you may be able to give me.
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Local Host IP Address on Linux
Date: Mon, 5 Jan 2004 10:44:16 -0800
Lines: 180
Distribution: su
Message-ID: <Pine.LNX.4.44.0401050931550.28579-100000@Xenon.Stanford.EDU>
References: <bta257$3p4$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073328258 7099 171.64.66.201 (5 Jan 2004 18:44:18 GMT)
X-Complaints-To: news@news.stanford.edu
To: Duggan John Dieterly <dieterly@Stanford.EDU>,  <casado@cs.stanford.edu>
In-Reply-To: <bta257$3p4$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:4952


> Hi-
> 
> I've been working on assignment 1 (trying to get a jump on it). 

 trying to get a jump on it indeed!

> I'm working remotely,
> so I have to use machines other than the Stanford Hosts because of my remote situation.
> In particular, I use linux 2.4.22 of the debian distro.
> 
> In doing assignment 1, I have noticed that the meat of the work is in learning how to use
> the sockets api correctly.  I have tried to create a test program to create a control
> connection and a data connection with an ftp server.  I'm running into problems with
> creating the data connection.  In order to create the data connection, the local hosts's 
> IP address and port must be sent to the ftp server.  I can get the ephemeral port number 
> using getsockname, but I can't seem to consistently get the IP address.  Here is the 
> code in question:

 This seems to be a pretty common question for this assignment so lets KO it
 right now. 

 You really have three options here ....

 1) Use passive mode :) (PASV) this way you can reuse your socket connection
    code and don't have to implement server functionality in your program.

 2) You can use a shameless (nonportable and incorrect!) hack and use 
    gethostbyname() on the string returned by gethostname().
    This is a really lame way to get the local IP and it doesn't 
    work in all cases.
 
 3) You can use the following code :) to do it correctly.  I'm don't think
    anyone has actually posted the correct method of doing this nor actually
    used it (it is a bit obscure) so here it is.
    
    The solution is to connect to the destination .. say "ftp.microsoft.com"
    ... and use the local socket information for binding localy (to ensure we
    bind to the correct interface) and then use getsocketname(..) from there.
    At this point this may be a bit confusing but it should become more
    understandable over time.

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

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

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

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

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

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

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

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

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

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

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

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


  Hmm, perhaps this is a good one for the FAQ.

  Cheers,
    .m

> int main (int argc, char *argv[]) {
> 
>   int sfd, cfd, sl, cl;
>   struct sockaddr_in addr, caddr;
>   char port[256];
>   struct e {
>     unsigned char a;
>     unsigned char b;
>   };
> 
>   union  {
>     unsigned short c;
>     struct e d;
>   } x;
> 
>  
>   char ip[256];
>   char hostname[256];
>   struct hostent *host;
>   char *ptr;
> 	
>   if ( (sfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) printf ("E");
>   bzero((char*) &addr, sizeof(addr));
>   addr.sin_family = AF_INET;
>   addr.sin_port = htons(0);
>   addr.sin_addr.s_addr = htonl(INADDR_ANY);
> 
>   if ( (bind(sfd, (struct sockaddr *) &addr, sizeof(struct sockaddr))) < 0) printf ("E");
> 
>   sl =  sizeof(struct sockaddr);
>   getsockname(sfd, (struct sockaddr *) &addr, &sl);
>   sprintf(port, "%d", ntohs(addr.sin_port));
>   printf("port = %s\n", port);
>  
>   /* This didn't work; early attempt */ 
>   sprintf(ip, "%s", ntohl(addr.sin_addr.s_addr));
>   printf("ip = %s\n", ip);
> 
>   x.c = ntohs(addr.sin_port);
>   printf("low bits = %u\n", x.d.a);
>   printf("high bits = %u\n", x.d.b);
> 
> 
>   /* This doesn't work */
>   printf("ip address = %s\n", inet_ntoa(addr.sin_addr));
> 
>   /* This works on cygwin and sun but not on my linux machine that uses dhcp */
>   gethostname(hostname, 256);
>   if ( (host = gethostbyname(hostname)) < 0) perror("E: gethostbyname");
>   printf("ip address = %s\n", inet_ntoa(*( (struct in_addr*) (host->h_addr_list[0]))));
> 
>   /* Ignore this; early attempts */
>   printf("hostname = %s\n", hostname);
>   ptr = host->h_addr;
>   while (*ptr) {
>     printf("ip address = %d\n", *ptr);
>     ptr++;
>   }
> 
> 
> This works on the Stanford hosts and my pc using cygwin.  But, when I try to run this on my
> linux host it gives me the following results:
> 
> port = 32787
> ip = (null)
> low bits = 19
> high bits = 128
> ip address = 0.0.0.0
> hostname = icebox1.dieterly.com
> ip address = 127
> ip address = 127.0.0.1
> 
> The port info is correct, but the IP Address is always the loopback address.  
> 
> I've tried every possible configuration I can think of in /etc/hosts and /etc/network/interfaces, 
> but nothing seems to work.  I've also tried to find a sockets function that will return the
> dhcp IP Address that my pc running linux uses, but to no avail.  Since this seems to work 
> on the Stanford hosts, I guess that I could just use it and not worry about it not working
> on linux, but that doesn't seem very satisfactory to me.
> 
> Thanks for any help that you may be able to give me.
> 



.

Path: shelby.stanford.edu!not-for-mail
From: "Louis Eisenberg" <tarheel@stanford.edu>
Newsgroups: su.class.cs244a
Subject: textbooks
Date: Tue, 6 Jan 2004 02:12:03 -0800
Lines: 4
Distribution: su
Message-ID: <bte1lj$suo$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1073383924 29656 127.0.0.1 (6 Jan 2004 10:12:04 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:4953

Is it a big deal if I use the 2nd editions of the textbooks? It would save
me an awful lot of money...


.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Late day policy
Date: Tue, 6 Jan 2004 22:24:03 +0000 (UTC)
Lines: 4
Distribution: su
Message-ID: <btfci3$t3c$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine20.stanford.edu
X-Trace: news.Stanford.EDU 1073427843 29804 171.64.15.85 (6 Jan 2004 22:24:03 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:4954

Can I split the free 1 late day (24 hours) into hours at a time? Say 3 
hours late for assign1, and 4 hours late for assign2, etc.

Jason
.

Path: shelby.stanford.edu!elaine8.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: textbooks
Date: Wed, 7 Jan 2004 01:08:34 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <btfm6i$cn5$1@news.Stanford.EDU>
References: <bte1lj$suo$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine8.stanford.edu
X-Trace: news.Stanford.EDU 1073437714 13029 171.64.15.73 (7 Jan 2004 01:08:34 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:4955


>Is it a big deal if I use the 2nd editions of the textbooks? It would save
>me an awful lot of money...

Probably not.  Just be aware that some problem sets may assign problems
out of the 3rd edition of Peterson and Davies--so be sure that you answer
the correct problem for those.

The 2nd edition of the Stevens book should also suffice for the programming
assignments.
.

Path: shelby.stanford.edu!elaine8.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Late day policy
Date: Wed, 7 Jan 2004 01:10:45 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <btfmal$cv8$1@news.Stanford.EDU>
References: <btfci3$t3c$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine8.stanford.edu
X-Trace: news.Stanford.EDU 1073437845 13288 171.64.15.73 (7 Jan 2004 01:10:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:4956


>Can I split the free 1 late day (24 hours) into hours at a time? Say 3 
>hours late for assign1, and 4 hours late for assign2, etc.

Nope.  You may use it once only for a 24-hour extension, irrespective
of exactly when in that period you submit your assignment.

.

Path: shelby.stanford.edu!not-for-mail
From: "Michael Hsieh" <mhsieh33@stanford.edu>
Newsgroups: su.class.cs244a
Subject: 3 or 4 units?
Date: Tue, 6 Jan 2004 21:25:30 -0800
Lines: 4
Distribution: su
Message-ID: <btg58d$74n$1@news.Stanford.EDU>
NNTP-Posting-Host: red63.stanford.edu
X-Trace: news.Stanford.EDU 1073453133 7319 128.12.33.167 (7 Jan 2004 05:25:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:4957

Is there a difference in workload if you take the class for 3 or 4 units?
Can undergrads choose either, etc.?


.

Path: shelby.stanford.edu!elaine17.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: 3 or 4 units?
Date: Wed, 7 Jan 2004 06:08:20 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <btg7ok$a72$1@news.Stanford.EDU>
References: <btg58d$74n$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine17.stanford.edu
X-Trace: news.Stanford.EDU 1073455700 10466 171.64.15.82 (7 Jan 2004 06:08:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:4958


>Is there a difference in workload if you take the class for 3 or 4 units?
>Can undergrads choose either, etc.?

There's no difference in workload.  My understanding is that the option
of taking the class for 3 units is available for grad students who
need to fit into, say, a 9-unit allowance with TA/RAships.
.

Path: shelby.stanford.edu!saga7.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PORT versus PASV
Date: Tue, 6 Jan 2004 22:28:59 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0401062222540.6780-100000@saga7.Stanford.EDU>
NNTP-Posting-Host: saga7.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073456942 11813 171.64.15.137 (7 Jan 2004 06:29:02 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:4959

It was mentioned previously in a post that PASV may be used or PORT to
establish a client data connection.

Does it matter which we choose in our ftp client? The assignment mentions
PORT but not PASV but tracing an ftp client it appears to me that it uses
PASV.

Thanks,

Edward G. Chron

.

Path: shelby.stanford.edu!saga7.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: IPV4
Date: Tue, 6 Jan 2004 22:33:59 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.GSO.4.44.0401062229060.6780-100000@saga7.Stanford.EDU>
NNTP-Posting-Host: saga7.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073457241 12203 171.64.15.137 (7 Jan 2004 06:34:01 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:4960

Is IPV4 support for our ftp client sufficient or do we also have to
support IPV6?

If so, is there an updated ftp RFC spec?
The ftp RFC appears to only cover 4 byte host addresses for some commands.

Thanks,

Edward G. Chron

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PORT versus PASV
Date: Tue, 6 Jan 2004 22:34:02 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0401062232250.19622-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401062222540.6780-100000@saga7.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073457245 12216 171.64.66.201 (7 Jan 2004 06:34:05 GMT)
X-Complaints-To: news@news.stanford.edu
To: Edward Chron <echron@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401062222540.6780-100000@saga7.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:4961


> It was mentioned previously in a post that PASV may be used or PORT to
> establish a client data connection.
> 
> Does it matter which we choose in our ftp client? The assignment mentions
> PORT but not PASV but tracing an ftp client it appears to me that it uses
> PASV.

  You can use either. 

  .mc

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: IPV4
Date: Tue, 6 Jan 2004 23:00:54 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.LNX.4.44.0401062253340.25536-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401062229060.6780-100000@saga7.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073458863 13967 171.64.66.201 (7 Jan 2004 07:01:03 GMT)
X-Complaints-To: news@news.stanford.edu
To: Edward Chron <echron@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401062229060.6780-100000@saga7.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:4962


> Is IPV4 support for our ftp client sufficient or do we also have to
> support IPV6?

 You do not have to support IPV6 

 :)
 .m

.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Details on the Friday "Review Session"
Date: Wed, 7 Jan 2004 08:41:17 -0800
Organization: CS Masters Program
Lines: 11
Distribution: su
Message-ID: <bthcrk$qvu$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1073493686 27646 127.0.0.1 (7 Jan 2004 16:41:26 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:4963

Can you give some details on the Friday review sessions?
- In general, what is the focus?
- Is attendance "required"?
- Is the Friday 2:15 - 3:05 session the only one? Is this time definite, or
might it change?

Thanks!

Greg


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Details on the Friday "Review Session"
Date: Wed, 7 Jan 2004 09:15:46 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.LNX.4.44.0401070910070.9554-100000@Xenon.Stanford.EDU>
References: <bthcrk$qvu$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073495748 29925 171.64.66.201 (7 Jan 2004 17:15:48 GMT)
X-Complaints-To: news@news.stanford.edu
To: Greg Friedman <gregory.friedman@cs.stanford.edu>
In-Reply-To: <bthcrk$qvu$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:4964


> Can you give some details on the Friday review sessions?
> - In general, what is the focus?

 The review sessions cover a different topic each week, but generally provide
 more details on current class subjects and programming assignments as well as
 reviews for the midterm and the final. 

> - Is attendance "required"?

 nope, but recommended :)

> - Is the Friday 2:15 - 3:05 session the only one? Is this time definite, or
> might it change?

 As far as I know that is the only session and the time is set. 

 .mc

.

Path: shelby.stanford.edu!not-for-mail
From: Woodley Packard <sweagles@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Local Host IP Address on Linux
Date: Wed, 07 Jan 2004 18:04:05 -0800
Lines: 113
Distribution: su
Message-ID: <btidql$fb2$2@news.Stanford.EDU>
References: <bta257$3p4$1@news.Stanford.EDU> <Pine.LNX.4.44.0401050931550.28579-100000@Xenon.Stanford.EDU>
Reply-To:  sweagles@stanford.edu
NNTP-Posting-Host: raptor14.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1073527445 15714 171.64.12.175 (8 Jan 2004 02:04:05 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:4965

Hi all,


 >>In order to create the data connection, the local hosts's
 >>IP address and port must be sent to the ftp server.  I can get the 
ephemeral port number
 >>using getsockname, but I can't seem to consistently get the IP address.

> The solution is to connect to the destination .. say "ftp.microsoft.com"
>     ... and use the local socket information for binding localy (to ensure we
>     bind to the correct interface) and then use getsocketname(..) from there.
>     At this point this may be a bit confusing but it should become more
>     understandable over time.
>

In the case of an ftp client, this is certainly a reasonable way to 
approach the problem, since you will need to connect to the remote host 
before you need your local IP address anyway.  In general, however, it 
is undesirable to have to connect to some public server just to find out 
your IP address :-)

Following is another approach which works in Linux and on Solaris. I 
don't know how standard it is (code by me for a game I wrote once -- use 
it if you like, cite as in the handout on the first day to avoid honor 
code issues or whatever).

Cheers,
-Woodley Packard



#include    <stdlib.h>

#define     BSD_COMP    1   // needed to enable these ioctl's on Solaris
#include    <sys/socket.h>
#include    <sys/ioctl.h>
#include    <netinet/in.h>
#include    <arpa/inet.h>
#include    <net/if.h>

#define ip_ascii_alloc(ip)  strcpy(malloc(32), inet_ntoa(ip))

int main()
{
     struct in_addr  ourip, localnet, netmask;

     if(!get_our_ip(&ourip, &localnet, &netmask))
     {
         printf("IP address: %s\n", inet_ntoa(ourip));
         printf("Broadcast:  %s\n", inet_ntoa(localnet));
         printf("Netmask:    %s\n", inet_ntoa(netmask));
     }
     else printf("Failed to get local IP address\n");
}

/* finds the ip address, broadcast address, and netmask
  * for the first non-loopback ethernet interface */

int get_our_ip(	struct in_addr   *ourip,
		struct in_addr  *localnet,
		struct in_addr   *netmask)
{
     int s, i, res = -1;
     struct sockaddr_in  *sa;
     struct ifreq    ifr;
     struct ifconf   ifc;

     s = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
     if(!s)return -1;
     ifc.ifc_len = 20*sizeof(struct ifreq);
     ifc.ifc_req = calloc(sizeof(struct ifreq), 20);
     if((i=ioctl(s, SIOCGIFCONF, &ifc)))
     {
         perror("ioctl get ifconfig failed");
         goto out;
     }
     for(i=0;i<ifc.ifc_len / sizeof(struct ifreq);i++)
     {
         //printf("name: %s\n", ifc.ifc_req[i].ifr_name);
         strcpy(ifr.ifr_name, ifc.ifc_req[i].ifr_name);

         // get the ip address
         ioctl(s, SIOCGIFADDR, &ifr);
         sa = (struct sockaddr_in*)&ifr.ifr_addr;
         //printf("ip: %s\n", inet_ntoa(sa->sin_addr));
         if(!strcmp(inet_ntoa(sa->sin_addr), "127.0.0.1"))
         {
             // -- no, that was the loopback address.
             continue;
         }
         *ourip = sa->sin_addr;

         // get the broadcast address
         ioctl(s, SIOCGIFBRDADDR, &ifr);
         sa = (struct sockaddr_in*)&ifr.ifr_addr;
         *localnet = sa->sin_addr;
         //printf("bc: %s\n", inet_ntoa(sa->sin_addr));

         // get the netmask
         ioctl(s, SIOCGIFNETMASK, &ifr);
         sa = (struct sockaddr_in*)&ifr.ifr_addr;
         *netmask = sa->sin_addr;
         //printf("nm: %s\n", inet_ntoa(sa->sin_addr));

         res = 0;
         break;
     }
     out:
     close(s);
     free(ifc.ifc_req);
     return res;
}

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Local Host IP Address on Linux
Date: Wed, 7 Jan 2004 19:05:34 -0800
Lines: 142
Distribution: su
Message-ID: <Pine.LNX.4.44.0401071849150.15469-100000@Xenon.Stanford.EDU>
References: <bta257$3p4$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401050931550.28579-100000@Xenon.Stanford.EDU>
 <btidql$fb2$2@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073531137 20795 171.64.66.201 (8 Jan 2004 03:05:37 GMT)
X-Complaints-To: news@news.stanford.edu
To: Woodley Packard <sweagles@stanford.edu>
In-Reply-To: <btidql$fb2$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:4966


> Hi all,
> 
> 
>  >>In order to create the data connection, the local hosts's
>  >>IP address and port must be sent to the ftp server.  I can get the 
> ephemeral port number
>  >>using getsockname, but I can't seem to consistently get the IP address.
> 
> > The solution is to connect to the destination .. say "ftp.microsoft.com"
> >     ... and use the local socket information for binding localy (to ensure we
> >     bind to the correct interface) and then use getsocketname(..) from there.
> >     At this point this may be a bit confusing but it should become more
> >     understandable over time.
> >
> 
> In the case of an ftp client, this is certainly a reasonable way to 
> approach the problem, since you will need to connect to the remote host 
> before you need your local IP address anyway.  In general, however, it 
> is undesirable to have to connect to some public server just to find out 
> your IP address :-)
> 
> Following is another approach which works in Linux and on Solaris. I 
> don't know how standard it is (code by me for a game I wrote once -- use 
> it if you like, cite as in the handout on the first day to avoid honor 
> code issues or whatever).
> 

  Actually your solution is not entirely correct (though it is better than
  using reverse DNS on the hostname).  A host may have multiple interfaces none
  of which need be loopback.  For example, if you are on a NAT box you could
  have an interface with a public IP and one with a private IP connected to
  your local network.  In this case, handing out the private IP to someone
  across the Internet is an obvious mistake.  

  The IP you hand out for use (as is the case of FTP) is dependant on the
  recipient.  That does not mean you need to make a connection (though if you
  have one it is easier, such as in the example I posted previously).  A common
  method of getting the correct source IP for a destination is to look at
  the routing table (/proc/net/route on linux) and then consult the interface
  list to get the IP.

  However, if you already have a connection, why go through the bother of
  iterating through the interface list and routing table when the kernel will
  do it for you?  Most client apps (such as vanilla unix ftp from inetutils)
  that need to send an IP to the server use some variant of the solution I
  posted previously, which is consistent with the OS method of source IP
  address allocation.

  Of course, this discussion is mostly academic.  For the purposes of the
  assignment you can use whichever method works correctly on the elaines.
  However, once you are all big, bad network hacking gurus, be careful how you
  select your source IPs ;-)

  .mc

> 
> 
> #include    <stdlib.h>
> 
> #define     BSD_COMP    1   // needed to enable these ioctl's on Solaris
> #include    <sys/socket.h>
> #include    <sys/ioctl.h>
> #include    <netinet/in.h>
> #include    <arpa/inet.h>
> #include    <net/if.h>
> 
> #define ip_ascii_alloc(ip)  strcpy(malloc(32), inet_ntoa(ip))
> 
> int main()
> {
>      struct in_addr  ourip, localnet, netmask;
> 
>      if(!get_our_ip(&ourip, &localnet, &netmask))
>      {
>          printf("IP address: %s\n", inet_ntoa(ourip));
>          printf("Broadcast:  %s\n", inet_ntoa(localnet));
>          printf("Netmask:    %s\n", inet_ntoa(netmask));
>      }
>      else printf("Failed to get local IP address\n");
> }
> 
> /* finds the ip address, broadcast address, and netmask
>   * for the first non-loopback ethernet interface */
> 
> int get_our_ip(	struct in_addr   *ourip,
> 		struct in_addr  *localnet,
> 		struct in_addr   *netmask)
> {
>      int s, i, res = -1;
>      struct sockaddr_in  *sa;
>      struct ifreq    ifr;
>      struct ifconf   ifc;
> 
>      s = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
>      if(!s)return -1;
>      ifc.ifc_len = 20*sizeof(struct ifreq);
>      ifc.ifc_req = calloc(sizeof(struct ifreq), 20);
>      if((i=ioctl(s, SIOCGIFCONF, &ifc)))
>      {
>          perror("ioctl get ifconfig failed");
>          goto out;
>      }
>      for(i=0;i<ifc.ifc_len / sizeof(struct ifreq);i++)
>      {
>          //printf("name: %s\n", ifc.ifc_req[i].ifr_name);
>          strcpy(ifr.ifr_name, ifc.ifc_req[i].ifr_name);
> 
>          // get the ip address
>          ioctl(s, SIOCGIFADDR, &ifr);
>          sa = (struct sockaddr_in*)&ifr.ifr_addr;
>          //printf("ip: %s\n", inet_ntoa(sa->sin_addr));
>          if(!strcmp(inet_ntoa(sa->sin_addr), "127.0.0.1"))
>          {
>              // -- no, that was the loopback address.
>              continue;
>          }
>          *ourip = sa->sin_addr;
> 
>          // get the broadcast address
>          ioctl(s, SIOCGIFBRDADDR, &ifr);
>          sa = (struct sockaddr_in*)&ifr.ifr_addr;
>          *localnet = sa->sin_addr;
>          //printf("bc: %s\n", inet_ntoa(sa->sin_addr));
> 
>          // get the netmask
>          ioctl(s, SIOCGIFNETMASK, &ifr);
>          sa = (struct sockaddr_in*)&ifr.ifr_addr;
>          *netmask = sa->sin_addr;
>          //printf("nm: %s\n", inet_ntoa(sa->sin_addr));
> 
>          res = 0;
>          break;
>      }
>      out:
>      close(s);
>      free(ifc.ifc_req);
>      return res;
> }
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Use of C99 extensions?
Date: Wed, 7 Jan 2004 20:59:53 -0800
Organization: CS Masters Program
Lines: 12
Distribution: su
Message-ID: <btio4g$s6e$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1073538002 28878 127.0.0.1 (8 Jan 2004 05:00:02 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:4967

Hi,

I asked in class whether or not we can use the C99 extensions in our
programming assignments. I'm not sure I know what the answer was.

So -- can we use C99, instead of old Ansi C?

Thanks,

Greg


.

Path: shelby.stanford.edu!elaine14.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Use of C99 extensions?
Date: Thu, 8 Jan 2004 05:47:56 +0000 (UTC)
Lines: 20
Distribution: su
Message-ID: <btiquc$2ht$1@news.Stanford.EDU>
References: <btio4g$s6e$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine14.stanford.edu
X-Trace: news.Stanford.EDU 1073540876 2621 171.64.15.79 (8 Jan 2004 05:47:56 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:4968



>I asked in class whether or not we can use the C99 extensions in our
>programming assignments. I'm not sure I know what the answer was.
>
>So -- can we use C99, instead of old Ansi C?

Unfortunately, no--the grading scripts for some of the assignments
at present assume ISO C (-ansi).  They may well work with C99 code, but I
haven't tested this--so it seems wiser not to introduce this change now at
the beginning of a new quarter, particularly since (to the best of my
knowledge) gcc support for C99 isn't yet complete.

Having said that, there's no problem with using things like snprintf(),
which weren't in older ISO C, but were standardised in C99.  Basically, if
your code compiles with -ansi, you should be in good shape.  You'll have to
avoid new C++-like constructs like variable-length arrays, // comments,
mixed code/variable declarations, etc. which don't compile with -ansi.

Hope this clears things up.
.

Path: shelby.stanford.edu!not-for-mail
From: Woodley Packard <sweagles@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: CDUP command
Date: Thu, 8 Jan 2004 08:28:59 +0000 (UTC)
Lines: 4
Distribution: su
Message-ID: <btj4cb$dik$1@news.Stanford.EDU>
NNTP-Posting-Host: firebird5.stanford.edu
X-Trace: news.Stanford.EDU 1073550539 13908 171.64.15.18 (8 Jan 2004 08:28:59 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.4.20-28.9 (i686))
Xref: shelby.stanford.edu su.class.cs244a:4969

The RFC referenced from the assignment (959) specifies the 'CDUP' command as a way of changing to the parent directory. The utility of such a command is that not all operating systems / ftp servers use ".." as the parent directory name, so "CWD .." might not be appropriate.  The RFC also, however, specifies that 'CDUP' is an optional command (i.e. a server might not support it, I suppose).  Are we allowed to use 'CDUP'?

Thanks,
-Woodley Packard
.

Path: shelby.stanford.edu!not-for-mail
From: Woodley Packard <sweagles@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Result code 550
Date: Thu, 8 Jan 2004 09:16:27 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <btj75b$g3r$1@news.Stanford.EDU>
NNTP-Posting-Host: firebird5.stanford.edu
X-Trace: news.Stanford.EDU 1073553387 16507 171.64.15.18 (8 Jan 2004 09:16:27 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.4.20-28.9 (i686))
Xref: shelby.stanford.edu su.class.cs244a:4970

Hi,

The assignment says we should silently ignore files/directories which we
do not have permission to access, but give up and print an error if we
encounter a "real" error.  I assume this includes "No such file or
directory" (e.g. if the root directory specified by the user doesn't
exist).  

FTP uses code 550 for both of these cases, and the text following the
code (which to a human easily distinguishes the two cases) is
(potentially) server dependent.  What is a reliable way of
distinguishing between these two situations?

Thanks,
-Woodley Packard
.

Path: shelby.stanford.edu!not-for-mail
From: David Chan <dmchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Details on the Friday "Review Session"
Date: Thu, 08 Jan 2004 01:34:29 -0800
Lines: 29
Distribution: su
Message-ID: <btj876$gqn$1@news.Stanford.EDU>
References: <bthcrk$qvu$1@news.Stanford.EDU> <Pine.LNX.4.44.0401070910070.9554-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: sprun.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1073554470 17239 128.12.57.21 (8 Jan 2004 09:34:30 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4
X-Accept-Language: en-us, en
In-Reply-To: <Pine.LNX.4.44.0401070910070.9554-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:4971

Is the review session going to be meeting in GatesB1 as well?

Dave

Martin Casado wrote:

>>Can you give some details on the Friday review sessions?
>>- In general, what is the focus?
> 
> 
>  The review sessions cover a different topic each week, but generally provide
>  more details on current class subjects and programming assignments as well as
>  reviews for the midterm and the final. 
> 
> 
>>- Is attendance "required"?
> 
> 
>  nope, but recommended :)
> 
> 
>>- Is the Friday 2:15 - 3:05 session the only one? Is this time definite, or
>>might it change?
> 
> 
>  As far as I know that is the only session and the time is set. 
> 
>  .mc
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Use of C99 extensions?
Date: Thu, 08 Jan 2004 09:10:00 -0800
Lines: 16
Distribution: su
Message-ID: <3FFD8EE8.4E0483B0@stanford.edu>
References: <btio4g$s6e$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1073581803 16069 127.0.0.1 (8 Jan 2004 17:10:03 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:4972

Greg Friedman wrote:
> 
> I asked in class whether or not we can use the C99 extensions in our
> programming assignments. I'm not sure I know what the answer was.
> 
> So -- can we use C99, instead of old Ansi C?

Off topic, but just one small note for your information:

C99 is not an "extension" any more; it's the standard.
ISO C99 standard has replaced the old ISO C90,
so "the C language" now officially means C99.
(Of course it's not what most people would feel.. :-))

-- 
Seungbeom Kim
.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: CDUP command
Date: Thu, 8 Jan 2004 22:51:58 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <btkmue$94o$1@news.Stanford.EDU>
References: <btj4cb$dik$1@news.Stanford.EDU>
NNTP-Posting-Host: cardinal3.stanford.edu
X-Trace: news.Stanford.EDU 1073602318 9368 171.64.15.251 (8 Jan 2004 22:51:58 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.4.20-28.9smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:4973

For purposes of this assignment, you can use "CWD ..". (Strictly speaking, 
both CDUP and CWD are not required as part of the minimum implementation 
of an FTP server per the RFC, so a more robust solution will need 
to do without CWD/CDUP (perhaps by using full pathnames with RETR and 
LIST)

Shankar

Woodley Packard <sweagles@stanford.edu> wrote:
: The RFC referenced from the assignment (959) specifies the 'CDUP' command as a way of changing to the parent directory. The utility of such a command is that not all operating systems / ftp servers use ".." as the parent directory name, so "CWD .." might not be appropriate.  The RFC also, however, specifies that 'CDUP' is an optional command (i.e. a server might not support it, I suppose).  Are we allowed to use 'CDUP'?

: Thanks,
: -Woodley Packard
.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Result code 550
Date: Thu, 8 Jan 2004 23:15:03 +0000 (UTC)
Lines: 23
Distribution: su
Message-ID: <btko9n$94o$2@news.Stanford.EDU>
References: <btj75b$g3r$1@news.Stanford.EDU>
NNTP-Posting-Host: cardinal3.stanford.edu
X-Trace: news.Stanford.EDU 1073603703 9368 171.64.15.251 (8 Jan 2004 23:15:03 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.4.20-28.9smp (i686))
Xref: shelby.stanford.edu su.class.cs244a:4974

Woodley Packard <sweagles@stanford.edu> wrote:
: Hi,

: The assignment says we should silently ignore files/directories which we
: do not have permission to access, but give up and print an error if we
: encounter a "real" error.  I assume this includes "No such file or
: directory" (e.g. if the root directory specified by the user doesn't
: exist).  

In the case when you get a 550 when cd'ing to the root directory specified 
by the user, you can print an error. In other cases, you can silently 
ignore the directory when you get a 550.

Shankar


: FTP uses code 550 for both of these cases, and the text following the
: code (which to a human easily distinguishes the two cases) is
: (potentially) server dependent.  What is a reliable way of
: distinguishing between these two situations?

: Thanks,
: -Woodley Packard
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Details on the Friday "Review Session"
Date: Thu, 8 Jan 2004 15:58:25 -0800
Lines: 40
Distribution: su
Message-ID: <Pine.LNX.4.44.0401081554260.9901-100000@Xenon.Stanford.EDU>
References: <bthcrk$qvu$1@news.Stanford.EDU> <Pine.LNX.4.44.0401070910070.9554-100000@Xenon.Stanford.EDU>
 <btj876$gqn$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073606307 14167 171.64.66.201 (8 Jan 2004 23:58:27 GMT)
X-Complaints-To: news@news.stanford.edu
To: David Chan <dmchan@stanford.edu>
In-Reply-To: <btj876$gqn$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:4975


> Is the review session going to be meeting in GatesB1 as well?

 From the website:

 "Lectures: Tue, Thu 2:45-4:00PM, Gates B01 / SITN live, Channel E3
  Review sessions: Fri 2:15-3:05PM, Gates B03 / SITN live, Channel E4"

 .m

> 
> Dave
> 
> Martin Casado wrote:
> 
> >>Can you give some details on the Friday review sessions?
> >>- In general, what is the focus?
> > 
> > 
> >  The review sessions cover a different topic each week, but generally provide
> >  more details on current class subjects and programming assignments as well as
> >  reviews for the midterm and the final. 
> > 
> > 
> >>- Is attendance "required"?
> > 
> > 
> >  nope, but recommended :)
> > 
> > 
> >>- Is the Friday 2:15 - 3:05 session the only one? Is this time definite, or
> >>might it change?
> > 
> > 
> >  As far as I know that is the only session and the time is set. 
> > 
> >  .mc
> > 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Use of C99 extensions?
Date: Fri, 9 Jan 2004 00:26:46 +0000 (UTC)
Lines: 35
Distribution: su
Message-ID: <btksg6$eeq$1@news.Stanford.EDU>
References: <btio4g$s6e$1@news.Stanford.EDU> <btiquc$2ht$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine10.stanford.edu
X-Trace: news.Stanford.EDU 1073608006 14810 171.64.15.75 (9 Jan 2004 00:26:46 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:4976

Matthew Jonathan Holliman <holliman@stanford.edu> wrote:

>>So -- can we use C99, instead of old Ansi C?

> Unfortunately, no--the grading scripts for some of the assignments
> at present assume ISO C (-ansi).  They may well work with C99 code, but I
> haven't tested this

I am not sure I understand this.  Looking at the grading guidelines, it
appears that all the automated tests are working out of the submitted
executable, not the source code.  Since a makefile is also to be submitted by
the student, the only difference between a C99 and C90 submission would be a
compiler flag (-std=c99) in that makefile.  If the grading script is using 
this makefile, it shouldn't care which dialect of C is used.

Reiterating the reasons for favoring C99:

- No longer need to put declarations at the beginning of functions;
- Supports C++ style comments (//)
- External identifiers can be 31 characters instead of just 6;
- Macros can take variable arguments;
- _Bool type;
- Allows automatic prevention of aliased pointers;
- Can declare variables inside a for loop;
- Can initialize struct members by name.  This is a BIG boost in code that 
uses lots of structs, as in this course;

Gcc 3.3 supports all of these (see http://gcc.gnu.org/gcc-3.3/c99status.html 
for a complete list) 

I think a lot of students would welcome the chance to use this facilities, and 
it would certainly ease the transition from C++ back to C.

Tyrone Nicholas

.

Path: shelby.stanford.edu!elaine34.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Use of C99 extensions?
Date: Fri, 9 Jan 2004 01:20:48 +0000 (UTC)
Lines: 17
Distribution: su
Message-ID: <btkvlg$jf6$1@news.Stanford.EDU>
References: <btio4g$s6e$1@news.Stanford.EDU> <btiquc$2ht$1@news.Stanford.EDU> <btksg6$eeq$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine34.stanford.edu
X-Trace: news.Stanford.EDU 1073611248 19942 171.64.15.109 (9 Jan 2004 01:20:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:4977

Tyrone Nicholas <tyronen@Stanford.EDU> writes:

>I am not sure I understand this.  Looking at the grading guidelines, it
>appears that all the automated tests are working out of the submitted
>executable, not the source code.  Since a makefile is also to be submitted by
>the student, the only difference between a C99 and C90 submission would be a
>compiler flag (-std=c99) in that makefile.  If the grading script is using 
>this makefile, it shouldn't care which dialect of C is used.


This is correct for HW#1, in which you write all the code and provide your
own Makefile.  However, for HW#2-4, we provide stub code and a Makefile.
This stub code may or may not work with C99--chances are that it will, I
can't see why it wouldn't, but we haven't verified this.  Moreover, for
HW#3, we substitute our own Makefile during grading, and again this
requires verification that everything works as expected with the new flag.

.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Use of C99 extensions?
Date: Thu, 8 Jan 2004 17:46:45 -0800
Organization: CS Masters Program
Lines: 55
Distribution: su
Message-ID: <btl16f$l6n$1@news.Stanford.EDU>
References: <btio4g$s6e$1@news.Stanford.EDU> <btiquc$2ht$1@news.Stanford.EDU> <btksg6$eeq$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1073612818 21719 127.0.0.1 (9 Jan 2004 01:46:58 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:4978

I have to agree with Tyrone; C99 is a significantly more pleasant language
in which to code, as compared to old Ansi C.

Does anyone know how upward-compatible C99 is with Ansi C? (If the answer is
"completely" or "99%", perhaps the grading scripts would be really easy to
update...)

Thanks,

Greg

"Tyrone Nicholas" <tyronen@Stanford.EDU> wrote in message
news:btksg6$eeq$1@news.Stanford.EDU...
> Matthew Jonathan Holliman <holliman@stanford.edu> wrote:
>
> >>So -- can we use C99, instead of old Ansi C?
>
> > Unfortunately, no--the grading scripts for some of the assignments
> > at present assume ISO C (-ansi).  They may well work with C99 code, but
I
> > haven't tested this
>
> I am not sure I understand this.  Looking at the grading guidelines, it
> appears that all the automated tests are working out of the submitted
> executable, not the source code.  Since a makefile is also to be submitted
by
> the student, the only difference between a C99 and C90 submission would be
a
> compiler flag (-std=c99) in that makefile.  If the grading script is using
> this makefile, it shouldn't care which dialect of C is used.
>
> Reiterating the reasons for favoring C99:
>
> - No longer need to put declarations at the beginning of functions;
> - Supports C++ style comments (//)
> - External identifiers can be 31 characters instead of just 6;
> - Macros can take variable arguments;
> - _Bool type;
> - Allows automatic prevention of aliased pointers;
> - Can declare variables inside a for loop;
> - Can initialize struct members by name.  This is a BIG boost in code that
> uses lots of structs, as in this course;
>
> Gcc 3.3 supports all of these (see
http://gcc.gnu.org/gcc-3.3/c99status.html
> for a complete list)
>
> I think a lot of students would welcome the chance to use this facilities,
and
> it would certainly ease the transition from C++ back to C.
>
> Tyrone Nicholas
>


.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: open file descriptors
Date: Thu, 8 Jan 2004 17:47:39 -0800
Lines: 6
Distribution: su
Message-ID: <20040108174739.7bbab57b.chanman@stanford.edu>
NNTP-Posting-Host: chanman.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1073612892 7583 128.12.94.94 (9 Jan 2004 01:48:12 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed version 0.9.6 (GTK+ 1.2.10; i386-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:4979

Hi,

What file descriptors are we allowed to have open if any at all?
My purify output indicates stdin, stdout, and stderr are open, all of which seem reasonable to me.  Also, purify has 2 descriptors open which seems fine.  However, I have another file descriptor left open, allocated by gethostbyname apparently.  Can I leave this descriptor open or how can I close this one?

--William
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Use of C99 extensions?
Date: Thu, 8 Jan 2004 18:38:35 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.LNX.4.44.0401081823300.30690-100000@Xenon.Stanford.EDU>
References: <btio4g$s6e$1@news.Stanford.EDU> <btiquc$2ht$1@news.Stanford.EDU>
 <btksg6$eeq$1@news.Stanford.EDU> <btl16f$l6n$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073615917 28154 171.64.66.201 (9 Jan 2004 02:38:37 GMT)
X-Complaints-To: news@news.stanford.edu
To: Greg Friedman <gregory.friedman@cs.stanford.edu>
In-Reply-To: <btl16f$l6n$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:4980


> I have to agree with Tyrone; C99 is a significantly more pleasant language
> in which to code, as compared to old Ansi C.

  I don't think this is necessarily up for debate.  Matt has the most
  experience with the grading scripts and if he thinks C99 support may throw a
  kink in the process it isn't worth the danger of potential problems while
  grading 100 student submissions accurately in a short time.  We are all aware
  of the benefits to using C99, and would prefer to use it ... believe me.  In
  the future it should certainly be supported, however for now (or until you
  get Matt or Nick's approval), you should write your programs in crusty ol'
  ansi c.
  
  .mc

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS1 bonus question
Date: Fri, 9 Jan 2004 04:09:15 +0000 (UTC)
Lines: 19
Distribution: su
Message-ID: <btl9hb$3tp$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine10.stanford.edu
X-Trace: news.Stanford.EDU 1073621355 4025 171.64.15.75 (9 Jan 2004 04:09:15 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:4981

Does part (a) mean

"What is the probability, *if a family has five children*, that four will 
be sons and one a daughter?"

or

"What is the probability that a family will have five children, *and* that 
four of those will be sons and one a daughter?"

i.e. a conditional or joint probability.

The second (joint) seems to match the wording of the question, but as far 
as I can tell, there is not enough information to answer it.  Or do we 
simply assume that the first daughter is always the last child?

Ditto for part (b).


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: open file descriptors
Date: Thu, 8 Jan 2004 20:09:35 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0401082003520.24089-100000@Xenon.Stanford.EDU>
References: <20040108174739.7bbab57b.chanman@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073621378 4219 171.64.66.201 (9 Jan 2004 04:09:38 GMT)
X-Complaints-To: news@news.stanford.edu
To: William Chan <chanman@stanford.edu>
In-Reply-To: <20040108174739.7bbab57b.chanman@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:4982


> Hi,
> 
> What file descriptors are we allowed to have open if any at all?  My purify
> output indicates stdin, stdout, and stderr are open, all of which seem
> reasonable to me.  Also, purify has 2 descriptors open which seems fine.
> However, I have another file descriptor left open, allocated by gethostbyname
> apparently.  Can I leave this descriptor open or how can I close this one?

   Certainly stdin, stdout and stderr are expected to be open.  You should
   call endhostent(..) before exiting.  From the man page:

   "endhostent() may be  called  to  indicate  that  the  caller expects  to
   do  no further host entry retrieval operations; the system may then
   deallocate resources it was using.   It is  still allowed, but possibly less
   efficient, for the pro- cess to call more host  retrieval  functions  after
   calling endhostent()."

   :)
   .m

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: open file descriptors
Date: Thu, 8 Jan 2004 20:19:39 -0800
Lines: 28
Distribution: su
Message-ID: <20040108201939.08f6bf8d.chanman@stanford.edu>
References: <20040108174739.7bbab57b.chanman@stanford.edu>
	<Pine.LNX.4.44.0401082003520.24089-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: chanman.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1073622013 7583 128.12.94.94 (9 Jan 2004 04:20:13 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed version 0.9.6 (GTK+ 1.2.10; i386-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:4983

On Thu, 8 Jan 2004 20:09:35 -0800
Martin Casado <casado@Xenon.Stanford.EDU> wrote:

Yeah, I read that and I did call endhostent().  No go.  On the other hand, I didn't call sethostent before, do I need to call that?

--William

> 
> > Hi,
> > 
> > What file descriptors are we allowed to have open if any at all?  My purify
> > output indicates stdin, stdout, and stderr are open, all of which seem
> > reasonable to me.  Also, purify has 2 descriptors open which seems fine.
> > However, I have another file descriptor left open, allocated by gethostbyname
> > apparently.  Can I leave this descriptor open or how can I close this one?
> 
>    Certainly stdin, stdout and stderr are expected to be open.  You should
>    call endhostent(..) before exiting.  From the man page:
> 
>    "endhostent() may be  called  to  indicate  that  the  caller expects  to
>    do  no further host entry retrieval operations; the system may then
>    deallocate resources it was using.   It is  still allowed, but possibly less
>    efficient, for the pro- cess to call more host  retrieval  functions  after
>    calling endhostent()."
> 
>    :)
>    .m
> 
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: open file descriptors
Date: Thu, 8 Jan 2004 20:42:11 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0401082037010.32018-100000@Xenon.Stanford.EDU>
References: <20040108174739.7bbab57b.chanman@stanford.edu>
 <Pine.LNX.4.44.0401082003520.24089-100000@Xenon.Stanford.EDU>
 <20040108201939.08f6bf8d.chanman@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073623333 6282 171.64.66.201 (9 Jan 2004 04:42:13 GMT)
X-Complaints-To: news@news.stanford.edu
To: William Chan <chanman@stanford.edu>
In-Reply-To: <20040108201939.08f6bf8d.chanman@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:4984


> 
> Yeah, I read that and I did call endhostent().  No go.  On the other hand, I
> didn't call sethostent before, do I need to call that?

  Actually from my understanding of sethostent()/endhostent() they are for
  doing DNS over TCP. You may want to try sethostent()/endhostent() to see if
  the implementation is cleaner.  Honestly, a single file descriptor leaked
  from gethostbyname(..) wont reflect negatively on your grade.  Leaving a
  socket open on the other hand ....

  .mc

.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 bonus question
Date: Fri, 9 Jan 2004 04:45:45 +0000 (UTC)
Lines: 25
Distribution: su
Message-ID: <btlblp$65p$1@news.Stanford.EDU>
References: <btl9hb$3tp$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine30.stanford.edu
X-Trace: news.Stanford.EDU 1073623545 6329 171.64.15.105 (9 Jan 2004 04:45:45 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:4985

Tyrone Nicholas <tyronen@stanford.edu> wrote:
: Does part (a) mean

: "What is the probability, *if a family has five children*, that four will 
: be sons and one a daughter?"

: or

: "What is the probability that a family will have five children, *and* that 
: four of those will be sons and one a daughter?"

: i.e. a conditional or joint probability.

It means the latter. Regarding the question below, there is enough 
information in the question to answer this.

Shankar

: The second (joint) seems to match the wording of the question, but as far 
: as I can tell, there is not enough information to answer it.  Or do we 
: simply assume that the first daughter is always the last child?

: Ditto for part (b).


.

Path: shelby.stanford.edu!elaine27.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: open file descriptors
Date: Fri, 9 Jan 2004 04:58:57 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <btlceh$6v5$1@news.Stanford.EDU>
References: <20040108174739.7bbab57b.chanman@stanford.edu>  <Pine.LNX.4.44.0401082003520.24089-100000@Xenon.Stanford.EDU>  <20040108201939.08f6bf8d.chanman@stanford.edu> <Pine.LNX.4.44.0401082037010.32018-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine27.stanford.edu
X-Trace: news.Stanford.EDU 1073624337 7141 171.64.15.102 (9 Jan 2004 04:58:57 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:4986



BTW, the grading script checks for this particular case--it won't penalise
you for this descriptor (/etc/.name_service_door) as it's an expected
error (likewise for stdout, stderr, the Purify descriptors, etc.)  It will
check only for other descriptors, e.g. sockets or files that you've opened
yourself.

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: open file descriptors
Date: Thu, 8 Jan 2004 21:39:15 -0800
Lines: 18
Distribution: su
Message-ID: <20040108213915.2a36b8d9.chanman@stanford.edu>
References: <20040108174739.7bbab57b.chanman@stanford.edu>
	<Pine.LNX.4.44.0401082003520.24089-100000@Xenon.Stanford.EDU>
	<20040108201939.08f6bf8d.chanman@stanford.edu>
	<Pine.LNX.4.44.0401082037010.32018-100000@Xenon.Stanford.EDU>
	<btlceh$6v5$1@news.Stanford.EDU>
NNTP-Posting-Host: chanman.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1073626789 7583 128.12.94.94 (9 Jan 2004 05:39:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed version 0.9.6 (GTK+ 1.2.10; i386-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:4987

Yeah, I noticed the grading script didn't catch it, but then I saw this in the grading guideline:
N**  	Purify: Socket or file descriptors left open  	-0.5

Anyway, if you guys don't mind, I won't bother then.  Just for personal reference though, you say it's an expected error.  Does that mean it's impossible to close?  Or is there a way to close it that I'm not getting?

--William

On Fri, 9 Jan 2004 04:58:57 +0000 (UTC)
holliman@Stanford.EDU (Matthew Jonathan Holliman) wrote:

> 
> 
> BTW, the grading script checks for this particular case--it won't penalise
> you for this descriptor (/etc/.name_service_door) as it's an expected
> error (likewise for stdout, stderr, the Purify descriptors, etc.)  It will
> check only for other descriptors, e.g. sockets or files that you've opened
> yourself.
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: transmit time vs propagation delay
Date: Fri, 9 Jan 2004 07:17:24 +0000 (UTC)
Lines: 16
Distribution: su
Message-ID: <btlki3$ea3$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine30.stanford.edu
X-Trace: news.Stanford.EDU 1073632644 14659 171.64.15.105 (9 Jan 2004 07:17:24 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:4988

I got an email from a student who didn't understand the difference between 
transmit time and propagation delay correctly. Transmit time is the time 
it takes to put the bits on the wire, while propagation delay is the time 
it takes for a given bit to travel from one end of the wire to the other.
This distiction is important to understand to solve the problems in 
problem set 1. Maybe this analogy might help you:

Suppose that you are transporting 1000 packages from stanford to seattle 
using a truck. Transmit time is analogous to the load time (i.e, the time 
it takes to load the 1000 packages onto the truck), while propagation 
delay is analogous to the driving time (i.e., the time it takes to drive 
from stanford to seattle.)

Of course, don't carry the analogy too far :-)

Shankar
.

Path: shelby.stanford.edu!not-for-mail
From: "Louis Eisenberg" <tarheel@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 #1d
Date: Fri, 9 Jan 2004 00:38:59 -0800
Lines: 5
Distribution: su
Message-ID: <btlpas$lbi$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1073637533 21874 127.0.0.1 (9 Jan 2004 08:38:53 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:4989

Can we assume anything about the variability of the first day of class? Is
this the same date each year, different each year, etc.? It seems like this
might change the answer.


.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Question for the content in textbook
Date: Fri, 9 Jan 2004 00:45:16 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.GSO.4.44.0401090041440.26774-100000@elaine9.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073637924 22308 171.64.15.74 (9 Jan 2004 08:45:24 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:4990

On page 46, the first paragraph,  it mentioned:

"... that abount correxpnds to 5.5 x 10**6 ..."

I thought the delay x bandwidth mentioned on page 45 is 2.25 x 10**6.  Is
this a mistake in the textbook, or am I missing something?

-Laura

.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 #1d
Date: Fri, 9 Jan 2004 08:59:10 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <btlqgu$mat$1@news.Stanford.EDU>
References: <btlpas$lbi$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine30.stanford.edu
X-Trace: news.Stanford.EDU 1073638750 22877 171.64.15.105 (9 Jan 2004 08:59:10 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:4991

Good point :-) You can assume it is the same date each year.

Shankar

Louis Eisenberg <tarheel@stanford.edu> wrote:
: Can we assume anything about the variability of the first day of class? Is
: this the same date each year, different each year, etc.? It seems like this
: might change the answer.


.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine3.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: open file descriptors
Date: 09 Jan 2004 09:58:47 -0800
Organization: Stanford University, CA, USA
Lines: 23
Distribution: su
Message-ID: <snnzncx0zs8.fsf@elaine3.Stanford.EDU>
References: <20040108174739.7bbab57b.chanman@stanford.edu> <Pine.LNX.4.44.0401082003520.24089-100000@Xenon.Stanford.EDU> <20040108201939.08f6bf8d.chanman@stanford.edu> <Pine.LNX.4.44.0401082037010.32018-100000@Xenon.Stanford.EDU> <btlceh$6v5$1@news.Stanford.EDU> <20040108213915.2a36b8d9.chanman@stanford.edu>
NNTP-Posting-Host: elaine3.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1073671127 26723 171.64.15.68 (9 Jan 2004 17:58:47 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:4992

William Chan <chanman@stanford.edu> writes:

> Yeah, I noticed the grading script didn't catch it, but then I saw this in the grading guideline:
> N**  	Purify: Socket or file descriptors left open  	-0.5
> 
> Anyway, if you guys don't mind, I won't bother then.  Just for personal reference though, you say it's an expected error.  Does that mean it's impossible to close?  Or is there a way to close it that I'm not getting?
> 
> --William

I don't know if it's impossible close...I'll check and respond later.  In
the meantime, I can give you a little more info about what the
..names_service_door file actually is.  (This information/most of the text
was pulled from the Sun managers mailing list):

It's a file-based semaphore used to communicate quickly with nscd, the
nameservice cache daemon.  A door is Sun's name for something similar to a
"named pipe"--it enables fast messaging between the kernel and
applications. As you mentioned earlier, the names_service_door is used by
gethostname and similar calls to access the nscd.  According the mailing
list the file is actually created at boot time when the system read
/etc/nsswitch.conf.

Susan
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine3.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: open file descriptors
Date: 09 Jan 2004 10:11:15 -0800
Organization: Stanford University, CA, USA
Lines: 18
Distribution: su
Message-ID: <snnu1350z7g.fsf@elaine3.Stanford.EDU>
References: <20040108174739.7bbab57b.chanman@stanford.edu> <Pine.LNX.4.44.0401082003520.24089-100000@Xenon.Stanford.EDU> <20040108201939.08f6bf8d.chanman@stanford.edu> <Pine.LNX.4.44.0401082037010.32018-100000@Xenon.Stanford.EDU> <btlceh$6v5$1@news.Stanford.EDU> <20040108213915.2a36b8d9.chanman@stanford.edu> <snnzncx0zs8.fsf@elaine3.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1073671875 27869 171.64.15.68 (9 Jan 2004 18:11:15 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:4993

Susan Noreen Shepard <shepard8@elaine3.Stanford.EDU> writes:

Here's some more detail from Martin Casado:

 Seriously though, .names_service_door is one of Solaris's cryptic
"doors" which is sun's version of a named pipe.  Last I knew, doors were
complex, undocumented and experimental.  If you look at the
call stack that opened the file descriptor it is in one of these door
calls which is called from gethostbyname_r(..).  That suggests that the
door handle returned from the internal method is never closed or that
the internal door implementation leaks.  This isn't an easy thing to
discern since we don't have access to the source and we aren't Solaris
system's programming gurus.


Sorry there isn't a better answer for you.

Susan
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine3.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Question for the content in textbook
Date: 09 Jan 2004 10:23:21 -0800
Organization: Stanford University, CA, USA
Lines: 33
Distribution: su
Message-ID: <snnptdt0yna.fsf@elaine3.Stanford.EDU>
References: <Pine.GSO.4.44.0401090041440.26774-100000@elaine9.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1073672601 27869 171.64.15.68 (9 Jan 2004 18:23:21 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:4994

Xiaohua Fang <xxf5@stanford.edu> writes:

(I only have the 2nd edition of the textbook, so I'll need to check the
latest edition later today to make sure we're talking about the same
problem, but...)

2.25 x 10**6 refers to the one-way latency. ie. the volume of the
pipe (how many bits it can hold)

5.5 x 10**6 is actually the roundtrip time (RTT), which is still (sort of)
delay x bandwidth. It is (2 x delay) x bandwidth.  Instead of telling you
the *volume* of the pipe, RTT tells you the minimum time the sender will have
to wait to get an acknowledgement that a bit was receive by the receiver.
(ie. It takes delay x bandwidth time for the bit to go from the sender to
the receiver.  It takes the same amount of time for the acknowledgement
bit to go from the receiver to the sender.  This ignores any transmission
or processing time at either end).

So, at least in my addition there is no typo. In my edition the textbook
goes on to say that "delay x bandwidth" can mean either the one-way
latency--the volume (1 x delay x bandwidth) or RTT (2 x delay x bandwidth)
and that you can which is desired by the context.

Susan

> On page 46, the first paragraph,  it mentioned:
> 
> "... that abount correxpnds to 5.5 x 10**6 ..."
> 
> I thought the delay x bandwidth mentioned on page 45 is 2.25 x 10**6.  Is
> this a mistake in the textbook, or am I missing something?
> 
> -Laura
.

Path: shelby.stanford.edu!elaine27.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Susan's leland ID/submitting HW
Date: Fri, 9 Jan 2004 18:47:03 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <btmsv7$19p$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine27.stanford.edu
X-Trace: news.Stanford.EDU 1073674023 1337 171.64.15.102 (9 Jan 2004 18:47:03 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:4995


We (I) goofed in the TA assignment procedure... for those of you assigned
to Susan (shepard@cs.stanford.edu), the leland ID to use when submitting
your programming assignment is 'shepard8'.

.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine3.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Question for the content in textbook
Date: 09 Jan 2004 15:05:16 -0800
Organization: Stanford University, CA, USA
Lines: 47
Distribution: su
Message-ID: <snnk740205v.fsf@elaine3.Stanford.EDU>
References: <Pine.GSO.4.44.0401090041440.26774-100000@elaine9.Stanford.EDU> <snnptdt0yna.fsf@elaine3.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1073689516 20298 171.64.15.68 (9 Jan 2004 23:05:16 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:4998

Susan Noreen Shepard <shepard8@elaine3.Stanford.EDU> writes:

I just realized my previous answer probably doesn't make sense.

I referred to the delay x bandwidth product using the one-way latency as
the volume of the pipe.  Actually the products using either one-way
latency or RTT are *both* volumes of the pipe.  So,

2.25 x 10**6 is the volume using the one-way latency (50ms).

and

5.5 x 10**6 is the volume using the roundtrip time (RTT) (100ms)

These results are delay x bandwidth products *not* the one-way latency or
roundtrip time themselves. One-way latency and RTT are the two delay
values that can be used in determining the product.
The results are still not a typo.  Both are valid interpretations of the
delay x bandwidth product.  Both are volumes.  Context determines which 
you are interested in.

Sorry for any confusion.

Susan

> Xiaohua Fang <xxf5@stanford.edu> writes:
> 
> (I only have the 2nd edition of the textbook, so I'll need to check the
> latest edition later today to make sure we're talking about the same
> problem, but...)
> 
> 2.25 x 10**6 refers to the one-way latency. ie. the volume of the
> pipe (how many bits it can hold)
> 
> 5.5 x 10**6 is actually the roundtrip time (RTT), which is still (sort of)
> delay x bandwidth. It is (2 x delay) x bandwidth.  Instead of telling you
> the *volume* of the pipe, RTT tells you the minimum time the sender will have
> to wait to get an acknowledgement that a bit was receive by the receiver.
> (ie. It takes delay x bandwidth time for the bit to go from the sender to
> the receiver.  It takes the same amount of time for the acknowledgement
> bit to go from the receiver to the sender.  This ignores any transmission
> or processing time at either end).
> 
> So, at least in my addition there is no typo. In my edition the textbook
> goes on to say that "delay x bandwidth" can mean either the one-way
> latency--the volume (1 x delay x bandwidth) or RTT (2 x delay x bandwidth)
> and that you can which is desired by the context.
.

Message-ID: <3FFF6168.5040801@stanford.edu>
Date: Fri, 09 Jan 2004 18:20:34 -0800
From: Sumeet Shendrikar <sumeets@stanford.edu>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: su.class.cs244a@news.stanford.edu
Subject: determining if all data received
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 15
Newsgroups: su.class.cs244a
Organization: Stanford University Posting Gateway (mailtonews 1.7/0.42)
Path: shelby.stanford.edu!mail-to-news!smtp-roam.stanford.edu
Sender: news@news.stanford.edu
X-Mail-Path: smtp-roam.stanford.edu!rescomp-03-60149.Stanford.EDU!sumeets@stanford.edu
X-Original-Date: Fri, 09 Jan 2004 18:20:24 -0800
Xref: shelby.stanford.edu su.class.cs244a:4999

hi,

how can a process tell if all of the bytes have been received?

Example:
client sends data server, receives a response from server.

how can the client tell if the entire response from the server has been 
received without knowing the size of the response before?

I tried to write a loop that would repeatedly call "read()" until it 
returned 0, but this hung the loop on the call to "read()".

thanks,
sumeet
.

Path: shelby.stanford.edu!not-for-mail
From: "Louis Eisenberg" <tarheel@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 #4, plus general question
Date: Fri, 9 Jan 2004 20:54:01 -0800
Lines: 10
Distribution: su
Message-ID: <bto0gv$h40$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1073710431 17536 127.0.0.1 (10 Jan 2004 04:53:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5000

In #4, it says that consecutive packets must be separated by at least G
seconds. Say it takes X seconds to transmit each packet, where X > G -- in
this case, is the restriction irrelevant? Or does it mean that the
transmitter sends a packet, then waits G seconds, then sends another packet?

Also, is the problem set really due on Wednesday? This seems a little
unreasonable considering we haven't covered a lot of the material yet (and
won't until Tuesday).


.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine3.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: determining if all data received
Date: 09 Jan 2004 23:19:30 -0800
Organization: Stanford University, CA, USA
Lines: 33
Distribution: su
Message-ID: <snneku81da5.fsf@elaine3.Stanford.EDU>
References: <3FFF6168.5040801@stanford.edu>
NNTP-Posting-Host: elaine3.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1073719170 21694 171.64.15.68 (10 Jan 2004 07:19:30 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5001

Sumeet Shendrikar <sumeets@stanford.edu> writes:

Are you refering to a socket reading the commands or the data?  I'm
assuming the commands.

Please read FAQ Q4 for homework 1.  The newsgroup from 2003
has some more information (see below) as well.  Please check the FAQ and
newsgroups first before posting.  If you're still confused, reply to this
thread with your questions.

It sounds like read the FTP RFC would help a lot to answer your questions.

Susan

Here's one of the responses by Martin last year (student's text is
prefaced by '>'):

> That means that I cant use buffered read. I will have to read server
> replies byte by byte till I get "\r\n", there is no conditional
> read(i.e.
> read till specific pattern), we have to specify a buffer size in read.
>
> So I will have to read the replies byte by byte till you get "\r\n" is
> that right??

 Actually no, that is not correct.  I would suspect that most students
 will
 choose to read byte-by-byte, but I assure you there is a more elegant and
 efficient way to do this.  I'll give you a hint:

 recv(sockfd,buf,len,MSG_PEEK)


.

Path: shelby.stanford.edu!elaine42.Stanford.EDU!mylesw
From: mylesw@Stanford.EDU (Myles Barrett Williams)
Newsgroups: su.class.cs244a
Subject: Re: determining if all data received
Date: Sat, 10 Jan 2004 08:32:32 +0000 (UTC)
Organization: Stanford University, CA 94305, USA
Lines: 18
Distribution: su
Message-ID: <btodb0$fn$1@news.Stanford.EDU>
References: <3FFF6168.5040801@stanford.edu> <snneku81da5.fsf@elaine3.Stanford.EDU>
NNTP-Posting-Host: elaine42.stanford.edu
X-Trace: news.Stanford.EDU 1073723552 503 171.64.15.117 (10 Jan 2004 08:32:32 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5002

In article <snneku81da5.fsf@elaine3.Stanford.EDU>,
Susan Noreen Shepard  <shepard8@elaine3.Stanford.EDU> wrote:
>Are you refering to a socket reading the commands or the data?  I'm
>assuming the commands.
>
>Please read FAQ Q4 for homework 1.  The newsgroup from 2003
>has some more information (see below) as well.  Please check the FAQ and
>newsgroups first before posting.  If you're still confused, reply to this
>thread with your questions.

I understand how to read each reply, but some servers send multiple
completion replies (e.g. ftp.stanford.edu when you connect).  Does the
protocol indicate explicitly which is the last one? I made a byte-by-
byte dump of the initial messages from ftp.stanford.edu and don't see
any useful difference between them (although I expected to, based on
the NVT spec).

Myles
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: determining if all data received
Date: Sat, 10 Jan 2004 09:56:06 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.LNX.4.44.0401100948400.18696-100000@Xenon.Stanford.EDU>
References: <3FFF6168.5040801@stanford.edu> <snneku81da5.fsf@elaine3.Stanford.EDU>
 <btodb0$fn$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073757369 29607 171.64.66.201 (10 Jan 2004 17:56:09 GMT)
X-Complaints-To: news@news.stanford.edu
To: Myles Barrett Williams <mylesw@Stanford.EDU>
In-Reply-To: <btodb0$fn$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5003

> 
> I understand how to read each reply, but some servers send multiple
> completion replies (e.g. ftp.stanford.edu when you connect).  Does the
> protocol indicate explicitly which is the last one? I made a byte-by-
> byte dump of the initial messages from ftp.stanford.edu and don't see
> any useful difference between them (although I expected to, based on
> the NVT spec).

  according to the rfc, section 4.2, to handle multi-line replys the 

  " .. user process then simply needs to search for the second occurance
    of the same reply code, followed by <SP> (space), at the beginning of
    a line, and ignore all intermediary lines. If an intermediary line
    begins with a 3-digit number, the Server must pad the front to
    avoid confusion."

  This tells you how to determine the final line in a multiline reply.

  .m

.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine3.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: determining if all data received
Date: 10 Jan 2004 10:01:10 -0800
Organization: Stanford University, CA, USA
Lines: 26
Distribution: su
Message-ID: <snn8ykf1y55.fsf@elaine3.Stanford.EDU>
References: <3FFF6168.5040801@stanford.edu> <snneku81da5.fsf@elaine3.Stanford.EDU> <btodb0$fn$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1073757670 29293 171.64.15.68 (10 Jan 2004 18:01:10 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5004

mylesw@Stanford.EDU (Myles Barrett Williams) writes:

> I understand how to read each reply, but some servers send multiple
> completion replies (e.g. ftp.stanford.edu when you connect).  Does the
> protocol indicate explicitly which is the last one? I made a byte-by-
> byte dump of the initial messages from ftp.stanford.edu and don't see
> any useful difference between them (although I expected to, based on
> the NVT spec).
> 
> Myles

I just connected to ftp.stanford.edu (I used telnet, btw...it's very
useful for seeing the messages print out).  It prints out *mult-line*
messages (all have same initial code).  Is that what you mean?
Or do you mean that it prints out multiple messages with different codes?
I didn't see the second behavior.

If this issue is *multi-line* responses, the FTP RFC explains how to
idenitfy multi-line (vs single-line) replies.  (hint: read section 4.2)
If you are getting multiple reply codes after an action, could you tell
me exactly what commands you sent ftp server (and what codes were returned)
so that I can duplicate the behavior and get back to you?

Thanks,

Susan
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine3.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 #4, plus general question
Date: 10 Jan 2004 10:05:19 -0800
Organization: Stanford University, CA, USA
Lines: 18
Distribution: su
Message-ID: <snn4qv31xy8.fsf@elaine3.Stanford.EDU>
References: <bto0gv$h40$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1073757919 29293 171.64.15.68 (10 Jan 2004 18:05:19 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5005

"Louis Eisenberg" <tarheel@stanford.edu> writes:

> In #4, it says that consecutive packets must be separated by at least G
> seconds. Say it takes X seconds to transmit each packet, where X > G -- in
> this case, is the restriction irrelevant? Or does it mean that the
> transmitter sends a packet, then waits G seconds, then sends another packet?

Let me get back to you on this question a little later today. 
 
> Also, is the problem set really due on Wednesday? This seems a little
> unreasonable considering we haven't covered a lot of the material yet (and
> won't until Tuesday).

But, I didn't want to wait to tell you that, yes, the homework is really
due on Wednesday.  This is a fast paced course.


Susan
.

Path: shelby.stanford.edu!elaine32.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: .h files
Date: Sat, 10 Jan 2004 10:21:23 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.GSO.4.44.0401101018570.27166-100000@elaine32.Stanford.EDU>
NNTP-Posting-Host: elaine32.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073758885 1220 171.64.15.107 (10 Jan 2004 18:21:25 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5006

in the last section entitled "Deliverables" of assign1 handout,
it says the submit script will pick up *.c, but has no mention of *.h?

I take this to mean that we are just supposed to implement this thing
in one big .c file and create no header files of our own, or am I missing
something?

--vishal

.

Path: shelby.stanford.edu!elaine34.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: .h files
Date: Sat, 10 Jan 2004 18:42:33 +0000 (UTC)
Lines: 20
Distribution: su
Message-ID: <btph2p$242$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401101018570.27166-100000@elaine32.Stanford.EDU>
NNTP-Posting-Host: elaine34.stanford.edu
X-Trace: news.Stanford.EDU 1073760153 2178 171.64.15.109 (10 Jan 2004 18:42:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5007


>in the last section entitled "Deliverables" of assign1 handout,
>it says the submit script will pick up *.c, but has no mention of *.h?

It says that a .c file is required.  Any .h file is optional--so you could
conceivably implement this all in one file if you wanted.  (I wouldn't
necessarily recommend this, of course).

>I take this to mean that we are just supposed to implement this thing
>in one big .c file and create no header files of our own, or am I missing
>something?

No--for example, if you're using the ftpparse library provided, you'll
presumably also have ftpparse.c and ftpparse.h in your project.

In short:  You can use as many *.c and *.h files as you want in this
assignment, just be sure to submit any file needed to compile your program.
When you submit, the script just tars any source files it finds in your
current working directory.

.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Any delays for EE qual takers?
Date: Sat, 10 Jan 2004 11:53:39 -0800
Lines: 6
Distribution: su
Message-ID: <40005843.6B93572D@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1073764421 6081 127.0.0.1 (10 Jan 2004 19:53:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U)
X-Accept-Language: ko,en
Xref: shelby.stanford.edu su.class.cs244a:5008

I heard that many classes allow late assignment submissions of a
week or so for people that take the EE Ph.D. Qualifying Examination.
Does this class also have such a policy for the first assignment?

-- 
Seungbeom Kim
.

Message-ID: <40008714.8050005@stanford.edu>
Date: Sat, 10 Jan 2004 15:13:29 -0800
From: Sumeet Shendrikar <sumeets@stanford.edu>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: su.class.cs244a@news.stanford.edu
Subject: Re: determining if all data received
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 10
Newsgroups: su.class.cs244a
Organization: Stanford University Posting Gateway (mailtonews 1.7/0.42)
Path: shelby.stanford.edu!mail-to-news!smtp-roam.stanford.edu
Sender: news@news.stanford.edu
X-Mail-Path: smtp-roam.stanford.edu!rescomp-03-60149.Stanford.EDU!sumeets@stanford.edu
X-Original-Date: Sat, 10 Jan 2004 15:13:24 -0800
Xref: shelby.stanford.edu su.class.cs244a:5009

I think my confusion stems from the FTP RFC:

"Every command must generate at least one
 reply, although there may be more than one; in the latter case,
 the multiple replies must be easily distinguished."

for an action, does this mean that there may be multiple reply codes or 
multiple lines to one reply code ( a multi-line response)?

thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine3.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 #4, plus general question
Date: 10 Jan 2004 16:49:29 -0800
Organization: Stanford University, CA, USA
Lines: 14
Distribution: su
Message-ID: <snnzncvz4va.fsf@elaine3.Stanford.EDU>
References: <bto0gv$h40$1@news.Stanford.EDU> <snn4qv31xy8.fsf@elaine3.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1073782169 22219 171.64.15.68 (11 Jan 2004 00:49:29 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5010

Susan Noreen Shepard <shepard8@elaine3.Stanford.EDU> writes:

> "Louis Eisenberg" <tarheel@stanford.edu> writes:
> 
> > In #4, it says that consecutive packets must be separated by at least G
> > seconds. Say it takes X seconds to transmit each packet, where X > G -- in
> > this case, is the restriction irrelevant? Or does it mean that the
> > transmitter sends a packet, then waits G seconds, then sends another packet?


It's the second interpretation: after you send a packet, there should be G
seconds with *no* sending before you send the next packet.

Susan
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine3.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Any delays for EE qual takers?
Date: 10 Jan 2004 16:50:17 -0800
Organization: Stanford University, CA, USA
Lines: 11
Distribution: su
Message-ID: <snnvfnjz4ty.fsf@elaine3.Stanford.EDU>
References: <40005843.6B93572D@stanford.edu>
NNTP-Posting-Host: elaine3.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1073782217 22219 171.64.15.68 (11 Jan 2004 00:50:17 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5011

Seungbeom Kim <sbkim@stanford.edu> writes:

> I heard that many classes allow late assignment submissions of a
> week or so for people that take the EE Ph.D. Qualifying Examination.
> Does this class also have such a policy for the first assignment?

No.  There are no extensions for students taking the ee quals.
The deadlines were chosen so that the first assignment is due after
quals.

Susan
.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Any delays for EE qual takers?
Date: Sat, 10 Jan 2004 17:20:29 -0800
Lines: 17
Distribution: su
Message-ID: <4000A4DD.E1651FFB@stanford.edu>
References: <40005843.6B93572D@stanford.edu> <snnvfnjz4ty.fsf@elaine3.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1073784031 24569 127.0.0.1 (11 Jan 2004 01:20:31 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U)
X-Accept-Language: ko,en
Xref: shelby.stanford.edu su.class.cs244a:5012

Susan Noreen Shepard wrote:
> 
> Seungbeom Kim <sbkim@stanford.edu> writes:
> 
> > I heard that many classes allow late assignment submissions of a
> > week or so for people that take the EE Ph.D. Qualifying Examination.
> > Does this class also have such a policy for the first assignment?
> 
> No.  There are no extensions for students taking the ee quals.
> The deadlines were chosen so that the first assignment is due after
> quals.

Oops, I was talking about the problem set #1,
due on 01/14 in the middle of the quals week.

-- 
Seungbeom Kim
.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PURIFY memory leaks
Date: Sat, 10 Jan 2004 18:11:27 -0800
Lines: 9
Distribution: su
Message-ID: <btqbd0$qn0$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1073787104 27360 128.12.90.43 (11 Jan 2004 02:11:44 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5013

Hi,
    I noticed in echodemo.c that none of the strings which are allocated
with malloc are ever freed, but when I run purify on it it tells me that
there are no leaked bytes. What's going on here?

Thanks,
Eddy


.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PURIFY memory leaks
Date: Sat, 10 Jan 2004 20:13:35 -0800
Organization: Stanford University
Lines: 21
Distribution: su
Message-ID: <pan.2004.01.11.04.13.33.839608@stanford.edu>
References: <btqbd0$qn0$1@news.Stanford.EDU>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1073794415 5408 128.12.69.27 (11 Jan 2004 04:13:35 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Xref: shelby.stanford.edu su.class.cs244a:5014

I dunno what to say about this; it worked for me, but I wanted to make
everyone aware that the version of purify that is installed on the Leland
cluster is incompatible with the version of gcc so purify won't exactly
report the proper locations of your leaks/memory access errors.  Just
something to be aware of.  I have already submitted a helpSU ticket about
this (there is a patch available) but I have not heard anything back.  If
everyone starts submitting complaints, however, I'm sure they'll have to
do something about this (easy to fix) problem.

--Chris

On Sat, 10 Jan 2004 18:11:27 -0800, Eddy Wu wrote:

> Hi,
>     I noticed in echodemo.c that none of the strings which are allocated
> with malloc are ever freed, but when I run purify on it it tells me that
> there are no leaked bytes. What's going on here?
> 
> Thanks,
> Eddy

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: determining if all data received
Date: Sat, 10 Jan 2004 21:25:35 -0800
Lines: 33
Distribution: su
Message-ID: <btqmp2$bb8$1@news.Stanford.EDU>
References: <3FFF6168.5040801@stanford.edu> <snneku81da5.fsf@elaine3.Stanford.EDU> <btodb0$fn$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1073798754 11624 128.12.90.43 (11 Jan 2004 05:25:54 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5015

I think I know why you might be getting confused about this. When you make a
connect() call to ftp.stanford.edu, it responds with a bunch of 220 replies
(the welcome message), ending with "220 ftp1.stanford.edu FTP server
ready.". The connect call triggers this, not any specific command that you
send over the control connection. So, if you were to call connect(), then
immediately send your USER command, it would reply with the 220 replies,
plus a "331 Guest login ok...." response, which might be why you think it is
sending multiple responses.

-Eddy

"Myles Barrett Williams" <mylesw@Stanford.EDU> wrote in message
news:btodb0$fn$1@news.Stanford.EDU...
> In article <snneku81da5.fsf@elaine3.Stanford.EDU>,
> Susan Noreen Shepard  <shepard8@elaine3.Stanford.EDU> wrote:
> >Are you refering to a socket reading the commands or the data?  I'm
> >assuming the commands.
> >
> >Please read FAQ Q4 for homework 1.  The newsgroup from 2003
> >has some more information (see below) as well.  Please check the FAQ and
> >newsgroups first before posting.  If you're still confused, reply to this
> >thread with your questions.
>
> I understand how to read each reply, but some servers send multiple
> completion replies (e.g. ftp.stanford.edu when you connect).  Does the
> protocol indicate explicitly which is the last one? I made a byte-by-
> byte dump of the initial messages from ftp.stanford.edu and don't see
> any useful difference between them (although I expected to, based on
> the NVT spec).
>
> Myles


.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine20.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Any delays for EE qual takers?
Date: 10 Jan 2004 21:44:17 -0800
Organization: Stanford University, CA, USA
Lines: 9
Distribution: su
Message-ID: <snnu133t4y6.fsf@elaine20.Stanford.EDU>
References: <40005843.6B93572D@stanford.edu> <snnvfnjz4ty.fsf@elaine3.Stanford.EDU> <4000A4DD.E1651FFB@stanford.edu>
NNTP-Posting-Host: elaine20.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1073799857 12569 171.64.15.85 (11 Jan 2004 05:44:17 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5016

Seungbeom Kim <sbkim@stanford.edu> writes:

> Oops, I was talking about the problem set #1,
> due on 01/14 in the middle of the quals week.

Sorry, I should have been more clear: there's no extensions for either the
first problem set or the programming assignment.

Susan
.

Path: shelby.stanford.edu!not-for-mail
From: Nick McKeown <nickm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Prizes: Best and First Assignments
Date: Sat, 10 Jan 2004 22:31:48 -0800
Organization: Stanford University
Lines: 13
Distribution: su
Message-ID: <btqqkj$egt$1@news.Stanford.EDU>
NNTP-Posting-Host: mckeown-pbdsl1.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1073802707 14877 171.66.211.98 (11 Jan 2004 06:31:47 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3) Gecko/20030312
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5017

Folks,

I like prizes. So I give prizes in CS244a
for the Best Assignment (one prize per assignment)
and the First Correct Assignment, which is the first
submitted assignment that receives 10 points.
The prize is a certificate, bragging rights and either
a holiday for two in the Caribbean, or a coffee voucher.
Hmmm, now let me think which....

Have a good weekend,
- Nick

.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine20.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PURIFY memory leaks
Date: 10 Jan 2004 23:06:47 -0800
Organization: Stanford University, CA, USA
Lines: 27
Distribution: su
Message-ID: <snnptdrt14o.fsf@elaine20.Stanford.EDU>
References: <btqbd0$qn0$1@news.Stanford.EDU> <pan.2004.01.11.04.13.33.839608@stanford.edu>
NNTP-Posting-Host: elaine20.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1073804807 16465 171.64.15.85 (11 Jan 2004 07:06:47 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5018

Chris Edstrom <cedstrom@stanford.edu> writes:

> >     I noticed in echodemo.c that none of the strings which are allocated
> > with malloc are ever freed, but when I run purify on it it tells me that
> > there are no leaked bytes. What's going on here?

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

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

Purify would consider something like this to be a leak:

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

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

Susan
.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Posting code
Date: Sat, 10 Jan 2004 23:23:45 -0800
Organization: Stanford University
Lines: 8
Distribution: su
Message-ID: <pan.2004.01.11.07.23.45.760704@stanford.edu>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1073805825 17547 128.12.69.27 (11 Jan 2004 07:23:45 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Xref: shelby.stanford.edu su.class.cs244a:5019

If we have a question about a specific piece of code, I assume you do not
want us to post it on the newsgroup.  However, I also don't want to wait
until Monday at 7 to get my question answered.  Can we email these types
of questions directly to the "on-call" TA?

Thanks.

--Chris
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Posting code
Date: Sat, 10 Jan 2004 23:46:24 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.LNX.4.44.0401102333330.3575-100000@Xenon.Stanford.EDU>
References: <pan.2004.01.11.07.23.45.760704@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073807185 18764 171.64.66.201 (11 Jan 2004 07:46:25 GMT)
X-Complaints-To: news@news.stanford.edu
To: Chris Edstrom <cedstrom@stanford.edu>
In-Reply-To: <pan.2004.01.11.07.23.45.760704@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5020


  Questions of a technical nature really should be submitted to the newsgroup.
  Generally you should try to reduce your problem to a small, representative
  example or describe the issue, please do not post large portions of code.

  Cheers,
   .mc

> If we have a question about a specific piece of code, I assume you do not
> want us to post it on the newsgroup.  However, I also don't want to wait
> until Monday at 7 to get my question answered.  Can we email these types
> of questions directly to the "on-call" TA?
> 
> Thanks.
> 
> --Chris
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: terminating on 4xx and 5xx errors
Date: Sun, 11 Jan 2004 00:26:55 -0800
Lines: 8
Distribution: su
Message-ID: <btr1d2$l0d$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1073809634 21517 128.12.90.43 (11 Jan 2004 08:27:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5021

I read in last year's newsgroup that we can just terminate on any 4xx or 5xx
response. Related to that: is there any case where 4xx or 5xx responses will
be multiline, and, more importantly, do we have to handle those cases?

Thanks,
Eddy


.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: struct hostent
Date: Sun, 11 Jan 2004 00:35:55 -0800
Lines: 14
Distribution: su
Message-ID: <btr1ti$lbg$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc508.stanford.edu
X-Trace: news.Stanford.EDU 1073810162 21872 128.12.197.8 (11 Jan 2004 08:36:02 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5022

In echodemo.c, there is a line of code:

bcopy(hostentPtr->h_addr, (char *) &servAddr.sin_addr,
hostentPtr->h_length);

This confuses me because the hostent structure does not have an h_addr
field.  However, this line of code apparently works.  Can someone please
explain this to me.

Thanks,

Justin


.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: struct hostent
Date: Sun, 11 Jan 2004 01:03:34 -0800
Lines: 21
Distribution: su
Message-ID: <20040111010334.7b238fc8.chanman@stanford.edu>
References: <btr1ti$lbg$1@news.Stanford.EDU>
NNTP-Posting-Host: chanman.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1073811829 21247 128.12.94.94 (11 Jan 2004 09:03:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed version 0.9.6 (GTK+ 1.2.10; i386-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:5023

in netdb.h

#define h_addr  h_addr_list[0]

On Sun, 11 Jan 2004 00:35:55 -0800
"Justin" <justinfw@stanford.edu> wrote:

> In echodemo.c, there is a line of code:
> 
> bcopy(hostentPtr->h_addr, (char *) &servAddr.sin_addr,
> hostentPtr->h_length);
> 
> This confuses me because the hostent structure does not have an h_addr
> field.  However, this line of code apparently works.  Can someone please
> explain this to me.
> 
> Thanks,
> 
> Justin
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: struct hostent
Date: Sun, 11 Jan 2004 01:06:40 -0800
Lines: 35
Distribution: su
Message-ID: <btr3nj$mhb$1@news.Stanford.EDU>
References: <btr1ti$lbg$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1073812019 23083 128.12.90.43 (11 Jan 2004 09:06:59 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5024

I did a quick google on this, and I found a man page on gethostbyname that
includes the following definition:

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	from name server */
	  };
	  #define   h_addr  h_addr_list[0]   /*	address, for backward compatibility

So I assume that the man page on the leland systems just doesn't mention
this extra #define because it's obsolete or whatever.

-Eddy

"Justin" <justinfw@stanford.edu> wrote in message
news:btr1ti$lbg$1@news.Stanford.EDU...
> In echodemo.c, there is a line of code:
>
> bcopy(hostentPtr->h_addr, (char *) &servAddr.sin_addr,
> hostentPtr->h_length);
>
> This confuses me because the hostent structure does not have an h_addr
> field.  However, this line of code apparently works.  Can someone please
> explain this to me.
>
> Thanks,
>
> Justin
>
>


.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question for the content in textbook
Date: Sun, 11 Jan 2004 08:15:04 -0800
Lines: 56
Distribution: su
Message-ID: <Pine.GSO.4.44.0401110813540.11700-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0401090041440.26774-100000@elaine9.Stanford.EDU>
 <snnptdt0yna.fsf@elaine3.Stanford.EDU> <snnk740205v.fsf@elaine3.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073837707 14009 171.64.15.118 (11 Jan 2004 16:15:07 GMT)
X-Complaints-To: news@news.stanford.edu
To: Susan Noreen Shepard <shepard8@elaine3.Stanford.EDU>
In-Reply-To: <snnk740205v.fsf@elaine3.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5025

However, should the answer for 2 x delay x bandwidth be 4.5 x 10**6,
instead of 5.5 x 10**6?

-Laura

On 9 Jan 2004, Susan Noreen Shepard wrote:

> Susan Noreen Shepard <shepard8@elaine3.Stanford.EDU> writes:
>
> I just realized my previous answer probably doesn't make sense.
>
> I referred to the delay x bandwidth product using the one-way latency as
> the volume of the pipe.  Actually the products using either one-way
> latency or RTT are *both* volumes of the pipe.  So,
>
> 2.25 x 10**6 is the volume using the one-way latency (50ms).
>
> and
>
> 5.5 x 10**6 is the volume using the roundtrip time (RTT) (100ms)
>
> These results are delay x bandwidth products *not* the one-way latency or
> roundtrip time themselves. One-way latency and RTT are the two delay
> values that can be used in determining the product.
> The results are still not a typo.  Both are valid interpretations of the
> delay x bandwidth product.  Both are volumes.  Context determines which
> you are interested in.
>
> Sorry for any confusion.
>
> Susan
>
> > Xiaohua Fang <xxf5@stanford.edu> writes:
> >
> > (I only have the 2nd edition of the textbook, so I'll need to check the
> > latest edition later today to make sure we're talking about the same
> > problem, but...)
> >
> > 2.25 x 10**6 refers to the one-way latency. ie. the volume of the
> > pipe (how many bits it can hold)
> >
> > 5.5 x 10**6 is actually the roundtrip time (RTT), which is still (sort of)
> > delay x bandwidth. It is (2 x delay) x bandwidth.  Instead of telling you
> > the *volume* of the pipe, RTT tells you the minimum time the sender will have
> > to wait to get an acknowledgement that a bit was receive by the receiver.
> > (ie. It takes delay x bandwidth time for the bit to go from the sender to
> > the receiver.  It takes the same amount of time for the acknowledgement
> > bit to go from the receiver to the sender.  This ignores any transmission
> > or processing time at either end).
> >
> > So, at least in my addition there is no typo. In my edition the textbook
> > goes on to say that "delay x bandwidth" can mean either the one-way
> > latency--the volume (1 x delay x bandwidth) or RTT (2 x delay x bandwidth)
> > and that you can which is desired by the context.
>

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS #1 Q3
Date: Sun, 11 Jan 2004 08:55:05 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.GSO.4.44.0401110822320.11799-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073840107 15719 171.64.15.118 (11 Jan 2004 16:55:07 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5026


What does "750 kbytes" stand for, 750 * 10**3 bytes  or 750 * 2**10 bytes?



.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS1 Q1c
Date: Sun, 11 Jan 2004 17:31:47 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <bts1a3$grd$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
X-Trace: news.Stanford.EDU 1073842307 17261 171.64.15.100 (11 Jan 2004 17:31:47 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5027

Are leap years expected to be part of the calculation?

If so, how are Feb. 29 birthdays handled in non-leap years?  Do we assume 
they are March 1?  Can we then also assume that the class never begins on 
Feb. 29 or March 1?

Tyrone
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS #1 Q3
Date: Sun, 11 Jan 2004 09:40:14 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0401110933450.25973-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401110822320.11799-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073842817 17944 171.64.66.201 (11 Jan 2004 17:40:17 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401110822320.11799-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5028



  On page 24 (of the second edition) of Peterson and Davies there is
  a little green box sidebar that explains when to use 2^X and when
  to use 10^x titled "How Big is a Mega?".  I'm assuming the third edition
  has something similary nearby.

  To summerize:

  Bandwidth -   10^n
  memory, message size - 2^n

  .mc

> 
> What does "750 kbytes" stand for, 750 * 10**3 bytes  or 750 * 2**10 bytes?
> 
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: terminating on 4xx and 5xx errors
Date: Sun, 11 Jan 2004 10:04:25 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.LNX.4.44.0401110957550.31780-100000@Xenon.Stanford.EDU>
References: <btr1d2$l0d$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073844269 19075 171.64.66.201 (11 Jan 2004 18:04:29 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <btr1d2$l0d$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5029

On Sun, 11 Jan 2004, Eddy Wu wrote:

> I read in last year's newsgroup that we can just terminate on any 4xx or 5xx
> response. Related to that: is there any case where 4xx or 5xx responses will
> be multiline, and, more importantly, do we have to handle those cases?

  You should be able to handle multi-line error responses (4xx, 5xx).

  .mc

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q1c
Date: Sun, 11 Jan 2004 10:07:46 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.LNX.4.44.0401111004320.31780-100000@Xenon.Stanford.EDU>
References: <bts1a3$grd$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073844470 19196 171.64.66.201 (11 Jan 2004 18:07:50 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <bts1a3$grd$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5030


> Are leap years expected to be part of the calculation?

  No, you can assume 365 days a year every year (read comment in 1 (a)).

  .m

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: STRU and MODE
Date: Sun, 11 Jan 2004 10:34:04 -0800
Lines: 6
Distribution: su
Message-ID: <bts4ut$kal$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1073846045 20821 128.12.90.43 (11 Jan 2004 18:34:05 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5031

Can we assume that servers follow the RFC and use file structure and stream
mode by default, or do we have to explicitly set them?

-Eddy


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: STRU and MODE
Date: Sun, 11 Jan 2004 10:49:54 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.LNX.4.44.0401111046370.10164-100000@Xenon.Stanford.EDU>
References: <bts4ut$kal$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073847005 21607 171.64.66.201 (11 Jan 2004 18:50:05 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <bts4ut$kal$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5032


> Can we assume that servers follow the RFC and use file structure and stream
> mode by default, or do we have to explicitly set them?

  You can assume the servers default to file structure and stream mode.

  .m

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Echodemo.c: Purify Warnings
Date: Sun, 11 Jan 2004 11:17:30 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.GSO.4.44.0401111114500.13141-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073848654 22975 171.64.15.118 (11 Jan 2004 19:17:34 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5033


When I try to "make all.purify" for echodemo, the purify engine genrates
lots of warnings such as:

Purify 2003.06.00 Solaris 2 (32-bit) Copyright (C) 1992-2002 Rational
Software Corp.  All rights reserved.
Instrumenting: echodemo.o libgcc.a.......................................
Purify engine: While processing file
/usr/pubsw/lib/gcc-lib/sparc-sun-solaris2.8/3.3.1/libgcc.a(_divdi3.oS):
Warning: Unhandled reloc type R_SPARC_DISP32 at location 0x1c (section 4 -
..eh_frame), addend 0x8
..
Purify engine: While processing file
/usr/pubsw/lib/gcc-lib/sparc-sun-solaris2.8/3.3.1/libgcc.a(_moddi3.oS):
Warning: Unhandled reloc type R_SPARC_DISP32 at location 0x1c (section 4 -
..eh_frame), addend 0x8

===

How can I get rid of these warnings?  Or should I just ignore them?

-Laura

.

Path: shelby.stanford.edu!elaine32.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS#1 Queuing questions
Date: Sun, 11 Jan 2004 12:17:49 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.GSO.4.44.0401111213340.11893-100000@elaine32.Stanford.EDU>
NNTP-Posting-Host: elaine32.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073852274 26415 171.64.15.107 (11 Jan 2004 20:17:54 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5034


Where can we get some background on all these queuing questions.
(ie...what chapter in book or what lecture?)

Problem 6 says to refer to the deterministic queue figures discussed in
class, but I looked through the class slides, didn't seem to help much.

Are we going to cover more about queuing stuff in class on Tuesday, should
we wait until then to tackle those problems?

--vishal


.

Path: shelby.stanford.edu!not-for-mail
From: Charles Rowe Burns <crburns@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: purify BSR error in getservbyname
Date: Sun, 11 Jan 2004 20:27:20 +0000 (UTC)
Lines: 32
Distribution: su
Message-ID: <btsbj7$q26$1@news.Stanford.EDU>
NNTP-Posting-Host: saga16.stanford.edu
X-Trace: news.Stanford.EDU 1073852840 26694 171.64.15.146 (11 Jan 2004 20:27:20 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5035

Purify complains about this BSR error:

		BSR: Beyond stack read error:
		  * This is occurring while in:
			nvmatch        [getenv.c]
			nss_get_environment [nss_common.c]
			_nss_db_state_constr [nss_common.c]
			nss_search     [libc.so.1]
			_switch_getservbyname_r [netdir_inet.c]
			_get_hostserv_inetnetdir_byname [netdir_inet.c]
			getservbyname_r [libsocket.so.1]
			main           [ftpcopy.c:482]
			_start         [crt1.o]
		  * Reading 1 byte from 0xffbeef60.
		  * Stack pointer 0xffbef010

The call in question is my code is:

		getservbyname("ftp", "tcp");

Yet, when I create a tiny test case:

	main() { printf("XXX %x XXX\n", getservbyname("ftp", "tcp")); }

The error does not occur.

Any suggestions?

Thanks.

Charlie

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sending a USER command
Date: Sun, 11 Jan 2004 13:54:29 -0800
Lines: 21
Distribution: su
Message-ID: <btsgf0$16e$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1073857824 1230 128.12.189.163 (11 Jan 2004 21:50:24 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5036

Hi,
I have written a very simple program where I am connecting to a ftp
server.It works fine upto the point where I create and connect to the
server.
When I actually try to write something to the socket, it just returns a
negative value indicating error.
I wanted to test if my connection is setup by sending a USER comand over the
connection.
as
write(s, "USER\r\n",6);
here it fails to write to the server.
Is my syntax wrong?
Am I missing something here?
How do I send a USER command otherwise?Also how do i check to see if my
control connection is successfully set up & whether I can actually send a
ftp command over it?
Please let me know,
Thanks,
Haripriya


.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Echodemo.c: Purify Warnings
Date: Sun, 11 Jan 2004 13:52:04 -0800
Organization: Stanford University
Lines: 32
Distribution: su
Message-ID: <pan.2004.01.11.21.52.03.405536@stanford.edu>
References: <Pine.GSO.4.44.0401111114500.13141-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1073857925 916 128.12.69.27 (11 Jan 2004 21:52:05 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Xref: shelby.stanford.edu su.class.cs244a:5037

See my posting a little further down under "Re: PURIFY memory leaks"  This
is because of an incompatibility with Purify/Solaris 9/gcc3.  You can just
ignore the warning, but the result is that purify sometimes can't tell you
exactly where memory access errors occurred.

--Chris

On Sun, 11 Jan 2004 11:17:30 -0800, Xiaohua Fang wrote:

> 
> When I try to "make all.purify" for echodemo, the purify engine genrates
> lots of warnings such as:
> 
> Purify 2003.06.00 Solaris 2 (32-bit) Copyright (C) 1992-2002 Rational
> Software Corp.  All rights reserved.
> Instrumenting: echodemo.o libgcc.a.......................................
> Purify engine: While processing file
> /usr/pubsw/lib/gcc-lib/sparc-sun-solaris2.8/3.3.1/libgcc.a(_divdi3.oS):
> Warning: Unhandled reloc type R_SPARC_DISP32 at location 0x1c (section 4 -
> .eh_frame), addend 0x8
> .
> Purify engine: While processing file
> /usr/pubsw/lib/gcc-lib/sparc-sun-solaris2.8/3.3.1/libgcc.a(_moddi3.oS):
> Warning: Unhandled reloc type R_SPARC_DISP32 at location 0x1c (section 4 -
> .eh_frame), addend 0x8
> 
> ===
> 
> How can I get rid of these warnings?  Or should I just ignore them?
> 
> -Laura

.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: purify BSR error in getservbyname
Date: Sun, 11 Jan 2004 13:55:38 -0800
Organization: Stanford University
Lines: 38
Distribution: su
Message-ID: <pan.2004.01.11.21.55.36.286087@stanford.edu>
References: <btsbj7$q26$1@news.Stanford.EDU>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1073858138 916 128.12.69.27 (11 Jan 2004 21:55:38 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Xref: shelby.stanford.edu su.class.cs244a:5038

See Purify FAQ Q4.

--Chris

On Sun, 11 Jan 2004 20:27:20 +0000, Charles Rowe Burns wrote:

> Purify complains about this BSR error:
> 
> 		BSR: Beyond stack read error:
> 		  * This is occurring while in:
> 			nvmatch        [getenv.c]
> 			nss_get_environment [nss_common.c]
> 			_nss_db_state_constr [nss_common.c]
> 			nss_search     [libc.so.1]
> 			_switch_getservbyname_r [netdir_inet.c]
> 			_get_hostserv_inetnetdir_byname [netdir_inet.c]
> 			getservbyname_r [libsocket.so.1]
> 			main           [ftpcopy.c:482]
> 			_start         [crt1.o]
> 		  * Reading 1 byte from 0xffbeef60.
> 		  * Stack pointer 0xffbef010
> 
> The call in question is my code is:
> 
> 		getservbyname("ftp", "tcp");
> 
> Yet, when I create a tiny test case:
> 
> 	main() { printf("XXX %x XXX\n", getservbyname("ftp", "tcp")); }
> 
> The error does not occur.
> 
> Any suggestions?
> 
> Thanks.
> 
> Charlie

.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Purify complaints
Date: Sun, 11 Jan 2004 14:08:04 -0800
Organization: Stanford University
Lines: 22
Distribution: su
Message-ID: <pan.2004.01.11.22.08.04.357762@stanford.edu>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1073858885 2135 128.12.69.27 (11 Jan 2004 22:08:05 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Xref: shelby.stanford.edu su.class.cs244a:5039

Hey--

Purify complains on:

char *ret=NULL;
char command[256];
bzero(command, sizeof(command));

do
{
  recv(controlSocket, command, sizeof(command), 0);
  ret = strstr(command, "string");  /* <--- Purify says UMR here */
}
while(ret == NULL);

Valgrind, another memory debugger, says "Conditional jump or move depends
on uninitialized value" on the same line.  What is wrong with this code?

Thanks for any help!

--Chris

.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Purify complaints
Date: Sun, 11 Jan 2004 14:36:53 -0800
Lines: 32
Distribution: su
Message-ID: <Pine.GSO.4.44.0401111434550.11650-100000@epic9.Stanford.EDU>
References: <pan.2004.01.11.22.08.04.357762@stanford.edu>
NNTP-Posting-Host: epic9.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073860615 3705 171.64.15.42 (11 Jan 2004 22:36:55 GMT)
X-Complaints-To: news@news.stanford.edu
To: Chris Edstrom <cedstrom@stanford.edu>
In-Reply-To: <pan.2004.01.11.22.08.04.357762@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5040

It's just a guess but you're not checking return value for error
after a call to recv.  Then you attempt to parse 'command'.
Perhaps, that's the cause.

Boris.

On Sun, 11 Jan 2004, Chris Edstrom wrote:

> Hey--
>
> Purify complains on:
>
> char *ret=NULL;
> char command[256];
> bzero(command, sizeof(command));
>
> do
> {
>   recv(controlSocket, command, sizeof(command), 0);
>   ret = strstr(command, "string");  /* <--- Purify says UMR here */
> }
> while(ret == NULL);
>
> Valgrind, another memory debugger, says "Conditional jump or move depends
> on uninitialized value" on the same line.  What is wrong with this code?
>
> Thanks for any help!
>
> --Chris
>
>

.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Nothing to do for echodemo in purify
Date: Sun, 11 Jan 2004 14:50:55 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.GSO.4.44.0401111445430.11650-100000@epic9.Stanford.EDU>
NNTP-Posting-Host: epic9.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073861456 4551 171.64.15.42 (11 Jan 2004 22:50:56 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5041

I ran purify on echodemo program and since
leaving some file descriptors open such as
stdin, stdout, stderr, and .name_service_dooor is OK
and purify does not catch memory leak if you don't
free memory but not reuse the same pointer until program
exits, it finds absolutely nothing to correct.

What are we supposed to fix with purify?

Thanks.

Boris.


.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Nothing to do for echodemo in purify
Date: Sun, 11 Jan 2004 14:56:41 -0800
Lines: 19
Distribution: su
Message-ID: <20040111145641.120d0bb0.chanman@stanford.edu>
References: <Pine.GSO.4.44.0401111445430.11650-100000@epic9.Stanford.EDU>
NNTP-Posting-Host: chanman.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1073861819 29905 128.12.94.94 (11 Jan 2004 22:56:59 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed version 0.9.6 (GTK+ 1.2.10; i386-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:5042

Run echodemo.purify klamath.stanford.edu

On Sun, 11 Jan 2004 14:50:55 -0800
Boris Senderzon <senderzo@stanford.edu> wrote:

> I ran purify on echodemo program and since
> leaving some file descriptors open such as
> stdin, stdout, stderr, and .name_service_dooor is OK
> and purify does not catch memory leak if you don't
> free memory but not reuse the same pointer until program
> exits, it finds absolutely nothing to correct.
> 
> What are we supposed to fix with purify?
> 
> Thanks.
> 
> Boris.
> 
> 
.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: getservbyname
Date: Sun, 11 Jan 2004 14:58:53 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.GSO.4.44.0401111455110.15904-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073861936 4843 171.64.15.118 (11 Jan 2004 22:58:56 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5043


By calling myServEnt = getservbyname( "echo", "tcp" ) in echodemo.c, it
finds the port for echo service in the client machine.  However, this port
number is used to fill in the server address.  Here the assumption is that
the server and client machine both uses the same port number for echo
service.  Can we assume the same thing in the case of "FTP", i.e., using
the getservbyname("ftp", "tcp") to find the port for FTP service in the
client machine, then use this same port as the default FTP service port
for the server machine?

_Laura

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: What should we do for invalid command line option?
Date: Sun, 11 Jan 2004 15:09:16 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0401111500570.15943-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073862558 5470 171.64.15.118 (11 Jan 2004 23:09:18 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5044


As defined in the assignment, item 9, there should be a one-line status
report at the temination.  However, what should be the proper error
message for the case when the command line option is input incorrectly,
such as not enough argument, invalid parameter?

Should we give the usage help, such as:

	Usage: ftpcopy ext level [port@]ftpsite [local-dir [remote-dir]]
?

What should we do if the command line gives the invalid port/level, say
-1 for both level and port?
Should the program terminate with ERROR: invalid level -1" or should it
try to use default port or level 0?



.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Nothing to do for echodemo in purify
Date: Sun, 11 Jan 2004 15:10:50 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.GSO.4.44.0401111509410.11974-100000@epic9.Stanford.EDU>
References: <Pine.GSO.4.44.0401111445430.11650-100000@epic9.Stanford.EDU>
 <20040111145641.120d0bb0.chanman@stanford.edu>
NNTP-Posting-Host: epic9.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073862653 5679 171.64.15.42 (11 Jan 2004 23:10:53 GMT)
X-Complaints-To: news@news.stanford.edu
To: William Chan <chanman@stanford.edu>
In-Reply-To: <20040111145641.120d0bb0.chanman@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5045

I guess I was not clear.  I meant that I ran
echodemo.purify klamath.stanford.edu and
was commenting on the contents of purify.output file
which listed only errors with opened
file descriptors and did not catch memory leaks.

On Sun, 11 Jan 2004, William Chan wrote:

> Run echodemo.purify klamath.stanford.edu
>
> On Sun, 11 Jan 2004 14:50:55 -0800
> Boris Senderzon <senderzo@stanford.edu> wrote:
>
> > I ran purify on echodemo program and since
> > leaving some file descriptors open such as
> > stdin, stdout, stderr, and .name_service_dooor is OK
> > and purify does not catch memory leak if you don't
> > free memory but not reuse the same pointer until program
> > exits, it finds absolutely nothing to correct.
> >
> > What are we supposed to fix with purify?
> >
> > Thanks.
> >
> > Boris.
> >
> >
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sending a USER command
Date: Sun, 11 Jan 2004 15:56:17 -0800
Lines: 38
Distribution: su
Message-ID: <btsnr0$7sq$1@news.Stanford.EDU>
References: <btsgf0$16e$1@news.Stanford.EDU>
NNTP-Posting-Host: agila.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1073865376 8090 128.12.194.74 (11 Jan 2004 23:56:16 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2
X-Accept-Language: en-us, en
In-Reply-To: <btsgf0$16e$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5046

Haripriya Rajagopal wrote:
> Hi,
> I have written a very simple program where I am connecting to a ftp
> server.It works fine upto the point where I create and connect to the
> server.
> When I actually try to write something to the socket, it just returns a
> negative value indicating error.
> I wanted to test if my connection is setup by sending a USER comand over the
> connection.
> as
> write(s, "USER\r\n",6);

Once you get a connection, immediately read from the socket.  The server 
will give you some welcome messages lines starting with a 3-digit 
response code (see the FTP RFC for details on the response codes). 
Then, depending on the response you get, issue your commands.

Also, try providing a username like "USER myusername\r\n" and if that 
still doesn't do it, try using send() with the MSG_WAITALL flag set so 
you're sure everything gets through.  Again, read lines from the socket 
to make sure this went through ok.

Hope that helps.

Paul E.

> here it fails to write to the server.
> Is my syntax wrong?
> Am I missing something here?
> How do I send a USER command otherwise?Also how do i check to see if my
> control connection is successfully set up & whether I can actually send a
> ftp command over it?
> Please let me know,
> Thanks,
> Haripriya
> 
> 

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: undefined reference to `hstrerror'
Date: Sun, 11 Jan 2004 16:33:36 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.GSO.4.44.0401111628490.17062-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073867617 10221 171.64.15.118 (12 Jan 2004 00:33:37 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5047

I got the following compiling error when I tried to use hstrerror to print
out the error message for gethostbyname().

 undefined reference to `hstrerror'


I can see the function prototype in /usr/include/netdb.h and my program
includes this header file.  What could be problem?

const char *hstrerror(int);

-Laura

.

Path: shelby.stanford.edu!elaine33.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Purify complaints
Date: Mon, 12 Jan 2004 01:46:57 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <btsuah$e99$1@news.Stanford.EDU>
References: <pan.2004.01.11.22.08.04.357762@stanford.edu> <Pine.GSO.4.44.0401111434550.11650-100000@epic9.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1073872017 14633 171.64.15.108 (12 Jan 2004 01:46:57 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5048


I'd guess that Purify can't tell that bzero() has zeroed out the array.  If
you do something like
  char command[256] = "";
I'd assume the error would go away.

BTW, Purify will occasionally give spurious warnings, as in this case.  I'm
not sure if Purify's capable of correctly detecting some of these
stack-related issues, so it tends to be conservative in these cases.  It's
probably best to fix the code (even if it's not really broken), just so the
'genuine' errors stand out.

Boris is correct that you should check the return value from recv().  Also,
remember that it may not read all bytes you requested.

.

Path: shelby.stanford.edu!elaine33.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: undefined reference to `hstrerror'
Date: Mon, 12 Jan 2004 01:49:26 +0000 (UTC)
Lines: 23
Distribution: su
Message-ID: <btsuf6$ecs$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401111628490.17062-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1073872166 14748 171.64.15.108 (12 Jan 2004 01:49:26 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5049

Xiaohua Fang <xxf5@stanford.edu> writes:

>I got the following compiling error when I tried to use hstrerror to print
>out the error message for gethostbyname().

> undefined reference to `hstrerror'


>I can see the function prototype in /usr/include/netdb.h and my program
>includes this header file.  What could be problem?

>const char *hstrerror(int);

>-Laura


The manpages specify the libraries to link in (above the required include
files)--you'll need to use -lresolv on Solaris for this function, in
addition to the usual -lnsl -lsocket.

BTW, if you find this information missing in the manpages for some reason,
you can also use 'nm' on the system libraries in /usr/lib to determine the
needed library.
.

Path: shelby.stanford.edu!elaine33.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: What should we do for invalid command line option?
Date: Mon, 12 Jan 2004 01:50:32 +0000 (UTC)
Lines: 22
Distribution: su
Message-ID: <btsuh8$ei5$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401111500570.15943-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1073872232 14917 171.64.15.108 (12 Jan 2004 01:50:32 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5050



>As defined in the assignment, item 9, there should be a one-line status
>report at the temination.  However, what should be the proper error
>message for the case when the command line option is input incorrectly,
>such as not enough argument, invalid parameter?

>Should we give the usage help, such as:

>	Usage: ftpcopy ext level [port@]ftpsite [local-dir [remote-dir]]
>?

Yes, that would be fine.

>What should we do if the command line gives the invalid port/level, say
>-1 for both level and port?
>Should the program terminate with ERROR: invalid level -1" or should it
>try to use default port or level 0?

We won't be testing this case, but exiting with an error seems the most
reasonable approach to me.

.

Path: shelby.stanford.edu!elaine33.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: getservbyname
Date: Mon, 12 Jan 2004 01:51:26 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <btsuiu$ejh$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401111455110.15904-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1073872286 14961 171.64.15.108 (12 Jan 2004 01:51:26 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5051



>By calling myServEnt = getservbyname( "echo", "tcp" ) in echodemo.c, it
>finds the port for echo service in the client machine.  However, this port
>number is used to fill in the server address.  Here the assumption is that
>the server and client machine both uses the same port number for echo
>service.  Can we assume the same thing in the case of "FTP", i.e., using
>the getservbyname("ftp", "tcp") to find the port for FTP service in the
>client machine, then use this same port as the default FTP service port
>for the server machine?

Yep, that's fine.
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: undefined reference to `hstrerror'
Date: Sun, 11 Jan 2004 19:24:35 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.LNX.4.44.0401111923280.6773-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401111628490.17062-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073877877 21139 171.64.66.201 (12 Jan 2004 03:24:37 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401111628490.17062-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5052


 This isn't a compilation error this is a link error.  You will need to 
 link with libresolv to provide the definition for hstrerror:

 gcc foo.c -lresolv 

 .m

> I got the following compiling error when I tried to use hstrerror to print
> out the error message for gethostbyname().
> 
>  undefined reference to `hstrerror'
> 
> 
> I can see the function prototype in /usr/include/netdb.h and my program
> includes this header file.  What could be problem?
> 
> const char *hstrerror(int);
> 
> -Laura
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: What should we do for invalid command line option?
Date: Sun, 11 Jan 2004 19:35:04 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.LNX.4.44.0401111928580.6773-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401111500570.15943-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073878508 21685 171.64.66.201 (12 Jan 2004 03:35:08 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401111500570.15943-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5053


> 
> As defined in the assignment, item 9, there should be a one-line status
> report at the temination.  However, what should be the proper error
> message for the case when the command line option is input incorrectly,
> such as not enough argument, invalid parameter?
> 
> Should we give the usage help, such as:
> 
> 	Usage: ftpcopy ext level [port@]ftpsite [local-dir [remote-dir]]
> ?

 providing usage information on incorrect args is ok. 
 
> What should we do if the command line gives the invalid port/level, say
> -1 for both level and port?
> Should the program terminate with ERROR: invalid level -1" or should it
> try to use default port or level 0?

 using a default on invalid input is probably not the best idea ... however,
 at some point you must make your own design decisions and support them in
 your write-up.  The assignment page and the grading script provide a pretty 
 good outline of what we expect from a functionality stand-point, much of the
 rest is up to you to engineer in a workable, usable way .. and to be able to
 justify convincingly.

 .mc

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS#1 Queuing questions
Date: Sun, 11 Jan 2004 20:08:26 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.LNX.4.44.0401111937270.9811-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401111213340.11893-100000@elaine32.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073880509 23509 171.64.66.201 (12 Jan 2004 04:08:29 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401111213340.11893-100000@elaine32.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5054


  
  PS questions 6, 7 & 8 (I assume these are the ones you are
  referring to) can be answered by the material covered in handout 3.  I would
  suggest taking a stab at them nowm coming to office hours if you have
  questions, and finish them up after the lecture on Tues. 

  .m

> Where can we get some background on all these queuing questions.
> (ie...what chapter in book or what lecture?)
> 
> Problem 6 says to refer to the deterministic queue figures discussed in
> class, but I looked through the class slides, didn't seem to help much.
> 
> Are we going to cover more about queuing stuff in class on Tuesday, should
> we wait until then to tackle those problems?
> 
> --vishal
> 
> 
> 


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Nothing to do for echodemo in purify
Date: Sun, 11 Jan 2004 20:20:05 -0800
Lines: 43
Distribution: su
Message-ID: <Pine.LNX.4.44.0401112009580.18393-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401111445430.11650-100000@epic9.Stanford.EDU>
 <20040111145641.120d0bb0.chanman@stanford.edu>
 <Pine.GSO.4.44.0401111509410.11974-100000@epic9.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073881207 24253 171.64.66.201 (12 Jan 2004 04:20:07 GMT)
X-Complaints-To: news@news.stanford.edu
To: Boris Senderzon <senderzo@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401111509410.11974-100000@epic9.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5055


 The point of the assignment is for you to get familiar with using gdb and
 purify and to have some preliminary experience with network code.  The goal is
 for you to find and ferret out all bugs in the program ...  We obviously
 cannot tell you what/where the bugs are ...

 I can assure you there are one or more problems, and run (and read) correctly,
 purify will give a indication is to where they may be. 

 .mc


> I guess I was not clear.  I meant that I ran
> echodemo.purify klamath.stanford.edu and
> was commenting on the contents of purify.output file
> which listed only errors with opened
> file descriptors and did not catch memory leaks.
> 
> On Sun, 11 Jan 2004, William Chan wrote:
> 
> > Run echodemo.purify klamath.stanford.edu
> >
> > On Sun, 11 Jan 2004 14:50:55 -0800
> > Boris Senderzon <senderzo@stanford.edu> wrote:
> >
> > > I ran purify on echodemo program and since
> > > leaving some file descriptors open such as
> > > stdin, stdout, stderr, and .name_service_dooor is OK
> > > and purify does not catch memory leak if you don't
> > > free memory but not reuse the same pointer until program
> > > exits, it finds absolutely nothing to correct.
> > >
> > > What are we supposed to fix with purify?
> > >
> > > Thanks.
> > >
> > > Boris.
> > >
> > >
> >
> 
> 

.

Path: shelby.stanford.edu!elaine8.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: purify BSR error in getservbyname
Date: Mon, 12 Jan 2004 04:27:33 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <btt7nl$nue$1@news.Stanford.EDU>
References: <btsbj7$q26$1@news.Stanford.EDU> <pan.2004.01.11.21.55.36.286087@stanford.edu>
NNTP-Posting-Host: elaine8.stanford.edu
X-Trace: news.Stanford.EDU 1073881653 24526 171.64.15.73 (12 Jan 2004 04:27:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5056

>See Purify FAQ Q4.

BTW--
the grading script will flag an error if you suppress BSRs/UMRs/whatever
for arbitrary functions.  it permits suppression for a few known bad apples
(this example isn't one of them), but you shouldn't have to suppress
anything else--if you do, look long and hard at your code...
.

Path: shelby.stanford.edu!not-for-mail
From: Charles Rowe Burns <crburns@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: test_code.pl problem
Date: Mon, 12 Jan 2004 05:23:06 +0000 (UTC)
Lines: 22
Distribution: su
Message-ID: <bttavq$rtn$1@news.Stanford.EDU>
NNTP-Posting-Host: saga6.stanford.edu
X-Trace: news.Stanford.EDU 1073884986 28599 171.64.15.136 (12 Jan 2004 05:23:06 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5057

When I ran the command:

/afs/ir/class/cs244a/bin/test_code.pl hw1 Makefile *.[ch] purify.output .purify

I got the result:

> Can't find a matching key for this test run.
> Would you like to generate a new one?  (y/n):  y
> Daily quota of 5 test attempts applies (from Jan 1 onwards).
> /usr/pubsw/bin/find: /afs/ir/class/cs244a/grading_script/student/crburns: No such file or directory
> count test attempts failed!
> You've used 0 test attempt(s) so far today.
> Test record directory /afs/ir/class/cs244a/grading_script/student/crburns does not exist!
> couldn't submit code for testing



Do you need to create this directory for me?

Thanks.

Charlie
.

Path: shelby.stanford.edu!elaine38.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: test_code.pl problem
Date: Mon, 12 Jan 2004 07:07:49 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <btth45$44f$1@news.Stanford.EDU>
References: <bttavq$rtn$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine38.stanford.edu
X-Trace: news.Stanford.EDU 1073891269 4239 171.64.15.113 (12 Jan 2004 07:07:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5058


>> Test record directory /afs/ir/class/cs244a/grading_script/student/crburns does not exist!
>> couldn't submit code for testing

>Do you need to create this directory for me?

yep, I've just done this.

for anyone else who sees this error--just send me an email.  I sync up the
directories with the results of the TA assignment over the first week or
so of class, but this is done manually.  I've pretty much stopped doing
this now under the assumption that everyone has assigned him/herself a TA.

.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: byte ordering of port number PASV command
Date: Mon, 12 Jan 2004 04:46:06 -0800
Lines: 10
Distribution: su
Message-ID: <btu4uf$n5s$1@news.Stanford.EDU>
NNTP-Posting-Host: agila.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1073911567 23740 128.12.194.74 (12 Jan 2004 12:46:07 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5059

When I receive the string

227 Entering Passive Mode (171,64,15,241,146,211)

as a reply to a PASV command I sent to the ftp server, are the last two 
comma separated numbers in the byte order of a) the network b) the local 
host or c) the remote host?

Paul E.

.

Path: shelby.stanford.edu!elaine10.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: byte ordering of port number PASV command
Date: Mon, 12 Jan 2004 15:56:48 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <btug40$37l$1@news.Stanford.EDU>
References: <btu4uf$n5s$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine10.stanford.edu
X-Trace: news.Stanford.EDU 1073923008 3317 171.64.15.75 (12 Jan 2004 15:56:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5060


>227 Entering Passive Mode (171,64,15,241,146,211)

>as a reply to a PASV command I sent to the ftp server, are the last two 
>comma separated numbers in the byte order of a) the network b) the local 
>host or c) the remote host?

How would you know what byte order the remote host is using?  And similarly,
how would it know what byte order your system uses?
.

Path: shelby.stanford.edu!elaine15.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PASV and PORT
Date: Mon, 12 Jan 2004 19:38:13 +0000 (UTC)
Lines: 29
Distribution: su
Message-ID: <btut35$h05$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine15.stanford.edu
X-Trace: news.Stanford.EDU 1073936293 17413 171.64.15.80 (12 Jan 2004 19:38:13 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5061

I'm posting the answer to a question sent to me by e-mail here...

>Basically, for the PASV mode, the ftpcopy has to maintain two sockets in
>the same process, one for control connection, one for the data connection,
>maybe use poll() to process the incoming messages.
>
>For the PORT mode, the ftpcopy need spawn another process to handle the
>incoming data connection request from the server.  The ftpcopy need to
>figure out the inter-process communication between the process that
>handles the control connection and the process that handles the data
>connection.
>
>This is my view of these two implementations.  Am I on the right track?

For both PASV and PORT you'll typically have two sockets open in the same
process, one for the control connection, one for the current data
connection.

You shouldn't need to use poll() or select()--in fact, it may be easier
in the long run if you don't, since we'll be reusing ftpcopy in a later
assignment where those interfaces probably won't be available.  Certainly
if you use PORT, and I'd assume PASV too (although I haven't checked this),
the protocol is defined so that there's no need to handle input on
both sockets simultaneously.  If you take another look at the assignment
description, it explains the sequence of steps associated with establishing
a data connection--everything can proceed sequentially (and synchronously)
as described.  There should be no need for a second process or IPC in this
assignment.

.

Path: shelby.stanford.edu!not-for-mail
From: "N Prasad" <nprasad1@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Handout #3, Foil #30
Date: Mon, 12 Jan 2004 13:30:45 -0800
Lines: 11
Distribution: su
Message-ID: <btv3lu$one$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1073943041 25326 127.0.0.1 (12 Jan 2004 21:30:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5062

If there are N router from Host A to HostB, there will be N+1 links. So, the
end to end latency will have (N+1) terms for (TRANSPi + PROPi), and N terms
will also have Qi.

The expression for "end to end latency" given on foil #30 implies that there
is queueing delay in the Host B as well. Is this correct?

Thanks,
-Nutan


.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Question 2c
Date: Mon, 12 Jan 2004 14:38:05 -0800
Lines: 6
Distribution: su
Message-ID: <btv7ko$t41$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1073947096 29825 128.12.90.43 (12 Jan 2004 22:38:16 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5063

What is the speed of data transfer in an optical fiber that we are supposed
to use? Nick mentioned in class that we can pretty much use 3x10^8 m/s (the
speed of light) to approximate, but the textbook gives the speed of light in
fiber as 2x10^8 m/s


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Handout #3, Foil #30
Date: Mon, 12 Jan 2004 17:49:24 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.LNX.4.44.0401121728440.32529-100000@Xenon.Stanford.EDU>
References: <btv3lu$one$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073958568 14001 171.64.66.201 (13 Jan 2004 01:49:28 GMT)
X-Complaints-To: news@news.stanford.edu
To: N Prasad <nprasad1@stanford.edu>
In-Reply-To: <btv3lu$one$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5064


> The expression for "end to end latency" given on foil #30 implies that there
> is queueing delay in the Host B as well. Is this correct?

  The slide does not show any queuing delay in host B.  The routers
  depicted are store and forward routers so they must get the full
  packet before they send it back out.  The only machines which
  have queuing delays are R1 and R2.

  In any case, for most practical purposes you do not consider
  queuing delays in end hosts.

  .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Question 2c
Date: Mon, 12 Jan 2004 17:51:20 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0401121749290.32529-100000@Xenon.Stanford.EDU>
References: <btv7ko$t41$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073958683 14202 171.64.66.201 (13 Jan 2004 01:51:23 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <btv7ko$t41$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5065


 go ahead and use 3x10^8.

 .m

> What is the speed of data transfer in an optical fiber that we are supposed
> to use? Nick mentioned in class that we can pretty much use 3x10^8 m/s (the
> speed of light) to approximate, but the textbook gives the speed of light in
> fiber as 2x10^8 m/s
> 
> 
> 

.

Path: shelby.stanford.edu!elaine27.Stanford.EDU!anneyeh
From: Anne Kang-Ping Yeh <anneyeh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Am I missing a command after PASS?
Date: Mon, 12 Jan 2004 19:44:18 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.GSO.4.44.0401121937500.16729-100000@elaine27.Stanford.EDU>
NNTP-Posting-Host: elaine27.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073965460 21202 171.64.15.102 (13 Jan 2004 03:44:20 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5066

Hi,

I've got a question on the FTP control connection sequence of commands.  I
have successfully made the connection and logged on, PASS command returns
230.  My question is, is there another required command after PASS before
I can start doing anything else?  I tried issuing a PASV command right
after PASS, but I get 230 back again.  If I issue PASV a second time, I
would get the expected result of "227 Entering Passive Mode ...".

Any suggestions?
Thanks!

Anne

.

Path: shelby.stanford.edu!elaine12.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Am I missing a command after PASS?
Date: Tue, 13 Jan 2004 03:58:15 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <btvqcn$lei$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401121937500.16729-100000@elaine27.Stanford.EDU>
NNTP-Posting-Host: elaine12.stanford.edu
X-Trace: news.Stanford.EDU 1073966295 21970 171.64.15.77 (13 Jan 2004 03:58:15 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5067



>I've got a question on the FTP control connection sequence of commands.  I
>have successfully made the connection and logged on, PASS command returns
>230.  My question is, is there another required command after PASS before
>I can start doing anything else?  I tried issuing a PASV command right
>after PASS, but I get 230 back again.  If I issue PASV a second time, I
>would get the expected result of "227 Entering Passive Mode ...".

It works as expected when I try 'telnet ftp.stanford.edu 21' and enter that
sequence of commands manually.  On which server are you seeing this
behaviour?  Have you double-checked that you correctly parsed all the lines
returned in the original PASS response?
.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS1 Q7
Date: Tue, 13 Jan 2004 04:21:25 +0000 (UTC)
Lines: 2
Distribution: su
Message-ID: <btvro5$mg0$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1073967685 23040 171.64.15.116 (13 Jan 2004 04:21:25 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5068

What unit is represented by A(t)?  Is it simply bits per second, or does it represent the 
cumulative total of bits received since the beginning of the transmission?
.

Path: shelby.stanford.edu!elaine12.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Question for the content in textbook
Date: Tue, 13 Jan 2004 04:24:56 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <btvruo$n15$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401090041440.26774-100000@elaine9.Stanford.EDU>  <snnptdt0yna.fsf@elaine3.Stanford.EDU> <snnk740205v.fsf@elaine3.Stanford.EDU> <Pine.GSO.4.44.0401110813540.11700-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine12.stanford.edu
X-Trace: news.Stanford.EDU 1073967896 23589 171.64.15.77 (13 Jan 2004 04:24:56 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5069


>However, should the answer for 2 x delay x bandwidth be 4.5 x 10**6,
>instead of 5.5 x 10**6?

Yep.
.

Path: shelby.stanford.edu!elaine12.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q7
Date: Tue, 13 Jan 2004 04:29:51 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <btvs7v$n7i$1@news.Stanford.EDU>
References: <btvro5$mg0$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine12.stanford.edu
X-Trace: news.Stanford.EDU 1073968191 23794 171.64.15.77 (13 Jan 2004 04:29:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5070


>What unit is represented by A(t)?  Is it simply bits per second, or does it represent the 
>cumulative total of bits received since the beginning of the transmission?

It's a cumulative total, not a rate (cf. Handout #3).
.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Q7 (def of A(t)
Date: Mon, 12 Jan 2004 21:04:11 -0800
Lines: 14
Distribution: su
Message-ID: <btvu8n$p9p$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1073970263 25913 128.12.90.43 (13 Jan 2004 05:04:23 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5071

So the definition of A(t) from the handout is "Cumulative number of bits
that have arrived up until time t". This implies that after 1.2 seconds, 1.2
bits have arrived.. is this correct? Or should we treat it as quantized by
bits?

A related question is whether, then, if the flow is actually continuous,
does that mean that the output link will start transmitting as soon as any
part of a bit arrives? For instance, if A(t) = t, during the first second, 1
bit arrives. Assuming the output link is also at 1 b/s, does it also
transmit 1 bit in the first second, or only after the second second?

-Eddy


.

Path: shelby.stanford.edu!elaine10.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q7 (def of A(t)
Date: Tue, 13 Jan 2004 05:15:24 +0000 (UTC)
Lines: 20
Distribution: su
Message-ID: <btvutc$ptf$1@news.Stanford.EDU>
References: <btvu8n$p9p$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine10.stanford.edu
X-Trace: news.Stanford.EDU 1073970924 26543 171.64.15.75 (13 Jan 2004 05:15:24 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5072


>So the definition of A(t) from the handout is "Cumulative number of bits
>that have arrived up until time t". This implies that after 1.2 seconds, 1.2
>bits have arrived.. is this correct? Or should we treat it as quantized by
>bits?

In this simple model, you can assume that bits arrive and depart
fractionally, on a continuous basis (as part (a) might suggest).
(The bit-by-bit model is an inaccurate approximation to simplify things, so
introducing quantization in here would be unnecessarily precise).

>A related question is whether, then, if the flow is actually continuous,
>does that mean that the output link will start transmitting as soon as any
>part of a bit arrives? For instance, if A(t) = t, during the first second, 1
>bit arrives. Assuming the output link is also at 1 b/s, does it also
>transmit 1 bit in the first second, or only after the second second?

In general, unless stated otherwise, you can assume continuous operation
for 'bits' as described above, and store-and-forward operation for
'packets'.
.

Path: shelby.stanford.edu!elaine32.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: determining if all data received
Date: Mon, 12 Jan 2004 23:34:21 -0800
Lines: 46
Distribution: su
Message-ID: <Pine.GSO.4.44.0401122332540.4365-100000@elaine32.Stanford.EDU>
References: <3FFF6168.5040801@stanford.edu> <snneku81da5.fsf@elaine3.Stanford.EDU>
 <btodb0$fn$1@news.Stanford.EDU> <btqmp2$bb8$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine32.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1073979264 7138 171.64.15.107 (13 Jan 2004 07:34:24 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <btqmp2$bb8$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5073


Hmm,

So are all connects to ftp servers expected to give a response of some
kind? because if not, and we call a read expecting one, our client will
hang

--vp

On Sat, 10 Jan 2004, Eddy Wu wrote:

> I think I know why you might be getting confused about this. When you make a
> connect() call to ftp.stanford.edu, it responds with a bunch of 220 replies
> (the welcome message), ending with "220 ftp1.stanford.edu FTP server
> ready.". The connect call triggers this, not any specific command that you
> send over the control connection. So, if you were to call connect(), then
> immediately send your USER command, it would reply with the 220 replies,
> plus a "331 Guest login ok...." response, which might be why you think it is
> sending multiple responses.
>
> -Eddy
>
> "Myles Barrett Williams" <mylesw@Stanford.EDU> wrote in message
> news:btodb0$fn$1@news.Stanford.EDU...
> > In article <snneku81da5.fsf@elaine3.Stanford.EDU>,
> > Susan Noreen Shepard  <shepard8@elaine3.Stanford.EDU> wrote:
> > >Are you refering to a socket reading the commands or the data?  I'm
> > >assuming the commands.
> > >
> > >Please read FAQ Q4 for homework 1.  The newsgroup from 2003
> > >has some more information (see below) as well.  Please check the FAQ and
> > >newsgroups first before posting.  If you're still confused, reply to this
> > >thread with your questions.
> >
> > I understand how to read each reply, but some servers send multiple
> > completion replies (e.g. ftp.stanford.edu when you connect).  Does the
> > protocol indicate explicitly which is the last one? I made a byte-by-
> > byte dump of the initial messages from ftp.stanford.edu and don't see
> > any useful difference between them (although I expected to, based on
> > the NVT spec).
> >
> > Myles
>
>
>

.

Path: shelby.stanford.edu!elaine12.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: determining if all data received
Date: Tue, 13 Jan 2004 07:49:45 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <bu07up$7sd$1@news.Stanford.EDU>
References: <3FFF6168.5040801@stanford.edu> <snneku81da5.fsf@elaine3.Stanford.EDU>  <btodb0$fn$1@news.Stanford.EDU> <btqmp2$bb8$1@news.Stanford.EDU> <Pine.GSO.4.44.0401122332540.4365-100000@elaine32.Stanford.EDU>
NNTP-Posting-Host: elaine12.stanford.edu
X-Trace: news.Stanford.EDU 1073980185 8077 171.64.15.77 (13 Jan 2004 07:49:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5074




>So are all connects to ftp servers expected to give a response of some
>kind? because if not, and we call a read expecting one, our client will
>hang

This is answered in the RFC--see sec. 5.4.
.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Purify complaints
Date: Tue, 13 Jan 2004 05:04:05 -0800
Organization: Stanford University
Lines: 25
Distribution: su
Message-ID: <pan.2004.01.13.13.04.03.541127@stanford.edu>
References: <pan.2004.01.11.22.08.04.357762@stanford.edu> <Pine.GSO.4.44.0401111434550.11650-100000@epic9.Stanford.EDU> <btsuah$e99$1@news.Stanford.EDU>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1073999045 28003 128.12.69.27 (13 Jan 2004 13:04:05 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Xref: shelby.stanford.edu su.class.cs244a:5075

So actually, you can't tell from this snippet, but this is non-blocking.
Also, it has changed a little bit, i.e., it appends to the buffer as
opposed to overwriting the data.  Anyway, I tried both checking the return
value of recv and doing the char command[256] = "" and still to no avail
as the error persists.  Any other ideas?

--Chris

On Mon, 12 Jan 2004 01:46:57 +0000, Matthew Jonathan Holliman wrote:

> 
> I'd guess that Purify can't tell that bzero() has zeroed out the array.  If
> you do something like
>   char command[256] = "";
> I'd assume the error would go away.
> 
> BTW, Purify will occasionally give spurious warnings, as in this case.  I'm
> not sure if Purify's capable of correctly detecting some of these
> stack-related issues, so it tends to be conservative in these cases.  It's
> probably best to fix the code (even if it's not really broken), just so the
> 'genuine' errors stand out.
> 
> Boris is correct that you should check the return value from recv().  Also,
> remember that it may not read all bytes you requested.

.

Path: shelby.stanford.edu!elaine10.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Send PASV once for the complete session
Date: Tue, 13 Jan 2004 09:46:32 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0401130937410.6510-100000@elaine10.Stanford.EDU>
NNTP-Posting-Host: elaine10.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074015996 15263 171.64.15.75 (13 Jan 2004 17:46:36 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5076


I understand that every data tranfer request (LIST, RETR), a new data
connection will be opened and then closed upon finish. What aboout "PASV"
command?
Should it be sent once, and then the returned port can be used for all
future data connection within the session?  or should PASV be sent for
every data request to obtain a potentially different port for each data
connection?

-Laura

.

Path: shelby.stanford.edu!epic8.Stanford.EDU!jmsilver
From: jmsilver@Stanford.EDU (Joshua M Silver)
Newsgroups: su.class.cs244a
Subject: Re: Purify complaints
Date: Tue, 13 Jan 2004 18:29:58 +0000 (UTC)
Organization: Stanford University, CA 94305, USA
Lines: 16
Distribution: su
Message-ID: <bu1df6$ht2$1@news.Stanford.EDU>
References: <pan.2004.01.11.22.08.04.357762@stanford.edu> <Pine.GSO.4.44.0401111434550.11650-100000@epic9.Stanford.EDU> <btsuah$e99$1@news.Stanford.EDU> <pan.2004.01.13.13.04.03.541127@stanford.edu>
NNTP-Posting-Host: epic8.stanford.edu
X-Trace: news.Stanford.EDU 1074018598 18338 171.64.15.41 (13 Jan 2004 18:29:58 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5077

Chris,

You could try running the purify executable under gdb and put a breakpoint
at "purify_stop_here".  When you hit the breakpoint, take a look at your
buffer and see what's going on.

Josh


>So actually, you can't tell from this snippet, but this is non-blocking.
>Also, it has changed a little bit, i.e., it appends to the buffer as
>opposed to overwriting the data.  Anyway, I tried both checking the return
>value of recv and doing the char command[256] = "" and still to no avail
>as the error persists.  Any other ideas?
>
>--Chris
.

Path: shelby.stanford.edu!elaine13.Stanford.EDU!anneyeh
From: Anne Kang-Ping Yeh <anneyeh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PASV and PORT
Date: Tue, 13 Jan 2004 12:14:39 -0800
Lines: 43
Distribution: su
Message-ID: <Pine.GSO.4.44.0401131211380.9124-100000@elaine13.Stanford.EDU>
References: <btut35$h05$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine13.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074024883 26377 171.64.15.78 (13 Jan 2004 20:14:43 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <btut35$h05$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5078

I'm a bit confused over how PASV and PORT are used, or what is the
difference between their usage.  Am I correct to say that PASV can be used
for commands like LIST, where the server will push data onto the data
connection established after the PASV command?  I tried that, but LIST
replies "425 Can't open data connection".

Thanks for help,
AYeh


On Mon, 12 Jan 2004, Matthew Jonathan Holliman wrote:

> I'm posting the answer to a question sent to me by e-mail here...
>
> >Basically, for the PASV mode, the ftpcopy has to maintain two sockets in
> >the same process, one for control connection, one for the data connection,
> >maybe use poll() to process the incoming messages.
> >
> >For the PORT mode, the ftpcopy need spawn another process to handle the
> >incoming data connection request from the server.  The ftpcopy need to
> >figure out the inter-process communication between the process that
> >handles the control connection and the process that handles the data
> >connection.
> >
> >This is my view of these two implementations.  Am I on the right track?
>
> For both PASV and PORT you'll typically have two sockets open in the same
> process, one for the control connection, one for the current data
> connection.
>
> You shouldn't need to use poll() or select()--in fact, it may be easier
> in the long run if you don't, since we'll be reusing ftpcopy in a later
> assignment where those interfaces probably won't be available.  Certainly
> if you use PORT, and I'd assume PASV too (although I haven't checked this),
> the protocol is defined so that there's no need to handle input on
> both sockets simultaneously.  If you take another look at the assignment
> description, it explains the sequence of steps associated with establishing
> a data connection--everything can proceed sequentially (and synchronously)
> as described.  There should be no need for a second process or IPC in this
> assignment.
>
>

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PASV and PORT
Date: Tue, 13 Jan 2004 21:04:57 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <bu1mhp$t62$1@news.Stanford.EDU>
References: <btut35$h05$1@news.Stanford.EDU> <Pine.GSO.4.44.0401131211380.9124-100000@elaine13.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1074027897 29890 171.64.15.118 (13 Jan 2004 21:04:57 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5079


>I'm a bit confused over how PASV and PORT are used, or what is the
>difference between their usage.  Am I correct to say that PASV can be used
>for commands like LIST, where the server will push data onto the data
>connection established after the PASV command?  I tried that, but LIST
>replies "425 Can't open data connection".

They're used roughly the same way, in the same places; the main difference
is that with PORT, you create a passive socket to which the ftp server
connects (as described in the assignment), while with PASV, you connect to
an address specified by the ftp server.  Both are used for data transfer
(LIST, RETR, etc.)

The assignment description assumes the use of PORT--so while you can use
PASV if you wish, you'll probably have to rely on the RFC for that.
.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Send PASV once for the complete session
Date: Tue, 13 Jan 2004 21:08:10 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <bu1mnq$34$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401130937410.6510-100000@elaine10.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1074028090 100 171.64.15.118 (13 Jan 2004 21:08:10 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5080



>I understand that every data tranfer request (LIST, RETR), a new data
>connection will be opened and then closed upon finish. What aboout "PASV"
>command?
>Should it be sent once, and then the returned port can be used for all
>future data connection within the session?  or should PASV be sent for
>every data request to obtain a potentially different port for each data
>connection?

Keep in mind how you tell when the server's finished a particular data
transfer--how would this work if it were to reuse the same data
connection?

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Purify complaints
Date: Tue, 13 Jan 2004 21:16:18 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <bu1n72$uq$1@news.Stanford.EDU>
References: <pan.2004.01.11.22.08.04.357762@stanford.edu> <Pine.GSO.4.44.0401111434550.11650-100000@epic9.Stanford.EDU> <btsuah$e99$1@news.Stanford.EDU> <pan.2004.01.13.13.04.03.541127@stanford.edu>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1074028578 986 171.64.15.118 (13 Jan 2004 21:16:18 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5081


>So actually, you can't tell from this snippet, but this is non-blocking.
>Also, it has changed a little bit, i.e., it appends to the buffer as
>opposed to overwriting the data.  Anyway, I tried both checking the return
>value of recv and doing the char command[256] = "" and still to no avail
>as the error persists.  Any other ideas?

In the original code you do a recv() of the buffer size--if it returned all
bytes requested, the string would no longer be guaranteed to be
null-terminated.  If the server returns a long greeting, I suppose this
situation might occur.

.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Due date for Problem Set #1
Date: Tue, 13 Jan 2004 13:23:31 -0800
Lines: 11
Distribution: su
Message-ID: <400461D3.BF6CC92@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074029012 1102 127.0.0.1 (13 Jan 2004 21:23:32 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U)
X-Accept-Language: ko,en
Xref: shelby.stanford.edu su.class.cs244a:5082

The Problem Set #1 says "Due 4pm, Wednesday 14th January 2004"
and Susan also seemed to confirm that in her postings on Saturday.

However, the timetable on the class web site says it's due at noon,
Friday 16th January, and so does Martin in his email today.

So, what's the due date for the Problem Set #1 really?
I haven't heard of any announcement regarding this issue.

-- 
Seungbeom Kim
.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Due date for Problem Set #1
Date: Tue, 13 Jan 2004 21:32:31 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <bu1o5f$27t$1@news.Stanford.EDU>
References: <400461D3.BF6CC92@stanford.edu>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1074029551 2301 171.64.15.118 (13 Jan 2004 21:32:31 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5083


>So, what's the due date for the Problem Set #1 really?
>I haven't heard of any announcement regarding this issue.

Nick sent an e-mail out to the class mailing list earlier today about this.
(Everyone registered for the class should have received it).

The problem set due date has been pushed back until Friday, since some
of the material needed for the last few questions won't be covered
until today's lecture.
.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Purify complaints
Date: Tue, 13 Jan 2004 13:33:02 -0800
Lines: 17
Distribution: su
Message-ID: <20040113133302.23c45c9c.chanman@stanford.edu>
References: <pan.2004.01.11.22.08.04.357762@stanford.edu>
	<Pine.GSO.4.44.0401111434550.11650-100000@epic9.Stanford.EDU>
	<btsuah$e99$1@news.Stanford.EDU>
	<pan.2004.01.13.13.04.03.541127@stanford.edu>
	<bu1n72$uq$1@news.Stanford.EDU>
NNTP-Posting-Host: chanman.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074029614 10434 128.12.94.94 (13 Jan 2004 21:33:34 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed version 0.9.6 (GTK+ 1.2.10; i386-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:5084

Wouldn't that be an array bounds error and not uninitialized memory?  Just my intuition.

On Tue, 13 Jan 2004 21:16:18 +0000 (UTC)
holliman@Stanford.EDU (Matthew Jonathan Holliman) wrote:

> 
> >So actually, you can't tell from this snippet, but this is non-blocking.
> >Also, it has changed a little bit, i.e., it appends to the buffer as
> >opposed to overwriting the data.  Anyway, I tried both checking the return
> >value of recv and doing the char command[256] = "" and still to no avail
> >as the error persists.  Any other ideas?
> 
> In the original code you do a recv() of the buffer size--if it returned all
> bytes requested, the string would no longer be guaranteed to be
> null-terminated.  If the server returns a long greeting, I suppose this
> situation might occur.
> 
.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Purify complaints
Date: Tue, 13 Jan 2004 21:39:42 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <bu1oiu$2qm$1@news.Stanford.EDU>
References: <pan.2004.01.11.22.08.04.357762@stanford.edu> 	<Pine.GSO.4.44.0401111434550.11650-100000@epic9.Stanford.EDU> 	<btsuah$e99$1@news.Stanford.EDU> 	<pan.2004.01.13.13.04.03.541127@stanford.edu> 	<bu1n72$uq$1@news.Stanford.EDU> <20040113133302.23c45c9c.chanman@stanford.edu>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1074029982 2902 171.64.15.118 (13 Jan 2004 21:39:42 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5085


>Wouldn't that be an array bounds error and not uninitialized memory?  Just my intuition.

Hmm, it might be.

Another thing to try would be to use memset() rather than bzero().

.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Purify complaints
Date: Tue, 13 Jan 2004 13:43:15 -0800
Organization: Stanford University
Lines: 26
Distribution: su
Message-ID: <pan.2004.01.13.21.43.12.444599@stanford.edu>
References: <pan.2004.01.11.22.08.04.357762@stanford.edu> <Pine.GSO.4.44.0401111434550.11650-100000@epic9.Stanford.EDU> <btsuah$e99$1@news.Stanford.EDU> <pan.2004.01.13.13.04.03.541127@stanford.edu> <bu1n72$uq$1@news.Stanford.EDU> <20040113133302.23c45c9c.chanman@stanford.edu>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1074030195 3120 128.12.69.27 (13 Jan 2004 21:43:15 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Xref: shelby.stanford.edu su.class.cs244a:5086

Hmmm,

Strangely, no.  That was the problem.

--Chris

On Tue, 13 Jan 2004 13:33:02 -0800, William Chan wrote:

> Wouldn't that be an array bounds error and not uninitialized memory?  Just my intuition.
> 
> On Tue, 13 Jan 2004 21:16:18 +0000 (UTC)
> holliman@Stanford.EDU (Matthew Jonathan Holliman) wrote:
> 
>> 
>> >So actually, you can't tell from this snippet, but this is non-blocking.
>> >Also, it has changed a little bit, i.e., it appends to the buffer as
>> >opposed to overwriting the data.  Anyway, I tried both checking the return
>> >value of recv and doing the char command[256] = "" and still to no avail
>> >as the error persists.  Any other ideas?
>> 
>> In the original code you do a recv() of the buffer size--if it returned all
>> bytes requested, the string would no longer be guaranteed to be
>> null-terminated.  If the server returns a long greeting, I suppose this
>> situation might occur.
>>

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Q7b
Date: Tue, 13 Jan 2004 15:12:45 -0800
Lines: 7
Distribution: su
Message-ID: <bu1u1t$8ti$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074035581 9138 128.12.90.43 (13 Jan 2004 23:13:01 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5087

I read in a previous year's newsgroup that the answers to part b of question
7 should be in bits. However, given that this is a store-and-forward router,
it seems like it would be impossible to write a continuous mathematical
equation given that the departures will be bursty. Am I just missing
something?


.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Q3b
Date: Tue, 13 Jan 2004 16:27:42 -0800
Lines: 3
Distribution: su
Message-ID: <20040113162742.0c23dc8d.chanman@stanford.edu>
NNTP-Posting-Host: chanman.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074040094 10434 128.12.94.94 (14 Jan 2004 00:28:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed version 0.9.6 (GTK+ 1.2.10; i386-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:5088

So what's the deal with the departure rate?  If the malfunction does not affect it, then the average delay seems trivial (0).  However, it seems weird that it would match the arrival rate of non-dropped packets.  How should this question be interpreted?

--William
.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Due date for Problem Set #1
Date: Tue, 13 Jan 2004 17:19:46 -0800
Lines: 17
Distribution: su
Message-ID: <40049932.C69FDD15@stanford.edu>
References: <400461D3.BF6CC92@stanford.edu> <bu1o5f$27t$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074043187 19947 127.0.0.1 (14 Jan 2004 01:19:47 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U)
X-Accept-Language: ko,en
Xref: shelby.stanford.edu su.class.cs244a:5089

Matthew Jonathan Holliman wrote:
> 
> Nick sent an e-mail out to the class mailing list earlier today about this.
> (Everyone registered for the class should have received it).

Did he? To which address? I didn't get it, although I'm receiving
emails sent to <cs244a-win0304-all@lists.stanford.edu>.

I checked Axess and saw that I had CS244A in my study list;
I checked EEClass and saw that I was registered there;
what else could I have missed?

And can I also ask that all announcements be posted here even when
they are sent in emails so that students can find all of them here?

-- 
Seungbeom Kim
.

Path: shelby.stanford.edu!elaine39.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ps1 q7
Date: Tue, 13 Jan 2004 17:30:57 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.GSO.4.44.0401131729400.11373-100000@elaine39.Stanford.EDU>
NNTP-Posting-Host: elaine39.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074043858 20743 171.64.15.114 (14 Jan 2004 01:30:58 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5090

Just would like some clarification of the unit of the A(t), D(t) etc. Are
the values in bits or number of packets? Thank you.

Lin

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Q8
Date: Tue, 13 Jan 2004 18:14:31 -0800
Lines: 4
Distribution: su
Message-ID: <bu28mn$ooj$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074046487 25363 128.12.90.43 (14 Jan 2004 02:14:47 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5091

Can we assume that rho and sigma are positive numbers?



.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Due date for Problem Set #1
Date: Tue, 13 Jan 2004 18:59:07 -0800
Organization: Stanford University
Lines: 21
Distribution: su
Message-ID: <pan.2004.01.14.02.59.06.128233@stanford.edu>
References: <400461D3.BF6CC92@stanford.edu> <bu1o5f$27t$1@news.Stanford.EDU> <40049932.C69FDD15@stanford.edu>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1074049147 28316 128.12.69.27 (14 Jan 2004 02:59:07 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Xref: shelby.stanford.edu su.class.cs244a:5092

I didn't get it either and I am registered in both places as well.

--Chris

On Tue, 13 Jan 2004 17:19:46 -0800, Seungbeom Kim wrote:

> Matthew Jonathan Holliman wrote:
>> 
>> Nick sent an e-mail out to the class mailing list earlier today about this.
>> (Everyone registered for the class should have received it).
> 
> Did he? To which address? I didn't get it, although I'm receiving
> emails sent to <cs244a-win0304-all@lists.stanford.edu>.
> 
> I checked Axess and saw that I had CS244A in my study list;
> I checked EEClass and saw that I was registered there;
> what else could I have missed?
> 
> And can I also ask that all announcements be posted here even when
> they are sent in emails so that students can find all of them here?

.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Due date for Problem Set #1
Date: Tue, 13 Jan 2004 19:01:09 -0800
Organization: Stanford University
Lines: 28
Distribution: su
Message-ID: <pan.2004.01.14.03.01.07.651798@stanford.edu>
References: <400461D3.BF6CC92@stanford.edu> <bu1o5f$27t$1@news.Stanford.EDU> <40049932.C69FDD15@stanford.edu> <pan.2004.01.14.02.59.06.128233@stanford.edu>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1074049269 28316 128.12.69.27 (14 Jan 2004 03:01:09 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Xref: shelby.stanford.edu su.class.cs244a:5093

In fact, now that I check closer, I haven't gotten anything from
cs244a-win0304-all.

--Chris

On Tue, 13 Jan 2004 18:59:07 -0800, Chris Edstrom wrote:

> I didn't get it either and I am registered in both places as well.
> 
> --Chris
> 
> On Tue, 13 Jan 2004 17:19:46 -0800, Seungbeom Kim wrote:
> 
>> Matthew Jonathan Holliman wrote:
>>> 
>>> Nick sent an e-mail out to the class mailing list earlier today about this.
>>> (Everyone registered for the class should have received it).
>> 
>> Did he? To which address? I didn't get it, although I'm receiving
>> emails sent to <cs244a-win0304-all@lists.stanford.edu>.
>> 
>> I checked Axess and saw that I had CS244A in my study list;
>> I checked EEClass and saw that I was registered there;
>> what else could I have missed?
>> 
>> And can I also ask that all announcements be posted here even when
>> they are sent in emails so that students can find all of them here?

.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Due date for Problem Set #1
Date: Wed, 14 Jan 2004 03:33:28 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <bu2da8$12h$1@news.Stanford.EDU>
References: <400461D3.BF6CC92@stanford.edu> <bu1o5f$27t$1@news.Stanford.EDU> <40049932.C69FDD15@stanford.edu> <pan.2004.01.14.02.59.06.128233@stanford.edu> <pan.2004.01.14.03.01.07.651798@stanford.edu>
NNTP-Posting-Host: elaine26.stanford.edu
X-Trace: news.Stanford.EDU 1074051208 1105 171.64.15.101 (14 Jan 2004 03:33:28 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5094


Hmm, you're both on cs244a-win0304-students@lists (that goes for anyone
else who's sent me e-mail about this too)--I'm not sure why you wouldn't
be receiving those e-mails.  Perhaps it's a transient problem in a
mail server somewhere.

We'll try and post announcements to the newsgroup as well in future.

.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q7b
Date: Wed, 14 Jan 2004 03:42:48 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <bu2dro$206$1@news.Stanford.EDU>
References: <bu1u1t$8ti$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
X-Trace: news.Stanford.EDU 1074051768 2054 171.64.15.101 (14 Jan 2004 03:42:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5095


>I read in a previous year's newsgroup that the answers to part b of question
>7 should be in bits. However, given that this is a store-and-forward router,
>it seems like it would be impossible to write a continuous mathematical
>equation given that the departures will be bursty. Am I just missing
>something?

Why will the departures be bursty?  You can assume that bits flow into and
out of the router 'smoothly' (i.e. continuously, no need to worry about
working with only whole bits).

.

Path: shelby.stanford.edu!not-for-mail
From: Hong Thai Lam <honglam@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: electronic hw submission???
Date: Wed, 14 Jan 2004 03:44:30 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <bu2duu$1so$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1074051870 1944 171.64.15.68 (14 Jan 2004 03:44:30 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5096

Hi,

Can we email the solutions to Problem Sets or do you have to
drop off a hardcopy?

Thanks,
hong
.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q3b
Date: Wed, 14 Jan 2004 03:44:47 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <bu2dvf$24v$1@news.Stanford.EDU>
References: <20040113162742.0c23dc8d.chanman@stanford.edu>
NNTP-Posting-Host: elaine26.stanford.edu
X-Trace: news.Stanford.EDU 1074051887 2207 171.64.15.101 (14 Jan 2004 03:44:47 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5097


>So what's the deal with the departure rate?  If the malfunction does not affect it, then the average delay seems trivial (0).  However, it seems weird that it would match the arrival rate of non-dropped packets.  How should this question be interpreted?

Sorry, I don't understand what you're asking.  Can you rephrase your
question?

.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: electronic hw submission???
Date: Wed, 14 Jan 2004 03:45:49 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <bu2e1d$27i$1@news.Stanford.EDU>
References: <bu2duu$1so$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
X-Trace: news.Stanford.EDU 1074051949 2290 171.64.15.101 (14 Jan 2004 03:45:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5098



>Can we email the solutions to Problem Sets or do you have to
>drop off a hardcopy?

Please drop off a hardcopy--emailed solutions tend to be misplaced or
forgotten by TAs during grading.
.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ps1 q7
Date: Wed, 14 Jan 2004 03:46:33 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <bu2e2p$29b$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401131729400.11373-100000@elaine39.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
X-Trace: news.Stanford.EDU 1074051993 2347 171.64.15.101 (14 Jan 2004 03:46:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5099


>Just would like some clarification of the unit of the A(t), D(t) etc. Are
>the values in bits or number of packets? Thank you.

These are all in bits.
.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q8
Date: Wed, 14 Jan 2004 03:47:20 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <bu2e48$2at$1@news.Stanford.EDU>
References: <bu28mn$ooj$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
X-Trace: news.Stanford.EDU 1074052040 2397 171.64.15.101 (14 Jan 2004 03:47:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5100


>Can we assume that rho and sigma are positive numbers?

Sure, what would be their interpretation if they were negative?

.

Path: shelby.stanford.edu!elaine21.Stanford.EDU!anneyeh
From: Anne Kang-Ping Yeh <anneyeh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftpd and PASS
Date: Tue, 13 Jan 2004 19:50:18 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.GSO.4.44.0401131944450.21238-100000@elaine21.Stanford.EDU>
NNTP-Posting-Host: elaine21.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074052219 2653 171.64.15.86 (14 Jan 2004 03:50:19 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5101

I'm trying to use the ftpd provided, the USER command is ok, but the PASS
command would fail with code "500 '': command not understood."
The same piece of code works fine if I connect to ftp.cs.stanford.edu.

Am I doing something wrong?
Thanks,
Anne


.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ftpd and PASS
Date: Wed, 14 Jan 2004 04:08:52 +0000 (UTC)
Lines: 21
Distribution: su
Message-ID: <bu2fck$3mm$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401131944450.21238-100000@elaine21.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1074053332 3798 171.64.15.119 (14 Jan 2004 04:08:52 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5102


>I'm trying to use the ftpd provided, the USER command is ok, but the PASS
>command would fail with code "500 '': command not understood."
>The same piece of code works fine if I connect to ftp.cs.stanford.edu.

>Am I doing something wrong?

Sounds like it:


% telnet localhost 47596
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
220 elaine0.Stanford.EDU FTP server (Version 2.0WU(44) Fri Jan 14 13:36:13 PST 2000) ready.
USER anonymous
331 Guest login ok, send your complete e-mail address as password.
PASS holliman@stanford.edu
230 Guest login ok, access restrictions apply.


.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q7b
Date: Tue, 13 Jan 2004 20:40:49 -0800
Lines: 29
Distribution: su
Message-ID: <bu2hak$5sj$1@news.Stanford.EDU>
References: <bu1u1t$8ti$1@news.Stanford.EDU> <bu2dro$206$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074055316 6035 128.12.90.43 (14 Jan 2004 04:41:56 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5103

"The incoming link has a data-rate of 1000 bits per second. A new packet of
size 100 bits begins to arrive every second. The output link also operates
at a constant 1000 bits per second."

It would seem to me that this means that it takes .1 seconds for the first
100-bit packet to arrive, so at time .1 the router starts to discharge the
packet at 1000 bits per second, which would take another .1 seconds. But the
next incoming packet doesn't arrive until second 1, which is .8 seconds
later, during which time the router appears to be completely idle.

Is this the correct interpretation of the problem?

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:bu2dro$206$1@news.Stanford.EDU...
>
> >I read in a previous year's newsgroup that the answers to part b of
question
> >7 should be in bits. However, given that this is a store-and-forward
router,
> >it seems like it would be impossible to write a continuous mathematical
> >equation given that the departures will be bursty. Am I just missing
> >something?
>
> Why will the departures be bursty?  You can assume that bits flow into and
> out of the router 'smoothly' (i.e. continuously, no need to worry about
> working with only whole bits).
>


.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q7b
Date: Wed, 14 Jan 2004 04:46:06 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <bu2hie$63o$1@news.Stanford.EDU>
References: <bu1u1t$8ti$1@news.Stanford.EDU> <bu2dro$206$1@news.Stanford.EDU> <bu2hak$5sj$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1074055566 6264 171.64.15.119 (14 Jan 2004 04:46:06 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5104

>"The incoming link has a data-rate of 1000 bits per second. A new packet of
>size 100 bits begins to arrive every second. The output link also operates
>at a constant 1000 bits per second."

>It would seem to me that this means that it takes .1 seconds for the first
>100-bit packet to arrive, so at time .1 the router starts to discharge the
>packet at 1000 bits per second, which would take another .1 seconds. But the
>next incoming packet doesn't arrive until second 1, which is .8 seconds
>later, during which time the router appears to be completely idle.

>Is this the correct interpretation of the problem?

Ah, I see what you're asking--yes, that's the correct interpretation.
.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q7b
Date: Tue, 13 Jan 2004 20:50:42 -0800
Lines: 26
Distribution: su
Message-ID: <bu2hrh$6c6$1@news.Stanford.EDU>
References: <bu1u1t$8ti$1@news.Stanford.EDU> <bu2dro$206$1@news.Stanford.EDU> <bu2hak$5sj$1@news.Stanford.EDU> <bu2hie$63o$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074055857 6534 128.12.90.43 (14 Jan 2004 04:50:57 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5105

Are we allowed to use floor() and/or ceil() in our function definitions
then?


"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:bu2hie$63o$1@news.Stanford.EDU...
> >"The incoming link has a data-rate of 1000 bits per second. A new packet
of
> >size 100 bits begins to arrive every second. The output link also
operates
> >at a constant 1000 bits per second."
>
> >It would seem to me that this means that it takes .1 seconds for the
first
> >100-bit packet to arrive, so at time .1 the router starts to discharge
the
> >packet at 1000 bits per second, which would take another .1 seconds. But
the
> >next incoming packet doesn't arrive until second 1, which is .8 seconds
> >later, during which time the router appears to be completely idle.
>
> >Is this the correct interpretation of the problem?
>
> Ah, I see what you're asking--yes, that's the correct interpretation.


.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q7b
Date: Wed, 14 Jan 2004 04:56:18 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <bu2i5i$6kn$1@news.Stanford.EDU>
References: <bu1u1t$8ti$1@news.Stanford.EDU> <bu2dro$206$1@news.Stanford.EDU> <bu2hak$5sj$1@news.Stanford.EDU> <bu2hie$63o$1@news.Stanford.EDU> <bu2hrh$6c6$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1074056178 6807 171.64.15.119 (14 Jan 2004 04:56:18 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5106


>Are we allowed to use floor() and/or ceil() in our function definitions
>then?

Yep.

.

Path: shelby.stanford.edu!not-for-mail
From: Joey Liaw <jliaw@@@stanford.....nospam.edu>
Newsgroups: su.class.cs244a
Subject: fragmentation bits
Date: Wed, 14 Jan 2004 06:12:35 +0000 (UTC)
Organization: Stanford University
Lines: 3
Distribution: su
Message-ID: <Xns946FE1EECD786jliawstanfordnospam@171.64.14.103>
NNTP-Posting-Host: myeah.stanford.edu
X-Trace: news.Stanford.EDU 1074060755 11848 128.12.102.21 (14 Jan 2004 06:12:35 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Xnews/5.04.25
Xref: shelby.stanford.edu su.class.cs244a:5107

In the lecture notes diagram, fragmentation offset seems to be smaller than  
total packet length.  Does this ever cause a problem on very large (nearing 
65535) length packets?
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: fragmentation bits
Date: Tue, 13 Jan 2004 23:16:48 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0401132314490.23640-100000@Xenon.Stanford.EDU>
References: <Xns946FE1EECD786jliawstanfordnospam@171.64.14.103>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074064611 16099 171.64.66.201 (14 Jan 2004 07:16:51 GMT)
X-Complaints-To: news@news.stanford.edu
To: Joey Liaw <jliaw@stanford.edu>
In-Reply-To: <Xns946FE1EECD786jliawstanfordnospam@171.64.14.103>
Xref: shelby.stanford.edu su.class.cs244a:5108


> In the lecture notes diagram, fragmentation offset seems to be smaller than  
> total packet length.  Does this ever cause a problem on very large (nearing 
> 65535) length packets?

  The fragment offset field contains the offset in 8 byte units from the
  beginning of the original datagram, so it can handle a packet of
  maximum length.

  .mc

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Local Host IP Address on Linux (Question for Martin's code)
Date: Wed, 14 Jan 2004 00:02:32 -0800
Lines: 209
Distribution: su
Message-ID: <Pine.GSO.4.44.0401132353260.22723-100000@elaine31.Stanford.EDU>
References: <bta257$3p4$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401050931550.28579-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074067354 19231 171.64.15.106 (14 Jan 2004 08:02:34 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0401050931550.28579-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5109


Hey Martin,

I'm trying to understand your code, but am having problems...Here are
some quesitons:

1. the first call to getsockname passing in ctrl socket is
what obtains the local ip address, correct?

2. after that step, you bind the data socket to that address structure
(passing in 0 for sin_port to get the ephemeral port) and then call
getsockname again.Is this second getsockname simply to get the actual port number,
because the IP address is unchanged from calling the getsockname the first time,
correct?  I'm guessing that you did this only because these were the next
steps in establishing the data connection for our ftp client, but not
necessarily a required step if all we wanted was the local IP address, is
that correct?

3. Also, I was trying to read in the text what SO_REUSEADDR was supposed
to do, but kinda got lost...do you have any simple way to explain it?

Thanx

--vishal

On Mon, 5 Jan 2004, Martin Casado wrote:

>
> > Hi-
> >
> > I've been working on assignment 1 (trying to get a jump on it).
>
>  trying to get a jump on it indeed!
>
> > I'm working remotely,
> > so I have to use machines other than the Stanford Hosts because of my remote situation.
> > In particular, I use linux 2.4.22 of the debian distro.
> >
> > In doing assignment 1, I have noticed that the meat of the work is in learning how to use
> > the sockets api correctly.  I have tried to create a test program to create a control
> > connection and a data connection with an ftp server.  I'm running into problems with
> > creating the data connection.  In order to create the data connection, the local hosts's
> > IP address and port must be sent to the ftp server.  I can get the ephemeral port number
> > using getsockname, but I can't seem to consistently get the IP address.  Here is the
> > code in question:
>
>  This seems to be a pretty common question for this assignment so lets KO it
>  right now.
>
>  You really have three options here ....
>
>  1) Use passive mode :) (PASV) this way you can reuse your socket connection
>     code and don't have to implement server functionality in your program.
>
>  2) You can use a shameless (nonportable and incorrect!) hack and use
>     gethostbyname() on the string returned by gethostname().
>     This is a really lame way to get the local IP and it doesn't
>     work in all cases.
>
>  3) You can use the following code :) to do it correctly.  I'm don't think
>     anyone has actually posted the correct method of doing this nor actually
>     used it (it is a bit obscure) so here it is.
>
>     The solution is to connect to the destination .. say "ftp.microsoft.com"
>     ... and use the local socket information for binding localy (to ensure we
>     bind to the correct interface) and then use getsocketname(..) from there.
>     At this point this may be a bit confusing but it should become more
>     understandable over time.
>
>     /* -------------------------------------------------------- */
>
>     struct  sockaddr_in ctrl_addr; /* connected to server */
>     struct  sockaddr_in data_addr; /* used to get local IP */
>     int     datas, ctrls;  /* couple' o file descriptors */
>     int     one = 1; /* the number one ... don't ask */
>     int     len = 0;
>
>     /* -- connect to server ... ftp.microsoft.com in this case -- */
>       ctrls = socket(AF_INET, SOCK_STREAM, 0);
>
>       memset((char *)&ctrl_addr, 0, sizeof (ctrl_addr));
>       ctrl_addr.sin_addr.s_addr = inet_addr("207.46.133.140");
>       ctrl_addr.sin_family = AF_INET;
>       ctrl_addr.sin_port = htons(21);
>
>       if (connect(ctrls, (struct sockaddr *)&ctrl_addr, sizeof (ctrl_addr)) ==
>               -1)
>       { perror("connect"); return -1; }
>     /* -- done connecting to ftp.microsoft.com                 -- */
>
>     memset((char *)&data_addr, 0, sizeof(struct sockaddr_in));
>
>     /* -- get local socket info on connected socket -- */
>     len = sizeof(data_addr);
>     if( getsockname(ctrls, (struct sockaddr *)&data_addr, &len) == -1)
>     { perror("getsockname"); return -1; }
>
>     /* -- now we create a new socket to bind and read the addr from -- */
>      datas = socket(AF_INET, SOCK_STREAM, 0);
>
>      if( setsockopt(datas, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof (one))
>              == -1)
>      { perror("setsockupt"); return -1; }
>
>      data_addr.sin_port = 0;
>      if ( bind(datas, (struct sockaddr *)&data_addr, sizeof (data_addr)) == -1)
>      { perror("bind"); return -1; }
>     /* -- done binding local socket -- */
>
>     len = sizeof (data_addr);
>     if ( getsockname(datas, (struct sockaddr *)&data_addr, &len) == -1 )
>     { perror("getsockname"); return -1; }
>
>     printf(" Address: %s\n", inet_ntoa(data_addr.sin_addr));
>     /* -- TADA! -- */
>
>
>   Hmm, perhaps this is a good one for the FAQ.
>
>   Cheers,
>     .m
>
> > int main (int argc, char *argv[]) {
> >
> >   int sfd, cfd, sl, cl;
> >   struct sockaddr_in addr, caddr;
> >   char port[256];
> >   struct e {
> >     unsigned char a;
> >     unsigned char b;
> >   };
> >
> >   union  {
> >     unsigned short c;
> >     struct e d;
> >   } x;
> >
> >
> >   char ip[256];
> >   char hostname[256];
> >   struct hostent *host;
> >   char *ptr;
> >
> >   if ( (sfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) printf ("E");
> >   bzero((char*) &addr, sizeof(addr));
> >   addr.sin_family = AF_INET;
> >   addr.sin_port = htons(0);
> >   addr.sin_addr.s_addr = htonl(INADDR_ANY);
> >
> >   if ( (bind(sfd, (struct sockaddr *) &addr, sizeof(struct sockaddr))) < 0) printf ("E");
> >
> >   sl =  sizeof(struct sockaddr);
> >   getsockname(sfd, (struct sockaddr *) &addr, &sl);
> >   sprintf(port, "%d", ntohs(addr.sin_port));
> >   printf("port = %s\n", port);
> >
> >   /* This didn't work; early attempt */
> >   sprintf(ip, "%s", ntohl(addr.sin_addr.s_addr));
> >   printf("ip = %s\n", ip);
> >
> >   x.c = ntohs(addr.sin_port);
> >   printf("low bits = %u\n", x.d.a);
> >   printf("high bits = %u\n", x.d.b);
> >
> >
> >   /* This doesn't work */
> >   printf("ip address = %s\n", inet_ntoa(addr.sin_addr));
> >
> >   /* This works on cygwin and sun but not on my linux machine that uses dhcp */
> >   gethostname(hostname, 256);
> >   if ( (host = gethostbyname(hostname)) < 0) perror("E: gethostbyname");
> >   printf("ip address = %s\n", inet_ntoa(*( (struct in_addr*) (host->h_addr_list[0]))));
> >
> >   /* Ignore this; early attempts */
> >   printf("hostname = %s\n", hostname);
> >   ptr = host->h_addr;
> >   while (*ptr) {
> >     printf("ip address = %d\n", *ptr);
> >     ptr++;
> >   }
> >
> >
> > This works on the Stanford hosts and my pc using cygwin.  But, when I try to run this on my
> > linux host it gives me the following results:
> >
> > port = 32787
> > ip = (null)
> > low bits = 19
> > high bits = 128
> > ip address = 0.0.0.0
> > hostname = icebox1.dieterly.com
> > ip address = 127
> > ip address = 127.0.0.1
> >
> > The port info is correct, but the IP Address is always the loopback address.
> >
> > I've tried every possible configuration I can think of in /etc/hosts and /etc/network/interfaces,
> > but nothing seems to work.  I've also tried to find a sockets function that will return the
> > dhcp IP Address that my pc running linux uses, but to no avail.  Since this seems to work
> > on the Stanford hosts, I guess that I could just use it and not worry about it not working
> > on linux, but that doesn't seem very satisfactory to me.
> >
> > Thanks for any help that you may be able to give me.
> >
>
>
>
>

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: electronic hw submission???
Date: Wed, 14 Jan 2004 00:04:34 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0401140003170.22723-100000@elaine31.Stanford.EDU>
References: <bu2duu$1so$1@news.Stanford.EDU> <bu2e1d$27i$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074067475 19299 171.64.15.106 (14 Jan 2004 08:04:35 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bu2e1d$27i$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5110


If we are remote students, can we use the normal procedure of faxing our
stuff into SCPD and letting them deliver it?  Its a little hard for me to
get to campus usually...

--vishal

On Wed, 14 Jan 2004, Matthew Jonathan Holliman wrote:

>
>
> >Can we email the solutions to Problem Sets or do you have to
> >drop off a hardcopy?
>
> Please drop off a hardcopy--emailed solutions tend to be misplaced or
> forgotten by TAs during grading.
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftpd and PASS
Date: Wed, 14 Jan 2004 07:52:00 -0800
Lines: 26
Distribution: su
Message-ID: <bu3oj1$fp8$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401131944450.21238-100000@elaine21.Stanford.EDU>
NNTP-Posting-Host: agila.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074095521 16168 128.12.194.74 (14 Jan 2004 15:52:01 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0401131944450.21238-100000@elaine21.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5111

Anne Kang-Ping Yeh wrote:
> I'm trying to use the ftpd provided, the USER command is ok, but the PASS
> command would fail with code "500 '': command not understood."
> The same piece of code works fine if I connect to ftp.cs.stanford.edu.
> 
> Am I doing something wrong?
> Thanks,
> Anne
> 
> 

You may be sending an extra '\0' character which the server interprets 
as the next command.  That happened to me when I did:

char *cmd = "USER anonymous\r\n";
send(ctrl_sockfd, cmd, strlen(cmd)+1, MSG_WAIT_ALL); // notice the (+1)

char *cmd = "PASS foo@bar.com";
send(ctrl_sockfd, cmd, strlen(cmd)+1, MSG_WAIT_ALL); // notice the (+1)

The +1 after strlen effectively sends the '\0' character as the next 
command since the ftp server reads the first command only up to "\r\n". 
  The second command then becomes "\0".

Paul E.

.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Handout #3, slide 37.
Date: Wed, 14 Jan 2004 08:24:10 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.GSO.4.44.0401140811340.17975-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: epic6.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074097452 17653 171.64.15.39 (14 Jan 2004 16:24:12 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5112

After Tuesday (01/13) lecture,
I'm looking at the example in the handout and not getting
the line of obtaining 25 bits as the average queue occupancy
when the queue is non-empty.

The line .5 * (.1*500) = 25 bits.  What does this mean and
what's the significance of each number.

Here is what I do understand.  I do understand why for the first
0.1 seconds the overall rate of bit arrival is 500 b/s (1000b/s arrival -
500 b/s departure).  The next 0.1 seconds, the rate is -500b/s
if looking from arrival point of reference.

I also understand that computing the area in between two curves
which happen to be a difference of areas of two triangles,
0.5*100*0.2 - 0.5*100*0.1 = 5 bits (same as the final result obtained in
the slide).

Boris.

.

Path: shelby.stanford.edu!not-for-mail
From: Duggan John Dieterly <dieterly@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Handout #3, slide 37.
Date: Wed, 14 Jan 2004 16:37:04 +0000 (UTC)
Lines: 45
Distribution: su
Message-ID: <bu3r7g$hmr$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401140811340.17975-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: saga7.stanford.edu
X-Trace: news.Stanford.EDU 1074098224 18139 171.64.15.137 (14 Jan 2004 16:37:04 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5113


I am also having trouble with this slide.  Is it possible that there is 
a mistake?

I think that the following line:

..5 * (.1 * 500) = 25 bits 

should be

..5 * 50 = 25 bits

50 comes from the fact that at the end of .1 seconds, there will be 
50 bits in the queue.  Is it possible that the (.1 * 500) which 
uses the rate of accumulation (500bits/s) just coincidently comes to 
50 and makes the result come out correct?  

After looking at this, I don't think that the rate of 500b/s should be
used in the calculations.  Only the number of actual bits left in the
queue after .1 seconds matters.




Boris Senderzon <senderzo@stanford.edu> wrote:
> After Tuesday (01/13) lecture,
> I'm looking at the example in the handout and not getting
> the line of obtaining 25 bits as the average queue occupancy
> when the queue is non-empty.

> The line .5 * (.1*500) = 25 bits.  What does this mean and
> what's the significance of each number.

> Here is what I do understand.  I do understand why for the first
> 0.1 seconds the overall rate of bit arrival is 500 b/s (1000b/s arrival -
> 500 b/s departure).  The next 0.1 seconds, the rate is -500b/s
> if looking from arrival point of reference.

> I also understand that computing the area in between two curves
> which happen to be a difference of areas of two triangles,
> 0.5*100*0.2 - 0.5*100*0.1 = 5 bits (same as the final result obtained in
> the slide).

> Boris.

.

Path: shelby.stanford.edu!not-for-mail
From: Duggan John Dieterly <dieterly@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Handout #3, slide 37 Incorrect?
Date: Wed, 14 Jan 2004 16:40:18 +0000 (UTC)
Lines: 21
Distribution: su
Message-ID: <bu3rdi$hmr$2@news.Stanford.EDU>
NNTP-Posting-Host: saga7.stanford.edu
X-Trace: news.Stanford.EDU 1074098418 18139 171.64.15.137 (14 Jan 2004 16:40:18 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5114

I am also having trouble with this slide.  Is it possible that there is
a mistake?

I think that the following line:

..5 * (.1 * 500) = 25 bits

should be

..5 * 50 = 25 bits

50 comes from the fact that at the end of .1 seconds, there will be
50 bits in the queue.  Is it possible that the (.1 * 500) which
uses the rate of accumulation (500bits/s) just coincidently comes to
50 and makes the result come out correct?

After looking at this, I don't think that the rate of 500b/s should be
used in the calculations.  Only the number of actual bits left in the
queue after .1 seconds matters.


.

Path: shelby.stanford.edu!not-for-mail
From: Duggan John Dieterly <dieterly@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Handout #3, slide 37.
Date: Wed, 14 Jan 2004 16:52:05 +0000 (UTC)
Lines: 48
Distribution: su
Message-ID: <bu3s3l$in7$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401140811340.17975-100000@epic6.Stanford.EDU> <bu3r7g$hmr$1@news.Stanford.EDU>
NNTP-Posting-Host: saga7.stanford.edu
X-Trace: news.Stanford.EDU 1074099125 19175 171.64.15.137 (14 Jan 2004 16:52:05 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5115

Okay, I got it.  The slide is correct.  Makes sense now.

Duggan John Dieterly <dieterly@stanford.edu> wrote:

> I am also having trouble with this slide.  Is it possible that there is 
> a mistake?

> I think that the following line:

> .5 * (.1 * 500) = 25 bits 

> should be

> .5 * 50 = 25 bits

> 50 comes from the fact that at the end of .1 seconds, there will be 
> 50 bits in the queue.  Is it possible that the (.1 * 500) which 
> uses the rate of accumulation (500bits/s) just coincidently comes to 
> 50 and makes the result come out correct?  

> After looking at this, I don't think that the rate of 500b/s should be
> used in the calculations.  Only the number of actual bits left in the
> queue after .1 seconds matters.




> Boris Senderzon <senderzo@stanford.edu> wrote:
>> After Tuesday (01/13) lecture,
>> I'm looking at the example in the handout and not getting
>> the line of obtaining 25 bits as the average queue occupancy
>> when the queue is non-empty.

>> The line .5 * (.1*500) = 25 bits.  What does this mean and
>> what's the significance of each number.

>> Here is what I do understand.  I do understand why for the first
>> 0.1 seconds the overall rate of bit arrival is 500 b/s (1000b/s arrival -
>> 500 b/s departure).  The next 0.1 seconds, the rate is -500b/s
>> if looking from arrival point of reference.

>> I also understand that computing the area in between two curves
>> which happen to be a difference of areas of two triangles,
>> 0.5*100*0.2 - 0.5*100*0.1 = 5 bits (same as the final result obtained in
>> the slide).

>> Boris.

.

Path: shelby.stanford.edu!not-for-mail
From: Duggan John Dieterly <dieterly@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Handout #3, slide 37 Incorrect?
Date: Wed, 14 Jan 2004 16:54:17 +0000 (UTC)
Lines: 26
Distribution: su
Message-ID: <bu3s7p$ips$1@news.Stanford.EDU>
References: <bu3rdi$hmr$2@news.Stanford.EDU>
NNTP-Posting-Host: saga7.stanford.edu
X-Trace: news.Stanford.EDU 1074099257 19260 171.64.15.137 (14 Jan 2004 16:54:17 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5116


 
Okay, I got it.  The slide is correct.  Sorry for the post.

Duggan John Dieterly <dieterly@stanford.edu> wrote:
> I am also having trouble with this slide.  Is it possible that there is
> a mistake?

> I think that the following line:

> .5 * (.1 * 500) = 25 bits

> should be

> .5 * 50 = 25 bits

> 50 comes from the fact that at the end of .1 seconds, there will be
> 50 bits in the queue.  Is it possible that the (.1 * 500) which
> uses the rate of accumulation (500bits/s) just coincidently comes to
> 50 and makes the result come out correct?

> After looking at this, I don't think that the rate of 500b/s should be
> used in the calculations.  Only the number of actual bits left in the
> queue after .1 seconds matters.


.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!anneyeh
From: Anne Kang-Ping Yeh <anneyeh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftpd and PASS
Date: Wed, 14 Jan 2004 09:22:21 -0800
Lines: 37
Distribution: su
Message-ID: <Pine.GSO.4.44.0401140919550.17142-100000@elaine23.Stanford.EDU>
References: <Pine.GSO.4.44.0401131944450.21238-100000@elaine21.Stanford.EDU>
 <bu3oj1$fp8$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074100943 21327 171.64.15.98 (14 Jan 2004 17:22:23 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bu3oj1$fp8$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5117

That doesn't seem to be the case for me.  I'm puzzled because the same
piece of connection code works fine with any other ftp servers, i.e.
ftp.cs.stanford.edu or ftp.microsoft.com.  So I'm wondering if there's
something different about the way the ftpd handles/parses the commands.

ayeh

On Wed, 14 Jan 2004, Paul E. wrote:

> Anne Kang-Ping Yeh wrote:
> > I'm trying to use the ftpd provided, the USER command is ok, but the PASS
> > command would fail with code "500 '': command not understood."
> > The same piece of code works fine if I connect to ftp.cs.stanford.edu.
> >
> > Am I doing something wrong?
> > Thanks,
> > Anne
> >
> >
>
> You may be sending an extra '\0' character which the server interprets
> as the next command.  That happened to me when I did:
>
> char *cmd = "USER anonymous\r\n";
> send(ctrl_sockfd, cmd, strlen(cmd)+1, MSG_WAIT_ALL); // notice the (+1)
>
> char *cmd = "PASS foo@bar.com";
> send(ctrl_sockfd, cmd, strlen(cmd)+1, MSG_WAIT_ALL); // notice the (+1)
>
> The +1 after strlen effectively sends the '\0' character as the next
> command since the ftp server reads the first command only up to "\r\n".
>   The second command then becomes "\0".
>
> Paul E.
>
>

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Handout #3, slide 37.
Date: Wed, 14 Jan 2004 09:25:09 -0800
Lines: 31
Distribution: su
Message-ID: <Pine.LNX.4.44.0401140917330.16919-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401140811340.17975-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074101112 21415 171.64.66.201 (14 Jan 2004 17:25:12 GMT)
X-Complaints-To: news@news.stanford.edu
To: Boris Senderzon <senderzo@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401140811340.17975-100000@epic6.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5118


 If packets are entering the router at 1000b/s and leaving at 500b/s the queue
 is growing by 500b/s.  Since we only have 100 bits, the packet will be
 arriving for .1s.  Therefore the maximum queue size if (.1*500) or 50.  If a
 queue increases linearly from 0 to 50 packets and back to zero, the average
 queue size over that time period is 25 bits.

 .m

> After Tuesday (01/13) lecture,
> I'm looking at the example in the handout and not getting
> the line of obtaining 25 bits as the average queue occupancy
> when the queue is non-empty.
> 
> The line .5 * (.1*500) = 25 bits.  What does this mean and
> what's the significance of each number.
> 
> Here is what I do understand.  I do understand why for the first
> 0.1 seconds the overall rate of bit arrival is 500 b/s (1000b/s arrival -
> 500 b/s departure).  The next 0.1 seconds, the rate is -500b/s
> if looking from arrival point of reference.
> 
> I also understand that computing the area in between two curves
> which happen to be a difference of areas of two triangles,
> 0.5*100*0.2 - 0.5*100*0.1 = 5 bits (same as the final result obtained in
> the slide).
> 
> Boris.
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ftpd and PASS
Date: Wed, 14 Jan 2004 09:34:58 -0800
Lines: 62
Distribution: su
Message-ID: <Pine.LNX.4.44.0401140929370.19664-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401131944450.21238-100000@elaine21.Stanford.EDU>
 <bu3oj1$fp8$1@news.Stanford.EDU> <Pine.GSO.4.44.0401140919550.17142-100000@elaine23.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074101700 21896 171.64.66.201 (14 Jan 2004 17:35:00 GMT)
X-Complaints-To: news@news.stanford.edu
To: Anne Kang-Ping Yeh <anneyeh@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401140919550.17142-100000@elaine23.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5119


 Some servers do not require/understand PASS.  For example ftp.gnu.org

[casado@nity ~]$ telnet ftp.gnu.org 21
Trying 199.232.41.7...
Connected to gnudist.gnu.org (199.232.41.7).
Escape character is '^]'.
220 GNU FTP server ready.
USER anonymous
230 Login successful.
PASS foo@bar
500 Unknown command.
quit
221 Goodbye.
Connection closed by foreign host.
[casado@nity ~]$

 Note that the return codes differ between a host that requires PASS and
one that doesn't ... one that requires PASS should return 3** after USER,
ones that don't should return 2**

 .m

> That doesn't seem to be the case for me.  I'm puzzled because the same
> piece of connection code works fine with any other ftp servers, i.e.
> ftp.cs.stanford.edu or ftp.microsoft.com.  So I'm wondering if there's
> something different about the way the ftpd handles/parses the commands.
> 
> ayeh
> 
> On Wed, 14 Jan 2004, Paul E. wrote:
> 
> > Anne Kang-Ping Yeh wrote:
> > > I'm trying to use the ftpd provided, the USER command is ok, but the PASS
> > > command would fail with code "500 '': command not understood."
> > > The same piece of code works fine if I connect to ftp.cs.stanford.edu.
> > >
> > > Am I doing something wrong?
> > > Thanks,
> > > Anne
> > >
> > >
> >
> > You may be sending an extra '\0' character which the server interprets
> > as the next command.  That happened to me when I did:
> >
> > char *cmd = "USER anonymous\r\n";
> > send(ctrl_sockfd, cmd, strlen(cmd)+1, MSG_WAIT_ALL); // notice the (+1)
> >
> > char *cmd = "PASS foo@bar.com";
> > send(ctrl_sockfd, cmd, strlen(cmd)+1, MSG_WAIT_ALL); // notice the (+1)
> >
> > The +1 after strlen effectively sends the '\0' character as the next
> > command since the ftp server reads the first command only up to "\r\n".
> >   The second command then becomes "\0".
> >
> > Paul E.
> >
> >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Local Host IP Address on Linux (Question for Martin's code)
Date: Wed, 14 Jan 2004 09:58:19 -0800
Lines: 40
Distribution: su
Message-ID: <Pine.LNX.4.44.0401140935520.22303-100000@Xenon.Stanford.EDU>
References: <bta257$3p4$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401050931550.28579-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401132353260.22723-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074103102 23518 171.64.66.201 (14 Jan 2004 17:58:22 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401132353260.22723-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5120


> 
> Hey Martin,
> 
> I'm trying to understand your code, but am having problems...Here are
> some quesitons:
> 
> 1. the first call to getsockname passing in ctrl socket is
> what obtains the local ip address, correct?

 yup
 
> 2. after that step, you bind the data socket to that address structure
> (passing in 0 for sin_port to get the ephemeral port) and then call
> getsockname again.Is this second getsockname simply to get the actual port number,
> because the IP address is unchanged from calling the getsockname the first time,
> correct?  I'm guessing that you did this only because these were the next
> steps in establishing the data connection for our ftp client, but not
> necessarily a required step if all we wanted was the local IP address, is
> that correct?

 yeah, my example was contrived to try and fit within the assignment.  You can
 get the IP from the first getsockname(..) but you are going to need to 
 bind and grab the ephemeral port to send to the server so I though it was
 easiest to show everything in one code snippet.  It sort of dilutes the
 example though doesn't it :-/

> 3. Also, I was trying to read in the text what SO_REUSEADDR was supposed
> to do, but kinda got lost...do you have any simple way to explain it?

 It lets you bind to a port without having to wait. In the example it is
 effectively useless, but if you are accepting connections it makes
 life much nicer. Steven's describes SO_REUSADDR and why you it can be
 bad to connect to a busy port (that is the the TIME_WAIT state).

 .m
 



.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: electronic hw submission???
Date: Wed, 14 Jan 2004 09:59:17 -0800
Lines: 25
Distribution: su
Message-ID: <Pine.LNX.4.44.0401140958400.22303-100000@Xenon.Stanford.EDU>
References: <bu2duu$1so$1@news.Stanford.EDU> <bu2e1d$27i$1@news.Stanford.EDU>
 <Pine.GSO.4.44.0401140003170.22723-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074103161 23558 171.64.66.201 (14 Jan 2004 17:59:21 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401140003170.22723-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5121


 If you are remote you can give your assignment to the SCPD courior as usual.

 .m

> 
> If we are remote students, can we use the normal procedure of faxing our
> stuff into SCPD and letting them deliver it?  Its a little hard for me to
> get to campus usually...
> 
> --vishal
> 
> On Wed, 14 Jan 2004, Matthew Jonathan Holliman wrote:
> 
> >
> >
> > >Can we email the solutions to Problem Sets or do you have to
> > >drop off a hardcopy?
> >
> > Please drop off a hardcopy--emailed solutions tend to be misplaced or
> > forgotten by TAs during grading.
> >
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Charles Rowe Burns <crburns@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: testing script issues
Date: Wed, 14 Jan 2004 22:00:59 +0000 (UTC)
Lines: 72
Distribution: su
Message-ID: <bu4e6r$a8c$1@news.Stanford.EDU>
NNTP-Posting-Host: saga4.stanford.edu
X-Trace: news.Stanford.EDU 1074117659 10508 171.64.15.134 (14 Jan 2004 22:00:59 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5122


Hello,

I ran the test script twice today and it's not clear to me
if my code is passing or failing the tests. Here's the tail
of the first submission:

    Test L.7, using current source tree and build^M
    make ^M
    make: `ftpcopy' is up to date.^M
    ^M
    Test L.5, using current source tree and build^M
    make ^M
    make: `ftpcopy' is up to date.^M
    ^M
    Testing special case:  ./ftpcopy  ext 1 transfer 2>&1^M
    Test L.6, using current source tree and build^M
Note that now L.5 and L.6 have different messages than before, but
still died on test M -- because the documentation is wrong (it sez
    make ^M
    make: `ftpcopy' is up to date.^M
    ^M

Note also that while
it is charging me for eaach test, it is not running all the tests
either (unless test M is the last test).

of the 
Also not clear if Test M was the last test, or if here were more
tests and it just quit after M.

    Testing special case:  ./ftpcopy  ext 1 site-does-not-exist 2>&1^M
    make ftpcopy.purify^M
    make: *** No rule to make target `ftpcopy.purify'.  Stop.^M
    make failed (error status 2)^M
    couldn't submit code for testing^M

Did I pass or fail test L.7,5,6? Perhaps the words PASS or FAIL
would be good to include in the message.

On test M, it implies I need ftpcopy.purify. So I read the
documentation and it said to make the target named "all.purify".
So I added that target to my makefile and ran again:


    Test L.5, using current source tree and build
    make
   
    Testing special case:  ./ftpcopy  ext 1 transfer 2>&1
    Test L.6, using current source tree and build
    make

    Testing special case:  ./ftpcopy  ext 1 site-does-not-exist 2>&1
    Test M, using current source tree and build
    make ftpcopy.purify
    make: *** No rule to make target `ftpcopy.purify'.  Stop.
    make failed (error status 2)
    couldn't submit code for testing

It still died on test M -- because the documentation is wrong (it sez
the makefile target should be all.purify not ftpcopy.purify).

This would all fine if running the tests were "free" but it's not
since we get a limited number of submissions.

It is also not clear to me if the "couldn't submit code for testing" 
applies only for test M or the whole thing since it's the last message.
Perhaps a "goodbye" or "you passed I of N tests" message would help.

Thanks for your time.

Charlie
.

Path: shelby.stanford.edu!not-for-mail
From: Charles Rowe Burns <crburns@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: testing script issues
Date: Wed, 14 Jan 2004 22:04:19 +0000 (UTC)
Lines: 61
Distribution: su
Message-ID: <bu4ed3$abu$1@news.Stanford.EDU>
References: <bu4e6r$a8c$1@news.Stanford.EDU>
NNTP-Posting-Host: saga4.stanford.edu
X-Trace: news.Stanford.EDU 1074117859 10622 171.64.15.134 (14 Jan 2004 22:04:19 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5123

Sorry, that posting got garbled when I copied and pasted it
from another machine where tin failed. Here's the right message:

Hello,

I ran the test script twice today and it's not clear to me
if my code is passing or failing the tests. Here's the tail
of the first submission:

    Test L.7, using current source tree and build^M
    make ^M
    make: `ftpcopy' is up to date.^M
    ^M
    Test L.5, using current source tree and build^M
    make ^M
    make: `ftpcopy' is up to date.^M
    ^M
    Testing special case:  ./ftpcopy  ext 1 transfer 2>&1^M
    Test L.6, using current source tree and build^M

    Testing special case:  ./ftpcopy  ext 1 site-does-not-exist 2>&1^M
    make ftpcopy.purify^M
    make: *** No rule to make target `ftpcopy.purify'.  Stop.^M
    make failed (error status 2)^M
    couldn't submit code for testing^M

Did I pass or fail test L.7,5,6? Perhaps the words PASS or FAIL
would be good to include in the message.

On test M, it implies I need ftpcopy.purify. So I read the
documentation and it said to make the target named "all.purify".
So I added that target to my makefile and ran again:


    Test L.5, using current source tree and build
    make
   
    Testing special case:  ./ftpcopy  ext 1 transfer 2>&1
    Test L.6, using current source tree and build
    make

    Testing special case:  ./ftpcopy  ext 1 site-does-not-exist 2>&1
    Test M, using current source tree and build
    make ftpcopy.purify
    make: *** No rule to make target `ftpcopy.purify'.  Stop.
    make failed (error status 2)
    couldn't submit code for testing

It still died on test M -- because the documentation is wrong (it sez
the makefile target should be all.purify not ftpcopy.purify).

This would all fine if running the tests were "free" but it's not
since we get a limited number of submissions.

It is also not clear to me if the "couldn't submit code for testing" 
applies only for test M or the whole thing since it's the last message.
Perhaps a "goodbye" or "you passed I of N tests" message would help.

Thanks for your time.

Charlie
.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: testing script issues
Date: Wed, 14 Jan 2004 14:21:54 -0800
Lines: 40
Distribution: su
Message-ID: <20040114142154.65e8ab72.chanman@stanford.edu>
References: <bu4e6r$a8c$1@news.Stanford.EDU>
	<bu4ed3$abu$1@news.Stanford.EDU>
NNTP-Posting-Host: chanman.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074118952 18297 128.12.94.94 (14 Jan 2004 22:22:32 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed version 0.9.6 (GTK+ 1.2.10; i386-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:5124

> Did I pass or fail test L.7,5,6? Perhaps the words PASS or FAIL
> would be good to include in the message.

I think if your code fails to compile, the grading script aborts.

You will know whether your code passes or fails if it completes, for example, this prints out at the end for me:

======================================================================
Summary prepared for chanman
======================================================================

Test B [out of 5]
Checks that ftpcopy runs without error.

Results:  OK
----------------------------------------------------------------------

....

----------------------------------------------------------------------

Test L.7 [out of 0.5]
Checks that ftpcopy returns error on non-existent remote dir.

Results:  OK
----------------------------------------------------------------------

Test L.5 [out of 0.5]
Checks that ftpcopy returns error on non-anon ftp server.

Results:  OK
----------------------------------------------------------------------

Test L.6 [out of 0.5]
Checks that ftpcopy returns error on non-existent host.

Results:  OK
----------------------------------------------------------------------
....

.

Path: shelby.stanford.edu!elaine20.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: testing script issues
Date: Wed, 14 Jan 2004 22:29:13 +0000 (UTC)
Lines: 21
Distribution: su
Message-ID: <bu4frp$c6i$1@news.Stanford.EDU>
References: <bu4e6r$a8c$1@news.Stanford.EDU> <bu4ed3$abu$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine20.stanford.edu
X-Trace: news.Stanford.EDU 1074119353 12498 171.64.15.85 (14 Jan 2004 22:29:13 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5125


>    make: *** No rule to make target `ftpcopy.purify'.  Stop.
>    make failed (error status 2)
>    couldn't submit code for testing

>It still died on test M -- because the documentation is wrong (it sez
>the makefile target should be all.purify not ftpcopy.purify).


Sorry--
The grading script is a little unfriendly if the make fails, as it
just bails out.  In your case, it could have returned useful output
for the other test cases, which use a different make target, but this
isn't implemented.  As is, I can't tell if they passed or not from what
you've posted.  Normally, you'll get a summary at the end (assuming
everything builds as expected).

Also, the documentation and script were in disagreement--there needs to be
an ftpcopy.purify target in the Makefile, as the error above indicates.
I've fixed the assignment description to agree with what the script expects.

.

Path: shelby.stanford.edu!elaine20.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: electronic hw submission???
Date: Wed, 14 Jan 2004 22:49:45 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <bu4h29$ddj$1@news.Stanford.EDU>
References: <bu2duu$1so$1@news.Stanford.EDU> <bu2e1d$27i$1@news.Stanford.EDU> <Pine.GSO.4.44.0401140003170.22723-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine20.stanford.edu
X-Trace: news.Stanford.EDU 1074120585 13747 171.64.15.85 (14 Jan 2004 22:49:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5126



>If we are remote students, can we use the normal procedure of faxing our
>stuff into SCPD and letting them deliver it?  Its a little hard for me to
>get to campus usually...

Sure, faxing to SCPD is fine as well.  As long as we receive a hardcopy
in some form or another, we're happy. :-)

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: testing script issues
Date: Wed, 14 Jan 2004 14:58:33 -0800
Lines: 76
Distribution: su
Message-ID: <Pine.LNX.4.44.0401141442220.19820-100000@Xenon.Stanford.EDU>
References: <bu4e6r$a8c$1@news.Stanford.EDU> <bu4ed3$abu$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074121114 14280 171.64.66.201 (14 Jan 2004 22:58:34 GMT)
X-Complaints-To: news@news.stanford.edu
To: Charles Rowe Burns <crburns@Stanford.EDU>
In-Reply-To: <bu4ed3$abu$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5127



 You are right, the failure messages aren't very clear.  If you have
 the correct make targets and the testing finishes however, you will
 get a full summary explaining whether you passed/failed each test.
 The homework page has been updated as well to contain ftpcopy.purify.

 thanks,
  .m
 



> Sorry, that posting got garbled when I copied and pasted it
> from another machine where tin failed. Here's the right message:
> 
> Hello,
> 
> I ran the test script twice today and it's not clear to me
> if my code is passing or failing the tests. Here's the tail
> of the first submission:
> 
>     Test L.7, using current source tree and build^M
>     make ^M
>     make: `ftpcopy' is up to date.^M
>     ^M
>     Test L.5, using current source tree and build^M
>     make ^M
>     make: `ftpcopy' is up to date.^M
>     ^M
>     Testing special case:  ./ftpcopy  ext 1 transfer 2>&1^M
>     Test L.6, using current source tree and build^M
> 
>     Testing special case:  ./ftpcopy  ext 1 site-does-not-exist 2>&1^M
>     make ftpcopy.purify^M
>     make: *** No rule to make target `ftpcopy.purify'.  Stop.^M
>     make failed (error status 2)^M
>     couldn't submit code for testing^M
> 
> Did I pass or fail test L.7,5,6? Perhaps the words PASS or FAIL
> would be good to include in the message.
> 
> On test M, it implies I need ftpcopy.purify. So I read the
> documentation and it said to make the target named "all.purify".
> So I added that target to my makefile and ran again:
> 
> 
>     Test L.5, using current source tree and build
>     make
>    
>     Testing special case:  ./ftpcopy  ext 1 transfer 2>&1
>     Test L.6, using current source tree and build
>     make
> 
>     Testing special case:  ./ftpcopy  ext 1 site-does-not-exist 2>&1
>     Test M, using current source tree and build
>     make ftpcopy.purify
>     make: *** No rule to make target `ftpcopy.purify'.  Stop.
>     make failed (error status 2)
>     couldn't submit code for testing
> 
> It still died on test M -- because the documentation is wrong (it sez
> the makefile target should be all.purify not ftpcopy.purify).
> 
> This would all fine if running the tests were "free" but it's not
> since we get a limited number of submissions.
> 
> It is also not clear to me if the "couldn't submit code for testing" 
> applies only for test M or the whole thing since it's the last message.
> Perhaps a "goodbye" or "you passed I of N tests" message would help.
> 
> Thanks for your time.
> 
> Charlie
> 

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Q7(b)(i)
Date: Wed, 14 Jan 2004 14:58:09 -0800
Lines: 4
Distribution: su
Message-ID: <20040114145809.13980568.chanman@stanford.edu>
NNTP-Posting-Host: chanman.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074121127 18297 128.12.94.94 (14 Jan 2004 22:58:47 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed version 0.9.6 (GTK+ 1.2.10; i386-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:5128

What's the meaning of d(t) in this store and forward router if no bits are incoming?  After the 100 bit packet arrives in the cycle in 7(b)(i), while the outgoing link is forwarding the bits, we know that more bits are not incoming until the next cycle begins.  However, there are still some bits that occupy the queue, so if a bit did come, there would be a delay.  Is the interpretation of d(t) in this case then what would the delay be of a bit if one did in fact come even though one is not supposed to?  Or should it be that, since we know no more bits are coming for this portion of the cycle, there is 0 delay?

Thanks,
William
.

Path: shelby.stanford.edu!not-for-mail
From: "Michael Kepe" <mkepe@stanford.edu>
Newsgroups: su.class.cs244a
Subject: problem with accepting new data connections
Date: Wed, 14 Jan 2004 15:17:45 -0800
Lines: 57
Distribution: su
Message-ID: <bu4imq$f3m$1@news.Stanford.EDU>
NNTP-Posting-Host: gatesb02-pc12.stanford.edu
X-Trace: news.Stanford.EDU 1074122266 15478 172.24.65.17 (14 Jan 2004 23:17:46 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5129

hi,

my client creates a data socket, binds, listens, and sends the PORT command.
my client can receive data from the first LIST command issued, but the next
time it issues the LIST command, the server responds with a "425: Can't open
data connection".
however, if i close the data socket after each LIST command and create a new
socket before the next, everything works fine.  This doesn't seem right.

i tried using netcat to bind a port locally and send this to a server:

elaine28:~>nc -l -p 4866 &

then, in another window i connected to ftp.stanford.edu through telnet:

>Connected to ftp1.Stanford.EDU (171.64.15.240).
>Escape character is '^]'.
>220------------------------------------------------------------------------
-----
>220-    Abuse of this facility may be considered violation of Federal or
>220-    California law or the policies of Stanford University.  If you have
>220-    questions regarding this policy please send mail to
>220-    root@ftp.Stanford.EDU
>220------------------------------------------------------------------------
-----
>220-
>220 ftp1.Stanford.EDU FTP
>USER anonymous
>331 Guest login ok, send your complete e-mail address as password.
>PASS anon@anon.com
>230-Please read the file README
>230-  it was last modified on Fri Feb 15 12:22:25 2002 - 698 days ago
>230 Guest login ok, access restrictions apply.
>PORT 171,64,15,103,19,2
>200 PORT command successful.
>LIST
>150 Opening ASCII mode data connection for /bin/ls.
>226 Transfer complete.


This list data was received.  However, when i then did the following:

>CWD etc
>250 CWD command successful.
>PORT 171,64,15,103,19,2
>200 PORT command successful.
>LIST

Nothing happens on either end.  No control response from the server, no data
received.

Can someone please explain where I've gone wrong?

Thanks,
sumeet


.

Path: shelby.stanford.edu!not-for-mail
From: "Michael Kepe" <mkepe@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problem with accepting new data connections
Date: Wed, 14 Jan 2004 15:20:07 -0800
Lines: 76
Distribution: su
Message-ID: <bu4irb$f95$1@news.Stanford.EDU>
References: <bu4imq$f3m$1@news.Stanford.EDU>
NNTP-Posting-Host: gatesb02-pc12.stanford.edu
X-Trace: news.Stanford.EDU 1074122411 15653 172.24.65.17 (14 Jan 2004 23:20:11 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5130

I should point out that this post wasn't from Michael Kepe.  Dummy me and
using public machines.

Sumeet
sumeet@stanford


"Michael Kepe" <mkepe@stanford.edu> wrote in message
news:bu4imq$f3m$1@news.Stanford.EDU...
> hi,
>
> my client creates a data socket, binds, listens, and sends the PORT
command.
> my client can receive data from the first LIST command issued, but the
next
> time it issues the LIST command, the server responds with a "425: Can't
open
> data connection".
> however, if i close the data socket after each LIST command and create a
new
> socket before the next, everything works fine.  This doesn't seem right.
>
> i tried using netcat to bind a port locally and send this to a server:
>
> elaine28:~>nc -l -p 4866 &
>
> then, in another window i connected to ftp.stanford.edu through telnet:
>
> >Connected to ftp1.Stanford.EDU (171.64.15.240).
> >Escape character is '^]'.
>
>220------------------------------------------------------------------------
> -----
> >220-    Abuse of this facility may be considered violation of Federal or
> >220-    California law or the policies of Stanford University.  If you
have
> >220-    questions regarding this policy please send mail to
> >220-    root@ftp.Stanford.EDU
>
>220------------------------------------------------------------------------
> -----
> >220-
> >220 ftp1.Stanford.EDU FTP
> >USER anonymous
> >331 Guest login ok, send your complete e-mail address as password.
> >PASS anon@anon.com
> >230-Please read the file README
> >230-  it was last modified on Fri Feb 15 12:22:25 2002 - 698 days ago
> >230 Guest login ok, access restrictions apply.
> >PORT 171,64,15,103,19,2
> >200 PORT command successful.
> >LIST
> >150 Opening ASCII mode data connection for /bin/ls.
> >226 Transfer complete.
>
>
> This list data was received.  However, when i then did the following:
>
> >CWD etc
> >250 CWD command successful.
> >PORT 171,64,15,103,19,2
> >200 PORT command successful.
> >LIST
>
> Nothing happens on either end.  No control response from the server, no
data
> received.
>
> Can someone please explain where I've gone wrong?
>
> Thanks,
> sumeet
>
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q7(b)(i)
Date: Wed, 14 Jan 2004 15:58:55 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0401141552180.16750-100000@Xenon.Stanford.EDU>
References: <20040114145809.13980568.chanman@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074124742 18236 171.64.66.201 (14 Jan 2004 23:59:02 GMT)
X-Complaints-To: news@news.stanford.edu
To: William Chan <chanman@stanford.edu>
In-Reply-To: <20040114145809.13980568.chanman@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5131


 You want to compute d(t) only for the times in which bits are arriving.

 .m

> What's the meaning of d(t) in this store and forward router if no bits are incoming?  After the 100 bit packet arrives in the cycle in 7(b)(i), while the outgoing link is forwarding the bits, we know that more bits are not incoming until the next cycle begins.  However, there are still some bits that occupy the queue, so if a bit did come, there would be a delay.  Is the interpretation of d(t) in this case then what would the delay be of a bit if one did in fact come even though one is not supposed to?  Or should it be that, since we know no more bits are coming for this portion of the cycle, there is 0 delay?
> 
> Thanks,
> William
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: problem with accepting new data connections
Date: Wed, 14 Jan 2004 16:27:21 -0800
Lines: 181
Distribution: su
Message-ID: <Pine.LNX.4.44.0401141620220.16750-100000@Xenon.Stanford.EDU>
References: <bu4imq$f3m$1@news.Stanford.EDU> <bu4irb$f95$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074126444 20282 171.64.66.201 (15 Jan 2004 00:27:24 GMT)
X-Complaints-To: news@news.stanford.edu
To: Sumeet Uday Shendrikar <sumeets@stanford.edu>
In-Reply-To: <bu4irb$f95$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5132


 fyi I just compiled a simple socket server and ran ran successive PORT/LIST
 commands from ftp.gnu.org and got multiple listings from the same bound socket
 so I'm inclined to say that your code is somehow incorrect.  One problem you
 may be having is that nc will quite after the socket disconnects .. so it
 will only work once (I had forgotten about this).  You can test your
 implementation using the following modified version of Beej's simple
 stream server ...

 I tested this on elaine18 in it worked spiffily.

 .m 

 #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <errno.h>
    #include <string.h>
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netinet/in.h>
    #include <arpa/inet.h>
    #include <sys/wait.h>
    #include <signal.h>

    #define MYPORT 4866    // the port users will be connecting to

    #define BACKLOG 10     // how many pending connections queue will hold

    void sigchld_handler(int s)
    {
        while(wait(NULL) > 0);
    }

    int main(void)
    {
        int sockfd, new_fd;  // listen on sock_fd, new connection on new_fd
        struct sockaddr_in my_addr;    // my address information
        struct sockaddr_in their_addr; // connector's address information
        int sin_size;
        struct sigaction sa;
        int yes=1;

        if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
            perror("socket");
            exit(1);
        }

        if (setsockopt(sockfd,SOL_SOCKET,SO_REUSEADDR,&yes,sizeof(int)) == -1) {
            perror("setsockopt");
            exit(1);
        }

        my_addr.sin_family = AF_INET;         // host byte order
        my_addr.sin_port = htons(MYPORT);     // short, network byte order
        my_addr.sin_addr.s_addr = INADDR_ANY; // automatically fill with my IP
        memset(&(my_addr.sin_zero), '\0', 8); // zero the rest of the struct

        if (bind(sockfd, (struct sockaddr *)&my_addr, sizeof(struct sockaddr))
                                                                       == -1) {
            perror("bind");
            exit(1);
        }

        if (listen(sockfd, BACKLOG) == -1) {
            perror("listen");
            exit(1);
        }

        sa.sa_handler = sigchld_handler; // reap all dead processes
        sigemptyset(&sa.sa_mask);
        sa.sa_flags = SA_RESTART;
        if (sigaction(SIGCHLD, &sa, NULL) == -1) {
            perror("sigaction");
            exit(1);
        }
       while(1) {  // main accept() loop
            char buf[BUFSIZ];

            sin_size = sizeof(struct sockaddr_in);
            if ((new_fd = accept(sockfd, (struct sockaddr *)&their_addr,
                                                           &sin_size)) == -1) {
                perror("accept");
                continue;
            }
            printf("server: got connection from %s\n",
                                               inet_ntoa(their_addr.sin_addr));
            if (!fork()) { // this is the child process
                close(sockfd); // child doesn't need the listener
                while (recv(new_fd, buf, BUFSIZ, 0) > 0)
                {
                    printf("%s\n",buf);
                }
                close(new_fd);
                exit(0);
            }
            close(new_fd);  // parent doesn't need this
        }

        return 0;
    }


> I should point out that this post wasn't from Michael Kepe.  Dummy me and
> using public machines.
> 
> Sumeet
> sumeet@stanford
> 
> 
> "Michael Kepe" <mkepe@stanford.edu> wrote in message
> news:bu4imq$f3m$1@news.Stanford.EDU...
> > hi,
> >
> > my client creates a data socket, binds, listens, and sends the PORT
> command.
> > my client can receive data from the first LIST command issued, but the
> next
> > time it issues the LIST command, the server responds with a "425: Can't
> open
> > data connection".
> > however, if i close the data socket after each LIST command and create a
> new
> > socket before the next, everything works fine.  This doesn't seem right.
> >
> > i tried using netcat to bind a port locally and send this to a server:
> >
> > elaine28:~>nc -l -p 4866 &
> >
> > then, in another window i connected to ftp.stanford.edu through telnet:
> >
> > >Connected to ftp1.Stanford.EDU (171.64.15.240).
> > >Escape character is '^]'.
> >
> >220------------------------------------------------------------------------
> > -----
> > >220-    Abuse of this facility may be considered violation of Federal or
> > >220-    California law or the policies of Stanford University.  If you
> have
> > >220-    questions regarding this policy please send mail to
> > >220-    root@ftp.Stanford.EDU
> >
> >220------------------------------------------------------------------------
> > -----
> > >220-
> > >220 ftp1.Stanford.EDU FTP
> > >USER anonymous
> > >331 Guest login ok, send your complete e-mail address as password.
> > >PASS anon@anon.com
> > >230-Please read the file README
> > >230-  it was last modified on Fri Feb 15 12:22:25 2002 - 698 days ago
> > >230 Guest login ok, access restrictions apply.
> > >PORT 171,64,15,103,19,2
> > >200 PORT command successful.
> > >LIST
> > >150 Opening ASCII mode data connection for /bin/ls.
> > >226 Transfer complete.
> >
> >
> > This list data was received.  However, when i then did the following:
> >
> > >CWD etc
> > >250 CWD command successful.
> > >PORT 171,64,15,103,19,2
> > >200 PORT command successful.
> > >LIST
> >
> > Nothing happens on either end.  No control response from the server, no
> data
> > received.
> >
> > Can someone please explain where I've gone wrong?
> >
> > Thanks,
> > sumeet
> >
> >
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Kirk Shimano <kshimano@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Q2
Date: Wed, 14 Jan 2004 17:13:22 -0800
Lines: 12
Distribution: su
Message-ID: <bu4pfj$n05$1@news.Stanford.EDU>
NNTP-Posting-Host: zaphod.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074129203 23557 128.12.41.60 (15 Jan 2004 01:13:23 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4) Gecko/20030624 Netscape/7.1
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5133

For parts (a) and (b) of this time, are we to assume that the "pipe" has 
a length that's equal to the RTT, or does the "pipe" have a length 
that's equal to the one-way latency?

The book seems to say that either the RTT or the one-way latency can be 
used to calculate the delay x bandwith product, and in these situations 
I'm not sure which would be more appropriate.

Thanks!

-Kirk

.

Path: shelby.stanford.edu!elaine33.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Q6
Date: Wed, 14 Jan 2004 17:30:32 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0401141726170.14956-100000@elaine33.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074130235 24628 171.64.15.108 (15 Jan 2004 01:30:35 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5134

Does the inter-packet gap, g, affect outgoing packets as well?  In other
words, must the router pause g seconds after one packet is sent before
beginning to send the next?

Thanks,
Barrett

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q2
Date: Wed, 14 Jan 2004 17:33:16 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.LNX.4.44.0401141730470.14644-100000@Xenon.Stanford.EDU>
References: <bu4pfj$n05$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074130400 24823 171.64.66.201 (15 Jan 2004 01:33:20 GMT)
X-Complaints-To: news@news.stanford.edu
To: Kirk Shimano <kshimano@stanford.edu>
In-Reply-To: <bu4pfj$n05$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5135


> For parts (a) and (b) of this time, are we to assume that the "pipe" has 
> a length that's equal to the RTT, or does the "pipe" have a length 
> that's equal to the one-way latency?

  the former
  
  .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q6
Date: Wed, 14 Jan 2004 17:38:18 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.LNX.4.44.0401141735130.19363-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401141726170.14956-100000@elaine33.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074130701 25109 171.64.66.201 (15 Jan 2004 01:38:21 GMT)
X-Complaints-To: news@news.stanford.edu
To: Barrett Trask <btrask@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401141726170.14956-100000@elaine33.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5136


> Does the inter-packet gap, g, affect outgoing packets as well? 

 Nope, the interpacket gap is a characteristic of the incoming flow. 

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q3b
Date: Wed, 14 Jan 2004 18:30:34 -0800
Lines: 18
Distribution: su
Message-ID: <bu4tv7$rn8$1@news.Stanford.EDU>
References: <20040113162742.0c23dc8d.chanman@stanford.edu> <bu2dvf$24v$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1074133799 28392 128.12.61.97 (15 Jan 2004 02:29:59 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5137

It seems to me that the confusion is as follows:
Do we assume that the buffer STILL contains 750 kbytes of data on average,
or does that possibly change when it starts dropping 25% of the packets?
Seems that if it's the latter it would eventually clear out the buffer, if
we assume that the departure rate doesn't decrease.

Oded

> >So what's the deal with the departure rate?  If the malfunction does not
affect it, then the average delay seems trivial (0).  However, it seems
weird that it would match the arrival rate of non-dropped packets.  How
should this question be interpreted?
>
> Sorry, I don't understand what you're asking.  Can you rephrase your
> question?
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q3b
Date: Wed, 14 Jan 2004 19:44:08 -0800
Lines: 31
Distribution: su
Message-ID: <Pine.LNX.4.44.0401141938010.19240-100000@Xenon.Stanford.EDU>
References: <20040113162742.0c23dc8d.chanman@stanford.edu> <bu2dvf$24v$1@news.Stanford.EDU>
 <bu4tv7$rn8$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074138250 2618 171.64.66.201 (15 Jan 2004 03:44:10 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <bu4tv7$rn8$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5138



 Why would the latter clear out the buffer?  The problem states that "on
 average" the buffer has 750 kbytes.  Since we can presume the queue is
 stable, that means over some period of time the ingress is equivalent to
 the egress ... therefore there must be some characteristic of the traffic
 that accounts for the queuing.  Given that, how would the router behave
 if 25% of the incoming packets are dropped.

 .m

> It seems to me that the confusion is as follows:
> Do we assume that the buffer STILL contains 750 kbytes of data on average,
> or does that possibly change when it starts dropping 25% of the packets?
> Seems that if it's the latter it would eventually clear out the buffer, if
> we assume that the departure rate doesn't decrease.
> 
> Oded
> 
> > >So what's the deal with the departure rate?  If the malfunction does not
> affect it, then the average delay seems trivial (0).  However, it seems
> weird that it would match the arrival rate of non-dropped packets.  How
> should this question be interpreted?
> >
> > Sorry, I don't understand what you're asking.  Can you rephrase your
> > question?
> >
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: analogy to slide37
Date: Wed, 14 Jan 2004 21:30:34 -0800
Lines: 12
Distribution: su
Message-ID: <bu58a1$93s$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1074144385 9340 128.12.189.163 (15 Jan 2004 05:26:25 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5139

Hi,
I had a question.In slide 37 it says that the queue fills from 0 to 100 in
..1 sec and then drains from 100 to 0 in 0.1 again
consider this scenario:
queue fills from 0 to 100 in 0.1 sec
it drains from 100 to 50 in 0.9 sec
So at the end of the first second I have some bits left in the queue.
How do I get the queue occupancy & the average queue ocupancy here?
Thanks,
haripriya


.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: residential network
Date: Wed, 14 Jan 2004 21:42:07 -0800
Organization: Stanford University
Lines: 5
Distribution: su
Message-ID: <pan.2004.01.15.05.42.07.156023@stanford.edu>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1074145327 10281 128.12.69.27 (15 Jan 2004 05:42:07 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Xref: shelby.stanford.edu su.class.cs244a:5140

Anyone else noticing that the residential network (128.12.x.x) is
spectacularly slow tonight, even to sites as close as
ftp.slac.stanford.edu?

--Chris
.

Path: shelby.stanford.edu!elaine27.Stanford.EDU!anneyeh
From: Anne Kang-Ping Yeh <anneyeh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftpd and PASS
Date: Wed, 14 Jan 2004 22:26:09 -0800
Lines: 70
Distribution: su
Message-ID: <Pine.GSO.4.44.0401142225050.16650-100000@elaine27.Stanford.EDU>
References: <Pine.GSO.4.44.0401131944450.21238-100000@elaine21.Stanford.EDU>
 <bu3oj1$fp8$1@news.Stanford.EDU> <Pine.GSO.4.44.0401140919550.17142-100000@elaine23.Stanford.EDU>
 <Pine.LNX.4.44.0401140929370.19664-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine27.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074147971 12951 171.64.15.102 (15 Jan 2004 06:26:11 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0401140929370.19664-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5141

But ftpd _does_ require a password, it returns 331 to the USER command.

Anne

On Wed, 14 Jan 2004, Martin Casado wrote:

>
>  Some servers do not require/understand PASS.  For example ftp.gnu.org
>
> [casado@nity ~]$ telnet ftp.gnu.org 21
> Trying 199.232.41.7...
> Connected to gnudist.gnu.org (199.232.41.7).
> Escape character is '^]'.
> 220 GNU FTP server ready.
> USER anonymous
> 230 Login successful.
> PASS foo@bar
> 500 Unknown command.
> quit
> 221 Goodbye.
> Connection closed by foreign host.
> [casado@nity ~]$
>
>  Note that the return codes differ between a host that requires PASS and
> one that doesn't ... one that requires PASS should return 3** after USER,
> ones that don't should return 2**
>
>  .m
>
> > That doesn't seem to be the case for me.  I'm puzzled because the same
> > piece of connection code works fine with any other ftp servers, i.e.
> > ftp.cs.stanford.edu or ftp.microsoft.com.  So I'm wondering if there's
> > something different about the way the ftpd handles/parses the commands.
> >
> > ayeh
> >
> > On Wed, 14 Jan 2004, Paul E. wrote:
> >
> > > Anne Kang-Ping Yeh wrote:
> > > > I'm trying to use the ftpd provided, the USER command is ok, but the PASS
> > > > command would fail with code "500 '': command not understood."
> > > > The same piece of code works fine if I connect to ftp.cs.stanford.edu.
> > > >
> > > > Am I doing something wrong?
> > > > Thanks,
> > > > Anne
> > > >
> > > >
> > >
> > > You may be sending an extra '\0' character which the server interprets
> > > as the next command.  That happened to me when I did:
> > >
> > > char *cmd = "USER anonymous\r\n";
> > > send(ctrl_sockfd, cmd, strlen(cmd)+1, MSG_WAIT_ALL); // notice the (+1)
> > >
> > > char *cmd = "PASS foo@bar.com";
> > > send(ctrl_sockfd, cmd, strlen(cmd)+1, MSG_WAIT_ALL); // notice the (+1)
> > >
> > > The +1 after strlen effectively sends the '\0' character as the next
> > > command since the ftp server reads the first command only up to "\r\n".
> > >   The second command then becomes "\0".
> > >
> > > Paul E.
> > >
> > >
> >
> >
>
>

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ftpd and PASS
Date: Wed, 14 Jan 2004 22:43:07 -0800
Lines: 93
Distribution: su
Message-ID: <Pine.LNX.4.44.0401142232490.29264-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401131944450.21238-100000@elaine21.Stanford.EDU>
 <bu3oj1$fp8$1@news.Stanford.EDU> <Pine.GSO.4.44.0401140919550.17142-100000@elaine23.Stanford.EDU>
 <Pine.LNX.4.44.0401140929370.19664-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401142225050.16650-100000@elaine27.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074148991 14134 171.64.66.201 (15 Jan 2004 06:43:11 GMT)
X-Complaints-To: news@news.stanford.edu
To: Anne Kang-Ping Yeh <anneyeh@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401142225050.16650-100000@elaine27.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5142


 Sorry about that, responded without scrolling all the way down :-/

 I ran the provided ftpd, telneted into it and it seemed to
work just fine ....

casado@Xenon:~ >telnet elaine25 52853
Trying 171.64.15.100...
Connected to elaine25.Stanford.EDU (171.64.15.100).
Escape character is '^]'.
220 elaine25.Stanford.EDU FTP server (Version 2.0WU(44) Fri Jan 14 13:36:13 PST 
2000) ready.
USER anonymous
331 Guest login ok, send your complete e-mail address as password.
PASS whee
230 Guest login ok, access restrictions apply.

 its hard to tell from your description what the problem might be. 

  .mc 

> But ftpd _does_ require a password, it returns 331 to the USER command.
> 
> Anne
> 
> On Wed, 14 Jan 2004, Martin Casado wrote:
> 
> >
> >  Some servers do not require/understand PASS.  For example ftp.gnu.org
> >
> > [casado@nity ~]$ telnet ftp.gnu.org 21
> > Trying 199.232.41.7...
> > Connected to gnudist.gnu.org (199.232.41.7).
> > Escape character is '^]'.
> > 220 GNU FTP server ready.
> > USER anonymous
> > 230 Login successful.
> > PASS foo@bar
> > 500 Unknown command.
> > quit
> > 221 Goodbye.
> > Connection closed by foreign host.
> > [casado@nity ~]$
> >
> >  Note that the return codes differ between a host that requires PASS and
> > one that doesn't ... one that requires PASS should return 3** after USER,
> > ones that don't should return 2**
> >
> >  .m
> >
> > > That doesn't seem to be the case for me.  I'm puzzled because the same
> > > piece of connection code works fine with any other ftp servers, i.e.
> > > ftp.cs.stanford.edu or ftp.microsoft.com.  So I'm wondering if there's
> > > something different about the way the ftpd handles/parses the commands.
> > >
> > > ayeh
> > >
> > > On Wed, 14 Jan 2004, Paul E. wrote:
> > >
> > > > Anne Kang-Ping Yeh wrote:
> > > > > I'm trying to use the ftpd provided, the USER command is ok, but the PASS
> > > > > command would fail with code "500 '': command not understood."
> > > > > The same piece of code works fine if I connect to ftp.cs.stanford.edu.
> > > > >
> > > > > Am I doing something wrong?
> > > > > Thanks,
> > > > > Anne
> > > > >
> > > > >
> > > >
> > > > You may be sending an extra '\0' character which the server interprets
> > > > as the next command.  That happened to me when I did:
> > > >
> > > > char *cmd = "USER anonymous\r\n";
> > > > send(ctrl_sockfd, cmd, strlen(cmd)+1, MSG_WAIT_ALL); // notice the (+1)
> > > >
> > > > char *cmd = "PASS foo@bar.com";
> > > > send(ctrl_sockfd, cmd, strlen(cmd)+1, MSG_WAIT_ALL); // notice the (+1)
> > > >
> > > > The +1 after strlen effectively sends the '\0' character as the next
> > > > command since the ftp server reads the first command only up to "\r\n".
> > > >   The second command then becomes "\0".
> > > >
> > > > Paul E.
> > > >
> > > >
> > >
> > >
> >
> >
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Lei Zhang" <lei.zhang@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Q6
Date: Thu, 15 Jan 2004 00:17:36 -0800
Lines: 14
Distribution: su
Message-ID: <bu5iba$k98$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074154668 20776 127.0.0.1 (15 Jan 2004 08:17:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5143

Is inner gap defined as
1. the difference between arrival time of the first bit of two packets,
OR
2. arrival time of the first bit of the second packet subtract the arrival
time of the last bit of the first packet

The figure is a little misleading where L is measured as length and g is
time.

Thanks,
Lei



.

Path: shelby.stanford.edu!not-for-mail
From: "Tony Hsieh" <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Q7b
Date: Thu, 15 Jan 2004 00:22:30 -0800
Lines: 6
Distribution: su
Message-ID: <bu5ikb$kj1$1@news.Stanford.EDU>
NNTP-Posting-Host: acc7f725.ipt.aol.com
X-Trace: news.Stanford.EDU 1074154957 21089 172.199.247.37 (15 Jan 2004 08:22:37 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5144

When it says that "arriving packets are completely stored before starting
transmission on the outgoing link," where are the arriving bits stored?  Are
they stored in the queue while arriving?  Or is the packet placed in the
queue after all of its bits have arrived?


.

Path: shelby.stanford.edu!saga6.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Little's result & ps 1 q3
Date: Thu, 15 Jan 2004 00:51:34 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.GSO.4.44.0401150048140.3669-100000@saga6.Stanford.EDU>
NNTP-Posting-Host: saga6.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074156699 22719 171.64.15.136 (15 Jan 2004 08:51:39 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5145

Hi,

Could anyone explain a little bit on why the Little's result does not hold
when customs are lost/dropped, as indicated on the slide. I think this
relates to problem 3 in ps1, since it is suggested we still apply Little's
result even when packets are dropped.


thanks,

-Yuhui

.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: analogy to slide37
Date: Thu, 15 Jan 2004 19:12:54 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <bu6onm$sjt$1@news.Stanford.EDU>
References: <bu58a1$93s$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine30.stanford.edu
X-Trace: news.Stanford.EDU 1074193974 29309 171.64.15.105 (15 Jan 2004 19:12:54 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5146

Haripriya Rajagopal <hpriya@stanford.edu> wrote:
: Hi,
: I had a question.In slide 37 it says that the queue fills from 0 to 100 in
: .1 sec and then drains from 100 to 0 in 0.1 again

It drains from 100 to 0 in 0.2 seconds.

: consider this scenario:
: queue fills from 0 to 100 in 0.1 sec
: it drains from 100 to 50 in 0.9 sec
: So at the end of the first second I have some bits left in the queue.
: How do I get the queue occupancy & the average queue ocupancy here?

In this case, the queue is not stable. (I take it that you mean every 
second a train of 100 bits arrive at 1000b/s, and the departure rate is 
50b/s.)

Shankar
.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: residential network
Date: Thu, 15 Jan 2004 19:15:22 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <bu6osa$sjt$2@news.Stanford.EDU>
References: <pan.2004.01.15.05.42.07.156023@stanford.edu>
NNTP-Posting-Host: elaine30.stanford.edu
X-Trace: news.Stanford.EDU 1074194122 29309 171.64.15.105 (15 Jan 2004 19:15:22 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5147

Chris Edstrom <cedstrom@stanford.edu> wrote:
: Anyone else noticing that the residential network (128.12.x.x) is
: spectacularly slow tonight, even to sites as close as
: ftp.slac.stanford.edu?

I did notice some slowness, but my experience is only anecdotal (no 
measurements :-))

Shankar
.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q6
Date: Thu, 15 Jan 2004 19:18:46 +0000 (UTC)
Lines: 19
Distribution: su
Message-ID: <bu6p2l$sjt$3@news.Stanford.EDU>
References: <bu5iba$k98$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine30.stanford.edu
X-Trace: news.Stanford.EDU 1074194326 29309 171.64.15.105 (15 Jan 2004 19:18:46 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5148

Lei Zhang <lei.zhang@cs.stanford.edu> wrote:
: Is inner gap defined as
: 1. the difference between arrival time of the first bit of two packets,
: OR
: 2. arrival time of the first bit of the second packet subtract the arrival
: time of the last bit of the first packet

It is (2), as indicated by the figure.

Shankar

: The figure is a little misleading where L is measured as length and g is
: time.

: Thanks,
: Lei



.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Little's result & ps 1 q3
Date: Thu, 15 Jan 2004 19:22:55 +0000 (UTC)
Lines: 17
Distribution: su
Message-ID: <bu6paf$sjt$4@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401150048140.3669-100000@saga6.Stanford.EDU>
NNTP-Posting-Host: elaine30.stanford.edu
X-Trace: news.Stanford.EDU 1074194575 29309 171.64.15.105 (15 Jan 2004 19:22:55 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5149

Yuhui Jin <yhjin@stanford.edu> wrote:
: Hi,

: Could anyone explain a little bit on why the Little's result does not hold
: when customs are lost/dropped, as indicated on the slide. I think this
: relates to problem 3 in ps1, since it is suggested we still apply Little's
: result even when packets are dropped.

The result won't apply as is, but might apply if you figure how to 
account for the dropped packets.

Shankar

: thanks,

: -Yuhui

.

Path: shelby.stanford.edu!not-for-mail
From: "Tony Hsieh" <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Q7bi
Date: Thu, 15 Jan 2004 12:55:14 -0800
Lines: 6
Distribution: su
Message-ID: <bu6unn$67q$1@news.Stanford.EDU>
NNTP-Posting-Host: acc21411.ipt.aol.com
X-Trace: news.Stanford.EDU 1074200121 6394 172.194.20.17 (15 Jan 2004 20:55:21 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5150

When it says that "arriving packets are completely stored before starting
transmission on the outgoing link," where are the arriving bits stored?  Are
they stored in the queue while arriving?  Or is the packet placed in the
queue after all of its bits have arrived?


.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jsilver@akamai.com>
Newsgroups: su.class.cs244a
Subject: Re: Local Host IP Address on Linux
Date: Thu, 15 Jan 2004 13:02:11 -0800
Lines: 218
Distribution: su
Message-ID: <bu6v4r$6pp$1@news.Stanford.EDU>
References: <bta257$3p4$1@news.Stanford.EDU> <Pine.LNX.4.44.0401050931550.28579-100000@Xenon.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074200540 6969 127.0.0.1 (15 Jan 2004 21:02:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5151

A little late to this thread, but I thought I would post it anyway in case
anyone is still wondering about this. In Stevens' book, section 8.14, there
is a blurb about how to determine your outgoing interface.  The solution is
similar to what Martin has below except it uses UDP.    The advantage of
using UDP is that the connect() call on UDP doesn't send anything to the
host.  There's some code in the book about how to do this.

Josh

"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0401050931550.28579-100000@Xenon.Stanford.EDU...
>
> > Hi-
> >
> > I've been working on assignment 1 (trying to get a jump on it).
>
>  trying to get a jump on it indeed!
>
> > I'm working remotely,
> > so I have to use machines other than the Stanford Hosts because of my
remote situation.
> > In particular, I use linux 2.4.22 of the debian distro.
> >
> > In doing assignment 1, I have noticed that the meat of the work is in
learning how to use
> > the sockets api correctly.  I have tried to create a test program to
create a control
> > connection and a data connection with an ftp server.  I'm running into
problems with
> > creating the data connection.  In order to create the data connection,
the local hosts's
> > IP address and port must be sent to the ftp server.  I can get the
ephemeral port number
> > using getsockname, but I can't seem to consistently get the IP address.
Here is the
> > code in question:
>
>  This seems to be a pretty common question for this assignment so lets KO
it
>  right now.
>
>  You really have three options here ....
>
>  1) Use passive mode :) (PASV) this way you can reuse your socket
connection
>     code and don't have to implement server functionality in your program.
>
>  2) You can use a shameless (nonportable and incorrect!) hack and use
>     gethostbyname() on the string returned by gethostname().
>     This is a really lame way to get the local IP and it doesn't
>     work in all cases.
>
>  3) You can use the following code :) to do it correctly.  I'm don't think
>     anyone has actually posted the correct method of doing this nor
actually
>     used it (it is a bit obscure) so here it is.
>
>     The solution is to connect to the destination .. say
"ftp.microsoft.com"
>     ... and use the local socket information for binding localy (to ensure
we
>     bind to the correct interface) and then use getsocketname(..) from
there.
>     At this point this may be a bit confusing but it should become more
>     understandable over time.
>
>     /* -------------------------------------------------------- */
>
>     struct  sockaddr_in ctrl_addr; /* connected to server */
>     struct  sockaddr_in data_addr; /* used to get local IP */
>     int     datas, ctrls;  /* couple' o file descriptors */
>     int     one = 1; /* the number one ... don't ask */
>     int     len = 0;
>
>     /* -- connect to server ... ftp.microsoft.com in this case -- */
>       ctrls = socket(AF_INET, SOCK_STREAM, 0);
>
>       memset((char *)&ctrl_addr, 0, sizeof (ctrl_addr));
>       ctrl_addr.sin_addr.s_addr = inet_addr("207.46.133.140");
>       ctrl_addr.sin_family = AF_INET;
>       ctrl_addr.sin_port = htons(21);
>
>       if (connect(ctrls, (struct sockaddr *)&ctrl_addr, sizeof
(ctrl_addr)) ==
>               -1)
>       { perror("connect"); return -1; }
>     /* -- done connecting to ftp.microsoft.com                 -- */
>
>     memset((char *)&data_addr, 0, sizeof(struct sockaddr_in));
>
>     /* -- get local socket info on connected socket -- */
>     len = sizeof(data_addr);
>     if( getsockname(ctrls, (struct sockaddr *)&data_addr, &len) == -1)
>     { perror("getsockname"); return -1; }
>
>     /* -- now we create a new socket to bind and read the addr from -- */
>      datas = socket(AF_INET, SOCK_STREAM, 0);
>
>      if( setsockopt(datas, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof
(one))
>              == -1)
>      { perror("setsockupt"); return -1; }
>
>      data_addr.sin_port = 0;
>      if ( bind(datas, (struct sockaddr *)&data_addr, sizeof (data_addr))
== -1)
>      { perror("bind"); return -1; }
>     /* -- done binding local socket -- */
>
>     len = sizeof (data_addr);
>     if ( getsockname(datas, (struct sockaddr *)&data_addr, &len) == -1 )
>     { perror("getsockname"); return -1; }
>
>     printf(" Address: %s\n", inet_ntoa(data_addr.sin_addr));
>     /* -- TADA! -- */
>
>
>   Hmm, perhaps this is a good one for the FAQ.
>
>   Cheers,
>     .m
>
> > int main (int argc, char *argv[]) {
> >
> >   int sfd, cfd, sl, cl;
> >   struct sockaddr_in addr, caddr;
> >   char port[256];
> >   struct e {
> >     unsigned char a;
> >     unsigned char b;
> >   };
> >
> >   union  {
> >     unsigned short c;
> >     struct e d;
> >   } x;
> >
> >
> >   char ip[256];
> >   char hostname[256];
> >   struct hostent *host;
> >   char *ptr;
> >
> >   if ( (sfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) printf ("E");
> >   bzero((char*) &addr, sizeof(addr));
> >   addr.sin_family = AF_INET;
> >   addr.sin_port = htons(0);
> >   addr.sin_addr.s_addr = htonl(INADDR_ANY);
> >
> >   if ( (bind(sfd, (struct sockaddr *) &addr, sizeof(struct sockaddr))) <
0) printf ("E");
> >
> >   sl =  sizeof(struct sockaddr);
> >   getsockname(sfd, (struct sockaddr *) &addr, &sl);
> >   sprintf(port, "%d", ntohs(addr.sin_port));
> >   printf("port = %s\n", port);
> >
> >   /* This didn't work; early attempt */
> >   sprintf(ip, "%s", ntohl(addr.sin_addr.s_addr));
> >   printf("ip = %s\n", ip);
> >
> >   x.c = ntohs(addr.sin_port);
> >   printf("low bits = %u\n", x.d.a);
> >   printf("high bits = %u\n", x.d.b);
> >
> >
> >   /* This doesn't work */
> >   printf("ip address = %s\n", inet_ntoa(addr.sin_addr));
> >
> >   /* This works on cygwin and sun but not on my linux machine that uses
dhcp */
> >   gethostname(hostname, 256);
> >   if ( (host = gethostbyname(hostname)) < 0) perror("E: gethostbyname");
> >   printf("ip address = %s\n", inet_ntoa(*( (struct in_addr*)
(host->h_addr_list[0]))));
> >
> >   /* Ignore this; early attempts */
> >   printf("hostname = %s\n", hostname);
> >   ptr = host->h_addr;
> >   while (*ptr) {
> >     printf("ip address = %d\n", *ptr);
> >     ptr++;
> >   }
> >
> >
> > This works on the Stanford hosts and my pc using cygwin.  But, when I
try to run this on my
> > linux host it gives me the following results:
> >
> > port = 32787
> > ip = (null)
> > low bits = 19
> > high bits = 128
> > ip address = 0.0.0.0
> > hostname = icebox1.dieterly.com
> > ip address = 127
> > ip address = 127.0.0.1
> >
> > The port info is correct, but the IP Address is always the loopback
address.
> >
> > I've tried every possible configuration I can think of in /etc/hosts and
/etc/network/interfaces,
> > but nothing seems to work.  I've also tried to find a sockets function
that will return the
> > dhcp IP Address that my pc running linux uses, but to no avail.  Since
this seems to work
> > on the Stanford hosts, I guess that I could just use it and not worry
about it not working
> > on linux, but that doesn't seem very satisfactory to me.
> >
> > Thanks for any help that you may be able to give me.
> >
>
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Michael Hsieh" <mhsieh33@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Q2 b/c
Date: Thu, 15 Jan 2004 13:44:00 -0800
Lines: 4
Distribution: su
Message-ID: <bu71j9$9bn$1@news.Stanford.EDU>
NNTP-Posting-Host: red63.stanford.edu
X-Trace: news.Stanford.EDU 1074203049 9591 128.12.33.167 (15 Jan 2004 21:44:09 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5152

For these parts, does Mb/s mean megabits per second or megabytes per second?
Does Gb/s mean gigabits or gigabytes per second?


.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: reply code lines
Date: Thu, 15 Jan 2004 14:40:38 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0401151439020.28685-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074206441 13857 171.64.15.106 (15 Jan 2004 22:40:41 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5153


Is it safe to assume that any reply that begins w/ 3 digit characters
must have a ' ' or '-' following it, according to ftp protocol?

ie.. we can't have a reply like: '1559999' or '155BlahBlah', correct?

--vishal

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: reply codes of 100-199
Date: Thu, 15 Jan 2004 15:09:38 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.GSO.4.44.0401151507360.29040-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074208180 15843 171.64.15.106 (15 Jan 2004 23:09:40 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5154


After a RETR command,

I'm getting a single line reply of:

150 Opening BINARY mode data connection for schedule.html (92999 bytes).

Code 150 leads me to believe that there is more to read, so
I call read( sock, reply, len ) again, but it hangs...has anyone seen
this or have any idea why?

--vishal



.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: what if local dir specified by 4th argument is non-existent
Date: Thu, 15 Jan 2004 16:31:53 -0800
Lines: 6
Distribution: su
Message-ID: <Pine.GSO.4.44.0401151631200.1006-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074213116 22512 171.64.15.106 (16 Jan 2004 00:31:56 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5155


Should we create a new one or just exit the program w/ an error message?

--vishal


.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q7bi
Date: Fri, 16 Jan 2004 00:38:07 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <bu7bpf$k7j$1@news.Stanford.EDU>
References: <bu6unn$67q$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1074213487 20723 171.64.15.108 (16 Jan 2004 00:38:07 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5156

Tony Hsieh <thsieh@stanford.edu> wrote:
: When it says that "arriving packets are completely stored before starting
: transmission on the outgoing link," where are the arriving bits stored?  Are
: they stored in the queue while arriving?  

Yes. They are stored in the queue while arriving.

Shankar
.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q2 b/c
Date: Fri, 16 Jan 2004 00:39:04 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <bu7br8$k7j$2@news.Stanford.EDU>
References: <bu71j9$9bn$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1074213544 20723 171.64.15.108 (16 Jan 2004 00:39:04 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5157

Michael Hsieh <mhsieh33@stanford.edu> wrote:
: For these parts, does Mb/s mean megabits per second or megabytes per second?
: Does Gb/s mean gigabits or gigabytes per second?

Small 'b' means bits.

Shankar

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS1 Q7b
Date: Fri, 16 Jan 2004 01:30:42 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <bu7es2$qd4$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1074216642 27044 171.64.15.103 (16 Jan 2004 01:30:42 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5158

Is the required answer expected to cover only integral values of t (i.e at 
second boundaries) or all real values, i.e. dividing into subcases based 
on fractions of a second?

Tyrone
.

Path: shelby.stanford.edu!not-for-mail
From: Daniel Maynes-Aminzade <monzy@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Q8a
Date: Thu, 15 Jan 2004 17:33:03 -0800
Lines: 6
Distribution: su
Message-ID: <bu7f0i$rks$1@news.Stanford.EDU>
NNTP-Posting-Host: pup9.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074216786 28316 171.64.66.159 (16 Jan 2004 01:33:06 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5159

I'm a little confused about question 8.  If we look at an interval of 
zero length (tau=0), then sigma bits can still arrive (in zero time). 
Does this mean that the maximum arrival rate is infinity?

- Dan

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS1 Q7b- packets arrive
Date: Fri, 16 Jan 2004 01:37:11 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <bu7f87$rr4$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1074217031 28516 171.64.15.103 (16 Jan 2004 01:37:11 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5160

When it says "a new packet...begins to arrive every second", can we assume 
that these are the 0NLY packets that arrive?  Or does it mean that packets 
are arriving at a rate such that one is always starting when each second 
starts (ie, 2, 5, or 10 packets per second)?

Tyrone
.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: reply code lines
Date: Fri, 16 Jan 2004 01:43:21 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <bu7fjp$k7j$3@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401151439020.28685-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1074217401 20723 171.64.15.108 (16 Jan 2004 01:43:21 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5161

Vishal Patel <vishalp@stanford.edu> wrote:

: Is it safe to assume that any reply that begins w/ 3 digit characters
: must have a ' ' or '-' following it, according to ftp protocol?

The first and the last lines of a multi-line reply will begin with a 
3-digit code followed by a '-' or a space, and if it's a single line reply 
the line will start with a 3 digit code followed by a space.

Shankar
.

Path: shelby.stanford.edu!not-for-mail
From: Dan Wendlandt <danwent@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 Q8 b/c
Date: Thu, 15 Jan 2004 17:42:58 -0800
Organization: Soto House
Lines: 5
Distribution: su
Message-ID: <bu7fm3$sjb$1@news.Stanford.EDU>
Reply-To: danwent@stanford.edu
NNTP-Posting-Host: hollander.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
X-Trace: news.Stanford.EDU 1074217475 29291 128.12.45.20 (16 Jan 2004 01:44:35 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: KNode/0.7.2
Xref: shelby.stanford.edu su.class.cs244a:5162

Are we to assume the queue is stable, ie: there is a finite value for its
size?

It seems that if sigma is very large and rho very small there would be no
way to have a finite sized queue.
.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: reply codes of 100-199
Date: Fri, 16 Jan 2004 01:45:20 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <bu7fng$k7j$4@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401151507360.29040-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1074217520 20723 171.64.15.108 (16 Jan 2004 01:45:20 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5163

Vishal Patel <vishalp@stanford.edu> wrote:

: After a RETR command,

: I'm getting a single line reply of:

: 150 Opening BINARY mode data connection for schedule.html (92999 bytes).

: Code 150 leads me to believe that there is more to read, so
: I call read( sock, reply, len ) again, but it hangs...has anyone seen
: this or have any idea why?

The spec says that a 1yz reply can also be used to indicate that the 
command was accepted and the user-process may now pay attention
to the data connections. So, try reading from the data connection ..

Shankar

.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: reply codes of 100-199
Date: Fri, 16 Jan 2004 01:46:17 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <bu7fp8$k7j$5@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401151507360.29040-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1074217577 20723 171.64.15.108 (16 Jan 2004 01:46:17 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5164

Vishal Patel <vishalp@stanford.edu> wrote:

: After a RETR command,

: I'm getting a single line reply of:

: 150 Opening BINARY mode data connection for schedule.html (92999 bytes).

: Code 150 leads me to believe that there is more to read, so
: I call read( sock, reply, len ) again, but it hangs...has anyone seen
: this or have any idea why?

This qn is answered in the new thread.

Shankar



.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q8a
Date: Fri, 16 Jan 2004 01:50:03 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <bu7g0b$k7j$6@news.Stanford.EDU>
References: <bu7f0i$rks$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1074217803 20723 171.64.15.108 (16 Jan 2004 01:50:03 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5165

Daniel Maynes-Aminzade <monzy@stanford.edu> wrote:
: I'm a little confused about question 8.  If we look at an interval of 
: zero length (tau=0), then sigma bits can still arrive (in zero time). 
: Does this mean that the maximum arrival rate is infinity?

Max arrival rate may be thought of as infinity, but only for 
that infinitesimal period. Note that in (a), "average"refers to average 
over an extended period of time.

Shankar

.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q7b- packets arrive
Date: Fri, 16 Jan 2004 01:52:24 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <bu7g4o$k7j$7@news.Stanford.EDU>
References: <bu7f87$rr4$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1074217944 20723 171.64.15.108 (16 Jan 2004 01:52:24 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5166

Tyrone Nicholas <tyronen@stanford.edu> wrote:
: When it says "a new packet...begins to arrive every second", can we assume 
: that these are the 0NLY packets that arrive?  Or does it mean that packets 
: are arriving at a rate such that one is always starting when each second 
: starts (ie, 2, 5, or 10 packets per second)?

It means the former.

Shankar
.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: what if local dir specified by 4th argument is non-existent
Date: Fri, 16 Jan 2004 01:57:51 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <bu7gev$k7j$8@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401151631200.1006-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1074218271 20723 171.64.15.108 (16 Jan 2004 01:57:51 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5167

Vishal Patel <vishalp@stanford.edu> wrote:

: Should we create a new one or just exit the program w/ an error message?

: --vishal

See bullet 6 under "The Problem" in the assignment specification

Shankar


.

Path: shelby.stanford.edu!not-for-mail
From: Shankar Ravindra Ponnekanti <pshankar@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q8 b/c
Date: Fri, 16 Jan 2004 02:05:48 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <bu7gts$k7j$9@news.Stanford.EDU>
References: <bu7fm3$sjb$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1074218748 20723 171.64.15.108 (16 Jan 2004 02:05:48 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5168

Dan Wendlandt <danwent@stanford.edu> wrote:
: Are we to assume the queue is stable, ie: there is a finite value for its
: size?

: It seems that if sigma is very large and rho very small there would be no
: way to have a finite sized queue.

Sigma may be large, but it is still finite. Think of what happens over a 
large period of time.

Shankar
.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q8a
Date: Fri, 16 Jan 2004 02:23:05 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <bu7hu9$295$1@news.Stanford.EDU>
References: <bu7f0i$rks$1@news.Stanford.EDU> <bu7g0b$k7j$6@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1074219785 2341 171.64.15.103 (16 Jan 2004 02:23:05 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5169

Shankar Ravindra Ponnekanti <pshankar@stanford.edu> wrote:

> Max arrival rate may be thought of as infinity, but only for 
> that infinitesimal period. Note that in (a), "average"refers to average 
> over an extended period of time.

So does this mean that the average rate varies according to the value of 
tau?  I'd originally thought the question was looking for a fixed upper 
bound, regardless of the value of tau.

Tyrone

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q8a
Date: Thu, 15 Jan 2004 18:42:09 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.LNX.4.44.0401151839230.24126-100000@Xenon.Stanford.EDU>
References: <bu7f0i$rks$1@news.Stanford.EDU> <bu7g0b$k7j$6@news.Stanford.EDU>
 <bu7hu9$295$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074220935 4500 171.64.66.201 (16 Jan 2004 02:42:15 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bu7hu9$295$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5170

On Fri, 16 Jan 2004, Tyrone Nicholas wrote:

> Shankar Ravindra Ponnekanti <pshankar@stanford.edu> wrote:
> 
> > Max arrival rate may be thought of as infinity, but only for 
> > that infinitesimal period. Note that in (a), "average"refers to average 
> > over an extended period of time.
> 
> So does this mean that the average rate varies according to the value of 
> tau?  I'd originally thought the question was looking for a fixed upper 
> bound, regardless of the value of tau.

Here's a bit more formal version of 8(a): what is the maximum average rate 
over any time t as t->infinity? 

Shankar


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q7b
Date: Thu, 15 Jan 2004 18:49:45 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.LNX.4.44.0401151848380.27869-100000@Xenon.Stanford.EDU>
References: <bu7es2$qd4$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074221394 4985 171.64.66.201 (16 Jan 2004 02:49:54 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bu7es2$qd4$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5171



On Fri, 16 Jan 2004, Tyrone Nicholas wrote:

> Is the required answer expected to cover only integral values of t (i.e at 
> second boundaries) or all real values, i.e. dividing into subcases based 
> on fractions of a second?
> 

Wherever applicable, divide into subcases and report on each.

Shankar


.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q8 b/c
Date: Thu, 15 Jan 2004 19:00:10 -0800
Lines: 40
Distribution: su
Message-ID: <bu7k3u$5hb$1@news.Stanford.EDU>
References: <bu7fm3$sjb$1@news.Stanford.EDU> <bu7gts$k7j$9@news.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1074222014 5675 128.12.44.20 (16 Jan 2004 03:00:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5172

Over a large (infinite) period of time, you may run into an infinite number
of tau-length intervals of time, meaning you could accrue an infinite number
of (sigma + rho * tau)-sized packets. If rho is very small, there would be
no way to clear out these bits (since the departure process has a rate of 2
* rho).

Example:
sigma = 95
rho = 5
tau = 1

At 0 seconds, your queue length will be 0.
At 1 second, your queue length will be 90 (100 in, 10 out).
At 2 seconds, your queue length will be 180 (100 more in, 10 more out).

Essentially, the inbound rate is 100 while the outbound rate is 10. Even if
sigma is finite, you get an infinite queue.

Perhaps, did you mean that the outbound rate c = 2 * sigma?

- Sean


"Shankar Ravindra Ponnekanti" <pshankar@Stanford.EDU> wrote in message
news:bu7gts$k7j$9@news.Stanford.EDU...
> Dan Wendlandt <danwent@stanford.edu> wrote:
> : Are we to assume the queue is stable, ie: there is a finite value for
its
> : size?
>
> : It seems that if sigma is very large and rho very small there would be
no
> : way to have a finite sized queue.
>
> Sigma may be large, but it is still finite. Think of what happens over a
> large period of time.
>
> Shankar


.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q8 b/c
Date: Thu, 15 Jan 2004 19:03:19 -0800
Lines: 57
Distribution: su
Message-ID: <bu7k9r$5oc$1@news.Stanford.EDU>
References: <bu7fm3$sjb$1@news.Stanford.EDU> <bu7gts$k7j$9@news.Stanford.EDU> <bu7k3u$5hb$1@news.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1074222203 5900 128.12.44.20 (16 Jan 2004 03:03:23 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5173

Actually, I don't even think that having c = 2 * sigma really changes
anything, since you could create a similar situation with a very large rho
and a very small sigma.

Another approach: if rho = 0 and sigma > 0, how would the queue _not_
overflow (positive arrival rate, 0 departure rate)?

- Sean

"Sean M." <seanm514@stanford.edu> wrote in message
news:bu7k3u$5hb$1@news.Stanford.EDU...
> Over a large (infinite) period of time, you may run into an infinite
number
> of tau-length intervals of time, meaning you could accrue an infinite
number
> of (sigma + rho * tau)-sized packets. If rho is very small, there would be
> no way to clear out these bits (since the departure process has a rate of
2
> * rho).
>
> Example:
> sigma = 95
> rho = 5
> tau = 1
>
> At 0 seconds, your queue length will be 0.
> At 1 second, your queue length will be 90 (100 in, 10 out).
> At 2 seconds, your queue length will be 180 (100 more in, 10 more out).
>
> Essentially, the inbound rate is 100 while the outbound rate is 10. Even
if
> sigma is finite, you get an infinite queue.
>
> Perhaps, did you mean that the outbound rate c = 2 * sigma?
>
> - Sean
>
>
> "Shankar Ravindra Ponnekanti" <pshankar@Stanford.EDU> wrote in message
> news:bu7gts$k7j$9@news.Stanford.EDU...
> > Dan Wendlandt <danwent@stanford.edu> wrote:
> > : Are we to assume the queue is stable, ie: there is a finite value for
> its
> > : size?
> >
> > : It seems that if sigma is very large and rho very small there would be
> no
> > : way to have a finite sized queue.
> >
> > Sigma may be large, but it is still finite. Think of what happens over a
> > large period of time.
> >
> > Shankar
>
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q8 b/c
Date: Thu, 15 Jan 2004 19:09:02 -0800
Lines: 61
Distribution: su
Message-ID: <Pine.LNX.4.44.0401151902310.31953-100000@Xenon.Stanford.EDU>
References: <bu7fm3$sjb$1@news.Stanford.EDU> <bu7gts$k7j$9@news.Stanford.EDU>
 <bu7k3u$5hb$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074222544 6262 171.64.66.201 (16 Jan 2004 03:09:04 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bu7k3u$5hb$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5174


I see the confusion now. Note that tau is not a constant like sigma and 
rho! Read the problem carefully. (".. in any interval of duration tau .. 
where sigma and rho are constants.") 

Shankar

On Thu, 15 Jan 2004, Sean M. wrote:

> Over a large (infinite) period of time, you may run into an infinite number
> of tau-length intervals of time, meaning you could accrue an infinite number
> of (sigma + rho * tau)-sized packets. If rho is very small, there would be
> no way to clear out these bits (since the departure process has a rate of 2
> * rho).
> 
> Example:
> sigma = 95
> rho = 5
> tau = 1
> 
> At 0 seconds, your queue length will be 0.
> At 1 second, your queue length will be 90 (100 in, 10 out).
> At 2 seconds, your queue length will be 180 (100 more in, 10 more out).
> 
> Essentially, the inbound rate is 100 while the outbound rate is 10. Even if
> sigma is finite, you get an infinite queue.
> 
> Perhaps, did you mean that the outbound rate c = 2 * sigma?
> 
> - Sean
> 
> 
> "Shankar Ravindra Ponnekanti" <pshankar@Stanford.EDU> wrote in message
> news:bu7gts$k7j$9@news.Stanford.EDU...
> > Dan Wendlandt <danwent@stanford.edu> wrote:
> > : Are we to assume the queue is stable, ie: there is a finite value for
> its
> > : size?
> >
> > : It seems that if sigma is very large and rho very small there would be
> no
> > : way to have a finite sized queue.
> >
> > Sigma may be large, but it is still finite. Think of what happens over a
> > large period of time.
> >
> > Shankar
> 
> 
> 

-- 

Shankar Ponnekanti

PhD CS Student
#252, Gates Building, Stanford
E-mail : pshankar@stanford.edu, pshankar@cs.stanford.edu
Phone (evening)  : 650-497-4390
      (daytime)  : 650-725-3053

.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q8 b/c
Date: Thu, 15 Jan 2004 19:12:48 -0800
Lines: 77
Distribution: su
Message-ID: <bu7krl$6fj$1@news.Stanford.EDU>
References: <bu7fm3$sjb$1@news.Stanford.EDU> <bu7gts$k7j$9@news.Stanford.EDU> <bu7k3u$5hb$1@news.Stanford.EDU> <Pine.LNX.4.44.0401151902310.31953-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1074222773 6643 128.12.44.20 (16 Jan 2004 03:12:53 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5175

Oh. Dur. I'll look at it again, thanks.

- Sean

"Shankar Ponnekanti" <pshankar@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0401151902310.31953-100000@Xenon.Stanford.EDU...
>
> I see the confusion now. Note that tau is not a constant like sigma and
> rho! Read the problem carefully. (".. in any interval of duration tau ..
> where sigma and rho are constants.")
>
> Shankar
>
> On Thu, 15 Jan 2004, Sean M. wrote:
>
> > Over a large (infinite) period of time, you may run into an infinite
number
> > of tau-length intervals of time, meaning you could accrue an infinite
number
> > of (sigma + rho * tau)-sized packets. If rho is very small, there would
be
> > no way to clear out these bits (since the departure process has a rate
of 2
> > * rho).
> >
> > Example:
> > sigma = 95
> > rho = 5
> > tau = 1
> >
> > At 0 seconds, your queue length will be 0.
> > At 1 second, your queue length will be 90 (100 in, 10 out).
> > At 2 seconds, your queue length will be 180 (100 more in, 10 more out).
> >
> > Essentially, the inbound rate is 100 while the outbound rate is 10. Even
if
> > sigma is finite, you get an infinite queue.
> >
> > Perhaps, did you mean that the outbound rate c = 2 * sigma?
> >
> > - Sean
> >
> >
> > "Shankar Ravindra Ponnekanti" <pshankar@Stanford.EDU> wrote in message
> > news:bu7gts$k7j$9@news.Stanford.EDU...
> > > Dan Wendlandt <danwent@stanford.edu> wrote:
> > > : Are we to assume the queue is stable, ie: there is a finite value
for
> > its
> > > : size?
> > >
> > > : It seems that if sigma is very large and rho very small there would
be
> > no
> > > : way to have a finite sized queue.
> > >
> > > Sigma may be large, but it is still finite. Think of what happens over
a
> > > large period of time.
> > >
> > > Shankar
> >
> >
> >
>
> -- 
>
> Shankar Ponnekanti
>
> PhD CS Student
> #252, Gates Building, Stanford
> E-mail : pshankar@stanford.edu, pshankar@cs.stanford.edu
> Phone (evening)  : 650-497-4390
>       (daytime)  : 650-725-3053
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q8 b/c
Date: Thu, 15 Jan 2004 19:14:31 -0800
Lines: 77
Distribution: su
Message-ID: <Pine.LNX.4.44.0401151910510.1807-100000@Xenon.Stanford.EDU>
References: <bu7fm3$sjb$1@news.Stanford.EDU> <bu7gts$k7j$9@news.Stanford.EDU>
 <bu7k3u$5hb$1@news.Stanford.EDU> <bu7k9r$5oc$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074222872 6712 171.64.66.201 (16 Jan 2004 03:14:32 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bu7k9r$5oc$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5176


You can assume rho > 0. As indicated in my other reply, tau is not a 
constant. So think about it again :-)

Shankar

On Thu, 15 Jan 2004, Sean M. wrote:

> Actually, I don't even think that having c = 2 * sigma really changes
> anything, since you could create a similar situation with a very large rho
> and a very small sigma.
> 
> Another approach: if rho = 0 and sigma > 0, how would the queue _not_
> overflow (positive arrival rate, 0 departure rate)?
> 
> - Sean
> 
> "Sean M." <seanm514@stanford.edu> wrote in message
> news:bu7k3u$5hb$1@news.Stanford.EDU...
> > Over a large (infinite) period of time, you may run into an infinite
> number
> > of tau-length intervals of time, meaning you could accrue an infinite
> number
> > of (sigma + rho * tau)-sized packets. If rho is very small, there would be
> > no way to clear out these bits (since the departure process has a rate of
> 2
> > * rho).
> >
> > Example:
> > sigma = 95
> > rho = 5
> > tau = 1
> >
> > At 0 seconds, your queue length will be 0.
> > At 1 second, your queue length will be 90 (100 in, 10 out).
> > At 2 seconds, your queue length will be 180 (100 more in, 10 more out).
> >
> > Essentially, the inbound rate is 100 while the outbound rate is 10. Even
> if
> > sigma is finite, you get an infinite queue.
> >
> > Perhaps, did you mean that the outbound rate c = 2 * sigma?
> >
> > - Sean
> >
> >
> > "Shankar Ravindra Ponnekanti" <pshankar@Stanford.EDU> wrote in message
> > news:bu7gts$k7j$9@news.Stanford.EDU...
> > > Dan Wendlandt <danwent@stanford.edu> wrote:
> > > : Are we to assume the queue is stable, ie: there is a finite value for
> > its
> > > : size?
> > >
> > > : It seems that if sigma is very large and rho very small there would be
> > no
> > > : way to have a finite sized queue.
> > >
> > > Sigma may be large, but it is still finite. Think of what happens over a
> > > large period of time.
> > >
> > > Shankar
> >
> >
> 
> 
> 

-- 

Shankar Ponnekanti

PhD CS Student
#252, Gates Building, Stanford
E-mail : pshankar@stanford.edu, pshankar@cs.stanford.edu
Phone (evening)  : 650-497-4390
      (daytime)  : 650-725-3053

.

Path: shelby.stanford.edu!not-for-mail
From: Tony Chun-hao Hsieh <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: LIST using telnet?
Date: Thu, 15 Jan 2004 20:23:02 -0800
Lines: 40
Distribution: su
Message-ID: <40076726.C2ACDD05@stanford.edu>
NNTP-Posting-Host: elaine10.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074226982 11696 171.64.15.75 (16 Jan 2004 04:23:02 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (X11; U; SunOS 5.8 sun4u)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:5177

Hi,

I was using telnet to experiment with the FTP protocol.  I typed in
"telnet ftp.stanford.edu 21"  I then type in the USER command, the PASS
command, the TYPE command, the PASV command, and finally the LIST
command.  HOwever, when I type in the LIST command it hangs.

elaine10:~/cs244a/hw1> telnet ftp.stanford.edu 21
Trying 171.64.15.241...
Connected to ftp2.Stanford.EDU (171.64.15.241).
Escape character is '^]'.
220-----------------------------------------------------------------------------
220-    Abuse of this facility may be considered violation of Federal or
220-    California law or the policies of Stanford University.  If you
have
220-    questions regarding this policy please send mail to
220-    root@ftp.Stanford.EDU
220-----------------------------------------------------------------------------
220-
220 ftp2.Stanford.EDU FTP server ready.
USER anonymous
331 Guest login ok, send your complete e-mail address as password.
PASS thsieh@stanford.edu
230-Please read the file README
230-  it was last modified on Fri Feb 15 12:22:25 2002 - 699 days ago
230 Guest login ok, access restrictions apply.
TYPE A
200 Type set to A.
PASV
227 Entering Passive Mode (171,64,15,241,167,143)
LIST

I never receive the following replies.
150 Opening ASCII mode data connection for /bin/ls.
226 Transfer complete.


Am I supposed to be able to do this in telnet?  Thanks so much.

-Tony
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: LIST using telnet?
Date: Thu, 15 Jan 2004 22:05:16 -0800
Lines: 54
Distribution: su
Message-ID: <Pine.LNX.4.44.0401152156450.12050-100000@Xenon.Stanford.EDU>
References: <40076726.C2ACDD05@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074233116 18439 171.64.66.201 (16 Jan 2004 06:05:16 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <40076726.C2ACDD05@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5178


You need a data connection before you can issue the list command. See 
below.

On Thu, 15 Jan 2004, Tony Chun-hao Hsieh wrote:

> Hi,
> 
> I was using telnet to experiment with the FTP protocol.  I typed in
> "telnet ftp.stanford.edu 21"  I then type in the USER command, the PASS
> command, the TYPE command, the PASV command, and finally the LIST
> command.  HOwever, when I type in the LIST command it hangs.
> 
> elaine10:~/cs244a/hw1> telnet ftp.stanford.edu 21
> Trying 171.64.15.241...
> Connected to ftp2.Stanford.EDU (171.64.15.241).
> Escape character is '^]'.
> 220-----------------------------------------------------------------------------
> 220-    Abuse of this facility may be considered violation of Federal or
> 220-    California law or the policies of Stanford University.  If you
> have
> 220-    questions regarding this policy please send mail to
> 220-    root@ftp.Stanford.EDU
> 220-----------------------------------------------------------------------------
> 220-
> 220 ftp2.Stanford.EDU FTP server ready.
> USER anonymous
> 331 Guest login ok, send your complete e-mail address as password.
> PASS thsieh@stanford.edu
> 230-Please read the file README
> 230-  it was last modified on Fri Feb 15 12:22:25 2002 - 699 days ago
> 230 Guest login ok, access restrictions apply.
> TYPE A
> 200 Type set to A.
> PASV
> 227 Entering Passive Mode (171,64,15,241,167,143)

At this point, you will need to open a data connection (perhaps using 
nc on leland systems) to 171.64.15.241:port (where port = 256*167+143) 
before you can proceed with list. 

Shankar

> LIST
> 
> I never receive the following replies.
> 150 Opening ASCII mode data connection for /bin/ls.
> 226 Transfer complete.
> 
> 
> Am I supposed to be able to do this in telnet?  Thanks so much.
> 
> -Tony

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: The maximum size of the server response
Date: Thu, 15 Jan 2004 23:41:05 -0800
Lines: 6
Distribution: su
Message-ID: <Pine.GSO.4.44.0401152339560.20968-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074238869 23808 171.64.15.100 (16 Jan 2004 07:41:09 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5179


Is it a good assumption that the maximum size of the server response,
including the response for "LIST" will be no more than 1024 bytes?



.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: The maximum size of the server response
Date: Fri, 16 Jan 2004 00:00:59 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0401152358530.11631-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401152339560.20968-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074240060 25129 171.64.66.201 (16 Jan 2004 08:01:00 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0401152339560.20968-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5180

On Thu, 15 Jan 2004, Xiaohua Fang wrote:

> 
> Is it a good assumption that the maximum size of the server response,
> including the response for "LIST" will be no more than 1024 bytes?
> 

No. The response for LIST can be > 1024 bytes :-(

Shankar


.

Path: shelby.stanford.edu!not-for-mail
From: "Cynthia Lau" <cindabin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: problem with ftp.fedworld.gov
Date: Fri, 16 Jan 2004 00:05:47 -0800
Lines: 36
Distribution: su
Message-ID: <bu861v$oqo$1@news.Stanford.EDU>
NNTP-Posting-Host: francesca.stanford.edu
X-Trace: news.Stanford.EDU 1074240383 25432 171.64.77.109 (16 Jan 2004 08:06:23 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5181

Hi,

I am having problems testing with the ftp.fedworld.gov server that's listed
on the homework assignment.

When I try to run my ftpcopy program with it, after i send the PASS command,
i don't get any reply back from the server when i try to call read() -- i
always get a return value of 0.

I tried to run the unix ftp on that server to see what was going on, and i
got the following output:

> ftp ftp.fedworld.gov
Connected to ftp.fedworld.gov.
220-              Welcome to the FedWorld FTP Site
....

220-#0
220 ftp.fedworld.gov FTP server ready.
Name (ftp.fedworld.gov:cindabin): anonymous
331 Guest login ok, send your complete e-mail address as password.
Password:
421 Service not available, remote server has closed connection
Login failed.
ftp>

It seems strange to me that i can't read that 421 message successfully with
my ftpcopy; my program works fine with all other ftp servers that i can
think to try; no matter how many calls to read i try after sending the PASS
command, i get nothing from the ftp.fedworld.gov server.

Is anyone else having the same problems with this server?

-Cynthia


.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q8 b/c
Date: Fri, 16 Jan 2004 00:41:22 -0800
Lines: 87
Distribution: su
Message-ID: <bu883i$r1c$1@news.Stanford.EDU>
References: <bu7fm3$sjb$1@news.Stanford.EDU> <bu7gts$k7j$9@news.Stanford.EDU> <bu7k3u$5hb$1@news.Stanford.EDU> <bu7k9r$5oc$1@news.Stanford.EDU> <Pine.LNX.4.44.0401151910510.1807-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: agila.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074242482 27692 128.12.194.74 (16 Jan 2004 08:41:22 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2
X-Accept-Language: en-us, en
In-Reply-To: <Pine.LNX.4.44.0401151910510.1807-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5182

When you say maximum average rate, do you mean average over all possible 
tau, over time, or over both?

Paul E.

Shankar Ponnekanti wrote:
> You can assume rho > 0. As indicated in my other reply, tau is not a 
> constant. So think about it again :-)
> 
> Shankar
> 
> On Thu, 15 Jan 2004, Sean M. wrote:
> 
> 
>>Actually, I don't even think that having c = 2 * sigma really changes
>>anything, since you could create a similar situation with a very large rho
>>and a very small sigma.
>>
>>Another approach: if rho = 0 and sigma > 0, how would the queue _not_
>>overflow (positive arrival rate, 0 departure rate)?
>>
>>- Sean
>>
>>"Sean M." <seanm514@stanford.edu> wrote in message
>>news:bu7k3u$5hb$1@news.Stanford.EDU...
>>
>>>Over a large (infinite) period of time, you may run into an infinite
>>
>>number
>>
>>>of tau-length intervals of time, meaning you could accrue an infinite
>>
>>number
>>
>>>of (sigma + rho * tau)-sized packets. If rho is very small, there would be
>>>no way to clear out these bits (since the departure process has a rate of
>>
>>2
>>
>>>* rho).
>>>
>>>Example:
>>>sigma = 95
>>>rho = 5
>>>tau = 1
>>>
>>>At 0 seconds, your queue length will be 0.
>>>At 1 second, your queue length will be 90 (100 in, 10 out).
>>>At 2 seconds, your queue length will be 180 (100 more in, 10 more out).
>>>
>>>Essentially, the inbound rate is 100 while the outbound rate is 10. Even
>>
>>if
>>
>>>sigma is finite, you get an infinite queue.
>>>
>>>Perhaps, did you mean that the outbound rate c = 2 * sigma?
>>>
>>>- Sean
>>>
>>>
>>>"Shankar Ravindra Ponnekanti" <pshankar@Stanford.EDU> wrote in message
>>>news:bu7gts$k7j$9@news.Stanford.EDU...
>>>
>>>>Dan Wendlandt <danwent@stanford.edu> wrote:
>>>>: Are we to assume the queue is stable, ie: there is a finite value for
>>>
>>>its
>>>
>>>>: size?
>>>>
>>>>: It seems that if sigma is very large and rho very small there would be
>>>
>>>no
>>>
>>>>: way to have a finite sized queue.
>>>>
>>>>Sigma may be large, but it is still finite. Think of what happens over a
>>>>large period of time.
>>>>
>>>>Shankar
>>>
>>>
>>
>>
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine32.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: problem with ftp.fedworld.gov
Date: 16 Jan 2004 17:03:53 -0800
Organization: Stanford University, CA, USA
Lines: 30
Distribution: su
Message-ID: <snn3cafjshy.fsf@elaine32.Stanford.EDU>
References: <bu861v$oqo$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine32.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1074301433 24642 171.64.15.107 (17 Jan 2004 01:03:53 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5183


> It seems strange to me that i can't read that 421 message successfully with
> my ftpcopy; my program works fine with all other ftp servers that i can
> think to try; no matter how many calls to read i try after sending the PASS
> command, i get nothing from the ftp.fedworld.gov server.
> 
> Is anyone else having the same problems with this server?

I talked to one student after section today who was experiencing the same
issues.  I just tried telneting to ftp.fedworld.gov on port 21 and get
this is

<-- beginning messages chomped -->
220 ftp.fedworld.gov FTP server ready.
USER anonymous
331 Guest login ok, send your complete e-mail address as password.
PASS shepard8@stanford.edu
Connection closed by foreign host.


This happened all 10 times I tried to login just now.  It looks like it is
a problem with the ftp server/site and not your ftpclient.   I'll test
again later and investigate further as well.  I'll post again if I have
any other findings.

So, summary: right now, don't worry if your ftp client is failing after
sending the PASS command to ftp.fedworld.gov.

susan

.

Path: shelby.stanford.edu!not-for-mail
From: "Cynthia Lau" <cindabin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: The maximum size of the server response
Date: Fri, 16 Jan 2004 17:17:24 -0800
Lines: 23
Distribution: su
Message-ID: <bua2gj$pfj$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401152339560.20968-100000@elaine25.Stanford.EDU> <Pine.LNX.4.44.0401152358530.11631-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: francesca.stanford.edu
X-Trace: news.Stanford.EDU 1074302291 26099 171.64.77.109 (17 Jan 2004 01:18:11 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5184

but what about individual lines of the list response?  can we assume that
they are <= 1024 bytes, i.e. we will encounter a "\r\n" before we exceed
1024 bytes?

-cynthia


"Shankar Ponnekanti" <pshankar@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0401152358530.11631-100000@Xenon.Stanford.EDU...
> On Thu, 15 Jan 2004, Xiaohua Fang wrote:
>
> >
> > Is it a good assumption that the maximum size of the server response,
> > including the response for "LIST" will be no more than 1024 bytes?
> >
>
> No. The response for LIST can be > 1024 bytes :-(
>
> Shankar
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Cynthia Lau" <cindabin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: nevermind
Date: Fri, 16 Jan 2004 17:18:51 -0800
Lines: 32
Distribution: su
Message-ID: <bua2j5$ph2$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401152339560.20968-100000@elaine25.Stanford.EDU> <Pine.LNX.4.44.0401152358530.11631-100000@Xenon.Stanford.EDU> <bua2gj$pfj$1@news.Stanford.EDU>
NNTP-Posting-Host: francesca.stanford.edu
X-Trace: news.Stanford.EDU 1074302373 26146 171.64.77.109 (17 Jan 2004 01:19:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5185

I found the answer on the FAQ.  sorry bout that.

-Cynthia


"Cynthia Lau" <cindabin@stanford.edu> wrote in message
news:bua2gj$pfj$1@news.Stanford.EDU...
> but what about individual lines of the list response?  can we assume that
> they are <= 1024 bytes, i.e. we will encounter a "\r\n" before we exceed
> 1024 bytes?
>
> -cynthia
>
>
> "Shankar Ponnekanti" <pshankar@Xenon.Stanford.EDU> wrote in message
> news:Pine.LNX.4.44.0401152358530.11631-100000@Xenon.Stanford.EDU...
> > On Thu, 15 Jan 2004, Xiaohua Fang wrote:
> >
> > >
> > > Is it a good assumption that the maximum size of the server response,
> > > including the response for "LIST" will be no more than 1024 bytes?
> > >
> >
> > No. The response for LIST can be > 1024 bytes :-(
> >
> > Shankar
> >
> >
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: Kirk Shimano <kshimano@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Multiple Replies
Date: Fri, 16 Jan 2004 17:48:52 -0800
Lines: 16
Distribution: su
Message-ID: <bua4a5$r48$1@news.Stanford.EDU>
NNTP-Posting-Host: zaphod.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074304134 27784 128.12.41.60 (17 Jan 2004 01:48:54 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4) Gecko/20030624 Netscape/7.1
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5186

When I first send "USER anonymous\r\n" to ftp.stanford.edu, it sends me 
two replies - the first is a multi-line welcome message with a reply 
code of 220, the other is a request for a password with a reply code of 
331.

If I leave the reply buffer size at 1024, everything works fine. But if 
I shrink the reply buffer size, my parser will break off after getting 
to the end of the first reply and ignore the second reply.

Is this acceptable behavior? Or is there some way to test if the ftp 
server will be supplying two replies for a single command?

Thanks!

-Kirk

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: control characters
Date: Fri, 16 Jan 2004 18:54:11 -0800
Lines: 9
Distribution: su
Message-ID: <bua7to$2s0$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1074307833 2944 128.12.189.163 (17 Jan 2004 02:50:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5187

Hi,
When I transfer html files by setting type to Image, I still get  a
character ^M at the end of each line.
This does not happen with other files I transfer like Makefiles, README etc.
Any guesses why?Is this acceptable behavior?
Thanks,
haripriya


.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: FTP reply protocol
Date: Fri, 16 Jan 2004 21:09:09 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.GSO.4.44.0401162104200.502-100000@epic9.Stanford.EDU>
NNTP-Posting-Host: epic9.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074316150 10980 171.64.15.42 (17 Jan 2004 05:09:10 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5188

Are servers allowed to violate reply protocol
if they don't allow connection to the FTP port.
I'm getting the following from the pc19.cs.ucdavis.edu

FTP is no longer used in the CSIF for security reasons. Please use sftp.\n

No error code, no "\r\n".  My program waits for "\r\n", eventually timing
out after 10 seconds.

Is this acceptable?
Boris.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 Q8 b/c
Date: Fri, 16 Jan 2004 22:59:10 -0800
Lines: 109
Distribution: su
Message-ID: <Pine.LNX.4.44.0401162257260.4716-100000@Xenon.Stanford.EDU>
References: <bu7fm3$sjb$1@news.Stanford.EDU> <bu7gts$k7j$9@news.Stanford.EDU>
 <bu7k3u$5hb$1@news.Stanford.EDU> <bu7k9r$5oc$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401151910510.1807-100000@Xenon.Stanford.EDU>
 <bu883i$r1c$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074322750 16626 171.64.66.201 (17 Jan 2004 06:59:10 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bu883i$r1c$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5189



On Fri, 16 Jan 2004, Paul E. wrote:

> When you say maximum average rate, do you mean average over all possible 
> tau, over time, or over both?

it means average over time. also, i am not sure what "average over all 
possible tau" means, if anything.

Shankar

> 
> Paul E.
> 
> Shankar Ponnekanti wrote:
> > You can assume rho > 0. As indicated in my other reply, tau is not a 
> > constant. So think about it again :-)
> > 
> > Shankar
> > 
> > On Thu, 15 Jan 2004, Sean M. wrote:
> > 
> > 
> >>Actually, I don't even think that having c = 2 * sigma really changes
> >>anything, since you could create a similar situation with a very large rho
> >>and a very small sigma.
> >>
> >>Another approach: if rho = 0 and sigma > 0, how would the queue _not_
> >>overflow (positive arrival rate, 0 departure rate)?
> >>
> >>- Sean
> >>
> >>"Sean M." <seanm514@stanford.edu> wrote in message
> >>news:bu7k3u$5hb$1@news.Stanford.EDU...
> >>
> >>>Over a large (infinite) period of time, you may run into an infinite
> >>
> >>number
> >>
> >>>of tau-length intervals of time, meaning you could accrue an infinite
> >>
> >>number
> >>
> >>>of (sigma + rho * tau)-sized packets. If rho is very small, there would be
> >>>no way to clear out these bits (since the departure process has a rate of
> >>
> >>2
> >>
> >>>* rho).
> >>>
> >>>Example:
> >>>sigma = 95
> >>>rho = 5
> >>>tau = 1
> >>>
> >>>At 0 seconds, your queue length will be 0.
> >>>At 1 second, your queue length will be 90 (100 in, 10 out).
> >>>At 2 seconds, your queue length will be 180 (100 more in, 10 more out).
> >>>
> >>>Essentially, the inbound rate is 100 while the outbound rate is 10. Even
> >>
> >>if
> >>
> >>>sigma is finite, you get an infinite queue.
> >>>
> >>>Perhaps, did you mean that the outbound rate c = 2 * sigma?
> >>>
> >>>- Sean
> >>>
> >>>
> >>>"Shankar Ravindra Ponnekanti" <pshankar@Stanford.EDU> wrote in message
> >>>news:bu7gts$k7j$9@news.Stanford.EDU...
> >>>
> >>>>Dan Wendlandt <danwent@stanford.edu> wrote:
> >>>>: Are we to assume the queue is stable, ie: there is a finite value for
> >>>
> >>>its
> >>>
> >>>>: size?
> >>>>
> >>>>: It seems that if sigma is very large and rho very small there would be
> >>>
> >>>no
> >>>
> >>>>: way to have a finite sized queue.
> >>>>
> >>>>Sigma may be large, but it is still finite. Think of what happens over a
> >>>>large period of time.
> >>>>
> >>>>Shankar
> >>>
> >>>
> >>
> >>
> > 
> 
> 

-- 

Shankar Ponnekanti

PhD CS Student
#252, Gates Building, Stanford
E-mail : pshankar@stanford.edu, pshankar@cs.stanford.edu
Phone (evening)  : 650-497-4390
      (daytime)  : 650-725-3053

.

Path: shelby.stanford.edu!not-for-mail
From: "Lei Zhang" <lei.zhang@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: getservname
Date: Fri, 16 Jan 2004 23:14:19 -0800
Lines: 11
Distribution: su
Message-ID: <buanck$h2f$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074323671 17487 127.0.0.1 (17 Jan 2004 07:14:31 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5190

It's must be something stupid on my side, but just can't figure out:

getservname gives me seg fault when being called within a function. But it
runs just fine if called from main.

Any idea?

Thanks,
Lei


.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine32.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Multiple Replies
Date: 17 Jan 2004 11:44:54 -0800
Organization: Stanford University, CA, USA
Lines: 24
Distribution: su
Message-ID: <snny8s6icll.fsf@elaine32.Stanford.EDU>
References: <bua4a5$r48$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine32.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1074368695 24287 171.64.15.107 (17 Jan 2004 19:44:55 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5191

Kirk Shimano <kshimano@stanford.edu> writes:

You're not getting two replies from USER anonymous.  If you look at the
FTP RFC (page 49), it shows that connection establishment should generate
a message with the code 120 then 220, 220, or 421.  What's happening is
that you aren't reading the connection establishment message first before
sending the login commands.

Susan

> When I first send "USER anonymous\r\n" to ftp.stanford.edu, it sends me
> two replies - the first is a multi-line welcome message with a reply code
> of 220, the other is a request for a password with a reply code of 331.
> 
> If I leave the reply buffer size at 1024, everything works fine. But if I
> shrink the reply buffer size, my parser will break off after getting to
> the end of the first reply and ignore the second reply.
> 
> Is this acceptable behavior? Or is there some way to test if the ftp
> server will be supplying two replies for a single command?
> 
> Thanks!
> 
> -Kirk
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine32.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: control characters
Date: 17 Jan 2004 11:52:52 -0800
Organization: Stanford University, CA, USA
Lines: 45
Distribution: su
Message-ID: <snnu12uic8b.fsf@elaine32.Stanford.EDU>
References: <bua7to$2s0$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine32.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1074369173 24287 171.64.15.107 (17 Jan 2004 19:52:53 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5192


I don't think that it *particularly* has to do with the html files but
does have to do with the fact that you are transfering a text file as a
binary (which is what you are supposed to do for this assignment).


As you may know there are multiple ways to end a line in an ASCII file.
Here's a good explanation I found on the web:

"There are two common ways of ending a line in an ASCII text file.  UNIX
systems mark the end of a line with a single character - a linefeed or
newline (LF or NL).  DOS (and Windows) uses a pair a characters instead -
a carriage return (CR) followed by a linefeed.
In order to preserve the meaning of these ends of lines when transfering
files, the end of line characters have to be changed.  When going from
UNIX to DOS, LF's have to be replaced with CR/LF pairs.  Similarly, when
going from DOS to UNIX, CR/LF pairs have to be changed to a single LF.
That is the difference between them.
I believe that Macs use a single carriage return character.
In a UNIX text file, carriage returns are just like any other character
(except that you can't usually see them).  If you transfer a text file
from DOS to UNIX as a Binary file, it will have carriage returns (which
sometimes look like ^M or a rectangle) on the end of each line."

So, the ^M probably means that the file you transferred was created or
edited on a DOS/Windows machine at some point.  It's very possible that
the README and Makefile were actually created on a UNIX machine which why
they don't have the problem.

So, to summarize, this sounds like expected behavior to me and not an
error.

Susan



"Haripriya Rajagopal" <hpriya@stanford.edu> writes:

> Hi,
> When I transfer html files by setting type to Image, I still get  a
> character ^M at the end of each line.
> This does not happen with other files I transfer like Makefiles, README etc.
> Any guesses why?Is this acceptable behavior?
> Thanks,
> haripriya
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine32.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: FTP reply protocol
Date: 17 Jan 2004 11:58:03 -0800
Organization: Stanford University, CA, USA
Lines: 20
Distribution: su
Message-ID: <snnptdiibzo.fsf@elaine32.Stanford.EDU>
References: <Pine.GSO.4.44.0401162104200.502-100000@epic9.Stanford.EDU>
NNTP-Posting-Host: elaine32.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1074369484 24287 171.64.15.107 (17 Jan 2004 19:58:04 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5193

Sounds acceptable to me.  The homework 1 FAQ Q16 states that you're client
doesn't need to work with non-RFC compliant ftp servers.  This site is
arguably non-compliant since it doesn't terminate lines with a \r\n.

Susan


Boris Senderzon <senderzo@stanford.edu> writes:

> Are servers allowed to violate reply protocol
> if they don't allow connection to the FTP port.
> I'm getting the following from the pc19.cs.ucdavis.edu
> 
> FTP is no longer used in the CSIF for security reasons. Please use sftp.\n
> 
> No error code, no "\r\n".  My program waits for "\r\n", eventually timing
> out after 10 seconds.
> 
> Is this acceptable?
> Boris.
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine32.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: getservname
Date: 17 Jan 2004 11:59:52 -0800
Organization: Stanford University, CA, USA
Lines: 16
Distribution: su
Message-ID: <snnllo6ibwn.fsf@elaine32.Stanford.EDU>
References: <buanck$h2f$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine32.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1074369592 24287 171.64.15.107 (17 Jan 2004 19:59:52 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5194

Have you tried running purify (or even gdb should give you info)?  It
sounds like you could have a bad pointer somewhere.

Susan

"Lei Zhang" <lei.zhang@cs.stanford.edu> writes:

> It's must be something stupid on my side, but just can't figure out:
> 
> getservname gives me seg fault when being called within a function. But it
> runs just fine if called from main.
> 
> Any idea?
> 
> Thanks,
> Lei
.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: :( running on grading script
Date: Sat, 17 Jan 2004 12:50:18 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.GSO.4.44.0401171243080.8611-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074372623 28345 171.64.15.106 (17 Jan 2004 20:50:23 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5195


I just wanted to know if anyone is having (or had and solved) a similar
problem as me.

Basically, I was running various tests, mixing up the 'levels' and 'ext'
parameter accross several servers (ftp.microsoft, ftp.stanford,
ftp.cs.stanford to be exact), and all my manual test run fine...

however, when I invoke the grading script...I can't even seem to pass
the simplest test, and my program times out (it says the only 2/5 tests
passed on the 'copy atleast one file' section), and then the rest of the
tests just say 'not tested'...

I notice that the script uses ftp.slac.stanford.edu...is there something
special about this server?  can we manually test on this server?

Anyone, anywhere??? PLEASE help :)

--vishal

.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: parsing LIST reply
Date: Sat, 17 Jan 2004 15:30:55 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.GSO.4.44.0401171526360.6276-100000@elaine0.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074382256 6161 171.64.15.119 (17 Jan 2004 23:30:56 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5196

I have some problem with the return of the LIST command.

I send the LIST command to server. Then i read everything out from the
data connection to some buffer. But seems I could find no \r\n in the
replied string. I printed out the string and I see all the files and
directories with their info. Seems the lines are seperated simply by \n.
Anyone has the same problem? or am i doing anything wrong?

Thanks

Lin

.

Path: shelby.stanford.edu!not-for-mail
From: "David Domyancic" <ddom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: multi-line responses
Date: Sat, 17 Jan 2004 21:22:04 -0600
Lines: 38
Distribution: su
Message-ID: <bucu4s$hm3$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074396126 18115 127.0.0.1 (18 Jan 2004 03:22:06 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5197

I am having trouble dealing with multiple lines.  Below is an example of a
response from the FTP server where there are multpile reponses (in this case
a response to a USER Command).

As  described by 959, the algorithm to handle this issue to to look for
hyphens, '-', just after the 3 digit reply code in the message.  If there is
a hyphen, that means that there the server is going to be sending multi-line
response.   The way to determine that there the last received message
(client-side) is in fact the last message received is because the last
message will have a space <SP> immadiately after the reply code.  Correct?

In this case, the last message(3rd message) had a hyphen in it just after
the reply code which kind of blows up what I just said.  What am I missing
here???.

Thank you,
David

COPY of server response to a USER command
Message 1:
220-------------------------------------------------------------------------
----

Message 2:
220-    Abuse of this facility may be considered violation of Federal or
------

Message 3:
220-    California law or the policies of Stanford University.  If you have
220-    questions regarding this policy please send mail to
220-    root@ftp.Stanford.EDU
220-------------------------------------------------------------------------
----
220-
220 ftp2.Stanford.EDU FTP server ready.
331 Guest login ok, send your complete e-mail address as password.


.

Path: shelby.stanford.edu!not-for-mail
From: Tony Chun-hao Hsieh <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: generating .purify file
Date: Sat, 17 Jan 2004 19:59:34 -0800
Lines: 7
Distribution: su
Message-ID: <400A04A6.DD09F0AB@stanford.edu>
NNTP-Posting-Host: elaine26.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074398375 19702 171.64.15.101 (18 Jan 2004 03:59:35 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (X11; U; SunOS 5.8 sun4u)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:5198

Hi,

I was wondering how we generate the .purify file.  The assignment specs
says to look at the FAQs, but the FAQs only talk about the purify.output
file.  How do I generate the .purify file?  Thanks so much.

-Tony
.

Path: shelby.stanford.edu!not-for-mail
From: Tony Chun-hao Hsieh <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: testing script NOT TESTED result?
Date: Sat, 17 Jan 2004 20:26:13 -0800
Lines: 7
Distribution: su
Message-ID: <400A0AE5.295A7048@stanford.edu>
NNTP-Posting-Host: elaine26.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074399973 20938 171.64.15.101 (18 Jan 2004 04:26:13 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (X11; U; SunOS 5.8 sun4u)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:5199

Hi,

I just ran the test script and it tells me for many of the tests that my
results are NOT TESTED.  I was wondering what that means?  Does it mean
my program failed the test?  I thought NOT OK meant it failed?  Thanks.

-Tony
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine31.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: :( running on grading script
Date: 17 Jan 2004 21:06:26 -0800
Organization: Stanford University, CA, USA
Lines: 26
Distribution: su
Message-ID: <snnptdhvoa5.fsf@elaine31.Stanford.EDU>
References: <Pine.GSO.4.44.0401171243080.8611-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1074402386 22833 171.64.15.106 (18 Jan 2004 05:06:26 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5200

I don't have any insight into what you're issues are, but I am able to
telnet ftp.slac.stanford.edu 21, so I suspect that, yes, you can test
against it.

Susan

Vishal Patel <vishalp@stanford.edu> writes:

> I just wanted to know if anyone is having (or had and solved) a similar
> problem as me.
> 
> Basically, I was running various tests, mixing up the 'levels' and 'ext'
> parameter accross several servers (ftp.microsoft, ftp.stanford,
> ftp.cs.stanford to be exact), and all my manual test run fine...
> 
> however, when I invoke the grading script...I can't even seem to pass
> the simplest test, and my program times out (it says the only 2/5 tests
> passed on the 'copy atleast one file' section), and then the rest of the
> tests just say 'not tested'...
> 
> I notice that the script uses ftp.slac.stanford.edu...is there something
> special about this server?  can we manually test on this server?
> 
> Anyone, anywhere??? PLEASE help :)
> 
> --vishal
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine31.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: parsing LIST reply
Date: 17 Jan 2004 21:12:53 -0800
Organization: Stanford University, CA, USA
Lines: 19
Distribution: su
Message-ID: <snnllo5vnze.fsf@elaine31.Stanford.EDU>
References: <Pine.GSO.4.44.0401171526360.6276-100000@elaine0.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1074402773 22833 171.64.15.106 (18 Jan 2004 05:12:53 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5201

There should definitely be \r\n between the lines.  Are you sure that you
are transfering the LIST data as the correct type?

Susan


Lin Chan <linchan@stanford.edu> writes:

> I have some problem with the return of the LIST command.
> 
> I send the LIST command to server. Then i read everything out from the
> data connection to some buffer. But seems I could find no \r\n in the
> replied string. I printed out the string and I see all the files and
> directories with their info. Seems the lines are seperated simply by \n.
> Anyone has the same problem? or am i doing anything wrong?
> 
> Thanks
> 
> Lin
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine31.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: multi-line responses
Date: 17 Jan 2004 21:16:27 -0800
Organization: Stanford University, CA, USA
Lines: 53
Distribution: su
Message-ID: <snnhdytvntg.fsf@elaine31.Stanford.EDU>
References: <bucu4s$hm3$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1074402987 22833 171.64.15.106 (18 Jan 2004 05:16:27 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5202

Are you talking about this message?

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

Because this is actually a separate message.  I answered a similar
question to this earlier today.   The 220 is *not* a result of the USER
command, it's a result of making the connection. You got two messages at
once because you didn't check for messages before you sent the USER
command.

It looks to me that the sections message 1,2 and 3 are all part of the
same 220 message (except the 331 which is the reply from the USEr command)

Susan

"David Domyancic" <ddom@stanford.edu> writes:

> I am having trouble dealing with multiple lines.  Below is an example of a
> response from the FTP server where there are multpile reponses (in this case
> a response to a USER Command).
> 
> As  described by 959, the algorithm to handle this issue to to look for
> hyphens, '-', just after the 3 digit reply code in the message.  If there is
> a hyphen, that means that there the server is going to be sending multi-line
> response.   The way to determine that there the last received message
> (client-side) is in fact the last message received is because the last
> message will have a space <SP> immadiately after the reply code.  Correct?
> 
> In this case, the last message(3rd message) had a hyphen in it just after
> the reply code which kind of blows up what I just said.  What am I missing
> here???.
> 
> Thank you,
> David
> 
> COPY of server response to a USER command
> Message 1:
> 220-------------------------------------------------------------------------
> ----
> 
> Message 2:
> 220-    Abuse of this facility may be considered violation of Federal or
> ------
> 
> Message 3:
> 220-    California law or the policies of Stanford University.  If you have
> 220-    questions regarding this policy please send mail to
> 220-    root@ftp.Stanford.EDU
> 220-------------------------------------------------------------------------
> ----
> 220-
> 220 ftp2.Stanford.EDU FTP server ready.
> 331 Guest login ok, send your complete e-mail address as password.
.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: getsockname
Date: Sat, 17 Jan 2004 21:16:50 -0800
Lines: 31
Distribution: su
Message-ID: <bud4sb$mpu$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc507.stanford.edu
X-Trace: news.Stanford.EDU 1074403019 23358 128.12.197.7 (18 Jan 2004 05:16:59 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5203

I am having trouble getting the required info for the port command.
getsockname() always seems to return me the IP address "0.0.0.0".

Here is what I am doing (slightly abbreviated):

struct sockaddr_in server;
struct sockaddr_in addr;
int len;

bzero((char *) &server, sizeof(server));
server.sin_family = AF_INET;
server.sin_port = 0;
server.sin_addr.s_addr = htonl(INADDR_ANY);

bind(dsocket, &server, sizeof(server));

len = sizeof(addr);
getsocknam(dsocket, &addr, &len);

printf("Port = %u\n", addr.sin_port);
printf("IP = %s\n", inet_ntoa(addr.sin_addr));


On a side note, when I print out the port, I usually get something like
40688.  Is that ok?

Thanks for the help,

Justin


.

Path: shelby.stanford.edu!elaine12.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: :( running on grading script
Date: Sun, 18 Jan 2004 06:54:00 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <budai8$r4h$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401171243080.8611-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine12.stanford.edu
X-Trace: news.Stanford.EDU 1074408840 27793 171.64.15.77 (18 Jan 2004 06:54:00 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5204



>I notice that the script uses ftp.slac.stanford.edu...is there something
>special about this server?  can we manually test on this server?

There's nothing special about this, and yes, we encourage you to do your
own manual testing against a variety of servers.  We may well test against
different ftp servers when we grade.

.

Path: shelby.stanford.edu!elaine12.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: generating .purify file
Date: Sun, 18 Jan 2004 06:57:36 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <budap0$r9r$1@news.Stanford.EDU>
References: <400A04A6.DD09F0AB@stanford.edu>
NNTP-Posting-Host: elaine12.stanford.edu
X-Trace: news.Stanford.EDU 1074409056 27963 171.64.15.77 (18 Jan 2004 06:57:36 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5205



>I was wondering how we generate the .purify file.  The assignment specs
>says to look at the FAQs, but the FAQs only talk about the purify.output
>file.  How do I generate the .purify file?  Thanks so much.

The simplest one is an empty file, which you could create with 'touch .purify'.
You can find some examples of things you might want to put in the file in
the Purify FAQ on the class webpage.
.

Path: shelby.stanford.edu!elaine12.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: testing script NOT TESTED result?
Date: Sun, 18 Jan 2004 07:00:39 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <budaun$rga$1@news.Stanford.EDU>
References: <400A0AE5.295A7048@stanford.edu>
NNTP-Posting-Host: elaine12.stanford.edu
X-Trace: news.Stanford.EDU 1074409239 28170 171.64.15.77 (18 Jan 2004 07:00:39 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5206



>I just ran the test script and it tells me for many of the tests that my
>results are NOT TESTED.  I was wondering what that means?  Does it mean
>my program failed the test?  I thought NOT OK meant it failed?  Thanks.

It depends--some of the tests depend on the results of previous tests,
in the sense that if you fail one of the prerequisites (e.g., test C), it
doesn't make sense to go on and try the more stringent checks (e.g., test D
etc.)
.

Path: shelby.stanford.edu!not-for-mail
From: "Michael Lyubomirskiy" <lyubomir@stanford.edu>
Newsgroups: su.class.cs244a
Subject: how do I tell where the FTP reply ended?
Date: Sat, 17 Jan 2004 23:18:14 -0800
Lines: 11
Distribution: su
Message-ID: <budbvp$se6$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-50491.stanford.edu
X-Trace: news.Stanford.EDU 1074410297 29126 128.12.51.110 (18 Jan 2004 07:18:17 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5207

my question is a continuation of David Domyancic's. Apparently many of the
FTP server's replies are done in such a way that it takes several calls to
read() function to read them in completely. Thus, for instance, the
welcoming message from ftp.stanford.edu requires 3 reads. So how do we tell
how many times to call read() on any given reply in order to read it in
completely? After all, if an extra read()is called unnecessarily, the
program will just hang.
Thank you.
Michael


.

Path: shelby.stanford.edu!not-for-mail
From: "David Domyancic" <ddom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Multi-Line Responses
Date: Sun, 18 Jan 2004 01:42:45 -0600
Lines: 50
Distribution: su
Message-ID: <budddk$hd$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074411766 557 127.0.0.1 (18 Jan 2004 07:42:46 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5208

I was able to get past the USER command. However, I am having trouble with
multiple line responses. Below is a printout of server responses to a PASS
Command.

230-Please read the file README

plete e-mail address as password.

ou have

220- questions regarding this policy please send mail to

220- root@ftp.Stanford.EDU

220-------------------------------------------------------------------------
----

220-

220 ftp2.Stanford.EDU FTP server ready.

230- it was last modified on Fri Feb 15 12:22:25 2002 - 701 days ago

230 Guest login ok, access restrictions apply.

ease send mail to

220- root@ftp.Stanford.EDU

220-------------------------------------------------------------------------
----

220-

220 ftp2.Stanford.EDU FTP server ready.

230 is the successful response to the PASS Command. The first message has a
reply code of 230 with a hyphen included. This tells me/my logic that the
server is going to send another command. The second message (the message I
waiting for) also has 230 with a hyphen inluded. This tells me that there is
going to be another message. The problem is that the third message did not
come and the final success (230 Guest login ok, access restrictions apply)
was actually in the second message. WHere am I failing in my my logic of
multi-line responses.

Thank you,

David


.

Path: shelby.stanford.edu!not-for-mail
From: John Cieslewicz <jciesle@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: how do I tell where the FTP reply ended?
Date: Sat, 17 Jan 2004 23:58:23 -0800
Organization: Stanford University
Lines: 19
Distribution: su
Message-ID: <budebj$163$1@news.Stanford.EDU>
References: <budbvp$se6$1@news.Stanford.EDU>
Reply-To: jciesle@stanford.edu
NNTP-Posting-Host: johnc.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
X-Trace: news.Stanford.EDU 1074412723 1219 128.12.89.246 (18 Jan 2004 07:58:43 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: KNode/0.7.2
Xref: shelby.stanford.edu su.class.cs244a:5209

There's a hint in an earlier thread about how to do this in an 'elegent
manner'. See the thread: determining if all data received.
The hint is:  recv(sockfd,buf,len,MSG_PEEK)

John

Michael Lyubomirskiy wrote:

> my question is a continuation of David Domyancic's. Apparently many of the
> FTP server's replies are done in such a way that it takes several calls to
> read() function to read them in completely. Thus, for instance, the
> welcoming message from ftp.stanford.edu requires 3 reads. So how do we
> tell how many times to call read() on any given reply in order to read it
> in completely? After all, if an extra read()is called unnecessarily, the
> program will just hang.
> Thank you.
> Michael


.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine31.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Multi-Line Responses
Date: 18 Jan 2004 00:08:45 -0800
Organization: Stanford University, CA, USA
Lines: 60
Distribution: su
Message-ID: <snn8yk5vfua.fsf@elaine31.Stanford.EDU>
References: <budddk$hd$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1074413325 1889 171.64.15.106 (18 Jan 2004 08:08:45 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5210


So, you're saying that you can both lines of the 230 message in one
packet?  My understanding is that the hyphen doesn't mean that you will
get multiple packets, just that there are multiple \r\n terminated lines.
This means you need to parse the text returned to see if multiple lines
were sent in one packet.  See the RFC about multi-line responses...it
doesn't say that each line will come in its own packet.

Susan

"David Domyancic" <ddom@stanford.edu> writes:

> I was able to get past the USER command. However, I am having trouble with
> multiple line responses. Below is a printout of server responses to a PASS
> Command.
> 
> 230-Please read the file README
> 
> plete e-mail address as password.
> 
> ou have
> 
> 220- questions regarding this policy please send mail to
> 
> 220- root@ftp.Stanford.EDU
> 
> 220-------------------------------------------------------------------------
> ----
> 
> 220-
> 
> 220 ftp2.Stanford.EDU FTP server ready.
> 
> 230- it was last modified on Fri Feb 15 12:22:25 2002 - 701 days ago
> 
> 230 Guest login ok, access restrictions apply.
> 
> ease send mail to
> 
> 220- root@ftp.Stanford.EDU
> 
> 220-------------------------------------------------------------------------
> ----
> 
> 220-
> 
> 220 ftp2.Stanford.EDU FTP server ready.
> 
> 230 is the successful response to the PASS Command. The first message has a
> reply code of 230 with a hyphen included. This tells me/my logic that the
> server is going to send another command. The second message (the message I
> waiting for) also has 230 with a hyphen inluded. This tells me that there is
> going to be another message. The problem is that the third message did not
> come and the final success (230 Guest login ok, access restrictions apply)
> was actually in the second message. WHere am I failing in my my logic of
> multi-line responses.
> 
> Thank you,
> 
> David
.

Path: shelby.stanford.edu!not-for-mail
From: "David Domyancic" <ddom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Multi-Line Responses
Date: Sun, 18 Jan 2004 02:37:51 -0600
Lines: 124
Distribution: su
Message-ID: <budgl1$3kh$1@news.Stanford.EDU>
References: <budddk$hd$1@news.Stanford.EDU> <snn8yk5vfua.fsf@elaine31.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074415074 3729 127.0.0.1 (18 Jan 2004 08:37:54 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5211

Correct.  I had the 230 message in two different packets.

So, here is the example of taken out of the RFC verbatim.

For example:
                                123-First line
                                Second line
                                  234 A line beginning with numbers
                                123 The last line

So, there could be multiple '\r\n' line in one packet (one execution of
read()).  Am I understanding this to be your reply message and that is how
RFC is basing its explanation of multi-line responses?   So the RFC
interpretation follows that within a packet, if one comes accross a line
with reply code and a hypen, then the client must parse the next line(s)
until one of the \r\n lines has a reply code and <SP> immediately after the
reply code.  Correct?

  Example:
          320- hi testing\r\n
          220 nice night tonight\r\n
          220 sunny tommorow\r\n
          320 correct?\r\n

Susan, you sound surprised that I received two packets?  Sorry that my
snippet of server responses did not reflect that better

Try this...

230-Please read the file README
plete e-mail address as password.
ou have
220-    questions regarding this policy please send mail to
220-    root@ftp.Stanford.EDU
220-------------------------------------------------------------------------
----
220-
220 ftp1.Stanford.EDU FTP server ready.

230-  it was last modified on Fri Feb 15 12:22:25 2002 - 702 days ago
230 Guest login ok, access restrictions apply.
ease send mail to
220-    root@ftp.Stanford.EDU
220-------------------------------------------------------------------------
----
220-
220 ftp1.Stanford.EDU FTP server ready.



"Susan Noreen Shepard" <shepard8@elaine31.Stanford.EDU> wrote in message
news:snn8yk5vfua.fsf@elaine31.Stanford.EDU...
>
> So, you're saying that you can both lines of the 230 message in one
> packet?  My understanding is that the hyphen doesn't mean that you will
> get multiple packets, just that there are multiple \r\n terminated lines.
> This means you need to parse the text returned to see if multiple lines
> were sent in one packet.  See the RFC about multi-line responses...it
> doesn't say that each line will come in its own packet.
>
> Susan
>
> "David Domyancic" <ddom@stanford.edu> writes:
>
> > I was able to get past the USER command. However, I am having trouble
with
> > multiple line responses. Below is a printout of server responses to a
PASS
> > Command.
> >
> > 230-Please read the file README
> >
> > plete e-mail address as password.
> >
> > ou have
> >
> > 220- questions regarding this policy please send mail to
> >
> > 220- root@ftp.Stanford.EDU
> >
> >
220-------------------------------------------------------------------------
> > ----
> >
> > 220-
> >
> > 220 ftp2.Stanford.EDU FTP server ready.
> >
> > 230- it was last modified on Fri Feb 15 12:22:25 2002 - 701 days ago
> >
> > 230 Guest login ok, access restrictions apply.
> >
> > ease send mail to
> >
> > 220- root@ftp.Stanford.EDU
> >
> >
220-------------------------------------------------------------------------
> > ----
> >
> > 220-
> >
> > 220 ftp2.Stanford.EDU FTP server ready.
> >
> > 230 is the successful response to the PASS Command. The first message
has a
> > reply code of 230 with a hyphen included. This tells me/my logic that
the
> > server is going to send another command. The second message (the message
I
> > waiting for) also has 230 with a hyphen inluded. This tells me that
there is
> > going to be another message. The problem is that the third message did
not
> > come and the final success (230 Guest login ok, access restrictions
apply)
> > was actually in the second message. WHere am I failing in my my logic of
> > multi-line responses.
> >
> > Thank you,
> >
> > David


.

Path: shelby.stanford.edu!not-for-mail
From: "Michael Lyubomirskiy" <lyubomir@stanford.edu>
Newsgroups: su.class.cs244a
Subject: multiple reads in one reply, you are not explaining the right thing
Date: Sun, 18 Jan 2004 01:39:53 -0800
Lines: 19
Distribution: su
Message-ID: <budk9e$789$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-50491.stanford.edu
X-Trace: news.Stanford.EDU 1074418798 7433 128.12.51.110 (18 Jan 2004 09:39:58 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5212

I feel that we are just talking about different things. Your explanations
deal with multiline replies and with the rfc protocol involving several
replies. That's not the point. When I connect to ftp.stanford.edu, server
sends me only one (multiline) reply, with the code 220. (Under RFC it could
send either this single 220 or a 1xx followed by 220). But the problem is,
it sends this single 220 reply in 3 packages, of 82, 74, 298 bytes
respectively. So you need to call read() 3 times to read in this single
reply from the server to make room for further reading. All of these 3 reads
yield strings that have no '\0' character in them, hence they are
indistinguishable as far as I can see. Now, obviously, I can just code in
these 3 calls to work with this server, but that would be just stupid. A
similar subdivision of replies might be happening with later replies too,
but I will not vouch for that.
I hope I have described the problem in sufficient detail. Any help is highly
appreciated.

Michael


.

Path: shelby.stanford.edu!not-for-mail
From: "Michael Lyubomirskiy" <lyubomir@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: multiple reads in one reply, you are not explaining the right thing
Date: Sun, 18 Jan 2004 01:50:10 -0800
Lines: 32
Distribution: su
Message-ID: <budkso$7pf$1@news.Stanford.EDU>
References: <budk9e$789$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-50491.stanford.edu
X-Trace: news.Stanford.EDU 1074419416 7983 128.12.51.110 (18 Jan 2004 09:50:16 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5213

ok, I think I got it. The end of the reply is marked by the reply code not
followed by a -, whereas lines inside of reply all start with the code
followed by -. This does not seem to jibe with rfc for multiline reply, but
it makes sense. So in terms of read()s, I just call these as many times as
necessary to find the end-line of reply.
Michael
"Michael Lyubomirskiy" <lyubomir@stanford.edu> wrote in message
news:budk9e$789$1@news.Stanford.EDU...
> I feel that we are just talking about different things. Your explanations
> deal with multiline replies and with the rfc protocol involving several
> replies. That's not the point. When I connect to ftp.stanford.edu, server
> sends me only one (multiline) reply, with the code 220. (Under RFC it
could
> send either this single 220 or a 1xx followed by 220). But the problem is,
> it sends this single 220 reply in 3 packages, of 82, 74, 298 bytes
> respectively. So you need to call read() 3 times to read in this single
> reply from the server to make room for further reading. All of these 3
reads
> yield strings that have no '\0' character in them, hence they are
> indistinguishable as far as I can see. Now, obviously, I can just code in
> these 3 calls to work with this server, but that would be just stupid. A
> similar subdivision of replies might be happening with later replies too,
> but I will not vouch for that.
> I hope I have described the problem in sufficient detail. Any help is
highly
> appreciated.
>
> Michael
>
>


.

Path: shelby.stanford.edu!saga1.Stanford.EDU!mylesw
From: mylesw@Stanford.EDU (Myles Barrett Williams)
Newsgroups: su.class.cs244a
Subject: LIST works only on ftp.microsoft.com
Date: Sun, 18 Jan 2004 15:26:54 +0000 (UTC)
Organization: Stanford University, CA 94305, USA
Lines: 28
Distribution: su
Message-ID: <bue8ju$pch$1@news.Stanford.EDU>
NNTP-Posting-Host: saga1.stanford.edu
X-Trace: news.Stanford.EDU 1074439614 26001 171.64.15.131 (18 Jan 2004 15:26:54 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5214

I am unable to list a directory on any server except
ftp.microsoft.com. Here is a dump of the commands to the server:
--
> ./ftpcopy gz 2 ftp.microsoft.com
USER anonymous
PASS mylesw@
TYPE A
PORT 171,64,15,131,134,26
LIST
CWD bussys
--
The CWD command indicates that the directory was received. If I try
the same thing with ftp.stanford.edu,
--
> ./ftpcopy gz 2 ftp.stanford.edu
USER anonymous
PASS mylesw@
TYPE A
PORT 171,64,15,131,134,28
LIST
--
I get "425 Can't build data connection: Connection refused." Same with
ftp.apple.com, ftp.simtel.com, ftp.wustl.edu. Why would the data
connection work only on one server? I have bound the listening socket
to INADDR_ANY.

Myles

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: parsing LIST reply
Date: Sun, 18 Jan 2004 07:47:27 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.GSO.4.44.0401180746390.16794-100000@elaine41.Stanford.EDU>
References: <Pine.GSO.4.44.0401171526360.6276-100000@elaine0.Stanford.EDU>
 <snnllo5vnze.fsf@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074440849 26741 171.64.15.116 (18 Jan 2004 15:47:29 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <snnllo5vnze.fsf@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5215

So do you mean I need to use Text for LIST and then Binary for file data?
Is that a problem if I simply use binary for all actions?
Thanks

Lin

On 17 Jan 2004, Susan Noreen Shepard wrote:

> There should definitely be \r\n between the lines.  Are you sure that you
> are transfering the LIST data as the correct type?
>
> Susan
>
>
> Lin Chan <linchan@stanford.edu> writes:
>
> > I have some problem with the return of the LIST command.
> >
> > I send the LIST command to server. Then i read everything out from the
> > data connection to some buffer. But seems I could find no \r\n in the
> > replied string. I printed out the string and I see all the files and
> > directories with their info. Seems the lines are seperated simply by \n.
> > Anyone has the same problem? or am i doing anything wrong?
> >
> > Thanks
> >
> > Lin
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: No of subdirectories in a directory
Date: Sun, 18 Jan 2004 09:30:56 -0800
Lines: 7
Distribution: su
Message-ID: <buefkl$18k$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1074446806 1300 128.12.189.163 (18 Jan 2004 17:26:46 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5216

Hi,
I was wondering if there is any limit to the number of entries a directory
can have.Just trying to gauge how long a LIST command can be.
Thanks,
Haripriya


.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine31.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: parsing LIST reply
Date: 18 Jan 2004 09:28:07 -0800
Organization: Stanford University, CA, USA
Lines: 34
Distribution: su
Message-ID: <snn3cadupy0.fsf@elaine31.Stanford.EDU>
References: <Pine.GSO.4.44.0401171526360.6276-100000@elaine0.Stanford.EDU> <snnllo5vnze.fsf@elaine31.Stanford.EDU> <Pine.GSO.4.44.0401180746390.16794-100000@elaine41.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1074446887 1280 171.64.15.106 (18 Jan 2004 17:28:07 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5217

Yes, you can't use binary for everything.

Susan

Lin Chan <linchan@stanford.edu> writes:

> So do you mean I need to use Text for LIST and then Binary for file data?
> Is that a problem if I simply use binary for all actions?
> Thanks
> 
> Lin
> 
> On 17 Jan 2004, Susan Noreen Shepard wrote:
> 
> > There should definitely be \r\n between the lines.  Are you sure that you
> > are transfering the LIST data as the correct type?
> >
> > Susan
> >
> >
> > Lin Chan <linchan@stanford.edu> writes:
> >
> > > I have some problem with the return of the LIST command.
> > >
> > > I send the LIST command to server. Then i read everything out from the
> > > data connection to some buffer. But seems I could find no \r\n in the
> > > replied string. I printed out the string and I see all the files and
> > > directories with their info. Seems the lines are seperated simply by \n.
> > > Anyone has the same problem? or am i doing anything wrong?
> > >
> > > Thanks
> > >
> > > Lin
> >
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine31.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: multiple reads in one reply, you are not explaining the right thing
Date: 18 Jan 2004 09:36:19 -0800
Organization: Stanford University, CA, USA
Lines: 64
Distribution: su
Message-ID: <snny8s5tazw.fsf@elaine31.Stanford.EDU>
References: <budk9e$789$1@news.Stanford.EDU> <budkso$7pf$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1074447380 1280 171.64.15.106 (18 Jan 2004 17:36:20 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5218

You are correct: a multi-line reply starts with the code follwoed by a
'-'.  The message ends with a line that starts with the *same* code
followed by a space followed by some optional text and the end
Telnet-end-of-line code.  This is straight from the RFC:

         Thus the format for multi-line replies is that the first line
         will begin with the exact required reply code, followed
         immediately by a Hyphen, "-" (also known as Minus), followed by
         text.  The last line will begin with the same code, followed
         immediately by Space <SP>, optionally some text, and the Telnet
         end-of-line code.

            For example:
                                123-First line
                                Second line
                                  234 A line beginning with numbers
                                123 The last line

         The user-process then simply needs to search for the second
         occurrence of the same reply code, followed by <SP> (Space), at
         the beginning of a line, and ignore all intermediary lines.  If
         an intermediary line begins with a 3-digit number, the Server
         must pad the front  to avoid confusion.

The RFC actually suggests that the middle lines should NOT start with a
code (should be padded by a space), but it does seem that most sites
repeat the code followed by the hyphen.  Still, you should just be able to
ignore all the intermediate lines until you find the last one that has the
same code and only a space follows it.

Susan

"Michael Lyubomirskiy" <lyubomir@stanford.edu> writes:

> ok, I think I got it. The end of the reply is marked by the reply code not
> followed by a -, whereas lines inside of reply all start with the code
> followed by -. This does not seem to jibe with rfc for multiline reply, but
> it makes sense. So in terms of read()s, I just call these as many times as
> necessary to find the end-line of reply.
> Michael
> "Michael Lyubomirskiy" <lyubomir@stanford.edu> wrote in message
> news:budk9e$789$1@news.Stanford.EDU...
> > I feel that we are just talking about different things. Your explanations
> > deal with multiline replies and with the rfc protocol involving several
> > replies. That's not the point. When I connect to ftp.stanford.edu, server
> > sends me only one (multiline) reply, with the code 220. (Under RFC it
> could
> > send either this single 220 or a 1xx followed by 220). But the problem is,
> > it sends this single 220 reply in 3 packages, of 82, 74, 298 bytes
> > respectively. So you need to call read() 3 times to read in this single
> > reply from the server to make room for further reading. All of these 3
> reads
> > yield strings that have no '\0' character in them, hence they are
> > indistinguishable as far as I can see. Now, obviously, I can just code in
> > these 3 calls to work with this server, but that would be just stupid. A
> > similar subdivision of replies might be happening with later replies too,
> > but I will not vouch for that.
> > I hope I have described the problem in sufficient detail. Any help is
> highly
> > appreciated.
> >
> > Michael
> >
> >
.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Multi-Line Responses
Date: Sun, 18 Jan 2004 17:48:45 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <buegtt$2bo$1@news.Stanford.EDU>
References: <budddk$hd$1@news.Stanford.EDU> <snn8yk5vfua.fsf@elaine31.Stanford.EDU> <budgl1$3kh$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1074448125 2424 171.64.15.67 (18 Jan 2004 17:48:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5219

>So, there could be multiple '\r\n' line in one packet (one execution of
>read()).  Am I understanding this to be your reply message and that is how

TCP is a stream-based service--you shouldn't be thinking in terms of
"packets" when using it an application.  The server could packetise
responses however it sees fit.

.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine31.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Multi-Line Responses
Date: 18 Jan 2004 09:57:08 -0800
Organization: Stanford University, CA, USA
Lines: 64
Distribution: su
Message-ID: <snnu12tta17.fsf@elaine31.Stanford.EDU>
References: <budddk$hd$1@news.Stanford.EDU> <snn8yk5vfua.fsf@elaine31.Stanford.EDU> <budgl1$3kh$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1074448629 1280 171.64.15.106 (18 Jan 2004 17:57:09 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5220


Sorry my response should have been clearer.  I was *not at all* surprised
you received multiple packets.  RFC makes no guarantees about how many
packets (or "reads") it will take to receive an entire response.  It also
doesn't guarantee that each response will be received in a separate read:
that is, you can get two replies back at once (if you hadn't checked
earlier for the first reply).  I was also *not at all* surprised that you
received multiple lines in one "read".  These are expected behaviors.

> So, there could be multiple '\r\n' line in one packet (one execution of
> read()).  Am I understanding this to be your reply message and that is how
> RFC is basing its explanation of multi-line responses?

Yes.

> interpretation follows that within a packet, if one comes accross a line
> with reply code and a hypen, then the client must parse the next line(s)
> until one of the \r\n lines has a reply code and <SP> immediately after the
> reply code.  Correct?

This is almost correct.  You need to parse until you reach the line the
begins with the *same* reply code followed by a space (possibly followed
by some optional text) and then followed by \r\n.

Your example isn't quite right:

>           320- hi testing\r\n
>           220 nice night tonight\r\n
>           220 sunny tommorow\r\n
>           320 correct?\r\n

You'll never see two replies interleaved.  According to the RFC the 220
codes should be padded by an initial space so that they will *not* look
like a reply code.  It should look like this:

           320- hi testing\r\n
            220 nice night tonight\r\n
            220 sunny tommorow\r\n
           320 correct?\r\n

Realistically it seems a lot of sites all follow a format where 
the current reply code followed by a hyphen is repeated on every line
except the last.  (This is compatible with the RFC):

           320- hi testing\r\n
           320- nice night tonight\r\n
           320- sunny tommorow\r\n
           320 correct?\r\n

When I manually ftp to ftp.stanford.edu, here's what I get:

220-----------------------------------------------------------------------------
220-    Abuse of this facility may be considered violation of Federal or
220-    California law or the policies of Stanford University.  If you
have
220-    questions regarding this policy please send mail to
220-    root@ftp.Stanford.EDU
220-----------------------------------------------------------------------------
220-
220 ftp2.Stanford.EDU FTP server ready.
USER anonymous
331 Guest login ok, send your complete e-mail address as password.

Susan
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: No of subdirectories in a directory
Date: Sun, 18 Jan 2004 10:09:51 -0800
Lines: 17
Distribution: su
Message-ID: <buei5f$3dq$1@news.Stanford.EDU>
References: <buefkl$18k$1@news.Stanford.EDU>
NNTP-Posting-Host: agila.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074449391 3514 128.12.194.74 (18 Jan 2004 18:09:51 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2
X-Accept-Language: en-us, en
In-Reply-To: <buefkl$18k$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5221

be careful of LIST using absolute paths though.  I haven't done any 
ridid formal testing, but my experience is that 'LIST <absolute_path>' 
doesn't work for some sites like ftp.slac.stanford.edu or 
ftp.microsoft.com.  But if it works for you, then I guess it's ok. :)

Paul E.


Haripriya Rajagopal wrote:
> Hi,
> I was wondering if there is any limit to the number of entries a directory
> can have.Just trying to gauge how long a LIST command can be.
> Thanks,
> Haripriya
> 
> 

.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: getsockname
Date: Sun, 18 Jan 2004 19:03:22 +0000 (UTC)
Lines: 55
Distribution: su
Message-ID: <buel9q$6a5$1@news.Stanford.EDU>
References: <bud4sb$mpu$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1074452602 6469 171.64.15.67 (18 Jan 2004 19:03:22 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5222


An IP address can't be assigned to a socket until both ends of the
connection are established--the reason is that on a multi-homed device
(e.g. a NAT box, a server with multiple NICs, etc), the local IP address
associated with a connection depends on the peer.

The bind() with a wildcard address (INADDR_ANY) tells the kernel that it
will accept an incoming connection for any valid IP address on this machine.
Once a client connects and the subsequent accept() returns, you can use
getsockname() on the newly accepted socket at that time.  (You cannot
use it for the wildcard listening socket, since there's no notion of
a connection on such a socket).

The port looks reasonable.  It seems a bit of an anomaly in the sockets
interface that getsockname() can return a port for a listening socket,
rather than associating that port with only a particular destination
address--this is actually more restrictive than required by TCP, which
requires only that the (remote addr, remote port, local addr, local port)
4-tuple be globally unique.

There were several earlier posts on the newsgroup about obtaining the local
IP address, which you may find relevant.


>I am having trouble getting the required info for the port command.
>getsockname() always seems to return me the IP address "0.0.0.0".

>Here is what I am doing (slightly abbreviated):

>struct sockaddr_in server;
>struct sockaddr_in addr;
>int len;

>bzero((char *) &server, sizeof(server));
>server.sin_family = AF_INET;
>server.sin_port = 0;
>server.sin_addr.s_addr = htonl(INADDR_ANY);

>bind(dsocket, &server, sizeof(server));

>len = sizeof(addr);
>getsocknam(dsocket, &addr, &len);

>printf("Port = %u\n", addr.sin_port);
>printf("IP = %s\n", inet_ntoa(addr.sin_addr));


>On a side note, when I print out the port, I usually get something like
>40688.  Is that ok?

>Thanks for the help,

>Justin


.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: getsockname
Date: Sun, 18 Jan 2004 19:05:41 +0000 (UTC)
Lines: 3
Distribution: su
Message-ID: <buele5$6e3$1@news.Stanford.EDU>
References: <bud4sb$mpu$1@news.Stanford.EDU> <buel9q$6a5$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1074452741 6595 171.64.15.67 (18 Jan 2004 19:05:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5223

Oops, before I forget--
Remember that getsockname() returns the port in network byte order, like
all the sockets APIs.
.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Multiple data connections
Date: Sun, 18 Jan 2004 11:15:44 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0401181106370.15183-100000@epic9.Stanford.EDU>
NNTP-Posting-Host: epic9.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074453348 7193 171.64.15.42 (18 Jan 2004 19:15:48 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5224

Is it feasible while reading info on one data connection
from the server, create new data socket, tell server
via PORT about it and then expect server send additional data
on this new data connection.

If it is feasible then what's the right way of doing it?
I'm getting 0 bytes when reading on 2nd such connection?

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Multiple data connections
Date: Sun, 18 Jan 2004 11:33:11 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181131510.25456-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401181106370.15183-100000@epic9.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074454394 8142 171.64.66.201 (18 Jan 2004 19:33:14 GMT)
X-Complaints-To: news@news.stanford.edu
To: Boris Senderzon <senderzo@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401181106370.15183-100000@epic9.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5225


 I just tried to force parallel RETRs of a large file (linux 2.6 kernel
 from ftp.kernel.org) and the second PORT command hung until the file
 was fully downloaded, therefore I am assuming that (at least some)
 ftp servers to support multiple, parallel data connections.

 .m

> Is it feasible while reading info on one data connection
> from the server, create new data socket, tell server
> via PORT about it and then expect server send additional data
> on this new data connection.
> 
> If it is feasible then what's the right way of doing it?
> I'm getting 0 bytes when reading on 2nd such connection?
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Multiple data connections
Date: Sun, 18 Jan 2004 11:44:49 -0800
Lines: 32
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181143250.29863-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401181106370.15183-100000@epic9.Stanford.EDU>
 <Pine.LNX.4.44.0401181131510.25456-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074455092 8844 171.64.66.201 (18 Jan 2004 19:44:52 GMT)
X-Complaints-To: news@news.stanford.edu
To: Boris Senderzon <senderzo@stanford.edu>
In-Reply-To: <Pine.LNX.4.44.0401181131510.25456-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5226


 aargh, type-o

 that last line should be

 "... therefore I am assuming that (at least some) ftp servers -don't- support
 multiple, parallel data connections"

 sorry bout' that.
 .m


> 
>  I just tried to force parallel RETRs of a large file (linux 2.6 kernel
>  from ftp.kernel.org) and the second PORT command hung until the file
>  was fully downloaded, therefore I am assuming that (at least some)
>  ftp servers to support multiple, parallel data connections.
> 
>  .m
> 
> > Is it feasible while reading info on one data connection
> > from the server, create new data socket, tell server
> > via PORT about it and then expect server send additional data
> > on this new data connection.
> > 
> > If it is feasible then what's the right way of doing it?
> > I'm getting 0 bytes when reading on 2nd such connection?
> > 
> > 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: test_code.pl Test F.2
Date: Sun, 18 Jan 2004 19:49:05 +0000 (UTC)
Lines: 20
Distribution: su
Message-ID: <buenvh$8oj$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1074455345 8979 171.64.15.84 (18 Jan 2004 19:49:05 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5227

I got a SOMEWHAT OK for Test F.2:

../ftpcopy  ch 1 ftp.cs.stanford.edu 
/afs/ir.stanford.edu/users/j/a/jasonyli/cs244a/hw1/grading_src/build/ftp.cs.stanford.edu_ch_1_1 
/pub/cweb

for the reason:

Result of diff between your output and solution (ftp.cs.stanford.edu)
(">" indicates files missing in your output):
21a22,25
> examples/extex.ch
> examples/wc-dos.ch
> examples/wmer-os2.ch
> examples/wmerg-pc.ch

But level 1 is specified on the input! I suppose I should only copy those 
in the examples dir if 2 is specified?

Jason
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: No of subdirectories in a directory
Date: Sun, 18 Jan 2004 11:52:22 -0800
Lines: 30
Distribution: su
Message-ID: <bueo5n$8ti$1@news.Stanford.EDU>
References: <buefkl$18k$1@news.Stanford.EDU> <buei5f$3dq$1@news.Stanford.EDU>
NNTP-Posting-Host: agila.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074455543 9138 128.12.194.74 (18 Jan 2004 19:52:23 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2
X-Accept-Language: en-us, en
In-Reply-To: <buei5f$3dq$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5228

Oops.  I just found out what I was doing wrong.  I was putting a [space] 
character after the absolute path and the \r\n.  Apparently, 
ftp.stanford.edu ignores this but microsoft and slac don't.  They work 
fine if I take the space out.  Sorry, my bad.

Paul E.


Paul E. wrote:

> be careful of LIST using absolute paths though.  I haven't done any 
> ridid formal testing, but my experience is that 'LIST <absolute_path>' 
> doesn't work for some sites like ftp.slac.stanford.edu or 
> ftp.microsoft.com.  But if it works for you, then I guess it's ok. :)
> 
> Paul E.
> 
> 
> Haripriya Rajagopal wrote:
> 
>> Hi,
>> I was wondering if there is any limit to the number of entries a 
>> directory
>> can have.Just trying to gauge how long a LIST command can be.
>> Thanks,
>> Haripriya
>>
>>
> 

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: test_code.pl Test F.2
Date: Sun, 18 Jan 2004 11:59:45 -0800
Lines: 30
Distribution: su
Message-ID: <20040118115945.2f1647f3.chanman@stanford.edu>
References: <buenvh$8oj$1@news.Stanford.EDU>
NNTP-Posting-Host: chanman.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074456051 18936 128.12.94.94 (18 Jan 2004 20:00:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed version 0.9.6 (GTK+ 1.2.10; i386-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:5229

level 0 would mean to just get the stuff in ftp.cs.stanford.edu_ch_1_1
level 1 means to include the stuff in the subdirectories of ftp.cs.stanford.edu_ch_1_1 1 level deep, such as ftp.cs.stanford.edu_ch_1_1/examples/*.ch

So yes you should be including those files which the test says you are missing.

--William

On Sun, 18 Jan 2004 19:49:05 +0000 (UTC)
Jason Ying Li <jasonyli@Stanford.EDU> wrote:

> I got a SOMEWHAT OK for Test F.2:
> 
> ./ftpcopy  ch 1 ftp.cs.stanford.edu 
> /afs/ir.stanford.edu/users/j/a/jasonyli/cs244a/hw1/grading_src/build/ftp.cs.stanford.edu_ch_1_1 
> /pub/cweb
> 
> for the reason:
> 
> Result of diff between your output and solution (ftp.cs.stanford.edu)
> (">" indicates files missing in your output):
> 21a22,25
> > examples/extex.ch
> > examples/wc-dos.ch
> > examples/wmer-os2.ch
> > examples/wmerg-pc.ch
> 
> But level 1 is specified on the input! I suppose I should only copy those 
> in the examples dir if 2 is specified?
> 
> Jason
.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: freeing memory
Date: Sun, 18 Jan 2004 12:19:25 -0800
Lines: 10
Distribution: su
Message-ID: <buepmo$acl$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1074457112 10645 128.12.61.97 (18 Jan 2004 20:18:32 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5230

Are we expected to explicitly free memory before a normal termination (an
exit(0) call)?  Are we expected to explicitly free memory before an abnormal
termination (an exit(1) call)?

My guess is yes to normal, no to abnormal.  But then again, there's a good
reason I'm not a TA =)

Oded


.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: freeing memory
Date: Sun, 18 Jan 2004 12:35:34 -0800
Lines: 17
Distribution: su
Message-ID: <20040118123534.6074dced.chanman@stanford.edu>
References: <buepmo$acl$1@news.Stanford.EDU>
NNTP-Posting-Host: chanman.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074458201 18936 128.12.94.94 (18 Jan 2004 20:36:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed version 0.9.6 (GTK+ 1.2.10; i386-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:5231

I can't seem to find it, but I remember somewhere reading that you must free memory in all cases, even abnormal exits.

--William

On Sun, 18 Jan 2004 12:19:25 -0800
"Oded Wurman" <owurman@stanford.edu> wrote:

> Are we expected to explicitly free memory before a normal termination (an
> exit(0) call)?  Are we expected to explicitly free memory before an abnormal
> termination (an exit(1) call)?
> 
> My guess is yes to normal, no to abnormal.  But then again, there's a good
> reason I'm not a TA =)
> 
> Oded
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: /gnu directory in ftp.cs
Date: Sun, 18 Jan 2004 13:03:40 -0800
Lines: 339
Distribution: su
Message-ID: <bues3j$cbg$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1074459571 12656 128.12.189.163 (18 Jan 2004 20:59:31 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5232

Hi,
I seem to experience a strange thing.
This applies only to ftp.cs.stanford.edu and only to the /gnu directory

When I execute my program it sends a LIST command and I get back the result
-rw-r--r--   1 ftpuser  ftpusers      3630 Oct  1  1999 =README
-rw-r--r--   1 ftpuser  ftpusers       745 Mar 20  1997
=README-about-.diff-files
-rw-r--r--   1 ftpuser  ftpusers      1043 Jul  9  1996
=README-about-.gz-files
-rw-r--r--   1 ftpuser  ftpusers     13590 Aug 19  1998 ABOUT-NLS
-rw-r--r--   1 ftpuser  ftpusers        88 Apr 16  1993
Andrew-Toolkit.README
-rw-r--r--   1 ftpuser  ftpusers     17992 Dec 16  1998 COPYING
-rw-r--r--   1 ftpuser  ftpusers     12488 Jun 18  1991 COPYING-1.0
-rw-r--r--   1 ftpuser  ftpusers     17992 Sep 16  1999 COPYING-2.0
-rw-r--r--   1 ftpuser  ftpusers     18007 Mar 27  1997 COPYING-2.0.~1~
-rw-r--r--   1 ftpuser  ftpusers     26532 Jul  6  1999 COPYING.LIB
-rw-r--r--   1 ftpuser  ftpusers     25275 Mar 27  1997 COPYING.LIB-2.0
-rw-r--r--   1 ftpuser  ftpusers     26532 Jul  6  1999 COPYING.LIB-2.1
-rw-r--r--   1 ftpuser  ftpusers     84977 May  3  1998 DESCRIPTIONS
-rw-r--r--   1 ftpuser  ftpusers      1154 Jan  6  2000 DIR
-rw-r--r--   1 ftpuser  ftpusers    842639 Dec 16  1999 FILES.bytime
-rw-r--r--   1 ftpuser  ftpusers     78788 Dec 16  1999 FILES.bytime.gz
-rw-r--r--   1 ftpuser  ftpusers      4210 Dec 16  1999 FILES.last28days
-rw-r--r--   1 ftpuser  ftpusers      2155 Dec 16  1999 FILES.last7days
-rw-r--r--   1 ftpuser  ftpusers      4620 Jun 13  1995 FreelyAvailableTexts
-rw-r--r--   1 ftpuser  ftpusers      4737 May 18  1994 GETTING.GNU.SOFTWARE
drwxr-xr-x   2 ft

but when I ftp to ftp.cs.stanford.edu
and do a  ls  /gnu

I get back the result:
Mesa.README
MicrosPorts
ProgramIndex
README
README-about-.diff-fi
README-about-.gz-file
Sather
TeX.README
X11.README
a2ps
abuse
acct
acm.README
ada.README
ada.README.src
adns
ae.tar.gz
aegis.README
andrew-toolkit.README
apache.README
apache.README~
autoconf
automake
avl
barcode
bash
bc
binutils
bison
bsd-net2.README
btyacc.README
button.14.0.shar
calc
cfengine
cgicc
chess
clisp.README
clx
cook.README
cperf
cpio
cvs
cxref.README
dc.README
dclshar
ddd.README
dejagnu
dgs
diction
dictionary
diffutils
dirent.tar.gz
djgpp.README
dld
doschk
dumb.README
ecc.README
ed
electric
elib.README
elisp-archive.README
emacs
enscript
es.README
exim.README
f2c.README
ffcall.README
fileutils
findutils
finger
flex
flexfax.README
fontutils
freebuilder.README
freedos
g++.README
g77
gPhoto.README~
gamma.README
gamma.README~
gas.README
gawk
gcal
gcc
gcl
gdb
gdbm
generic-NQS.README
geomview.README
gettext
getting.gnu.software
gforth
ghostscript
ghostview
gimp.README
git
gleem
glibc
glibc-crypt-README
gmp
gn.README
gnans.README
gnat.README
gnat.README.src
gnats
gnome.README
gnu-0.2
gnu.ps.gz
gnucash.README
gnuchess
gnuchess.README
gnugo
gnumach
gnupg.README
gnuplot.README
gnurobots
gnuserv.README
gnushogi
gnussl
goose
gpc.README
gperf
gphoto.README
gprolog
graphics
graphics.README
greg
grep
grg.README
groff
gstep
gtk.README
guavac.README
guile
gzip
hello
help2man
hp2xx
htdig.README
httptunnel
hurd
hylafax.README
hyperbole
id-utils
ilisp.README
indent
inetutils
intlfonts
ispell
jacal
jacal1b0.zip
jargon
java2html
jpeg.README
karma.README
kawa
less
lesstif.README
libg++
libobjects
libstdc++
libtool
libxmi
lily.README
lilypond
lost+found
lout.README
lpf
lynx
m4
mailman
make
makeinfo.README
malloc.tar.gz
mandelspawn.README
maverik
maxima
mc
mcsim
metahtml
mig
miscfiles
mkid.README
mkisofs.README
mm
motti
ms.README
mtools.README
mtools.README~
mule.README
mutt.README
mutt.README~
nana.README
ncurses
net2-bsd.README
netfax.README
nethack
nihcl.README
nvi.README
nvi.README~
oaklisp.README
objective-c.README
obst
octave
oleo
oops.README
p2c.README
para
parted
patch
pcl
perl
phantom
phttpd.README
pine.README
pips
plotutils
prcs.README
pth
ptx
ptx.README
queue
r.README
rc.README
rcs
readline
recode
regex
roxen.README
rsync.README
rx
sane.README
saoimage.README
saoimage.README~
sauce
scheme.README
scm5d1.zip
screen
sed
sh-utils
sharutils
shtool
sipp.README
slib2c6.zip
smail
smalleiffel.README
smalltalk
sneps.README
spell
spinner.README
stow
stump.README
superopt
swarm.README
synch1b3.zip
talkfilters
tar
termcap
termutils
tex.README
texinfo
texinfo.tex
textutils
tiff.README
tiff.README~
tile-forth
time
trueprint
ucblogo
units
userv
uucp
uuencode.README
vera
vm.README
vms.README
vrweb.README
w3.README
wdiff
wget
which
winboard
windows
windows32api
wn.README
x11.README
xaos
xboard
xdelta.README
xgrabsc.README
xinfo
xlogmaster
xmcd.README
xshogi
yale-T.README
ygl.README

As can be seen from above totally different files are being returned. I
tested my program with other directories , but they all work fine except for
/gnu.
Can anybody help me out here?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: freeing memory
Date: Sun, 18 Jan 2004 13:06:53 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181301290.14696-100000@Xenon.Stanford.EDU>
References: <buepmo$acl$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074460016 13031 171.64.66.201 (18 Jan 2004 21:06:56 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <buepmo$acl$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5233


 Freeing memory on abnormal exits is not strictly required, but heap
 allocated memory should always be accessible so we will certainly recognize
 efforts to clean it up on all exits when we are going over your code design.

 .m

> Are we expected to explicitly free memory before a normal termination (an
> exit(0) call)?  Are we expected to explicitly free memory before an abnormal
> termination (an exit(1) call)?
> 
> My guess is yes to normal, no to abnormal.  But then again, there's a good
> reason I'm not a TA =)
> 
> Oded
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: /gnu directory in ftp.cs
Date: Sun, 18 Jan 2004 13:10:48 -0800
Lines: 350
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181309000.14696-100000@Xenon.Stanford.EDU>
References: <bues3j$cbg$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074460251 13258 171.64.66.201 (18 Jan 2004 21:10:51 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bues3j$cbg$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5234


 There is something wrong with your program. The list command for /gnu on
 ftp.cs.stanford.edu is much larger than what your program is returning.
 I would guess your problem is reading the large list command .. i.e.
 not doing multiple reads, or reading into the buffer one byte off
 so your program thinks the string is terminated ....

 .m

> Hi,
> I seem to experience a strange thing.
> This applies only to ftp.cs.stanford.edu and only to the /gnu directory
> 
> When I execute my program it sends a LIST command and I get back the result
> -rw-r--r--   1 ftpuser  ftpusers      3630 Oct  1  1999 =README
> -rw-r--r--   1 ftpuser  ftpusers       745 Mar 20  1997
> =README-about-.diff-files
> -rw-r--r--   1 ftpuser  ftpusers      1043 Jul  9  1996
> =README-about-.gz-files
> -rw-r--r--   1 ftpuser  ftpusers     13590 Aug 19  1998 ABOUT-NLS
> -rw-r--r--   1 ftpuser  ftpusers        88 Apr 16  1993
> Andrew-Toolkit.README
> -rw-r--r--   1 ftpuser  ftpusers     17992 Dec 16  1998 COPYING
> -rw-r--r--   1 ftpuser  ftpusers     12488 Jun 18  1991 COPYING-1.0
> -rw-r--r--   1 ftpuser  ftpusers     17992 Sep 16  1999 COPYING-2.0
> -rw-r--r--   1 ftpuser  ftpusers     18007 Mar 27  1997 COPYING-2.0.~1~
> -rw-r--r--   1 ftpuser  ftpusers     26532 Jul  6  1999 COPYING.LIB
> -rw-r--r--   1 ftpuser  ftpusers     25275 Mar 27  1997 COPYING.LIB-2.0
> -rw-r--r--   1 ftpuser  ftpusers     26532 Jul  6  1999 COPYING.LIB-2.1
> -rw-r--r--   1 ftpuser  ftpusers     84977 May  3  1998 DESCRIPTIONS
> -rw-r--r--   1 ftpuser  ftpusers      1154 Jan  6  2000 DIR
> -rw-r--r--   1 ftpuser  ftpusers    842639 Dec 16  1999 FILES.bytime
> -rw-r--r--   1 ftpuser  ftpusers     78788 Dec 16  1999 FILES.bytime.gz
> -rw-r--r--   1 ftpuser  ftpusers      4210 Dec 16  1999 FILES.last28days
> -rw-r--r--   1 ftpuser  ftpusers      2155 Dec 16  1999 FILES.last7days
> -rw-r--r--   1 ftpuser  ftpusers      4620 Jun 13  1995 FreelyAvailableTexts
> -rw-r--r--   1 ftpuser  ftpusers      4737 May 18  1994 GETTING.GNU.SOFTWARE
> drwxr-xr-x   2 ft
> 
> but when I ftp to ftp.cs.stanford.edu
> and do a  ls  /gnu
> 
> I get back the result:
> Mesa.README
> MicrosPorts
> ProgramIndex
> README
> README-about-.diff-fi
> README-about-.gz-file
> Sather
> TeX.README
> X11.README
> a2ps
> abuse
> acct
> acm.README
> ada.README
> ada.README.src
> adns
> ae.tar.gz
> aegis.README
> andrew-toolkit.README
> apache.README
> apache.README~
> autoconf
> automake
> avl
> barcode
> bash
> bc
> binutils
> bison
> bsd-net2.README
> btyacc.README
> button.14.0.shar
> calc
> cfengine
> cgicc
> chess
> clisp.README
> clx
> cook.README
> cperf
> cpio
> cvs
> cxref.README
> dc.README
> dclshar
> ddd.README
> dejagnu
> dgs
> diction
> dictionary
> diffutils
> dirent.tar.gz
> djgpp.README
> dld
> doschk
> dumb.README
> ecc.README
> ed
> electric
> elib.README
> elisp-archive.README
> emacs
> enscript
> es.README
> exim.README
> f2c.README
> ffcall.README
> fileutils
> findutils
> finger
> flex
> flexfax.README
> fontutils
> freebuilder.README
> freedos
> g++.README
> g77
> gPhoto.README~
> gamma.README
> gamma.README~
> gas.README
> gawk
> gcal
> gcc
> gcl
> gdb
> gdbm
> generic-NQS.README
> geomview.README
> gettext
> getting.gnu.software
> gforth
> ghostscript
> ghostview
> gimp.README
> git
> gleem
> glibc
> glibc-crypt-README
> gmp
> gn.README
> gnans.README
> gnat.README
> gnat.README.src
> gnats
> gnome.README
> gnu-0.2
> gnu.ps.gz
> gnucash.README
> gnuchess
> gnuchess.README
> gnugo
> gnumach
> gnupg.README
> gnuplot.README
> gnurobots
> gnuserv.README
> gnushogi
> gnussl
> goose
> gpc.README
> gperf
> gphoto.README
> gprolog
> graphics
> graphics.README
> greg
> grep
> grg.README
> groff
> gstep
> gtk.README
> guavac.README
> guile
> gzip
> hello
> help2man
> hp2xx
> htdig.README
> httptunnel
> hurd
> hylafax.README
> hyperbole
> id-utils
> ilisp.README
> indent
> inetutils
> intlfonts
> ispell
> jacal
> jacal1b0.zip
> jargon
> java2html
> jpeg.README
> karma.README
> kawa
> less
> lesstif.README
> libg++
> libobjects
> libstdc++
> libtool
> libxmi
> lily.README
> lilypond
> lost+found
> lout.README
> lpf
> lynx
> m4
> mailman
> make
> makeinfo.README
> malloc.tar.gz
> mandelspawn.README
> maverik
> maxima
> mc
> mcsim
> metahtml
> mig
> miscfiles
> mkid.README
> mkisofs.README
> mm
> motti
> ms.README
> mtools.README
> mtools.README~
> mule.README
> mutt.README
> mutt.README~
> nana.README
> ncurses
> net2-bsd.README
> netfax.README
> nethack
> nihcl.README
> nvi.README
> nvi.README~
> oaklisp.README
> objective-c.README
> obst
> octave
> oleo
> oops.README
> p2c.README
> para
> parted
> patch
> pcl
> perl
> phantom
> phttpd.README
> pine.README
> pips
> plotutils
> prcs.README
> pth
> ptx
> ptx.README
> queue
> r.README
> rc.README
> rcs
> readline
> recode
> regex
> roxen.README
> rsync.README
> rx
> sane.README
> saoimage.README
> saoimage.README~
> sauce
> scheme.README
> scm5d1.zip
> screen
> sed
> sh-utils
> sharutils
> shtool
> sipp.README
> slib2c6.zip
> smail
> smalleiffel.README
> smalltalk
> sneps.README
> spell
> spinner.README
> stow
> stump.README
> superopt
> swarm.README
> synch1b3.zip
> talkfilters
> tar
> termcap
> termutils
> tex.README
> texinfo
> texinfo.tex
> textutils
> tiff.README
> tiff.README~
> tile-forth
> time
> trueprint
> ucblogo
> units
> userv
> uucp
> uuencode.README
> vera
> vm.README
> vms.README
> vrweb.README
> w3.README
> wdiff
> wget
> which
> winboard
> windows
> windows32api
> wn.README
> x11.README
> xaos
> xboard
> xdelta.README
> xgrabsc.README
> xinfo
> xlogmaster
> xmcd.README
> xshogi
> yale-T.README
> ygl.README
> 
> As can be seen from above totally different files are being returned. I
> tested my program with other directories , but they all work fine except for
> /gnu.
> Can anybody help me out here?
> Thanks,
> Haripriya
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Answer to Hw#1 Question 3b
Date: Sun, 18 Jan 2004 13:00:31 -0800
Lines: 7
Distribution: su
Message-ID: <buespi$cv1$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074460277 13281 127.0.0.1 (18 Jan 2004 21:11:17 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5235

I don't understand the solution to question 3b.  According to the solution,
the same router as in part a) is getting 25% fewer packets and yet the delay
time goes up from 10ms to 13.3 ms.    What am I missing?

Josh


.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: creating directories
Date: Sun, 18 Jan 2004 13:11:54 -0800
Lines: 9
Distribution: su
Message-ID: <buesr3$cvr$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc508.stanford.edu
X-Trace: news.Stanford.EDU 1074460323 13307 128.12.197.8 (18 Jan 2004 21:12:03 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5236

what fn are we supposed to use to create directories in unix?  i am sure i
knew this at some point in time, but i can't remember now.  Also, we should
fopen for files and chmod to change permissions, right?

Thanks,

Justin


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: creating directories
Date: Sun, 18 Jan 2004 13:21:01 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181318280.17962-100000@Xenon.Stanford.EDU>
References: <buesr3$cvr$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074460868 13750 171.64.66.201 (18 Jan 2004 21:21:08 GMT)
X-Complaints-To: news@news.stanford.edu
To: Justin <justinfw@stanford.edu>
In-Reply-To: <buesr3$cvr$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5237



 #include <sys/stat.h>
 #include <sys/types.h>

 int mkdir(const char *pathname, mode_t mode);

 and yes to fopen and chmod :)

  .m


> what fn are we supposed to use to create directories in unix?  i am sure i
> knew this at some point in time, but i can't remember now.  Also, we should
> fopen for files and chmod to change permissions, right?
> 
> Thanks,
> 
> Justin
> 
> 
> 

.

Path: shelby.stanford.edu!epic26.Stanford.EDU!ayaz
From: Ayaz Abdulla <ayaz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: second PORT/LIST
Date: Sun, 18 Jan 2004 13:25:31 -0800
Lines: 44
Distribution: su
Message-ID: <Pine.GSO.4.44.0401181323330.26668-100000@epic26.Stanford.EDU>
NNTP-Posting-Host: epic26.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074461139 13934 171.64.15.50 (18 Jan 2004 21:25:39 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5238


Based on the response below,

Does that mean we need to bind to a new port for every LIST command?

Thanks
Ayaz


---------------------------------------------------------------------

 I just tried against ftp.cs.stanford.edu and got the same results.
Worked OK with ftp.gnu.org.  Looks like you will have to work around
this.

 please post questions like this to the newsgroup so all the students
can benefit from the responses.

 Thanks,
 martin

> Hi Martin,
>
> I didn't understand your newsgroup post where you mentioned to use the
> Beej's simple stream server?
>
> I am having the problem where I send the second PORT command (using same
> values as the first PORT command) followed by the second LIST command.
>
> The server (ftp.cs.stanford.edu) replys back with "550 Cannot connect to
> x.x.x.x:x - Address already in use".
>
> I did close the data socket related to the first LIST command (ie. the
one
> created by accept()).
>
> Am I missing something?
>
> Thanks
> Ayaz
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: John Cieslewicz <jciesle@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: creating directories
Date: Sun, 18 Jan 2004 13:27:29 -0800
Organization: Stanford University
Lines: 40
Distribution: su
Message-ID: <bueto2$dfv$1@news.Stanford.EDU>
References: <buesr3$cvr$1@news.Stanford.EDU> <Pine.LNX.4.44.0401181318280.17962-100000@Xenon.Stanford.EDU>
Reply-To: jciesle@stanford.edu
NNTP-Posting-Host: johnc.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
X-Trace: news.Stanford.EDU 1074461250 13823 128.12.89.246 (18 Jan 2004 21:27:30 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: KNode/0.7.2
Xref: shelby.stanford.edu su.class.cs244a:5239

In the FAQ it says we can use 
open(path, O_WRONLY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE)
which then won't require the use of chmod to change the permissions of the
file.

John

Martin Casado wrote:

> 
> 
>  #include <sys/stat.h>
>  #include <sys/types.h>
> 
>  int mkdir(const char *pathname, mode_t mode);
> 
>  and yes to fopen and chmod :)
> 
>   .m
> 
> 
>> what fn are we supposed to use to create directories in unix?  i am sure
>> i
>> knew this at some point in time, but i can't remember now.  Also, we
>> should fopen for files and chmod to change permissions, right?
>> 
>> Thanks,
>> 
>> Justin
>> 
>> 
>>

-- 
John Cieslewicz
Senior- Computer Science Department
Stanford University

My homepage: http://www.stanford.edu/~jciesle/
My PGP public key is available at my home page.
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: creating directories
Date: Sun, 18 Jan 2004 13:30:44 -0800
Lines: 40
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181330270.20830-100000@Xenon.Stanford.EDU>
References: <buesr3$cvr$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401181318280.17962-100000@Xenon.Stanford.EDU>
 <bueto2$dfv$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074461447 14184 171.64.66.201 (18 Jan 2004 21:30:47 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bueto2$dfv$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5240


 yup, open is ok too.

 .m

> In the FAQ it says we can use 
> open(path, O_WRONLY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE)
> which then won't require the use of chmod to change the permissions of the
> file.
> 
> John
> 
> Martin Casado wrote:
> 
> > 
> > 
> >  #include <sys/stat.h>
> >  #include <sys/types.h>
> > 
> >  int mkdir(const char *pathname, mode_t mode);
> > 
> >  and yes to fopen and chmod :)
> > 
> >   .m
> > 
> > 
> >> what fn are we supposed to use to create directories in unix?  i am sure
> >> i
> >> knew this at some point in time, but i can't remember now.  Also, we
> >> should fopen for files and chmod to change permissions, right?
> >> 
> >> Thanks,
> >> 
> >> Justin
> >> 
> >> 
> >>
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: creating directories
Date: Sun, 18 Jan 2004 13:55:15 -0800
Lines: 33
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181352270.24619-100000@Xenon.Stanford.EDU>
References: <buesr3$cvr$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401181318280.17962-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074462918 15259 171.64.66.201 (18 Jan 2004 21:55:18 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0401181318280.17962-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5241


 just as a point of clarification ... with chmod I am referring to 
 the library call (chmod(2)) and not calling the chmod program using system(..)
 or some such hackery nonsense.
 
 :)
 .m

> 
> 
>  #include <sys/stat.h>
>  #include <sys/types.h>
> 
>  int mkdir(const char *pathname, mode_t mode);
> 
>  and yes to fopen and chmod :)
> 
>   .m
> 
> 
> > what fn are we supposed to use to create directories in unix?  i am sure i
> > knew this at some point in time, but i can't remember now.  Also, we should
> > fopen for files and chmod to change permissions, right?
> > 
> > Thanks,
> > 
> > Justin
> > 
> > 
> > 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: freeing memory
Date: Sun, 18 Jan 2004 14:03:25 -0800
Lines: 33
Distribution: su
Message-ID: <buevpq$fc8$1@news.Stanford.EDU>
References: <buepmo$acl$1@news.Stanford.EDU> <Pine.LNX.4.44.0401181301290.14696-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1074463355 15752 128.12.61.97 (18 Jan 2004 22:02:35 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5242

I cleaned all memory, and purify is still giving me a
"potentially leaked" error.  Is this something that I can safely ignore, or
do I have a problem that I'm missing?  My code is still very small, so I
think my freeing is correctly implemented.

Oded


>  Freeing memory on abnormal exits is not strictly required, but heap
>  allocated memory should always be accessible so we will certainly
recognize
>  efforts to clean it up on all exits when we are going over your code
design.
>
>  .m
>
> > Are we expected to explicitly free memory before a normal termination
(an
> > exit(0) call)?  Are we expected to explicitly free memory before an
abnormal
> > termination (an exit(1) call)?
> >
> > My guess is yes to normal, no to abnormal.  But then again, there's a
good
> > reason I'm not a TA =)
> >
> > Oded
> >
> >
> >
>


.

Path: shelby.stanford.edu!saga1.Stanford.EDU!mylesw
From: mylesw@Stanford.EDU (Myles Barrett Williams)
Newsgroups: su.class.cs244a
Subject: Re: LIST works only on ftp.microsoft.com
Date: Sun, 18 Jan 2004 23:46:33 +0000 (UTC)
Organization: Stanford University, CA 94305, USA
Lines: 11
Distribution: su
Message-ID: <buf5sp$ksm$1@news.Stanford.EDU>
References: <bue8ju$pch$1@news.Stanford.EDU>
NNTP-Posting-Host: saga1.stanford.edu
X-Trace: news.Stanford.EDU 1074469593 21398 171.64.15.131 (18 Jan 2004 23:46:33 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5243

In article <bue8ju$pch$1@news.Stanford.EDU>,
Myles Barrett Williams <mylesw@Stanford.EDU> wrote:
>I am unable to list a directory on any server except
>ftp.microsoft.com. 

I have resolved this problem after re-reading the data connection
instructions in the assigment sheet.

Myles


.

Path: shelby.stanford.edu!not-for-mail
From: "Lei Zhang" <lei.zhang@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Transfer 0 byte file test
Date: Sun, 18 Jan 2004 15:55:57 -0800
Lines: 13
Distribution: su
Message-ID: <buf6el$laf$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074470168 21839 127.0.0.1 (18 Jan 2004 23:56:08 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5244

I rememer that I saw a post regarding this but somehow couldn't find it.
Sorry if it is a duplicate.

My code failed test L1: Checks that ftpcopy transfers zero byte file
correctly. It appeared to me that the test script did not pass the correct
arguments according to the spec.

Can someone please verify?

Thanks,
Lei


.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: second PORT/LIST
Date: Sun, 18 Jan 2004 16:10:01 -0800
Lines: 58
Distribution: su
Message-ID: <Pine.GSO.4.44.0401181607440.17032-100000@epic9.Stanford.EDU>
References: <Pine.GSO.4.44.0401181323330.26668-100000@epic26.Stanford.EDU>
NNTP-Posting-Host: epic9.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074471003 22543 171.64.15.42 (19 Jan 2004 00:10:03 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0401181323330.26668-100000@epic26.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5245

I'm having similar issues.  1st time goes through
fine.  Then I try to do 2nd bind,
i get bind complaining about Invalid argument, although
first such call succeeded fine.  If attempt to close
the data socket altogether and try to do bind,listen,accept
sequence on new socket, I succeed until I try to read from
the accepted server socket and then I get 0 bytes.

Any suggestions?

On Sun, 18 Jan 2004, Ayaz Abdulla wrote:

>
> Based on the response below,
>
> Does that mean we need to bind to a new port for every LIST command?
>
> Thanks
> Ayaz
>
>
> ---------------------------------------------------------------------
>
>  I just tried against ftp.cs.stanford.edu and got the same results.
> Worked OK with ftp.gnu.org.  Looks like you will have to work around
> this.
>
>  please post questions like this to the newsgroup so all the students
> can benefit from the responses.
>
>  Thanks,
>  martin
>
> > Hi Martin,
> >
> > I didn't understand your newsgroup post where you mentioned to use the
> > Beej's simple stream server?
> >
> > I am having the problem where I send the second PORT command (using same
> > values as the first PORT command) followed by the second LIST command.
> >
> > The server (ftp.cs.stanford.edu) replys back with "550 Cannot connect to
> > x.x.x.x:x - Address already in use".
> >
> > I did close the data socket related to the first LIST command (ie. the
> one
> > created by accept()).
> >
> > Am I missing something?
> >
> > Thanks
> > Ayaz
> >
> >
>
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: utilizing echodemo.c code
Date: Sun, 18 Jan 2004 16:33:08 -0800
Lines: 13
Distribution: su
Message-ID: <buf8if$n2d$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1074472335 23629 128.12.61.97 (19 Jan 2004 00:32:15 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5246

I find that I'm using a lot of the tricks from echodemo.c to establish my
initial connection, to the point where I'm basically writing much of the
same code with different variable names (with obvious differences such as
parsing for the port number when provided in the command line).  Is this
acceptable?  It's very difficult to come up with the methods all on my own
when it's basically laid out in echodemo.c.  Everything will diverge once
the connection is established, of course, but the beginning of my code looks
very similar to the code provided...

Thanks,
Oded


.

Path: shelby.stanford.edu!not-for-mail
From: Tony Chun-hao Hsieh <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: getting total transferred bytes?
Date: Sun, 18 Jan 2004 16:41:45 -0800
Lines: 6
Distribution: su
Message-ID: <400B27C9.61D8468A@stanford.edu>
NNTP-Posting-Host: elaine32.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074472907 24252 171.64.15.107 (19 Jan 2004 00:41:47 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (X11; U; SunOS 5.8 sun4u)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:5247

Hi,

I was wondering fo the total transferred bytes whether we include the
bytes transferred from the LIST command as well?  Thanks.

-Tony
.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Maximum path length?
Date: Sun, 18 Jan 2004 17:08:52 -0800
Lines: 7
Distribution: su
Message-ID: <bufan7$p8e$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074474535 25870 128.12.90.43 (19 Jan 2004 01:08:55 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5248

I was wondering if we could impose an arbitrary maximum size on the total
file name length (path + name) of anything we are trying to create locally.

Thanks,
Eddy


.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Format of local directory argument
Date: Sun, 18 Jan 2004 17:17:19 -0800
Lines: 7
Distribution: su
Message-ID: <bufb72$pp9$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074475042 26409 128.12.90.43 (19 Jan 2004 01:17:22 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5249

What can we assume about the format of the local directory argument? Should
it end with a slash or not? should we handle both cases?

Thanks,
Eddy


.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftpparse size field
Date: Sun, 18 Jan 2004 17:26:18 -0800
Lines: 12
Distribution: su
Message-ID: <bufbns$qna$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074475580 27370 128.12.90.43 (19 Jan 2004 01:26:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5250

In the source code in the assignment page, it says shows:

    'size' = entry size in bytes (relevant if 'sizetype' ==
FTPPARSE_SIZE_BINARY)

Should we use this to tally the number of bytes transferred (if we download
this file), or can we just sum up the bytes_read returned from read calls?

Thanks,
Eddy


.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: problem with realloc
Date: Sun, 18 Jan 2004 17:51:48 -0800
Lines: 11
Distribution: su
Message-ID: <bufd12$sdh$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1074476898 29105 128.12.189.163 (19 Jan 2004 01:48:18 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5251

Hi,
I am using realloc to reallocate memory as my LIST command output gets read.
When I do a 'make all' and then run my output, it works fine
but when I do a ' make all.purify' and run the output, realloc fails to
allocate memory.
Any guesses?
Please help me.
Thanks,
Haripriya


.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: problem with realloc
Date: Sun, 18 Jan 2004 17:51:48 -0800
Lines: 11
Distribution: su
Message-ID: <bufd00$sci$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1074476864 29074 128.12.189.163 (19 Jan 2004 01:47:44 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5252

Hi,
I am using realloc to reallocate memory as my LIST command output gets read.
When I do a 'make all' and then run my output, it works fine
but when I do a ' make all.purify' and run the output, realloc fails to
allocate memory.
Any guesses?
Please help me.
Thanks,
Haripriya


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: freeing memory
Date: Sun, 18 Jan 2004 17:50:25 -0800
Lines: 40
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181749580.20637-100000@Xenon.Stanford.EDU>
References: <buepmo$acl$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401181301290.14696-100000@Xenon.Stanford.EDU>
 <buevpq$fc8$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074477029 29223 171.64.66.201 (19 Jan 2004 01:50:29 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <buevpq$fc8$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5253


 If you think your freeing is correctly implemented then you should be OK.

 .m

> I cleaned all memory, and purify is still giving me a
> "potentially leaked" error.  Is this something that I can safely ignore, or
> do I have a problem that I'm missing?  My code is still very small, so I
> think my freeing is correctly implemented.
> 
> Oded
> 
> 
> >  Freeing memory on abnormal exits is not strictly required, but heap
> >  allocated memory should always be accessible so we will certainly
> recognize
> >  efforts to clean it up on all exits when we are going over your code
> design.
> >
> >  .m
> >
> > > Are we expected to explicitly free memory before a normal termination
> (an
> > > exit(0) call)?  Are we expected to explicitly free memory before an
> abnormal
> > > termination (an exit(1) call)?
> > >
> > > My guess is yes to normal, no to abnormal.  But then again, there's a
> good
> > > reason I'm not a TA =)
> > >
> > > Oded
> > >
> > >
> > >
> >
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: second PORT/LIST
Date: Sun, 18 Jan 2004 18:05:50 -0800
Lines: 68
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181753050.20637-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401181323330.26668-100000@epic26.Stanford.EDU>
 <Pine.GSO.4.44.0401181607440.17032-100000@epic9.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074477953 27 171.64.66.201 (19 Jan 2004 02:05:53 GMT)
X-Complaints-To: news@news.stanford.edu
To: Boris Senderzon <senderzo@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401181607440.17032-100000@epic9.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5254


  Testing against ftp.cs.stanford.edu it looks like there isn't
  a straightfoward approach to using the same bound socket for
  some ftp servers .. seems to me like the best approach then is
  to re-bind() for each connection. 

  .m

> I'm having similar issues.  1st time goes through
> fine.  Then I try to do 2nd bind,
> i get bind complaining about Invalid argument, although
> first such call succeeded fine.  If attempt to close
> the data socket altogether and try to do bind,listen,accept
> sequence on new socket, I succeed until I try to read from
> the accepted server socket and then I get 0 bytes.
> 
> Any suggestions?
> 
> On Sun, 18 Jan 2004, Ayaz Abdulla wrote:
> 
> >
> > Based on the response below,
> >
> > Does that mean we need to bind to a new port for every LIST command?
> >
> > Thanks
> > Ayaz
> >
> >
> > ---------------------------------------------------------------------
> >
> >  I just tried against ftp.cs.stanford.edu and got the same results.
> > Worked OK with ftp.gnu.org.  Looks like you will have to work around
> > this.
> >
> >  please post questions like this to the newsgroup so all the students
> > can benefit from the responses.
> >
> >  Thanks,
> >  martin
> >
> > > Hi Martin,
> > >
> > > I didn't understand your newsgroup post where you mentioned to use the
> > > Beej's simple stream server?
> > >
> > > I am having the problem where I send the second PORT command (using same
> > > values as the first PORT command) followed by the second LIST command.
> > >
> > > The server (ftp.cs.stanford.edu) replys back with "550 Cannot connect to
> > > x.x.x.x:x - Address already in use".
> > >
> > > I did close the data socket related to the first LIST command (ie. the
> > one
> > > created by accept()).
> > >
> > > Am I missing something?
> > >
> > > Thanks
> > > Ayaz
> > >
> > >
> >
> >
> >
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Reply code 550 (copied from below)
Date: Sun, 18 Jan 2004 18:15:18 -0800
Lines: 25
Distribution: su
Message-ID: <bufel6$am$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074478566 342 128.12.90.43 (19 Jan 2004 02:16:06 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5255

In an earlier post:

>Woodley Packard <sweagles@stanford.edu> wrote:
>: Hi,
>
>: The assignment says we should silently ignore files/directories which we
>: do not have permission to access, but give up and print an error if we
>: encounter a "real" error.  I assume this includes "No such file or
>: directory" (e.g. if the root directory specified by the user doesn't
>: exist).
>
>In the case when you get a 550 when cd'ing to the root directory specified
>by the user, you can print an error. In other cases, you can silently
>ignore the directory when you get a 550.
>
>Shankar

Does this also apply to RETR commands? i.e. if I try to RETR a file and it
returns 550, can we assume it is a permissions problem and silently ignore
it?

Thanks,
Eddy


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: getting total transferred bytes?
Date: Sun, 18 Jan 2004 18:16:53 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181810480.20637-100000@Xenon.Stanford.EDU>
References: <400B27C9.61D8468A@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074478617 497 171.64.66.201 (19 Jan 2004 02:16:57 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tony Chun-hao Hsieh <thsieh@stanford.edu>
In-Reply-To: <400B27C9.61D8468A@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5256


 This should only reflect the number of bytes copied ( a la RETR ).

 .m

> Hi,
> 
> I was wondering fo the total transferred bytes whether we include the
> bytes transferred from the LIST command as well?  Thanks.
> 
> -Tony
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Transfer 0 byte file test
Date: Sun, 18 Jan 2004 18:19:46 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181819110.27387-100000@Xenon.Stanford.EDU>
References: <buf6el$laf$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074478790 852 171.64.66.201 (19 Jan 2004 02:19:50 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lei Zhang <lei.zhang@cs.stanford.edu>
In-Reply-To: <buf6el$laf$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5257


 The test looks OK to me.  Can you describe what you think the problem might
 be?

 .m

> I rememer that I saw a post regarding this but somehow couldn't find it.
> Sorry if it is a duplicate.
> 
> My code failed test L1: Checks that ftpcopy transfers zero byte file
> correctly. It appeared to me that the test script did not pass the correct
> arguments according to the spec.
> 
> Can someone please verify?
> 
> Thanks,
> Lei
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Format of local directory argument
Date: Sun, 18 Jan 2004 18:24:22 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181820450.27387-100000@Xenon.Stanford.EDU>
References: <bufb72$pp9$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074479064 1580 171.64.66.201 (19 Jan 2004 02:24:24 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <bufb72$pp9$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5258


 Making assumptions regarding command line arguments is probably not a good idea.
 You should be able to handle both cases.
 
 .m


> What can we assume about the format of the local directory argument? Should
> it end with a slash or not? should we handle both cases?
> 
> Thanks,
> Eddy
> 
> 
> 

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!bergerj
From: Jonathan Berger <bergerj@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Transfer 0 byte file test
Date: Sun, 18 Jan 2004 18:24:30 -0800
Lines: 35
Sender: bergerj@elaine3.Stanford.EDU
Distribution: su
Message-ID: <Pine.GSO.4.44.0401181820570.1429-100000@elaine3.Stanford.EDU>
References: <buf6el$laf$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074479071 1585 171.64.15.68 (19 Jan 2004 02:24:31 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <buf6el$laf$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5259


I am having trouble with the "zero byte" test as well, although not quite
what you describe.

I have verified with ftpd that my code transfers zero byte files
correctly, however the script still reports an error. I get:
"Incorrect program status code 256 (exit code 1).  Program output:"

I found a posting on last year's with a similar problem, and tried the
suggestion posted there (deleting the grading_src directory), but it did
not help.

Lei, I believe this test is calling ftpcopy with host "12345@localhost"
where 12345 is a port number, so you might want to make sure your code
handles that case correctly.

Jonathan

On Sun, 18 Jan 2004, Lei Zhang wrote:

> I rememer that I saw a post regarding this but somehow couldn't find it.
> Sorry if it is a duplicate.
>
> My code failed test L1: Checks that ftpcopy transfers zero byte file
> correctly. It appeared to me that the test script did not pass the correct
> arguments according to the spec.
>
> Can someone please verify?
>
> Thanks,
> Lei
>
>
>

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ftpparse size field
Date: Sun, 18 Jan 2004 18:26:53 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181825010.27387-100000@Xenon.Stanford.EDU>
References: <bufbns$qna$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074479217 1713 171.64.66.201 (19 Jan 2004 02:26:57 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <bufbns$qna$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5260


  Your choice, just be sure to print the correct number. :)

  .m

> In the source code in the assignment page, it says shows:
> 
>     'size' = entry size in bytes (relevant if 'sizetype' ==
> FTPPARSE_SIZE_BINARY)
> 
> Should we use this to tally the number of bytes transferred (if we download
> this file), or can we just sum up the bytes_read returned from read calls?
> 
> Thanks,
> Eddy
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: problem with realloc
Date: Sun, 18 Jan 2004 18:31:18 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181827150.27387-100000@Xenon.Stanford.EDU>
References: <bufd12$sdh$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074479481 2055 171.64.66.201 (19 Jan 2004 02:31:21 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bufd12$sdh$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5261


 I haven't had problems using realloc with purify.  It is difficult to
 determine the problem given your description .. you might want to try changing
 realloc(..) to a malloc()/memcpy() and a free(). 

  .m


> Hi,
> I am using realloc to reallocate memory as my LIST command output gets read.
> When I do a 'make all' and then run my output, it works fine
> but when I do a ' make all.purify' and run the output, realloc fails to
> allocate memory.
> Any guesses?
> Please help me.
> Thanks,
> Haripriya
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Reply code 550 (copied from below)
Date: Sun, 18 Jan 2004 18:38:03 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181831540.27387-100000@Xenon.Stanford.EDU>
References: <bufel6$am$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074479884 2359 171.64.66.201 (19 Jan 2004 02:38:04 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <bufel6$am$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5262


 
  I don't see any other option, do you?

  "550 Requested action not taken.
   File unavailable (e.g., file not found, no access)."

  .m

> 
> Does this also apply to RETR commands? i.e. if I try to RETR a file and it
> returns 550, can we assume it is a permissions problem and silently ignore
> it?
> 
> Thanks,
> Eddy
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: A note on posting/replies
Date: Sun, 18 Jan 2004 19:01:02 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181856120.3644-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074481268 3727 171.64.66.201 (19 Jan 2004 03:01:08 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5263


  At times we may fail to respond to a question on the news group due to
  overlooking, hasty deletion, momentary brain damage etc.  If you think this
  has happened to one of your questions (it goes unanswered for 24 hours),
  please repost.  We do try and answer all questions in a timely manner,
  but some certainly slip through the cracks.

  Thanks! :)
  .martin
  

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: utilizing echodemo.c code
Date: Sun, 18 Jan 2004 18:09:35 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181807520.20637-100000@Xenon.Stanford.EDU>
References: <buf8if$n2d$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074478184 276 171.64.66.201 (19 Jan 2004 02:09:44 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <buf8if$n2d$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5264


 There are only so many ways to establish a socket connection ... so if
 you are referring to basic address and socket setup, this should be OK.
 
 .m

> I find that I'm using a lot of the tricks from echodemo.c to establish my
> initial connection, to the point where I'm basically writing much of the
> same code with different variable names (with obvious differences such as
> parsing for the port number when provided in the command line).  Is this
> acceptable?  It's very difficult to come up with the methods all on my own
> when it's basically laid out in echodemo.c.  Everything will diverge once
> the connection is established, of course, but the beginning of my code looks
> very similar to the code provided...
> 
> Thanks,
> Oded
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Martin's Office hours changed
Date: Sun, 18 Jan 2004 19:09:16 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.LNX.4.44.0401181902190.5356-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074481759 4151 171.64.66.201 (19 Jan 2004 03:09:19 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5265


  I will be moving this week's office hours from Monday the 19th at 7-9pm to
  Tuesday (7-9pm).  

  Thanks :)
  .martin


.

Path: shelby.stanford.edu!not-for-mail
From: "David Domyancic" <ddom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Creating the data connection...
Date: Sun, 18 Jan 2004 22:00:34 -0600
Lines: 13
Distribution: su
Message-ID: <bufkrq$72i$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074484924 7250 127.0.0.1 (19 Jan 2004 04:02:04 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5266

I am working on creating the data connection to the FTP server.  I am using
the instructions as provided in the assignment sheet.  Step 3 of the
instructions says "the client calls listen() to indicate a willingness to
accept a connection to the new socket."  I looked into Stevens to get info
on using listen().  Stevens said that listen is only called by a TCP server.

Is this a typo in the writeup?  Who is right?

Thank you,
David



.

Path: shelby.stanford.edu!not-for-mail
From: "David Domyancic" <ddom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Creating the data connection...
Date: Sun, 18 Jan 2004 22:02:10 -0600
Lines: 14
Distribution: su
Message-ID: <bufktt$740$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074484990 7296 127.0.0.1 (19 Jan 2004 04:03:10 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5267

I am working on creating the data connection to the FTP server.  I am using
the instructions as provided in the assignment sheet.  Step 3 of the
instructions says "the client calls listen() to indicate a willingness to
accept a connection to the new socket."  I looked into Stevens to get info
on using listen().  Stevens said that listen is only called by a TCP server.

Is this a typo in the writeup?  Who is right?

Thank you,
David




.

Path: shelby.stanford.edu!not-for-mail
From: "David Domyancic" <ddom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: closing the data connection...
Date: Sun, 18 Jan 2004 22:15:25 -0600
Lines: 13
Distribution: su
Message-ID: <buflkn$7ru$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074485721 8062 127.0.0.1 (19 Jan 2004 04:15:21 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5268

Once the data connection to the FTP server has been established and client
has finished processing the LIST or RETR command, the assignment writeup
says "The server will automatically close the connection from its end
connection once all of the data has been sent."  The closing of the data
connection by the server does that refer to both the RETR command and the
LIST command?  If that statement is true, the will not have to worry about
closing the connection.  Also, once the server has sent the data in response
to a RETR/LIST command the server will close the connection.  Correct?

Thank you for the insight,
David


.

Path: shelby.stanford.edu!not-for-mail
From: "David Domyancic" <ddom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Arguments passed in..
Date: Sun, 18 Jan 2004 22:21:28 -0600
Lines: 17
Distribution: su
Message-ID: <bufm01$86o$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074486082 8408 127.0.0.1 (19 Jan 2004 04:21:22 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5269

I need a verification concerning the argument that handles the FTP server
name/address.  Basically, if I am interpretting this correctly, there are
three possible options that needs to be taken care of here:

Option 1: symbolic name i.e. ftp.stanford.edu
Option 2: IP Address: i.e. 115.24.46.32
Option 3: number@host.  The number will refer to the port number that the
client is to establish the control connection to the FTP server (not the
default port), and the host is to refers to the symbolic name (see Option
1).

Correct?

Thanks for the verification,
David


.

Path: shelby.stanford.edu!not-for-mail
From: David Chan <dmchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: HW#1: Creation of "Empty" Sub-directories
Date: Sun, 18 Jan 2004 20:47:18 -0800
Lines: 10
Distribution: su
Message-ID: <bufngn$9jd$1@news.Stanford.EDU>
NNTP-Posting-Host: sprun.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074487639 9837 128.12.57.21 (19 Jan 2004 04:47:19 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5270

In stipulation 3.b of the HW#1 handout, it says that we should not 
"create a null-size file with the same name" with regards to re-creating 
the directory structure of the remote server.

Does that mean that we should not attempt to create the directory at 
all, or is it acceptable to create and then remove the directory if no 
files were copied into it or its subdirectories?

Thanks,
Dave
.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: AFS is down?
Date: Sun, 18 Jan 2004 21:18:39 -0800
Lines: 8
Distribution: su
Message-ID: <bufpbq$bev$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc508.stanford.edu
X-Trace: news.Stanford.EDU 1074489530 11743 128.12.197.8 (19 Jan 2004 05:18:50 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5271

I can't get to my AFS i.e. not work on this assignment.  Is anyone else
having the same problem?

Just want to make sure I am not alone.

-Justin


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: AFS down
Date: Sun, 18 Jan 2004 21:19:56 -0800
Lines: 3
Distribution: su
Message-ID: <bufpco$bg0$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1074489560 11776 128.12.61.97 (19 Jan 2004 05:19:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5272

FYI: AFS appears to be (at least partially) down at 9:18 PM on Sunday.


.

Path: shelby.stanford.edu!not-for-mail
From: "David Domyancic" <ddom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: AFS is down?
Date: Sun, 18 Jan 2004 23:27:44 -0600
Lines: 19
Distribution: su
Message-ID: <bufpsf$c0l$1@news.Stanford.EDU>
References: <bufpbq$bev$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074490065 12309 127.0.0.1 (19 Jan 2004 05:27:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5273

Yeah,

I am having the same problem.  Oh Shit!!!

David


"Justin" <justinfw@stanford.edu> wrote in message
news:bufpbq$bev$1@news.Stanford.EDU...
> I can't get to my AFS i.e. not work on this assignment.  Is anyone else
> having the same problem?
>
> Just want to make sure I am not alone.
>
> -Justin
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: John Cieslewicz <jciesle@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Creating the data connection...
Date: Sun, 18 Jan 2004 22:17:46 -0800
Organization: Stanford University
Lines: 21
Distribution: su
Message-ID: <bufsqd$evf$1@news.Stanford.EDU>
References: <bufktt$740$1@news.Stanford.EDU>
Reply-To: jciesle@stanford.edu
NNTP-Posting-Host: johnc.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
X-Trace: news.Stanford.EDU 1074493069 15343 128.12.89.246 (19 Jan 2004 06:17:49 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: KNode/0.7.2
Xref: shelby.stanford.edu su.class.cs244a:5274

My understanding is that if you think about it, your ftp client is acting
like a server when it issues the PORT command to the ftp server. Your
client accepts a connection *from* the server, which in a way makes the
server a client of your program.

John

David Domyancic wrote:

> I am working on creating the data connection to the FTP server.  I am
> using
> the instructions as provided in the assignment sheet.  Step 3 of the
> instructions says "the client calls listen() to indicate a willingness to
> accept a connection to the new socket."  I looked into Stevens to get info
> on using listen().  Stevens said that listen is only called by a TCP
> server.
> 
> Is this a typo in the writeup?  Who is right?
> 
> Thank you,
> David
.

Path: shelby.stanford.edu!not-for-mail
From: David Chan <dmchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: [Fwd: AFS outage]
Date: Sun, 18 Jan 2004 22:44:36 -0800
Lines: 20
Distribution: su
Message-ID: <bufuck$gp1$1@news.Stanford.EDU>
NNTP-Posting-Host: sprun.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074494677 17185 128.12.57.21 (19 Jan 2004 06:44:37 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5275


More news on AFS. Someone's on it.

Dave

-------- Original Message --------
Subject: AFS outage
Date: Sun, 18 Jan 2004 21:38:16 -0800
From: Russ Allbery <eagle@windlord.stanford.edu>
Organization: ITSS Infrastructure Operations, Stanford University
Newsgroups: su.computers.announce,su.computers.rcc,su.computers.afs
Followup-To: su.computers.afs

Due to what appears to be a severe network switch failure, half of the 
AFS servers are currently unreachable, including those housing nearly 
all home directories.  The problem is being worked on currently.

-- 
Russ Allbery <eagle@windlord.stanford.edu>
Technical Lead, ITSS Infrastructure Operations, Stanford University
.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Use of text error code
Date: Mon, 19 Jan 2004 06:54:13 +0000 (UTC)
Lines: 4
Distribution: su
Message-ID: <bufuul$hac$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine16.stanford.edu
X-Trace: news.Stanford.EDU 1074495253 17740 171.64.15.81 (19 Jan 2004 06:54:13 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5276

Can we re-use the error handling code found in Appendix D of the Stevens text (at 
least in the 2nd edition)?

Tyrone
.

Path: shelby.stanford.edu!not-for-mail
From: "Daniel Danger Bentley" <dbentley@stanford.edu>
Newsgroups: su.class.cs244a
Subject: parsing command line for server address
Date: Sun, 18 Jan 2004 23:18:13 -0800
Lines: 12
Distribution: su
Message-ID: <bug0bl$imr$1@news.Stanford.EDU>
NNTP-Posting-Host: mencken.stanford.edu
X-Trace: news.Stanford.EDU 1074496693 19163 128.12.90.29 (19 Jan 2004 07:18:13 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5277

Quick question that I'm sure is stupid:

How do we tell if the address given is a name or IP address?  I was under
the impression, from UNP, that we cannot trust gethostbyname to work on IP
addresses, but I also wasn't sure what there could be in a name to prevent
an IP address form being a valid name.  Are they not allowed to begin with a
digit (names)?

Thanks,
Dan


.

Path: shelby.stanford.edu!elaine22.Stanford.EDU!aramg
From: Aram Grigoryan <aramg@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Message from test_code.pl
Date: Sun, 18 Jan 2004 23:32:18 -0800
Lines: 42
Distribution: su
Message-ID: <Pine.GSO.4.44.0401182324130.21889-100000@elaine22.Stanford.EDU>
NNTP-Posting-Host: elaine22.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074497553 19989 171.64.15.87 (19 Jan 2004 07:32:33 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5278


Hi there,

I am receiving "Can't find a matching key for this test run." from
test_code.pl  What does that mean?  Below is edited output from test_code.pl

Thanks in advance,
Aram

------------------------------------------------------------------------------

/afs/ir/class/cs244a/bin/test_code.pl hw1 Makefile *.c *.h purify.output
..purify
Creating submission tarball...

..
..
..
[list of files]
..
..
..

Checking to make sure target all compiles before testing... OK
Checking to make sure target ftpcopy.purify compiles before testing... OK

Starting...
Test B, new source tree required, extracting into grading_src/build...

..
..
..
[list of files]
..
..
..

Can't find a matching key for this test run.
Would you like to generate a new one?  (y/n):  y

------------------------------------------------------------------------------

.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: pasv on slac
Date: Sun, 18 Jan 2004 23:44:54 -0800
Organization: Stanford University
Lines: 8
Distribution: su
Message-ID: <pan.2004.01.19.07.44.53.922683@stanford.edu>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1074498294 20526 128.12.69.27 (19 Jan 2004 07:44:54 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Xref: shelby.stanford.edu su.class.cs244a:5279

Hey everybody--

I'm curious if this only affects me or not.  On my home machine (and
several others that I have tested) I can no longer LIST
ftp.slac.stanford.edu via a PASV connection.  Did the server stop allowing
this or something?

--Chris
.

Path: shelby.stanford.edu!not-for-mail
From: David Chan <dmchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: parsing command line for server address
Date: Mon, 19 Jan 2004 00:06:03 -0800
Lines: 41
Distribution: su
Message-ID: <400B8FEB.3000504@stanford.edu>
References: <bug0bl$imr$1@news.Stanford.EDU>
NNTP-Posting-Host: sprun.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074499563 22162 128.12.57.21 (19 Jan 2004 08:06:03 GMT)
X-Complaints-To: news@news.stanford.edu
To: Daniel Danger Bentley <dbentley@stanford.edu>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4
X-Accept-Language: en-us, en
In-Reply-To: <bug0bl$imr$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5280

Dan,

There's a great example in the echodemo.c code:

   /*
    * First try to convert the host name as a dotted-decimal number.
    * Only if that fails we call gethostbyname().
    */
   if ( (serverInaddr = inet_addr(serverHostName)) != INADDR_NONE ) {
     /* conversion succeeded */
     servAddr.sin_addr.s_addr = serverInaddr;
   }
   else {
     if ( (hostentPtr = gethostbyname(serverHostName)) == NULL) {
       fprintf(stderr, "ERROR: failed to resolve host name: %s\n ",
           serverHostName);
       exit(FAILURE);
     }
     bcopy( hostentPtr->h_addr, (char *) &servAddr.sin_addr,
        hostentPtr->h_length);
   }

Essentially, inet_addr serves the purpose of dotted-decimal string to 
32-bit address.

Dave

Daniel Danger Bentley wrote:

> Quick question that I'm sure is stupid:
> 
> How do we tell if the address given is a name or IP address?  I was under
> the impression, from UNP, that we cannot trust gethostbyname to work on IP
> addresses, but I also wasn't sure what there could be in a name to prevent
> an IP address form being a valid name.  Are they not allowed to begin with a
> digit (names)?
> 
> Thanks,
> Dan
> 
> 
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Creating the data connection...
Date: Mon, 19 Jan 2004 00:35:34 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0401190034320.18829-100000@Xenon.Stanford.EDU>
References: <bufkrq$72i$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074501337 24226 171.64.66.201 (19 Jan 2004 08:35:37 GMT)
X-Complaints-To: news@news.stanford.edu
To: David Domyancic <ddom@stanford.edu>
In-Reply-To: <bufkrq$72i$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5281


 When you use the PORT command to create a data connection you are binding
 locally as a server would do.  Both Stevens and the homework are correct.

 .m

> I am working on creating the data connection to the FTP server.  I am using
> the instructions as provided in the assignment sheet.  Step 3 of the
> instructions says "the client calls listen() to indicate a willingness to
> accept a connection to the new socket."  I looked into Stevens to get info
> on using listen().  Stevens said that listen is only called by a TCP server.
> 
> Is this a typo in the writeup?  Who is right?
> 
> Thank you,
> David
> 
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: closing the data connection...
Date: Mon, 19 Jan 2004 00:36:35 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0401190035590.18829-100000@Xenon.Stanford.EDU>
References: <buflkn$7ru$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074501398 24272 171.64.66.201 (19 Jan 2004 08:36:38 GMT)
X-Complaints-To: news@news.stanford.edu
To: David Domyancic <ddom@stanford.edu>
In-Reply-To: <buflkn$7ru$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5282


  Correct, the server will close the connection once all the data has been
  sent.

  .m

> Once the data connection to the FTP server has been established and client
> has finished processing the LIST or RETR command, the assignment writeup
> says "The server will automatically close the connection from its end
> connection once all of the data has been sent."  The closing of the data
> connection by the server does that refer to both the RETR command and the
> LIST command?  If that statement is true, the will not have to worry about
> closing the connection.  Also, once the server has sent the data in response
> to a RETR/LIST command the server will close the connection.  Correct?
> 
> Thank you for the insight,
> David
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Arguments passed in..
Date: Mon, 19 Jan 2004 00:37:46 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.LNX.4.44.0401190037200.18829-100000@Xenon.Stanford.EDU>
References: <bufm01$86o$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074501469 24344 171.64.66.201 (19 Jan 2004 08:37:49 GMT)
X-Complaints-To: news@news.stanford.edu
To: David Domyancic <ddom@stanford.edu>
In-Reply-To: <bufm01$86o$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5283


 Correct except that number@host .. host may be a domain name or an ip address.

 .m

> I need a verification concerning the argument that handles the FTP server
> name/address.  Basically, if I am interpretting this correctly, there are
> three possible options that needs to be taken care of here:
> 
> Option 1: symbolic name i.e. ftp.stanford.edu
> Option 2: IP Address: i.e. 115.24.46.32
> Option 3: number@host.  The number will refer to the port number that the
> client is to establish the control connection to the FTP server (not the
> default port), and the host is to refers to the symbolic name (see Option
> 1).
> 
> Correct?
> 
> Thanks for the verification,
> David
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: HW#1: Creation of "Empty" Sub-directories
Date: Mon, 19 Jan 2004 00:39:32 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0401190038090.18829-100000@Xenon.Stanford.EDU>
References: <bufngn$9jd$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074501576 24499 171.64.66.201 (19 Jan 2004 08:39:36 GMT)
X-Complaints-To: news@news.stanford.edu
To: David Chan <dmchan@stanford.edu>
In-Reply-To: <bufngn$9jd$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5284


  Creating and then removing the directory is fine.

  .m

> In stipulation 3.b of the HW#1 handout, it says that we should not 
> "create a null-size file with the same name" with regards to re-creating 
> the directory structure of the remote server.
> 
> Does that mean that we should not attempt to create the directory at 
> all, or is it acceptable to create and then remove the directory if no 
> files were copied into it or its subdirectories?
> 
> Thanks,
> Dave
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Use of text error code
Date: Mon, 19 Jan 2004 00:44:02 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0401190040360.18829-100000@Xenon.Stanford.EDU>
References: <bufuul$hac$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074501846 24753 171.64.66.201 (19 Jan 2004 08:44:06 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <bufuul$hac$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5285


  I'm not sure I know what exactly you are referring to however,
  unless it is something really trivial we prefer you write your own.

  .m

> Can we re-use the error handling code found in Appendix D of the Stevens text (at 
> least in the 2nd edition)?
> 
> Tyrone
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: parsing command line for server address
Date: Mon, 19 Jan 2004 00:48:52 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.LNX.4.44.0401190044270.18829-100000@Xenon.Stanford.EDU>
References: <bug0bl$imr$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074502134 24926 171.64.66.201 (19 Jan 2004 08:48:54 GMT)
X-Complaints-To: news@news.stanford.edu
To: Daniel Danger Bentley <dbentley@stanford.edu>
In-Reply-To: <bug0bl$imr$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5286


 DNS names can be have numbers:

 e.g.  42.com

 however, I don't know of any top level domains that are numeric, so ....

 .m

> Quick question that I'm sure is stupid:
> 
> How do we tell if the address given is a name or IP address?  I was under
> the impression, from UNP, that we cannot trust gethostbyname to work on IP
> addresses, but I also wasn't sure what there could be in a name to prevent
> an IP address form being a valid name.  Are they not allowed to begin with a
> digit (names)?
> 
> Thanks,
> Dan
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: pasv on slac
Date: Mon, 19 Jan 2004 00:51:10 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.LNX.4.44.0401190050340.18829-100000@Xenon.Stanford.EDU>
References: <pan.2004.01.19.07.44.53.922683@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074502275 25054 171.64.66.201 (19 Jan 2004 08:51:15 GMT)
X-Complaints-To: news@news.stanford.edu
To: Chris Edstrom <cedstrom@stanford.edu>
In-Reply-To: <pan.2004.01.19.07.44.53.922683@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5287



ftp> get robots.txt
local: robots.txt remote: robots.txt
227 Entering Passive Mode (134,79,18,30,165,180).
150 Opening BINARY mode data connection for robots.txt (27 bytes)
226 Transfer complete.
27 bytes received in 0.00306 secs (8.6 Kbytes/sec)
ftp> 

its working fine for me.

..m

> Hey everybody--
> 
> I'm curious if this only affects me or not.  On my home machine (and
> several others that I have tested) I can no longer LIST
> ftp.slac.stanford.edu via a PASV connection.  Did the server stop allowing
> this or something?
> 
> --Chris
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: test script
Date: Mon, 19 Jan 2004 01:01:19 -0800
Lines: 65
Distribution: su
Message-ID: <bug65e$omi$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1074502638 25298 128.12.189.163 (19 Jan 2004 08:57:18 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5288

Hi,
I'm having some problems.My test script out put gives me these 4 errors-
Test L.1 [out of 0.5]
Checks that ftpcopy transfers zero byte file correctly.

Results:  NOT OK

Incorrect program status code -1 (exit code 16777215).  Program output:
***Timeout expired during grading
Program output:

----------------------------------------------------------------------

Test L.2 [out of 0.5]
Checks that ftpcopy does not erroneously create empty dir.

Results:  NOT OK

Incorrect program status code -1 (exit code 16777215).  Program output:
***Timeout expired during grading
Program output:

----------------------------------------------------------------------

Test L.3 [out of 0.5]
Checks that ftpcopy does not create inaccessible file.

Results:  NOT OK

Incorrect program status code -1 (exit code 16777215).  Program output:
***Timeout expired during grading
Program output:

----------------------------------------------------------------------

Test L.4 [out of 0.5]
Checks that ftpcopy does not erroneously create dir containing only empty
subdirs.

Results:  NOT OK

Incorrect program status code -1 (exit code 16777215).  Program output:
***Timeout expired during grading
Program output:
-----------------------------------------
Now I had a problem finding zero file so I changed my USER to my SUID and
worked with transfer.stanford.edu
I find that my zero byte file does get correctly transferred.ie it does get
copied to the destination.Is it that we should not copy it?

Also I do create subdirectories while going down the tree, but if i find
that correspondingly at the source it is empty, I delete it while going back
to the root.
again i checked my permissions of my files created, they all have "rw"
permissions for user.

So basically, I fail to understand why the above tests fail.
Could you point me to a place where I could manually test for these cases?
Thanks,
Haripriya





.

Path: shelby.stanford.edu!not-for-mail
From: "Louis Eisenberg" <tarheel@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ee 284 vs. cs 244a?
Date: Mon, 19 Jan 2004 00:59:56 -0800
Lines: 5
Distribution: su
Message-ID: <bug6ah$oou$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074502803 25374 127.0.0.1 (19 Jan 2004 09:00:03 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5289

Can anyone tell me exactly how different (in content, difficulty, quality,
etc.) the autumn (EE 284) and winter (CS 244A) versions of this class are?
Just curious.


.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftpd and PASS
Date: Mon, 19 Jan 2004 01:10:52 -0800
Lines: 27
Distribution: su
Message-ID: <400B9F1C.F8229E2C@stanford.edu>
References: <Pine.GSO.4.44.0401131944450.21238-100000@elaine21.Stanford.EDU>
	 <bu3oj1$fp8$1@news.Stanford.EDU> <Pine.GSO.4.44.0401140919550.17142-100000@elaine23.Stanford.EDU> <Pine.LNX.4.44.0401140929370.19664-100000@Xenon.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074503452 25956 127.0.0.1 (19 Jan 2004 09:10:52 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U)
X-Accept-Language: ko,en
Xref: shelby.stanford.edu su.class.cs244a:5290

Martin Casado wrote:
> 
>  Some servers do not require/understand PASS.  For example ftp.gnu.org
> 
> [casado@nity ~]$ telnet ftp.gnu.org 21
> Trying 199.232.41.7...
> Connected to gnudist.gnu.org (199.232.41.7).
> Escape character is '^]'.
> 220 GNU FTP server ready.
> USER anonymous
> 230 Login successful.
> PASS foo@bar
> 500 Unknown command.
> quit
> 221 Goodbye.
> Connection closed by foreign host.
> [casado@nity ~]$
> 
>  Note that the return codes differ between a host that requires PASS and
> one that doesn't ... one that requires PASS should return 3** after USER,
> ones that don't should return 2**

Do I have to handle both cases then,
or can I just assume that PASS is required and understood?

-- 
Seungbeom Kim
.

Path: shelby.stanford.edu!not-for-mail
From: "David Domyancic" <ddom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Creating the data connection...
Date: Mon, 19 Jan 2004 03:24:24 -0600
Lines: 28
Distribution: su
Message-ID: <bug7o5$q6f$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074504263 26831 127.0.0.1 (19 Jan 2004 09:24:23 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5291

I am not able to create the data connection and I am probably doing
something stupid here, but I am not seeing the problem.

Below is a code snippet of the sequence of actions that I am taking here.  I
am failing on getsockname(), and getsockname prints out a message saying
'Bad List'.  I do not get it.  I think I am play the game right here...

I successfully issued TYPE and PASV commands successfully prior to this
sequence.

struct sockaddr_in servAddr;  /* server address */
  struct sockaddr_in clientAddr;

data_socket = socket(AF_INET, SOCK_STREAM, 0);

bzero( (char*) &servAddr, sizeof(servAddr));
  servAddr.sin_family = AF_INET;      /* Internet Address Family */
  servAddr.sin_port = 0;
  servAddr.sin_addr.s_addr = htonl(INADDR_ANY);

bind(data_socket, &servAddr, sizeof(servAddr);
listen(data_socket,1);
getsockname(data_socket, &clientAddr, sizeof(clientAddr)


David


.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Creating the data connection...
Date: Mon, 19 Jan 2004 02:11:43 -0800
Lines: 35
Distribution: su
Message-ID: <20040119021143.383b8ec9.chanman@stanford.edu>
References: <bug7o5$q6f$1@news.Stanford.EDU>
NNTP-Posting-Host: chanman.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074507173 29651 128.12.94.94 (19 Jan 2004 10:12:53 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed version 0.9.6 (GTK+ 1.2.10; i386-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:5292

If you're doing PASV, why are you creating a server socket?  You should be doing a connect() to the server as specified in the ftp server's response to your PASV.

--Will

On Mon, 19 Jan 2004 03:24:24 -0600
"David Domyancic" <ddom@stanford.edu> wrote:

> I am not able to create the data connection and I am probably doing
> something stupid here, but I am not seeing the problem.
> 
> Below is a code snippet of the sequence of actions that I am taking here.  I
> am failing on getsockname(), and getsockname prints out a message saying
> 'Bad List'.  I do not get it.  I think I am play the game right here...
> 
> I successfully issued TYPE and PASV commands successfully prior to this
> sequence.
> 
> struct sockaddr_in servAddr;  /* server address */
>   struct sockaddr_in clientAddr;
> 
> data_socket = socket(AF_INET, SOCK_STREAM, 0);
> 
> bzero( (char*) &servAddr, sizeof(servAddr));
>   servAddr.sin_family = AF_INET;      /* Internet Address Family */
>   servAddr.sin_port = 0;
>   servAddr.sin_addr.s_addr = htonl(INADDR_ANY);
> 
> bind(data_socket, &servAddr, sizeof(servAddr);
> listen(data_socket,1);
> getsockname(data_socket, &clientAddr, sizeof(clientAddr)
> 
> 
> David
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: parsing command line for server address
Date: Mon, 19 Jan 2004 02:27:11 -0800
Lines: 25
Distribution: su
Message-ID: <400BB0FF.AEB131E7@stanford.edu>
References: <bug0bl$imr$1@news.Stanford.EDU> <400B8FEB.3000504@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074508031 15 127.0.0.1 (19 Jan 2004 10:27:11 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U)
X-Accept-Language: ko,en
Xref: shelby.stanford.edu su.class.cs244a:5293

David Chan wrote:
> 
>    /*
>     * First try to convert the host name as a dotted-decimal number.
>     * Only if that fails we call gethostbyname().
>     */
>    if ( (serverInaddr = inet_addr(serverHostName)) != INADDR_NONE ) {
>      /* conversion succeeded */
>      servAddr.sin_addr.s_addr = serverInaddr;
>    }
>    else {
>      if ( (hostentPtr = gethostbyname(serverHostName)) == NULL) {
>        fprintf(stderr, "ERROR: failed to resolve host name: %s\n ",
>            serverHostName);
>        exit(FAILURE);
>      }
>      bcopy( hostentPtr->h_addr, (char *) &servAddr.sin_addr,
>         hostentPtr->h_length);
>    }

Can't we just skip the call to inet_addr and use gethostbyname
directly? I've been doing that and found no problems so far.

-- 
Seungbeom Kim
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ftpd and PASS
Date: Mon, 19 Jan 2004 06:45:09 -0800
Lines: 38
Distribution: su
Message-ID: <Pine.LNX.4.44.0401190639050.22017-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401131944450.21238-100000@elaine21.Stanford.EDU>
  <bu3oj1$fp8$1@news.Stanford.EDU> <Pine.GSO.4.44.0401140919550.17142-100000@elaine23.Stanford.EDU>
 <Pine.LNX.4.44.0401140929370.19664-100000@Xenon.Stanford.EDU>
 <400B9F1C.F8229E2C@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074523511 14864 171.64.66.201 (19 Jan 2004 14:45:11 GMT)
X-Complaints-To: news@news.stanford.edu
To: Seungbeom Kim <sbkim@stanford.edu>
In-Reply-To: <400B9F1C.F8229E2C@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5294


  You should be able to handle both cases as they are both RFC compliant.
  
  From the RFC

  " Additional identification information in the form of
    a password and/or an account command may also be required by
    some servers."

 .martin

> Martin Casado wrote:
> > 
> >  Some servers do not require/understand PASS.  For example ftp.gnu.org
> > 
> > [casado@nity ~]$ telnet ftp.gnu.org 21
> > Trying 199.232.41.7...
> > Connected to gnudist.gnu.org (199.232.41.7).
> > Escape character is '^]'.
> > 220 GNU FTP server ready.
> > USER anonymous
> > 230 Login successful.
> > PASS foo@bar
> > 500 Unknown command.
> > quit
> > 221 Goodbye.
> > Connection closed by foreign host.
> > [casado@nity ~]$
> > 
> >  Note that the return codes differ between a host that requires PASS and
> > one that doesn't ... one that requires PASS should return 3** after USER,
> > ones that don't should return 2**
> 
> Do I have to handle both cases then,
> or can I just assume that PASS is required and understood?
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Creating the data connection...
Date: Mon, 19 Jan 2004 06:48:51 -0800
Lines: 42
Distribution: su
Message-ID: <Pine.LNX.4.44.0401190646150.22017-100000@Xenon.Stanford.EDU>
References: <bug7o5$q6f$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074523734 15067 171.64.66.201 (19 Jan 2004 14:48:54 GMT)
X-Complaints-To: news@news.stanford.edu
To: David Domyancic <ddom@stanford.edu>
In-Reply-To: <bug7o5$q6f$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5295


 Your last argument is incorrect. 

 from the man page:

 int getsockname(int s, struct sockaddr *name, socklen_t *namelen);

 .m




> I am not able to create the data connection and I am probably doing
> something stupid here, but I am not seeing the problem.
> 
> Below is a code snippet of the sequence of actions that I am taking here.  I
> am failing on getsockname(), and getsockname prints out a message saying
> 'Bad List'.  I do not get it.  I think I am play the game right here...
> 
> I successfully issued TYPE and PASV commands successfully prior to this
> sequence.
> 
> struct sockaddr_in servAddr;  /* server address */
>   struct sockaddr_in clientAddr;
> 
> data_socket = socket(AF_INET, SOCK_STREAM, 0);
> 
> bzero( (char*) &servAddr, sizeof(servAddr));
>   servAddr.sin_family = AF_INET;      /* Internet Address Family */
>   servAddr.sin_port = 0;
>   servAddr.sin_addr.s_addr = htonl(INADDR_ANY);
> 
> bind(data_socket, &servAddr, sizeof(servAddr);
> listen(data_socket,1);
> getsockname(data_socket, &clientAddr, sizeof(clientAddr)
> 
> 
> David
> 
> 
> 

.

Message-ID: <400C0DA4.5070004@stanford.edu>
Date: Mon, 19 Jan 2004 09:02:36 -0800
From: Sumeet Shendrikar <sumeets@stanford.edu>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: su.class.cs244a@news.stanford.edu
Subject: Commenting style question
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 9
Newsgroups: su.class.cs244a
Organization: Stanford University Posting Gateway (mailtonews 1.7/0.42)
Path: shelby.stanford.edu!mail-to-news!smtp-roam.stanford.edu
Sender: news@news.stanford.edu
X-Mail-Path: smtp-roam.stanford.edu!rescomp-03-60149.Stanford.EDU!sumeets@stanford.edu
X-Original-Date: Mon, 19 Jan 2004 09:02:28 -0800
Xref: shelby.stanford.edu su.class.cs244a:5296

is there a preference for where the detailed comments for a function 
should appear? (the type that would explain the general information 
about the function, args, etc)

i.e. do they need to appear in both .h/.c files, or can we put them in 
just the .h file for clarity sake?

thanks,
sumeet
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: test script
Date: Mon, 19 Jan 2004 09:06:20 -0800
Lines: 11
Distribution: su
Message-ID: <buh2qd$lh1$1@news.Stanford.EDU>
References: <bug65e$omi$1@news.Stanford.EDU>
NNTP-Posting-Host: agila.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074531981 22049 128.12.194.74 (19 Jan 2004 17:06:21 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2
X-Accept-Language: en-us, en
In-Reply-To: <bug65e$omi$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5297


> Now I had a problem finding zero file so I changed my USER to my SUID and
> worked with transfer.stanford.edu
> I find that my zero byte file does get correctly transferred.ie it does get
> copied to the destination.Is it that we should not copy it?
> 

I think we're supposed to ignore files with 0 byte size.

Paul E.

.

Path: shelby.stanford.edu!elaine37.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Transfer 0 byte file test
Date: Mon, 19 Jan 2004 17:56:11 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <buh5nr$o93$1@news.Stanford.EDU>
References: <buf6el$laf$1@news.Stanford.EDU> <Pine.GSO.4.44.0401181820570.1429-100000@elaine3.Stanford.EDU>
NNTP-Posting-Host: elaine37.stanford.edu
X-Trace: news.Stanford.EDU 1074534971 24867 171.64.15.112 (19 Jan 2004 17:56:11 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5298


The script has to use a variety of different command line arguments to
test some of the special cases, e.g. absolute vs. relative paths,
port numbers specified, etc.  Needless to say, it can't distinguish failure
to handle some of those forms correctly vs. failure in logic elsewhere in
the code.

Be sure you've tested your code thoroughly at the command line with the
various options...
.

Path: shelby.stanford.edu!elaine37.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Maximum path length?
Date: Mon, 19 Jan 2004 18:02:32 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <buh63o$omc$1@news.Stanford.EDU>
References: <bufan7$p8e$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine37.stanford.edu
X-Trace: news.Stanford.EDU 1074535352 25292 171.64.15.112 (19 Jan 2004 18:02:32 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5299


>I was wondering if we could impose an arbitrary maximum size on the total
>file name length (path + name) of anything we are trying to create locally.

You can assume the regular PATH_MAX limit found in <limits.h>

.

Path: shelby.stanford.edu!elaine37.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Message from test_code.pl
Date: Mon, 19 Jan 2004 18:15:17 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <buh6rl$pfa$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401182324130.21889-100000@elaine22.Stanford.EDU>
NNTP-Posting-Host: elaine37.stanford.edu
X-Trace: news.Stanford.EDU 1074536117 26090 171.64.15.112 (19 Jan 2004 18:15:17 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5300



>I am receiving "Can't find a matching key for this test run." from
>test_code.pl  What does that mean?  Below is edited output from test_code.pl

It means you haven't tested this particular code before, and it will
count against your daily quota.  The process is explained a bit in
the grading script FAQ.

.

Path: shelby.stanford.edu!elaine37.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: parsing command line for server address
Date: Mon, 19 Jan 2004 18:27:45 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <buh7j1$q4h$1@news.Stanford.EDU>
References: <bug0bl$imr$1@news.Stanford.EDU> <400B8FEB.3000504@stanford.edu> <400BB0FF.AEB131E7@stanford.edu>
NNTP-Posting-Host: elaine37.stanford.edu
X-Trace: news.Stanford.EDU 1074536865 26769 171.64.15.112 (19 Jan 2004 18:27:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5301

>Can't we just skip the call to inet_addr and use gethostbyname
>directly? I've been doing that and found no problems so far.

I'm not sure if all systems support this--every example I can recall seeing
has used both inet_addr() and gethostbyname().  I've certainly read of
cases, e.g. with WinSock, where gethostbyname() has failed with a dotted
decimal address.

So for portability's sake, you should probably use both.

.

Path: shelby.stanford.edu!elaine37.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Commenting style question
Date: Mon, 19 Jan 2004 18:32:45 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <buh7sd$qgb$1@news.Stanford.EDU>
References: <400C0DA4.5070004@stanford.edu>
NNTP-Posting-Host: elaine37.stanford.edu
X-Trace: news.Stanford.EDU 1074537165 27147 171.64.15.112 (19 Jan 2004 18:32:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5302


>is there a preference for where the detailed comments for a function 
>should appear? (the type that would explain the general information 
>about the function, args, etc)

>i.e. do they need to appear in both .h/.c files, or can we put them in 
>just the .h file for clarity sake?

Just use your best judgment...
.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Long lines in the source code
Date: Mon, 19 Jan 2004 10:38:06 -0800
Lines: 16
Distribution: su
Message-ID: <400C240E.BA7F4047@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074537487 27437 127.0.0.1 (19 Jan 2004 18:38:07 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U)
X-Accept-Language: ko,en
Xref: shelby.stanford.edu su.class.cs244a:5303

The first discussion section document says:

Some more ways to lose points
- Make sure your lines are longer than 80 characters

Does this mean that the lines in the source codes should be
strictly shorter than 80 columns?

I understand the intent of trying to avoid very long lines in general,
but when I use a 8-column-wide tab for each indentation and somewhat
long names for identifiers (for more readability), moreover on a big
screen :), it's very easy to write lines longer than 80 columns and
I don't want to split those at arbitrary points each time.

-- 
Seungbeom Kim
.

Path: shelby.stanford.edu!elaine37.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: test script
Date: Mon, 19 Jan 2004 18:42:47 +0000 (UTC)
Lines: 34
Distribution: su
Message-ID: <buh8f7$r07$1@news.Stanford.EDU>
References: <bug65e$omi$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine37.stanford.edu
X-Trace: news.Stanford.EDU 1074537767 27655 171.64.15.112 (19 Jan 2004 18:42:47 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5304


>Now I had a problem finding zero file so I changed my USER to my SUID and
>worked with transfer.stanford.edu
>I find that my zero byte file does get correctly transferred.ie it does get
>copied to the destination.Is it that we should not copy it?

No, as the test says, you should copy it.  But the output also clearly
states that your program is timing out on execution, hence the failure.

Quite why this is the case, I can't say, but as mentioned elsewhere on
the newsgroup, there are a number of different ways of invoking ftpcopy--
different path styles, local port specified, etc.--some of which you're
likely handling incorrectly.  You should test this manually to verify that
the program parses the command-line arguments correctly.  (While I'm on
the subject of testing manually, I don't understand the comment above about
having a problem finding a zero byte file--surely these aren't difficult
to create?)

>Also I do create subdirectories while going down the tree, but if i find
>that correspondingly at the source it is empty, I delete it while going back
>to the root.

I would strongly encourage you to consider a more elegant approach--this
is a hack.

>So basically, I fail to understand why the above tests fail.
>Could you point me to a place where I could manually test for these cases?

Stressing your code is an important skill to develop--while you're coding,
you should be thinking of how you can test and debug the different control
paths found in your program.  At least 50% of your development time should
be spent on testing... the grading script should not be a crutch that
allows you to skip this most important aspect of coding!

.

Path: shelby.stanford.edu!elaine37.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Long lines in the source code
Date: Mon, 19 Jan 2004 18:49:20 +0000 (UTC)
Lines: 24
Distribution: su
Message-ID: <buh8rg$rat$1@news.Stanford.EDU>
References: <400C240E.BA7F4047@stanford.edu>
NNTP-Posting-Host: elaine37.stanford.edu
X-Trace: news.Stanford.EDU 1074538160 27997 171.64.15.112 (19 Jan 2004 18:49:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5305


>Does this mean that the lines in the source codes should be
>strictly shorter than 80 columns?

In general, they should be (as they would be in any normal project; this is
standard in corporate coding guidelines)--lines wrapping around make the
code very hard to read.  It's doubtful that we'd take off points for this
alone (although we haven't sat down to discuss precisely how we're grading
PA#1 yet), but this type of code tends to piss off the reader using a
regular 80-character wide terminal, which probably isn't a good idea, and
it would probably factor in when making an overall judgement about
ambigious concepts like "code style/design."  Basically, it just seems like
common sense.

>I understand the intent of trying to avoid very long lines in general,
>but when I use a 8-column-wide tab for each indentation and somewhat
>long names for identifiers (for more readability), moreover on a big
>screen :), it's very easy to write lines longer than 80 columns and
>I don't want to split those at arbitrary points each time.

I'd suggest the problem lies in the 8-column wide tabs. :-)
It's probably helpful to make sure your terminal window is just 80-chars
wide when coding to resist the temptation to keep going and going...

.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftp.slac.stanford.edu
Date: Mon, 19 Jan 2004 12:14:38 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.GSO.4.44.0401191211210.3651-100000@elaine0.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074543281 3489 171.64.15.119 (19 Jan 2004 20:14:41 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5306

I am having a problem with ftp.slac.stanford.edu

Whenever I do a LIST, i got the 150 code back and i can read all data
from the data connection. However, if i try to read the final confirmation
code from control connection, it hangs. Seems the slac server does not
send the final confirmation. And this is one of the test in the testing
script. Did I do something wrong, or how can I find why there is nothing
on the control connection?

Another question is how do I open a connection separately for LIST if I
want to test with Telnet? Thanks

Lin

.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Transfer 0 byte file test
Date: Mon, 19 Jan 2004 12:39:33 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.GSO.4.44.0401191212360.27999-100000@elaine5.Stanford.EDU>
References: <buf6el$laf$1@news.Stanford.EDU>
 <Pine.GSO.4.44.0401181820570.1429-100000@elaine3.Stanford.EDU>
 <buh5nr$o93$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine5.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074544776 5142 171.64.15.70 (19 Jan 2004 20:39:36 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
In-Reply-To: <buh5nr$o93$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5307


I am not sure about the problem of dealing with  absolute vs. relative
paths. When I issue the CWD command as following.

CWD  <SP> <pathname> <CRLF>

I got the 250 correct reponse in the case of either a correct
relative pathname or a correct absolute pathname. There seems to be no
extra logic need to be implemented. Am I missing something? Thanks.






On Mon, 19 Jan 2004, Matthew Jonathan Holliman wrote:

>
> The script has to use a variety of different command line arguments to
> test some of the special cases, e.g. absolute vs. relative paths,
> port numbers specified, etc.  Needless to say, it can't distinguish failure
> to handle some of those forms correctly vs. failure in logic elsewhere in
> the code.
>
> Be sure you've tested your code thoroughly at the command line with the
> various options...
>


.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Long lines in the source code
Date: Mon, 19 Jan 2004 12:48:39 -0800
Lines: 31
Distribution: su
Message-ID: <400C42A7.423B6110@stanford.edu>
References: <400C240E.BA7F4047@stanford.edu> <buh8rg$rat$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074545405 5766 127.0.0.1 (19 Jan 2004 20:50:05 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U)
X-Accept-Language: ko,en
Xref: shelby.stanford.edu su.class.cs244a:5308

Matthew Jonathan Holliman wrote:
> 
> >I understand the intent of trying to avoid very long lines in general,
> >but when I use a 8-column-wide tab for each indentation and somewhat
> >long names for identifiers (for more readability), moreover on a big
> >screen :), it's very easy to write lines longer than 80 columns and
> >I don't want to split those at arbitrary points each time.
> 
> I'd suggest the problem lies in the 8-column wide tabs. :-)

If I use a TAB character, you're going to count it as 8 columns, right?
Would you recommend that I should not use TAB characters and use spaces
instead (though it seems to me to be a personal style issue)?

> It's probably helpful to make sure your terminal window is just 80-chars
> wide when coding to resist the temptation to keep going and going...

Thanks for the advice. I just resized my terminal. :-)

By the way, what would you suggest I should do with this kind of long
lines?

> fprintf(stderr, "Usage: %s extension dir_levels [port@]host [local_dir] [remote_dir]\n", argv[0]);

All put in one line, with two levels of indentation, this line
originally went up to as far as 114 columns. This happens a lot
in my code with message printing.

-- 
Seungbeom Kim

.

Path: shelby.stanford.edu!not-for-mail
From: "Ursula Chen" <urse@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Long lines in the source code
Date: Mon, 19 Jan 2004 13:01:44 -0800
Lines: 22
Distribution: su
Message-ID: <buhgjr$6aj$1@news.Stanford.EDU>
References: <400C240E.BA7F4047@stanford.edu> <buh8rg$rat$1@news.Stanford.EDU> <400C42A7.423B6110@stanford.edu>
NNTP-Posting-Host: urse.stanford.edu
X-Trace: news.Stanford.EDU 1074546107 6483 128.12.185.104 (19 Jan 2004 21:01:47 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5309

You can separate it into two printf statements.

-Ursula

"Seungbeom Kim" <sbkim@stanford.edu> wrote in message
news:400C42A7.423B6110@stanford.edu...
(snip)
> By the way, what would you suggest I should do with this kind of long
> lines?
>
> > fprintf(stderr, "Usage: %s extension dir_levels [port@]host [local_dir]
[remote_dir]\n", argv[0]);
>
> All put in one line, with two levels of indentation, this line
> originally went up to as far as 114 columns. This happens a lot
> in my code with message printing.
>
> -- 
> Seungbeom Kim
>


.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Getting full hostname with gethostname()
Date: Mon, 19 Jan 2004 13:11:05 -0800
Lines: 5
Distribution: su
Message-ID: <400C47E9.FF65C850@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074546666 7192 127.0.0.1 (19 Jan 2004 21:11:06 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U)
X-Accept-Language: ko,en
Xref: shelby.stanford.edu su.class.cs244a:5310

Can I assume that gethostname() always returns the fully qualified name
of the host to be used for the anonymous ftp password?

-- 
Seungbeom Kim
.

Path: shelby.stanford.edu!elaine37.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ftp.slac.stanford.edu
Date: Mon, 19 Jan 2004 21:15:02 +0000 (UTC)
Lines: 23
Distribution: su
Message-ID: <buhhcm$76j$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401191211210.3651-100000@elaine0.Stanford.EDU>
NNTP-Posting-Host: elaine37.stanford.edu
X-Trace: news.Stanford.EDU 1074546902 7379 171.64.15.112 (19 Jan 2004 21:15:02 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5311


>Whenever I do a LIST, i got the 150 code back and i can read all data
>from the data connection. However, if i try to read the final confirmation
>code from control connection, it hangs. Seems the slac server does not
>send the final confirmation. And this is one of the test in the testing
>script. Did I do something wrong, or how can I find why there is nothing
>on the control connection?

Be sure to read through last year's newsgroup postings--ftp.slac.stanford.edu
frequently causes problems, and there are some good tips on debugging this
there.  Chances are good that someone else had encountered the exact
problem you describe (at least the symptoms sound identical), and posted
how to fix it.

>Another question is how do I open a connection separately for LIST if I
>want to test with Telnet? Thanks

Shankar had suggested in a previous thread (titled "LIST using telnet?")
using nc on the leland systems, but I haven't tried this myself.  If that
doesn't work for you, you could always just have a simple dummy socket
server program that listens on some random port, which you would then
specify in your PORT command.  This is probably just a few lines of perl.

.

Path: shelby.stanford.edu!elaine37.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Long lines in the source code
Date: Mon, 19 Jan 2004 21:18:13 +0000 (UTC)
Lines: 21
Distribution: su
Message-ID: <buhhil$7cn$1@news.Stanford.EDU>
References: <400C240E.BA7F4047@stanford.edu> <buh8rg$rat$1@news.Stanford.EDU> <400C42A7.423B6110@stanford.edu>
NNTP-Posting-Host: elaine37.stanford.edu
X-Trace: news.Stanford.EDU 1074547093 7575 171.64.15.112 (19 Jan 2004 21:18:13 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5312


>If I use a TAB character, you're going to count it as 8 columns, right?
>Would you recommend that I should not use TAB characters and use spaces
>instead (though it seems to me to be a personal style issue)?

It depends on whether we look at your code with 'more', which will assume
8 columns, or vi, where it's up to each individual (e.g. mine would be 4).
Yes, it's always better to use spaces for code that will be read by others--
but for those who prefer tabs, a compromise is to use 'indent' before it goes
out for public consumption. :-)

>By the way, what would you suggest I should do with this kind of long
>lines?

>> fprintf(stderr, "Usage: %s extension dir_levels [port@]host [local_dir] [remote_dir]\n", argv[0]);

fprintf(stderr,
        "Usage: %s xgdfgdfgdsfgdsfgdsfgdf"
        "dfgdfdfsgsdfgdsfgdfgd",
        argv[0]);

.

Path: shelby.stanford.edu!elaine37.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Getting full hostname with gethostname()
Date: Mon, 19 Jan 2004 21:23:13 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <buhhs1$7o0$1@news.Stanford.EDU>
References: <400C47E9.FF65C850@stanford.edu>
NNTP-Posting-Host: elaine37.stanford.edu
X-Trace: news.Stanford.EDU 1074547393 7936 171.64.15.112 (19 Jan 2004 21:23:13 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5313


>Can I assume that gethostname() always returns the fully qualified name
>of the host to be used for the anonymous ftp password?

That's fine.  You can also assume (per the assignment specification) that
the shell sets an environment variable HOST.
.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Can we use CDUP?
Date: Mon, 19 Jan 2004 14:42:17 -0800
Lines: 5
Distribution: su
Message-ID: <buhmgb$cra$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc409.stanford.edu
X-Trace: news.Stanford.EDU 1074552139 13162 128.12.196.9 (19 Jan 2004 22:42:19 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5314

I guess that says it all.

-Justin


.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: traceroute issues
Date: Mon, 19 Jan 2004 15:07:13 -0800
Lines: 82
Distribution: su
Message-ID: <buhnvp$eqd$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074553659 15181 127.0.0.1 (19 Jan 2004 23:07:39 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5315

I'm trying to access epic.stanford.edu and the video feeds from home and
work.  Every couple of minutes, my ssh terminal to epic.stanford.edu will
die or the video connection to (I think) cobb.stanford.edu will die for a
minute or so.  Obviously, this makes it difficult to do much work.

Since this seems relatively on-topic with the course material,   I'm
posting my traceroute output. Am I right that there's some router problem
between Level3.net and border-rtr.Stanford.EDU?   Interestingly, when I do a
traceroute from a machine on a different network to epic.stanford.edu, the
route seems to work fine.

Here's the bad traceroute (note the loss of packets between router 8 and
10):
Hostname                                %Loss  Rcv  Snt  Last Best  Avg
Worst
 1. corp7-primary.sanmateo.corp.akama.    0%   14   14     0    0    0
0
 2. 63.116.109.3                           0%   14   14     0    0    0
0
 3. 63.116.109.246                         0%   13   13     0    0    0
0
 4. se-4-0-6.hsa1.SanFrancisco1.Level3.    0%   13   13     1    1    1
2
 5. ge-6-0-0.mp1.SanFrancisco1.Level3.n    0%   13   13     2    2    2
2
 6. unknown.Level3.net                     0%   13   13     3    2    3
3
 7. ge-8-1.hsa1.SanJose1.Level3.net        0%   13   13     3    2    3
3
 8. CENIC.hsa1.Level3.net                  0%   13   13     3    3    3
3
 9. ???
10. border-rtr.Stanford.EDU               62%    5   13     5    4    4
5
11. bbr2-rtr.Stanford.EDU                 62%    5   13    11   11   12
13
12. sweet-rtr.Stanford.EDU                62%    5   13    11   11   18
38
13. epic26.Stanford.EDU                   62%    5   13    11   11   24
67

and here's the traceroute that works from a different machine:

Hostname                                %Loss  Rcv  Snt  Last Best  Avg
Worst
 1. 206.112.112.126                        0%   21   21     0    0    0
0
 2. 63.66.208.209                          0%   21   21     0    0    0
0
 3. 63.66.208.10                           0%   21   21     0    0    0
0
 4. 0.so-1-0-0.GW1.SJC2.ALTER.NET          0%   21   21     0    0    0
1
 5. 127.ATM5-0.XR1.SJC2.ALTER.NET          0%   21   21     0    0    0
1
 6. 0.so-1-0-0.XL1.SJC2.ALTER.NET          0%   20   20     1    0    1
1
 7. 0.so-3-0-0.XL1.SAC1.ALTER.NET          0%   20   20     4    4    4
4
 8. POS6-0.BR5.SAC1.ALTER.NET              0%   20   20     4    4    4
4
 9. 204.255.174.210                        0%   20   20     7    7    7
7
10. p6-2.core01.sjc01.atlas.cogentco.co    0%   20   20   133    8   24
208
11. p4-0.core01.sfo01.atlas.cogentco.co    0%   20   20     9    9    9
11
12. g7.ba21.b003123-1.sfo01.atlas.cogen    0%   20   20    10   10   10
10
13. Stanford_University2.demarc.cogentc    0%   20   20    10   10   10
10
14. bbr2-rtr.Stanford.EDU                  0%   20   20    12   11   16
89
15. sweet-rtr.Stanford.EDU                 0%   20   20    12   11   12
18
16. epic26.Stanford.EDU                    0%   20   20    15   11   13
18

By the way, I've sent email to SCPD tech support, and received no reply.
Does anyone know who could fix this if it's broken?


.

Path: shelby.stanford.edu!not-for-mail
From: Sumeet Shendrikar <sumeets@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Maximum path length?
Date: Mon, 19 Jan 2004 15:18:31 -0800
Lines: 16
Distribution: su
Message-ID: <buhoi1$ffq$1@news.Stanford.EDU>
References: <bufan7$p8e$1@news.Stanford.EDU> <buh63o$omc$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-64006.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074554241 15866 128.12.197.156 (19 Jan 2004 23:17:21 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4
X-Accept-Language: en-us, en
In-Reply-To: <buh63o$omc$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5316

has anyone had trouble using the PATH_MAX limit?

specifically, when i compile, i get 'PATH_MAX' undeclared.  i've 
included limits.h, so i can't figure out exactly what the problem is.

any help would be much appreciated.

sumeet

Matthew Jonathan Holliman wrote:
>>I was wondering if we could impose an arbitrary maximum size on the total
>>file name length (path + name) of anything we are trying to create locally.
> 
> 
> You can assume the regular PATH_MAX limit found in <limits.h>
> 
.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: generating .purify file
Date: Mon, 19 Jan 2004 15:31:11 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.GSO.4.44.0401191530090.6667-100000@elaine0.Stanford.EDU>
References: <400A04A6.DD09F0AB@stanford.edu> <budap0$r9r$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074555073 16854 171.64.15.119 (19 Jan 2004 23:31:13 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <budap0$r9r$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5317

So that means .purify is not something will affect our grades right? It is
simply a help file just like Makefile, right?

Thanks

Lin

On Sun, 18 Jan 2004, Matthew Jonathan Holliman wrote:

>
>
> >I was wondering how we generate the .purify file.  The assignment specs
> >says to look at the FAQs, but the FAQs only talk about the purify.output
> >file.  How do I generate the .purify file?  Thanks so much.
>
> The simplest one is an empty file, which you could create with 'touch .purify'.
> You can find some examples of things you might want to put in the file in
> the Purify FAQ on the class webpage.
>

.

Path: shelby.stanford.edu!not-for-mail
From: David Chan <dmchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp.slac.stanford.edu
Date: Mon, 19 Jan 2004 16:01:43 -0800
Lines: 32
Distribution: su
Message-ID: <buhr57$ihq$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401191211210.3651-100000@elaine0.Stanford.EDU>
NNTP-Posting-Host: sprun.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074556904 19002 128.12.57.21 (20 Jan 2004 00:01:44 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0401191211210.3651-100000@elaine0.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5318

I had this problem too. After using Ethereal to analyze the traffic 
between FTP client and FTP server using my program and the normal 'ftp' 
program, I discovered that the server is expecting you to close the 
connection before it'll return the final confirmation code.

I originally structured my code so that the port would be closed once 
the confirmation reply was given, but reversing them seems to work on 
all servers. That is, once you're done reading off of the data 
connection, close it, then the server will give you the confirmation reply.

By the way, the RFC states that the "sending host" is responsible for 
closing the data connection. In this case, SLAC is not abiding by that 
agreement.

Dave

Lin Chan wrote:

> I am having a problem with ftp.slac.stanford.edu
> 
> Whenever I do a LIST, i got the 150 code back and i can read all data
> from the data connection. However, if i try to read the final confirmation
> code from control connection, it hangs. Seems the slac server does not
> send the final confirmation. And this is one of the test in the testing
> script. Did I do something wrong, or how can I find why there is nothing
> on the control connection?
> 
> Another question is how do I open a connection separately for LIST if I
> want to test with Telnet? Thanks
> 
> Lin
> 
.

Path: shelby.stanford.edu!not-for-mail
From: David Chan <dmchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Can we use CDUP?
Date: Mon, 19 Jan 2004 16:02:36 -0800
Lines: 21
Distribution: su
Message-ID: <buhr6s$ihq$2@news.Stanford.EDU>
References: <buhmgb$cra$1@news.Stanford.EDU>
NNTP-Posting-Host: sprun.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074556956 19002 128.12.57.21 (20 Jan 2004 00:02:36 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4
X-Accept-Language: en-us, en
In-Reply-To: <buhmgb$cra$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5319

Quoth Shankar on 1/8:

--

For purposes of this assignment, you can use "CWD ..". (Strictly 
speaking, both CDUP and CWD are not required as part of the minimum 
implementation of an FTP server per the RFC, so a more robust solution 
will need to do without CWD/CDUP (perhaps by using full pathnames with 
RETR and LIST)

Shankar

--

Justin wrote:

> I guess that says it all.
> 
> -Justin
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: 1xx replies
Date: Mon, 19 Jan 2004 15:42:58 -0800
Lines: 10
Distribution: su
Message-ID: <buhrei$j0d$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074557202 19469 128.12.90.43 (20 Jan 2004 00:06:42 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5320

Out of the commands that we have to use in this project, both the initial
connection and the LIST and RETR commands can return a 1xx reply (according
to the RFC). But how are we supposed to tell between a 1xx reply that means
we should keep reading from the control connection for another reply and a
1xx reply that means we should start reading from the data connection?

Thanks,
Eddy


.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: directory-specific level number
Date: Mon, 19 Jan 2004 16:20:16 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.GSO.4.44.0401191618200.20709-100000@elaine3.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074558018 20697 171.64.15.68 (20 Jan 2004 00:20:18 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5321

Hi,

I just want to clarify one thing concering the copy of directories.
Suppose there is a non empty directory at the last level (i.e., the level
specified at the cmd line); it's non-empty but no files match the
extension, we should treat it as empty and do not copy it, right?


-Yuhui

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: traceroute issues
Date: Mon, 19 Jan 2004 16:20:27 -0800
Lines: 95
Distribution: su
Message-ID: <buhs8g$k7c$1@news.Stanford.EDU>
References: <buhnvp$eqd$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074558032 20716 128.12.90.43 (20 Jan 2004 00:20:32 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5322

Don't consider this an authoratative response by any means, but there are a
lot of connection problems on campus today, and I'm pretty sure that one of
the routers for outside connections is down. Stanford uses two main service
providers, level 3 and cogent, and from the looks of the traces you posted
it looks like the level3 connection is down.

-Eddy

"Joshua Silver" <jmsilver@stanford.edu> wrote in message
news:buhnvp$eqd$1@news.Stanford.EDU...
> I'm trying to access epic.stanford.edu and the video feeds from home and
> work.  Every couple of minutes, my ssh terminal to epic.stanford.edu will
> die or the video connection to (I think) cobb.stanford.edu will die for a
> minute or so.  Obviously, this makes it difficult to do much work.
>
> Since this seems relatively on-topic with the course material,   I'm
> posting my traceroute output. Am I right that there's some router problem
> between Level3.net and border-rtr.Stanford.EDU?   Interestingly, when I do
a
> traceroute from a machine on a different network to epic.stanford.edu, the
> route seems to work fine.
>
> Here's the bad traceroute (note the loss of packets between router 8 and
> 10):
> Hostname                                %Loss  Rcv  Snt  Last Best  Avg
> Worst
>  1. corp7-primary.sanmateo.corp.akama.    0%   14   14     0    0    0
> 0
>  2. 63.116.109.3                           0%   14   14     0    0    0
> 0
>  3. 63.116.109.246                         0%   13   13     0    0    0
> 0
>  4. se-4-0-6.hsa1.SanFrancisco1.Level3.    0%   13   13     1    1    1
> 2
>  5. ge-6-0-0.mp1.SanFrancisco1.Level3.n    0%   13   13     2    2    2
> 2
>  6. unknown.Level3.net                     0%   13   13     3    2    3
> 3
>  7. ge-8-1.hsa1.SanJose1.Level3.net        0%   13   13     3    2    3
> 3
>  8. CENIC.hsa1.Level3.net                  0%   13   13     3    3    3
> 3
>  9. ???
> 10. border-rtr.Stanford.EDU               62%    5   13     5    4    4
> 5
> 11. bbr2-rtr.Stanford.EDU                 62%    5   13    11   11   12
> 13
> 12. sweet-rtr.Stanford.EDU                62%    5   13    11   11   18
> 38
> 13. epic26.Stanford.EDU                   62%    5   13    11   11   24
> 67
>
> and here's the traceroute that works from a different machine:
>
> Hostname                                %Loss  Rcv  Snt  Last Best  Avg
> Worst
>  1. 206.112.112.126                        0%   21   21     0    0    0
> 0
>  2. 63.66.208.209                          0%   21   21     0    0    0
> 0
>  3. 63.66.208.10                           0%   21   21     0    0    0
> 0
>  4. 0.so-1-0-0.GW1.SJC2.ALTER.NET          0%   21   21     0    0    0
> 1
>  5. 127.ATM5-0.XR1.SJC2.ALTER.NET          0%   21   21     0    0    0
> 1
>  6. 0.so-1-0-0.XL1.SJC2.ALTER.NET          0%   20   20     1    0    1
> 1
>  7. 0.so-3-0-0.XL1.SAC1.ALTER.NET          0%   20   20     4    4    4
> 4
>  8. POS6-0.BR5.SAC1.ALTER.NET              0%   20   20     4    4    4
> 4
>  9. 204.255.174.210                        0%   20   20     7    7    7
> 7
> 10. p6-2.core01.sjc01.atlas.cogentco.co    0%   20   20   133    8   24
> 208
> 11. p4-0.core01.sfo01.atlas.cogentco.co    0%   20   20     9    9    9
> 11
> 12. g7.ba21.b003123-1.sfo01.atlas.cogen    0%   20   20    10   10   10
> 10
> 13. Stanford_University2.demarc.cogentc    0%   20   20    10   10   10
> 10
> 14. bbr2-rtr.Stanford.EDU                  0%   20   20    12   11   16
> 89
> 15. sweet-rtr.Stanford.EDU                 0%   20   20    12   11   12
> 18
> 16. epic26.Stanford.EDU                    0%   20   20    15   11   13
> 18
>
> By the way, I've sent email to SCPD tech support, and received no reply.
> Does anyone know who could fix this if it's broken?
>
>


.

Path: shelby.stanford.edu!saga20.Stanford.EDU!mylesw
From: mylesw@Stanford.EDU (Myles Barrett Williams)
Newsgroups: su.class.cs244a
Subject: Directory listing is incomplete
Date: Tue, 20 Jan 2004 00:23:22 +0000 (UTC)
Organization: Stanford University, CA 94305, USA
Lines: 19
Distribution: su
Message-ID: <buhsdq$kcp$1@news.Stanford.EDU>
NNTP-Posting-Host: saga20.stanford.edu
X-Trace: news.Stanford.EDU 1074558202 20889 171.64.15.150 (20 Jan 2004 00:23:22 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5323

On some servers I see the directory listing cut off before it is
finished.

On ftp.stanford.edu, the read() command returns normally and the
server replies with 226. The directory that fails varies, but the
cutoff point is always 2920 bytes. The command is
ftpcopy cc 8 ftp.stanford.edu . pub/class/cs140

On ftp.kernel.org, the read() command returns normally and the server
replies with 451. The failure is always 70 bytes into the first
directory listing. The command here is
ftpcopy bz2 8 ftp.kernel.org . pub/linux/kernel/v2.5

This is what happens when I run the program by itself. When I run it
in gdb and break before every data read (i.e. slow down the transfer),
the directory comes through reliably but file retrieval cuts off. What
gives?

Myles
.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Inaccessible file
Date: Mon, 19 Jan 2004 17:16:12 -0800
Lines: 13
Distribution: su
Message-ID: <buhv9n$nvm$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1074561143 24566 128.12.189.163 (20 Jan 2004 01:12:23 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5324

Hi,
I'm trying to test my program for an inaccessible file.
I'm testing it with ftpd daemon.
The problem is that my PORT command is successful but then I do not get back
a 5xx error saying that the file is inaccessible.
the program just keeps on waiting for an reply.
Other servers give back a 5xx error response because of which I can ignore
that file.
But how to do it with the ftpd daemon without an error message?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!elaine13.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: traceroute issues
Date: Tue, 20 Jan 2004 01:13:06 +0000 (UTC)
Lines: 20
Distribution: su
Message-ID: <buhvb2$o1j$1@news.Stanford.EDU>
References: <buhnvp$eqd$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine13.stanford.edu
X-Trace: news.Stanford.EDU 1074561186 24627 171.64.15.78 (20 Jan 2004 01:13:06 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5325


>Since this seems relatively on-topic with the course material,   I'm
>posting my traceroute output. Am I right that there's some router problem
>between Level3.net and border-rtr.Stanford.EDU?   Interestingly, when I do a
>traceroute from a machine on a different network to epic.stanford.edu, the
>route seems to work fine.

I've had no problems connecting from Intel today (telnetting to the
cleartext gateway).

>By the way, I've sent email to SCPD tech support, and received no reply.
>Does anyone know who could fix this if it's broken?

Probably none of us. :-)

You might try submitting a HelpSU request
(http://www.stanford.edu/dept/itss/services/helpsu/index.html)--I'm
not sure if these are the right folks to contact either, but they
might be more responsive than SCPD.

.

Path: shelby.stanford.edu!elaine13.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: generating .purify file
Date: Tue, 20 Jan 2004 01:14:28 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <buhvdk$o41$1@news.Stanford.EDU>
References: <400A04A6.DD09F0AB@stanford.edu> <budap0$r9r$1@news.Stanford.EDU> <Pine.GSO.4.44.0401191530090.6667-100000@elaine0.Stanford.EDU>
NNTP-Posting-Host: elaine13.stanford.edu
X-Trace: news.Stanford.EDU 1074561268 24705 171.64.15.78 (20 Jan 2004 01:14:28 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5326


>So that means .purify is not something will affect our grades right? It is
>simply a help file just like Makefile, right?

Yes, that's right (*except* if you have bogus suppression statements in
there).  An empty file is perfectly fine.

.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Creating empty subdirectories
Date: Mon, 19 Jan 2004 17:14:25 -0800
Lines: 22
Distribution: su
Message-ID: <400C80F1.97247BCC@stanford.edu>
References: <bug65e$omi$1@news.Stanford.EDU> <buh8f7$r07$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074561300 24743 127.0.0.1 (20 Jan 2004 01:15:00 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U)
X-Accept-Language: ko,en
Xref: shelby.stanford.edu su.class.cs244a:5327

Matthew Jonathan Holliman wrote:
> 
> >Also I do create subdirectories while going down the tree, but if i find
> >that correspondingly at the source it is empty, I delete it while going back
> >to the root.
> 
> I would strongly encourage you to consider a more elegant approach--this
> is a hack.

Another post from Martin Casado says:
<news:Pine.LNX.4.44.0401190038090.18829-100000@Xenon.Stanford.EDU>
(Subject: Re: HW#1: Creation of "Empty" Sub-directories)

"Creating and then removing the directory is fine."

So, which am I expected to follow?
Of course, trying not to make unnecessary subdirectories requires more
work in the code than just making one and deleting it when unnecessary.

-- 
Seungbeom Kim

.

Path: shelby.stanford.edu!elaine13.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: 1xx replies
Date: Tue, 20 Jan 2004 01:18:26 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <buhvl2$odq$1@news.Stanford.EDU>
References: <buhrei$j0d$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine13.stanford.edu
X-Trace: news.Stanford.EDU 1074561506 25018 171.64.15.78 (20 Jan 2004 01:18:26 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5328


>Out of the commands that we have to use in this project, both the initial
>connection and the LIST and RETR commands can return a 1xx reply (according
>to the RFC). But how are we supposed to tell between a 1xx reply that means
>we should keep reading from the control connection for another reply and a
>1xx reply that means we should start reading from the data connection?

In all the cases you mention, you know whether you have to read again
or not... e.g. you know you won't be reading from the data connection when
you first contact the server.  Could you clarify where the ambiguity lies?
.

Path: shelby.stanford.edu!elaine13.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: directory-specific level number
Date: Tue, 20 Jan 2004 01:19:49 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <buhvnl$ogo$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401191618200.20709-100000@elaine3.Stanford.EDU>
NNTP-Posting-Host: elaine13.stanford.edu
X-Trace: news.Stanford.EDU 1074561589 25112 171.64.15.78 (20 Jan 2004 01:19:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5329



>I just want to clarify one thing concering the copy of directories.
>Suppose there is a non empty directory at the last level (i.e., the level
>specified at the cmd line); it's non-empty but no files match the
>extension, we should treat it as empty and do not copy it, right?

Correct.  The example on the webpage, and in the discussion section slides,
should make this clear.
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Creating empty subdirectories
Date: Mon, 19 Jan 2004 17:25:14 -0800
Lines: 31
Distribution: su
Message-ID: <Pine.LNX.4.44.0401191716280.31694-100000@Xenon.Stanford.EDU>
References: <bug65e$omi$1@news.Stanford.EDU> <buh8f7$r07$1@news.Stanford.EDU>
 <400C80F1.97247BCC@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074561915 25554 171.64.66.201 (20 Jan 2004 01:25:15 GMT)
X-Complaints-To: news@news.stanford.edu
To: Seungbeom Kim <sbkim@stanford.edu>
In-Reply-To: <400C80F1.97247BCC@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5330


 Actually Matt makes a good point here, creating and deleting directories
 unecessarily isn't a very elegant approach.  I based my response on one our
 functional example implementations which isn't a paragon of style and design
 (sorry about that).  That said, given this discussion and Matt's response, you
 are best to not create directories needlessly.

 .m


> Matthew Jonathan Holliman wrote:
> > 
> > >Also I do create subdirectories while going down the tree, but if i find
> > >that correspondingly at the source it is empty, I delete it while going back
> > >to the root.
> > 
> > I would strongly encourage you to consider a more elegant approach--this
> > is a hack.
> 
> Another post from Martin Casado says:
> <news:Pine.LNX.4.44.0401190038090.18829-100000@Xenon.Stanford.EDU>
> (Subject: Re: HW#1: Creation of "Empty" Sub-directories)
> 
> "Creating and then removing the directory is fine."
> 
> So, which am I expected to follow?
> Of course, trying not to make unnecessary subdirectories requires more
> work in the code than just making one and deleting it when unnecessary.
> 
> 

.

Path: shelby.stanford.edu!elaine13.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Directory listing is incomplete
Date: Tue, 20 Jan 2004 01:27:41 +0000 (UTC)
Lines: 37
Distribution: su
Message-ID: <bui06d$p2c$1@news.Stanford.EDU>
References: <buhsdq$kcp$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine13.stanford.edu
X-Trace: news.Stanford.EDU 1074562061 25676 171.64.15.78 (20 Jan 2004 01:27:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5331


>On some servers I see the directory listing cut off before it is
>finished.

>On ftp.stanford.edu, the read() command returns normally and the
>server replies with 226. The directory that fails varies, but the
>cutoff point is always 2920 bytes. The command is
>ftpcopy cc 8 ftp.stanford.edu . pub/class/cs140

>On ftp.kernel.org, the read() command returns normally and the server
>replies with 451. The failure is always 70 bytes into the first
>directory listing. The command here is
>ftpcopy bz2 8 ftp.kernel.org . pub/linux/kernel/v2.5

>This is what happens when I run the program by itself. When I run it
>in gdb and break before every data read (i.e. slow down the transfer),
>the directory comes through reliably but file retrieval cuts off. What
>gives?

I don't think there's enough information in your post to hazard more than
a guess at what the problem might be.  Are you looping around on read()
until you've read everything you expected, or are you making assumptions
about how much data it will return?  Someone had posted earlier on here
with a similar problem in LIST output, where it appeared truncated on
directories with lots of files...

The race condition seems strange assuming you're using blocking I/O...
I presume you don't close the data connection socket until after read()
returns zero bytes... the main thing I'd suggest would be to run your
own ftpd and see if you can figure out with that what's going on (the
451 from the server seems quite mysterious).  If you still have no luck
with that, if you mail your TA a snippet of code, or bring it by office
hours, we can try and take a look and see if there's anything glaringly
obvious to us.

P.S. I haven't tried ftp.kernel.org, but ftp.stanford.edu has worked
for people before.
.

Path: shelby.stanford.edu!elaine13.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Inaccessible file
Date: Tue, 20 Jan 2004 01:32:06 +0000 (UTC)
Lines: 29
Distribution: su
Message-ID: <bui0em$pfi$1@news.Stanford.EDU>
References: <buhv9n$nvm$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine13.stanford.edu
X-Trace: news.Stanford.EDU 1074562326 26098 171.64.15.78 (20 Jan 2004 01:32:06 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5332


>I'm trying to test my program for an inaccessible file.
>I'm testing it with ftpd daemon.
>The problem is that my PORT command is successful but then I do not get back
>a 5xx error saying that the file is inaccessible.
>the program just keeps on waiting for an reply.
>Other servers give back a 5xx error response because of which I can ignore
>that file.

I get the usual 550 from the provided ftpd, and running it in passive mode
shows the same thing:

% telnet elaine13 55573
Trying 171.64.15.78...
Connected to elaine13.Stanford.EDU (171.64.15.78).
Escape character is '^]'.
220 elaine13.Stanford.EDU FTP server (Version 2.0WU(44) Fri Jan 14 13:36:13 PST
2000) ready.
USER anonymous
331 Guest login ok, send your complete e-mail address as password.
PASS foo
230 Guest login ok, access restrictions apply.
PASV
227 Entering Passive Mode (171,64,15,78,217,23)
RETR inaccessible_file.ext
550 inaccessible_file.ext: Permission denied.
QUIT
221 Goodbye.

.

Path: shelby.stanford.edu!elaine13.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Maximum path length?
Date: Tue, 20 Jan 2004 01:39:51 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <bui0t7$ptq$1@news.Stanford.EDU>
References: <bufan7$p8e$1@news.Stanford.EDU> <buh63o$omc$1@news.Stanford.EDU> <buhoi1$ffq$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine13.stanford.edu
X-Trace: news.Stanford.EDU 1074562791 26554 171.64.15.78 (20 Jan 2004 01:39:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5333


>has anyone had trouble using the PATH_MAX limit?

If you use '-ansi', you probably fall victim to some of the preprocessor
hackery that permeates the system headers.  Assuming you continue using
this flag, you can add something like '-D__EXTENSIONS__' to your CFLAGS.

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: 1xx replies
Date: Mon, 19 Jan 2004 17:53:21 -0800
Lines: 21
Distribution: su
Message-ID: <bui1mm$qmq$1@news.Stanford.EDU>
References: <buhrei$j0d$1@news.Stanford.EDU> <buhvl2$odq$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074563606 27354 128.12.90.43 (20 Jan 2004 01:53:26 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5334

I guess that was badly worded.. so if we get a 1xx reply from LIST or RETR
we should just assume that it means to check the data connection, and ignore
the possibility of any other meanings?

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:buhvl2$odq$1@news.Stanford.EDU...
>
> >Out of the commands that we have to use in this project, both the initial
> >connection and the LIST and RETR commands can return a 1xx reply
(according
> >to the RFC). But how are we supposed to tell between a 1xx reply that
means
> >we should keep reading from the control connection for another reply and
a
> >1xx reply that means we should start reading from the data connection?
>
> In all the cases you mention, you know whether you have to read again
> or not... e.g. you know you won't be reading from the data connection when
> you first contact the server.  Could you clarify where the ambiguity lies?


.

Path: shelby.stanford.edu!elaine13.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: 1xx replies
Date: Tue, 20 Jan 2004 01:56:34 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <bui1si$qs5$1@news.Stanford.EDU>
References: <buhrei$j0d$1@news.Stanford.EDU> <buhvl2$odq$1@news.Stanford.EDU> <bui1mm$qmq$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine13.stanford.edu
X-Trace: news.Stanford.EDU 1074563794 27525 171.64.15.78 (20 Jan 2004 01:56:34 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5335


>I guess that was badly worded.. so if we get a 1xx reply from LIST or RETR
>we should just assume that it means to check the data connection, and ignore
>the possibility of any other meanings?

Yep, that's all that response is used for.

.

Path: shelby.stanford.edu!not-for-mail
From: "Mike Hsieh" <mhsieh33@hotmail.com>
Newsgroups: su.class.cs244a
Subject: gethostbyname bus error
Date: Mon, 19 Jan 2004 18:30:44 -0800
Lines: 13
Distribution: su
Message-ID: <bui3sl$t84$1@news.Stanford.EDU>
NNTP-Posting-Host: red33.stanford.edu
X-Trace: news.Stanford.EDU 1074565845 29956 128.12.59.103 (20 Jan 2004 02:30:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5336

Hello,

I'm getting a strange bus error on the second time that i call

gethostbyname(getenv("HOST"));

the first time i set up a data connection and use this call it works fine,
but the second time results in a bus error.  Any ideas why?

Thanks,
Mike


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: gethostbyname bus error
Date: Mon, 19 Jan 2004 18:54:02 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.LNX.4.44.0401191848510.21985-100000@Xenon.Stanford.EDU>
References: <bui3sl$t84$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074567244 1683 171.64.66.201 (20 Jan 2004 02:54:04 GMT)
X-Complaints-To: news@news.stanford.edu
To: Mike Hsieh <mhsieh33@hotmail.com>
In-Reply-To: <bui3sl$t84$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5337


 I'm not sure exactly why you are getting a bus error on multiple calls
 however ...

 - as a general rule you should try and do as much error checking as
   possible.  getenv(..) may return a NULL on error.  Your program should
   check the return value before handing it off to gethostbyname(..)
 - is it really necessary to call that cascade of functions for every
   data connection?  This seems a bit unnecessary since the value from the
   previous call will not have changed.

   just some thoughts,
     .mc -= $.02

> Hello,
> 
> I'm getting a strange bus error on the second time that i call
> 
> gethostbyname(getenv("HOST"));
> 
> the first time i set up a data connection and use this call it works fine,
> but the second time results in a bus error.  Any ideas why?
> 
> Thanks,
> Mike
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Myles" <a@b.c>
Newsgroups: su.class.cs244a
Subject: Testing script problem
Date: Mon, 19 Jan 2004 19:10:22 -0800
Lines: 31
Distribution: su
Message-ID: <bui5u1$2cf$1@news.Stanford.EDU>
NNTP-Posting-Host: gazpacho.stanford.edu
X-Trace: news.Stanford.EDU 1074567937 2447 128.12.178.70 (20 Jan 2004 03:05:37 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
Xref: shelby.stanford.edu su.class.cs244a:5338


I'm not able to run the testing script. I get a prompt that I don't expect,
and when I answer 'y' the script aborts.

Myles

--
Starting...
Test B, new source tree required, extracting into grading_src/build...
..purify
Makefile
ftp.c
ftp.h
ftpcopy.c
ftpparse.c
ftpparse.h
purify.output

Can't find a matching key for this test run.
Would you like to generate a new one?  (y/n):  y
Daily quota of 3 test attempts applies (from Jan 19 onwards).
/usr/pubsw/bin/find: /afs/ir/class/cs244a/grading_script/student/mylesw: No
such file or directory
count test attempts failed!
You've used 0 test attempt(s) so far today.
Test record directory /afs/ir/class/cs244a/grading_script/student/mylesw
does not exist!
couldn't submit code for testing
>


.

Path: shelby.stanford.edu!elaine13.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Testing script problem
Date: Tue, 20 Jan 2004 03:18:22 +0000 (UTC)
Lines: 37
Distribution: su
Message-ID: <bui6lu$35u$1@news.Stanford.EDU>
References: <bui5u1$2cf$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine13.stanford.edu
X-Trace: news.Stanford.EDU 1074568702 3262 171.64.15.78 (20 Jan 2004 03:18:22 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5339


>I'm not able to run the testing script. I get a prompt that I don't expect,
>and when I answer 'y' the script aborts.

The prompt is perfectly normal, and is mentioned in the FAQ--as is the
other "problem."  I've just synchronised the grading script directory with
the TA assignment results again, so you should be good to go now.

(I stop running the synchronisation script after the first week or two of
classes, figuring people will have assigned themselves a TA by then...)


>--
>Starting...
>Test B, new source tree required, extracting into grading_src/build...
>.purify
>Makefile
>ftp.c
>ftp.h
>ftpcopy.c
>ftpparse.c
>ftpparse.h
>purify.output

>Can't find a matching key for this test run.
>Would you like to generate a new one?  (y/n):  y
>Daily quota of 3 test attempts applies (from Jan 19 onwards).
>/usr/pubsw/bin/find: /afs/ir/class/cs244a/grading_script/student/mylesw: No
>such file or directory
>count test attempts failed!
>You've used 0 test attempt(s) so far today.
>Test record directory /afs/ir/class/cs244a/grading_script/student/mylesw
>does not exist!
>couldn't submit code for testing
>>


.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: limits.h
Date: Mon, 19 Jan 2004 19:49:58 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0401191949010.16655-100000@elaine1.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074570599 5260 171.64.15.66 (20 Jan 2004 03:49:59 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5340

What was the compile flag to add MAX_PATH
definition from limits.h?

Thanks.
Boris.

P.S. I saw the post earlier, deleted it, and now suffer :-(.

.

Path: shelby.stanford.edu!elaine13.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: limits.h
Date: Tue, 20 Jan 2004 03:53:46 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <bui8oa$5fp$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401191949010.16655-100000@elaine1.Stanford.EDU>
NNTP-Posting-Host: elaine13.stanford.edu
X-Trace: news.Stanford.EDU 1074570826 5625 171.64.15.78 (20 Jan 2004 03:53:46 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5341


>What was the compile flag to add MAX_PATH
>definition from limits.h?

-D__EXTENSIONS__

(There's probably a better, more portable way of doing this, but I don't
remember what it is...)
.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: INADDR_ANY
Date: Mon, 19 Jan 2004 20:46:38 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.GSO.4.44.0401192041230.8558-100000@elaine5.Stanford.EDU>
NNTP-Posting-Host: elaine5.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074573999 9869 171.64.15.70 (20 Jan 2004 04:46:39 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5342


Hi,

The RFC spcifies the format:

PORT h1,h2,h3,h4,p1,p2
where h1 is the high order 8 bits of the internet host address.

I wonder whether the "internet host address" means INADDR_ANY? or the
network format i.e. htonl(INADDR_ANY).

Also, where is INADDR_ANY defined, how I suppose to know the type of
INADDR_ANY if I want to save it to some variable in order to convert it
into this crazy format above?

thanks.



.

Path: shelby.stanford.edu!not-for-mail
From: John Cieslewicz <jciesle@stanford.edu>
Newsgroups: su.class.cs244a
Subject: case sensitive file extensions & closing connections on error
Date: Mon, 19 Jan 2004 21:09:30 -0800
Organization: Stanford University
Lines: 9
Distribution: su
Message-ID: <pan.2004.01.20.05.09.29.549685@stanford.edu>
NNTP-Posting-Host: pithos.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1074575370 11223 128.12.89.245 (20 Jan 2004 05:09:30 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Xref: shelby.stanford.edu su.class.cs244a:5343

I'm not sure if this has been answered yet...

1. Should we assume file extensions are case sensitive or should we
download all files that match regardless of case?

2. Is it necessary to close our open sockets when terminating on an error?

Thanks,
John
.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftp.microsoft.com
Date: Mon, 19 Jan 2004 21:32:45 -0800
Lines: 13
Distribution: su
Message-ID: <buiei1$cbn$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc409.stanford.edu
X-Trace: news.Stanford.EDU 1074576769 12663 128.12.196.9 (20 Jan 2004 05:32:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5344

appears to not respond if you try to connect to the data connection it
establishes with PASV (i.e. my program just hangs).

I tried wsftp, and it first tried PASV, timed out, then tried PORT and
succeded.  Because of that I am pretty there is not a problem with my code.
Is this behavior acceptable, since we are allowed to use either PORT or
PASV?

Thanks,

Justin


.

Path: shelby.stanford.edu!elaine22.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: INADDR_ANY
Date: Tue, 20 Jan 2004 06:05:04 +0000 (UTC)
Lines: 23
Distribution: su
Message-ID: <buigeg$e9u$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401192041230.8558-100000@elaine5.Stanford.EDU>
NNTP-Posting-Host: elaine22.stanford.edu
X-Trace: news.Stanford.EDU 1074578704 14654 171.64.15.87 (20 Jan 2004 06:05:04 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5345


Maybe I'm misinterpreting your question...
Specifying INADDR_ANY in bind() just says to the kernel that you'll accept
incoming connections on any valid IP address for the local host.  The
constant itself is probably just all zeros, i.e. it can't be a valid IP
address, and would have no significance to any other host.

You have to specify a valid IP address in the PORT command... there are
a number of ways of obtaining this, which have been described previously
on the newsgroup.

>The RFC spcifies the format:

>PORT h1,h2,h3,h4,p1,p2
>where h1 is the high order 8 bits of the internet host address.

>I wonder whether the "internet host address" means INADDR_ANY? or the
>network format i.e. htonl(INADDR_ANY).

>Also, where is INADDR_ANY defined, how I suppose to know the type of
>INADDR_ANY if I want to save it to some variable in order to convert it
>into this crazy format above?

.

Path: shelby.stanford.edu!elaine22.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: case sensitive file extensions & closing connections on error
Date: Tue, 20 Jan 2004 06:06:49 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <buighp$ede$1@news.Stanford.EDU>
References: <pan.2004.01.20.05.09.29.549685@stanford.edu>
NNTP-Posting-Host: elaine22.stanford.edu
X-Trace: news.Stanford.EDU 1074578809 14766 171.64.15.87 (20 Jan 2004 06:06:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5346


>1. Should we assume file extensions are case sensitive or should we
>download all files that match regardless of case?

Yep, they're case-sensitive.

>2. Is it necessary to close our open sockets when terminating on an error?

It's not strictly necessary, but it's a good practice.  We don't check this
when grading (we *do* check on normal termination, of course), but it's a
bit unfriendly to leave the other side of the connection open.  You may as
well close the sockets and let the other side shut down gracefully...

.

Path: shelby.stanford.edu!elaine22.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ftp.microsoft.com
Date: Tue, 20 Jan 2004 06:09:34 +0000 (UTC)
Lines: 16
Distribution: su
Message-ID: <buigmu$el4$1@news.Stanford.EDU>
References: <buiei1$cbn$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine22.stanford.edu
X-Trace: news.Stanford.EDU 1074578974 15012 171.64.15.87 (20 Jan 2004 06:09:34 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5347


>appears to not respond if you try to connect to the data connection it
>establishes with PASV (i.e. my program just hangs).

>I tried wsftp, and it first tried PASV, timed out, then tried PORT and
>succeded.  Because of that I am pretty there is not a problem with my code.
>Is this behavior acceptable, since we are allowed to use either PORT or
>PASV?

I'll have to ask Martin to confirm, since he used PASV in his solution,
but I'd imagine so.  Thanks for letting us know--we won't test on
Microsoft's server :-)

P.S. ftp.microsoft.com is kind of finicky at the best of times--it often
blocks accesses from particular machines if you run ftpcopy too often, too
quickly...
.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Same with me here
Date: Tue, 20 Jan 2004 06:26:52 +0000 (UTC)
Lines: 4
Distribution: su
Message-ID: <buihnc$hed$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine16.stanford.edu
X-Trace: news.Stanford.EDU 1074580012 17869 171.64.15.81 (20 Jan 2004 06:26:52 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5348

Just to let you know you are not alone. Same with me on 
ftp.microsoft.com's data connection issue here.

Jason
.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: test script attempt
Date: Mon, 19 Jan 2004 23:38:03 -0800
Lines: 12
Distribution: su
Message-ID: <buillr$m84$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1074584059 22788 128.12.189.163 (20 Jan 2004 07:34:19 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5349

Hi,
I was using up my last attempt to run tests when i got the error saying
"couldn't submit code for testing"
and the test script exited.
I tried running my program again without changes but then it again asked for
a key-
when i said yes , it said that I had exceeded my quota.
I just ran the test twice, not thrice today.
Please help,
Haripriya


.

Path: shelby.stanford.edu!elaine30.Stanford.EDU!casado
From: Martin Casado <casado@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp.microsoft.com
Date: Mon, 19 Jan 2004 23:45:40 -0800
Lines: 25
Distribution: su
Message-ID: <Pine.GSO.4.44.0401192343380.21068-100000@elaine30.Stanford.EDU>
References: <buiei1$cbn$1@news.Stanford.EDU> <buigmu$el4$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine30.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074584746 23463 171.64.15.105 (20 Jan 2004 07:45:46 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <buigmu$el4$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5350


 I'm getting the same behavior ... cannot connect to the advertised
 PASV socket, but PORT is working OK.  Dropping microsoft from the
 testing suite is probably a good idea.

 .m

>
> >appears to not respond if you try to connect to the data connection it
> >establishes with PASV (i.e. my program just hangs).
>
> >I tried wsftp, and it first tried PASV, timed out, then tried PORT and
> >succeded.  Because of that I am pretty there is not a problem with my code.
> >Is this behavior acceptable, since we are allowed to use either PORT or
> >PASV?
>
> I'll have to ask Martin to confirm, since he used PASV in his solution,
> but I'd imagine so.  Thanks for letting us know--we won't test on
> Microsoft's server :-)
>
> P.S. ftp.microsoft.com is kind of finicky at the best of times--it often
> blocks accesses from particular machines if you run ftpcopy too often, too
> quickly...
>

.

Path: shelby.stanford.edu!elaine18.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: What should be done if ftpcopy fails to create directory on the
 local host?
Date: Tue, 20 Jan 2004 00:49:50 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.GSO.4.44.0401200048060.11036-100000@elaine18.Stanford.EDU>
NNTP-Posting-Host: elaine18.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074588593 28287 171.64.15.83 (20 Jan 2004 08:49:53 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5351


What should be done if ftpcopy fails to create directory on the local
host?

(1) terminate the program and printout error, or
(2) silently go the next entry in the list and continue.

-Laura

.

Path: shelby.stanford.edu!elaine30.Stanford.EDU!zavislak
From: Mark Zavislak <zavislak@elaine30.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: pthreads on elaine
Date: Tue, 20 Jan 2004 00:50:59 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.GSO.4.44.0401200047180.23541-100000@elaine30.Stanford.EDU>
NNTP-Posting-Host: elaine30.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074588661 28459 171.64.15.105 (20 Jan 2004 08:51:01 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5352

Hi,

I've been having trouble using pthreads at sweet hall.  I try to do a
pthread_create() but it always fails with an unknown error.  On my OS X
10.3 powerbook, though, the code works perfectly fine.  This is annoying
because I can't use purify on the running, threaded code.  Does anyone
know what's up?  Can we use pthreads at the sweet hall cluster?

This is what is failing me (returning non-zero):

pthread_create(&entry->tid, NULL, sr_arpdaemon, args)

Thanks!
-Mark

.

Path: shelby.stanford.edu!not-for-mail
From: Dan Wendlandt <danwent@stanford.edu>
Newsgroups: su.class.cs244a
Subject: no data transfered after LIST on ftp.slac.stanford.edu
Date: Tue, 20 Jan 2004 01:05:15 -0800
Organization: Soto House
Lines: 35
Distribution: su
Message-ID: <buir3h$ss6$1@news.Stanford.EDU>
Reply-To: danwent@stanford.edu
NNTP-Posting-Host: hollander.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
X-Trace: news.Stanford.EDU 1074589617 29574 128.12.45.20 (20 Jan 2004 09:06:57 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: KNode/0.7.2
Xref: shelby.stanford.edu su.class.cs244a:5353

ok, I'm at a loss on this one, so I thought I'd throw it out to the
newsgroup.

This never happens while testing with wu-ftpd, but I have noticed it on
ftp.slac.stanford.edu .  If I issue a simply "LIST" command, the server
returns the correct result, but if I send "LIST <path>", the server
connects but sends no data to my client.  The socket immeadiately returns a
zero.  Oddly, after sending me no data, it then sends the "226 Transfer
complete" message over the control connection.  My reads and writes on the
control connection are detailed below.  

any thoughts?
thanks,

Dan


<begin output>
WRITE (4): TYPE A
READ(4): 200 Type set to A

ip = 171,64,15,109 port = 37403

WRITE (4): PORT 171,64,15,109,146,27
READ(4): 200 PORT command successful
WRITE (4): LIST /doc
READ(4): 150 Opening ASCII mode data connection for file list

// in here the socket is read, and it immeadiately returns 0
completelyReadSocket: read 0 bytes

READ(4): 226 Transfer complete.

received reply of 0 bytes for list
<end output>
.

Path: shelby.stanford.edu!elaine30.Stanford.EDU!bahaa
From: Bahaa Eldin Yehia Fahim <bahaa@stanford.edu>
Newsgroups: su.class.cs244a
Subject: test script "cached results" ??
Date: Tue, 20 Jan 2004 01:10:44 -0800
Lines: 42
Distribution: su
Message-ID: <Pine.GSO.4.44.0401200057540.23530-100000@elaine30.Stanford.EDU>
NNTP-Posting-Host: elaine30.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074589847 29903 171.64.15.105 (20 Jan 2004 09:10:47 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5354


Hi,

first off my apologies if this question has somehow been asked before, but
I couldn't find it anywhere on the newsgroup ( and don't remember to have
come across it either ). I know that this is not in the FAQ either. So..

I run the grading script, and I get a bunch of messages like this :

Test F.2, using current source tree and build
make
make: Nothing to be done for `all'.

Using cached results from previous run
Using cached results from previous run
Using cached results from previous run
Using cached results from previous run
Using cached results from previous run
Checking host ftp.slac.stanford.edu
Checking host ftp.slac.stanford.edu
Checking host ftp.cs.stanford.edu
Checking host ftp.stanford.edu
Checking host 134.79.18.30

then I get "OK" on all tests at the "summary" section of the report.

Some of the tests, I do see the script run .ftpcopy <...> so I guess I
have some confidence it's actually doing something.

My concern is : Is my code being tested ?

What does "using cached results from prev run" mean ? Is it referring
to "my code" or the "expected response" as being cached ? and where is the
cache it's using the results from ? How does it know it's up to date ? In
fact I changed my code "slightly" and did a "make clean" and removed the
grading_src directory and I STILL get this..

Should I be concerned ? Or I am overly paranoid ?

Bahaa


.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Replies with data channels
Date: Tue, 20 Jan 2004 01:54:02 -0800
Lines: 24
Distribution: su
Message-ID: <400CFABA.B9E9B48C@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074592442 2634 127.0.0.1 (20 Jan 2004 09:54:02 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U)
X-Accept-Language: ko,en
Xref: shelby.stanford.edu su.class.cs244a:5355

In a passive mode, we get a directory list or a file like this:

- send "LIST" or "RETR" command to the control channel
- connect to the remote socket through the data channel
- receive the reply from the control channel
- receive data from the data channel
- the server closes the data channel
- receive the reply from the control channel

So, we have to get two replies from the server.
I found this out from experience; I tried to find it
in the RFC but couldn't. What is the relevant section?

In addition, what happens if an error occurs
while data is being received from the data channel with recv()?
Do I have to wait for the second reply or not?

This is a problem because the program would just hang
if I waited for a reply that was not guaranteed to come,
and the further execution would get messed up if I didn't
receive a reply that was not guaranteed not to come.

-- 
Seungbeom Kim
.

Path: shelby.stanford.edu!not-for-mail
From: "Lei Zhang" <lei.zhang@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Purify SBW error
Date: Tue, 20 Jan 2004 01:54:44 -0800
Lines: 33
Distribution: su
Message-ID: <buittc$2jh$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074592494 2673 127.0.0.1 (20 Jan 2004 09:54:54 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5356

Did anybody encounter a Purify SBW error while retrieving a file with a long
name, say, inaccessible_file.ext ? I can't figure out what's wrong with my
code, so suspect something hairy in ftpparse.c.

Purify complained about the following line for SBW:

 char * fullCMD = strcat(strcat(strcat(cmd, " "), arguments), kTelnetEOF);

Where
char cmd[] = "RETR";
char * arguments =  ftpInfo.name;

Here is a excerpt from purify.output:

SBW: Stack array bounds write:
  * This is occurring while in:
        strcat         [rtlib.o]
        sendCMD        [ftpcopy.c:217]
        retrieve       [ftpcopy.c:1045]
        list           [ftpcopy.c:982]
        retrieveFromDir [ftpcopy.c:1153]
        main           [ftpcopy.c:179]
  * Writing 22 bytes to 0xffbef58d.
  * Frame pointer 0xffbef5a0
  * Address 0xffbef58d is        5 bytes past start of local variable
"retrCMD" in function retrieve.

Thanks,
Lei




.

Path: shelby.stanford.edu!not-for-mail
From: Dan Wendlandt <danwent@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: no data transfered after LIST on ftp.slac.stanford.edu
Date: Tue, 20 Jan 2004 02:25:14 -0800
Organization: Soto House
Lines: 52
Distribution: su
Message-ID: <buivpg$5ff$1@news.Stanford.EDU>
References: <buir3h$ss6$1@news.Stanford.EDU>
Reply-To: danwent@stanford.edu
NNTP-Posting-Host: hollander.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
X-Trace: news.Stanford.EDU 1074594416 5615 128.12.45.20 (20 Jan 2004 10:26:56 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: KNode/0.7.2
Xref: shelby.stanford.edu su.class.cs244a:5357

is the "LIST <path>" notation not standard?  

according to the RFC:

If the pathname specifies a directory or other group of files, the server
should transfer a list of files in the specified directory.

however, the only way I could get it working on ftp.slac.stanford.edu was to
use CWD to move inside of the /docs directory, then issue the default
"LIST" command.

- Dan

Dan Wendlandt wrote:

> ok, I'm at a loss on this one, so I thought I'd throw it out to the
> newsgroup.
> 
> This never happens while testing with wu-ftpd, but I have noticed it on
> ftp.slac.stanford.edu .  If I issue a simply "LIST" command, the server
> returns the correct result, but if I send "LIST <path>", the server
> connects but sends no data to my client.  The socket immeadiately returns
> a
> zero.  Oddly, after sending me no data, it then sends the "226 Transfer
> complete" message over the control connection.  My reads and writes on the
> control connection are detailed below.
> 
> any thoughts?
> thanks,
> 
> Dan
> 
> 
> <begin output>
> WRITE (4): TYPE A
> READ(4): 200 Type set to A
> 
> ip = 171,64,15,109 port = 37403
> 
> WRITE (4): PORT 171,64,15,109,146,27
> READ(4): 200 PORT command successful
> WRITE (4): LIST /doc
> READ(4): 150 Opening ASCII mode data connection for file list
> 
> // in here the socket is read, and it immeadiately returns 0
> completelyReadSocket: read 0 bytes
> 
> READ(4): 226 Transfer complete.
> 
> received reply of 0 bytes for list
> <end output>

.

Path: shelby.stanford.edu!digibeta.stanford.edu!cedstrom
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: pthreads on elaine
Date: Tue, 20 Jan 2004 05:17:44 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.WNT.4.56.0401200516050.1848@digibeta.stanford.edu>
References: <Pine.GSO.4.44.0401200047180.23541-100000@elaine30.Stanford.EDU>
NNTP-Posting-Host: claxton.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074604668 17293 128.12.69.22 (20 Jan 2004 13:17:48 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0401200047180.23541-100000@elaine30.Stanford.EDU>
X-X-Sender: cedstrom@pobox5.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5358

I hate to be the bringer of bad news, but:

(from the CS244a HW1 FAQ)

" Q23: How important is performance? Should I thread my code?

A. In terms of performance, just use common sense in your design
decisions. We do not expect you to thread your code--and in fact the
grading scripts do not support this functionality in student programs!"

--Chris

On Tue, 20 Jan 2004, Mark Zavislak wrote:

> Hi,
>
> I've been having trouble using pthreads at sweet hall.  I try to do a
> pthread_create() but it always fails with an unknown error.  On my OS X
> 10.3 powerbook, though, the code works perfectly fine.  This is annoying
> because I can't use purify on the running, threaded code.  Does anyone
> know what's up?  Can we use pthreads at the sweet hall cluster?
>
> This is what is failing me (returning non-zero):
>
> pthread_create(&entry->tid, NULL, sr_arpdaemon, args)
>
> Thanks!
> -Mark
>
>
.

Path: shelby.stanford.edu!digibeta.stanford.edu!cedstrom
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Purify SBW error
Date: Tue, 20 Jan 2004 05:20:46 -0800
Lines: 42
Distribution: su
Message-ID: <Pine.WNT.4.56.0401200519400.1848@digibeta.stanford.edu>
References: <buittc$2jh$1@news.Stanford.EDU>
NNTP-Posting-Host: claxton.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074604848 17556 128.12.69.22 (20 Jan 2004 13:20:48 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <buittc$2jh$1@news.Stanford.EDU>
X-X-Sender: cedstrom@pobox5.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5359

No, the cmd array is only 4 characters long.  Your extensive strcatting is
probably putting more than 4 characters in the cmd buffer, hence the SBW
since you are smashing a local variable, an array in this case.

--Chris

On Tue, 20 Jan 2004, Lei Zhang wrote:

> Did anybody encounter a Purify SBW error while retrieving a file with a long
> name, say, inaccessible_file.ext ? I can't figure out what's wrong with my
> code, so suspect something hairy in ftpparse.c.
>
> Purify complained about the following line for SBW:
>
>  char * fullCMD = strcat(strcat(strcat(cmd, " "), arguments), kTelnetEOF);
>
> Where
> char cmd[] = "RETR";
> char * arguments =  ftpInfo.name;
>
> Here is a excerpt from purify.output:
>
> SBW: Stack array bounds write:
>   * This is occurring while in:
>         strcat         [rtlib.o]
>         sendCMD        [ftpcopy.c:217]
>         retrieve       [ftpcopy.c:1045]
>         list           [ftpcopy.c:982]
>         retrieveFromDir [ftpcopy.c:1153]
>         main           [ftpcopy.c:179]
>   * Writing 22 bytes to 0xffbef58d.
>   * Frame pointer 0xffbef5a0
>   * Address 0xffbef58d is        5 bytes past start of local variable
> "retrCMD" in function retrieve.
>
> Thanks,
> Lei
>
>
>
>
>
.

Path: shelby.stanford.edu!digibeta.stanford.edu!cedstrom
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Grading script weirdness
Date: Tue, 20 Jan 2004 05:22:46 -0800
Lines: 22
Distribution: su
Message-ID: <Pine.WNT.4.56.0401200521030.1848@digibeta.stanford.edu>
NNTP-Posting-Host: claxton.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074604968 17673 128.12.69.22 (20 Jan 2004 13:22:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-X-Sender: cedstrom@pobox5.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5360

On the test for trying to transfer to a non-existent local directory,
the grading script says:

"Test L.7 [out of 0.5]
Checks that ftpcopy returns error on non-existent remote dir.

Results:  NOT OK

Exit status (255) incorrect.  Program output:


ERROR: Could not find remote starting directory!"

My code says:

fprintf(stderr, "ERROR: Could not find remote starting directory!\n");
exit(-1);


What's up with that?

--Chris
.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!zavislak
From: Mark Zavislak <zavislak@elaine1.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: pthreads on elaine
Date: Tue, 20 Jan 2004 07:14:48 -0800
Lines: 38
Distribution: su
Message-ID: <Pine.GSO.4.44.0401200713580.28316-100000@elaine1.Stanford.EDU>
References: <Pine.GSO.4.44.0401200047180.23541-100000@elaine30.Stanford.EDU>
 <Pine.WNT.4.56.0401200516050.1848@digibeta.stanford.edu>
NNTP-Posting-Host: elaine1.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074611693 24224 171.64.15.66 (20 Jan 2004 15:14:53 GMT)
X-Complaints-To: news@news.stanford.edu
To: Chris Edstrom <cedstrom@stanford.edu>
In-Reply-To: <Pine.WNT.4.56.0401200516050.1848@digibeta.stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5361

This is for HW2, where they seem a bit more necessary.

-M

On Tue, 20 Jan 2004, Chris Edstrom wrote:

> I hate to be the bringer of bad news, but:
>
> (from the CS244a HW1 FAQ)
>
> " Q23: How important is performance? Should I thread my code?
>
> A. In terms of performance, just use common sense in your design
> decisions. We do not expect you to thread your code--and in fact the
> grading scripts do not support this functionality in student programs!"
>
> --Chris
>
> On Tue, 20 Jan 2004, Mark Zavislak wrote:
>
> > Hi,
> >
> > I've been having trouble using pthreads at sweet hall.  I try to do a
> > pthread_create() but it always fails with an unknown error.  On my OS X
> > 10.3 powerbook, though, the code works perfectly fine.  This is annoying
> > because I can't use purify on the running, threaded code.  Does anyone
> > know what's up?  Can we use pthreads at the sweet hall cluster?
> >
> > This is what is failing me (returning non-zero):
> >
> > pthread_create(&entry->tid, NULL, sr_arpdaemon, args)
> >
> > Thanks!
> > -Mark
> >
> >
>

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Grading script weirdness
Date: Tue, 20 Jan 2004 07:45:09 -0800
Lines: 29
Distribution: su
Message-ID: <20040120074509.0d0d0043.chanman@stanford.edu>
References: <Pine.WNT.4.56.0401200521030.1848@digibeta.stanford.edu>
NNTP-Posting-Host: chanman.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074613595 29651 128.12.94.94 (20 Jan 2004 15:46:35 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed version 0.9.6 (GTK+ 1.2.10; i386-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:5362

I'm not absolutely sure, but I think you need exit(1) and not exit(-1).  -1 in two's complement is 255, which is not what the grading script is expecting I believe.

--Will

On Tue, 20 Jan 2004 05:22:46 -0800
Chris Edstrom <cedstrom@stanford.edu> wrote:

> On the test for trying to transfer to a non-existent local directory,
> the grading script says:
> 
> "Test L.7 [out of 0.5]
> Checks that ftpcopy returns error on non-existent remote dir.
> 
> Results:  NOT OK
> 
> Exit status (255) incorrect.  Program output:
> 
> 
> ERROR: Could not find remote starting directory!"
> 
> My code says:
> 
> fprintf(stderr, "ERROR: Could not find remote starting directory!\n");
> exit(-1);
> 
> 
> What's up with that?
> 
> --Chris
.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: pthreads on elaine
Date: Tue, 20 Jan 2004 07:48:06 -0800
Lines: 24
Distribution: su
Message-ID: <20040120074806.2a7357d2.chanman@stanford.edu>
References: <Pine.GSO.4.44.0401200047180.23541-100000@elaine30.Stanford.EDU>
NNTP-Posting-Host: chanman.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074613772 29651 128.12.94.94 (20 Jan 2004 15:49:32 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed version 0.9.6 (GTK+ 1.2.10; i386-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:5363

pthreads working fine for me

you're including the correct library right? -lpthread?

--Will

On Tue, 20 Jan 2004 00:50:59 -0800
Mark Zavislak <zavislak@elaine30.Stanford.EDU> wrote:

> Hi,
> 
> I've been having trouble using pthreads at sweet hall.  I try to do a
> pthread_create() but it always fails with an unknown error.  On my OS X
> 10.3 powerbook, though, the code works perfectly fine.  This is annoying
> because I can't use purify on the running, threaded code.  Does anyone
> know what's up?  Can we use pthreads at the sweet hall cluster?
> 
> This is what is failing me (returning non-zero):
> 
> pthread_create(&entry->tid, NULL, sr_arpdaemon, args)
> 
> Thanks!
> -Mark
> 
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: pthreads on elaine
Date: Tue, 20 Jan 2004 08:03:06 -0800
Lines: 27
Distribution: su
Message-ID: <Pine.LNX.4.44.0401200756380.13796-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401200047180.23541-100000@elaine30.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074614588 26808 171.64.66.201 (20 Jan 2004 16:03:08 GMT)
X-Complaints-To: news@news.stanford.edu
To: Mark Zavislak <zavislak@elaine30.Stanford.EDU>
In-Reply-To: <Pine.GSO.4.44.0401200047180.23541-100000@elaine30.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5364


 Pthreads work fine on the elaines just make sure you are linking with
 -lpthread (you are able to link without the library which is sorta' lame).  I
 am curious though, are you starting on hw2?  (says I queued by sr_arpdaemon)
 The server isn't set up at the moment so you wont be able to connect to a 
 topology/grab traffic.

 :)
 .m

> Hi,
> 
> I've been having trouble using pthreads at sweet hall.  I try to do a
> pthread_create() but it always fails with an unknown error.  On my OS X
> 10.3 powerbook, though, the code works perfectly fine.  This is annoying
> because I can't use purify on the running, threaded code.  Does anyone
> know what's up?  Can we use pthreads at the sweet hall cluster?
> 
> This is what is failing me (returning non-zero):
> 
> pthread_create(&entry->tid, NULL, sr_arpdaemon, args)
> 
> Thanks!
> -Mark
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Grading script weirdness
Date: Tue, 20 Jan 2004 08:12:43 -0800
Lines: 38
Distribution: su
Message-ID: <20040120081243.147b9086.chanman@stanford.edu>
References: <Pine.WNT.4.56.0401200521030.1848@digibeta.stanford.edu>
	<20040120074509.0d0d0043.chanman@stanford.edu>
NNTP-Posting-Host: chanman.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074615249 29651 128.12.94.94 (20 Jan 2004 16:14:09 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed version 0.9.6 (GTK+ 1.2.10; i386-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:5365

Yeah, just tested it, you need exit(1) and not exit(-1).

Also I meant one's and not two's comp.  Too early in the morning =/

--Will

On Tue, 20 Jan 2004 07:45:09 -0800
William Chan <chanman@stanford.edu> wrote:

> I'm not absolutely sure, but I think you need exit(1) and not exit(-1).  -1 in two's complement is 255, which is not what the grading script is expecting I believe.
> 
> --Will
> 
> On Tue, 20 Jan 2004 05:22:46 -0800
> Chris Edstrom <cedstrom@stanford.edu> wrote:
> 
> > On the test for trying to transfer to a non-existent local directory,
> > the grading script says:
> > 
> > "Test L.7 [out of 0.5]
> > Checks that ftpcopy returns error on non-existent remote dir.
> > 
> > Results:  NOT OK
> > 
> > Exit status (255) incorrect.  Program output:
> > 
> > 
> > ERROR: Could not find remote starting directory!"
> > 
> > My code says:
> > 
> > fprintf(stderr, "ERROR: Could not find remote starting directory!\n");
> > exit(-1);
> > 
> > 
> > What's up with that?
> > 
> > --Chris
.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!zavislak
From: Mark Zavislak <zavislak@elaine1.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: pthreads on elaine
Date: Tue, 20 Jan 2004 08:17:28 -0800
Lines: 39
Distribution: su
Message-ID: <Pine.GSO.4.44.0401200813500.28741-100000@elaine1.Stanford.EDU>
References: <Pine.GSO.4.44.0401200047180.23541-100000@elaine30.Stanford.EDU>
 <Pine.LNX.4.44.0401200756380.13796-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074615450 27746 171.64.15.66 (20 Jan 2004 16:17:30 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0401200756380.13796-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5366

Ah, forgot about the linking.  I'd have thought I would get a linking
error if I made such a mistake :).  I am working on hw2, but using the
secondary vns (vns-2) and hijacking my own topology.  It's working fine
for me, grabbing traffic and sending packets.  Please don't take it down
too :)

-M

On Tue, 20 Jan 2004, Martin Casado wrote:

>
>  Pthreads work fine on the elaines just make sure you are linking with
>  -lpthread (you are able to link without the library which is sorta' lame).  I
>  am curious though, are you starting on hw2?  (says I queued by sr_arpdaemon)
>  The server isn't set up at the moment so you wont be able to connect to a
>  topology/grab traffic.
>
>  :)
>  .m
>
> > Hi,
> >
> > I've been having trouble using pthreads at sweet hall.  I try to do a
> > pthread_create() but it always fails with an unknown error.  On my OS X
> > 10.3 powerbook, though, the code works perfectly fine.  This is annoying
> > because I can't use purify on the running, threaded code.  Does anyone
> > know what's up?  Can we use pthreads at the sweet hall cluster?
> >
> > This is what is failing me (returning non-zero):
> >
> > pthread_create(&entry->tid, NULL, sr_arpdaemon, args)
> >
> > Thanks!
> > -Mark
> >
> >
>
>

.

Path: shelby.stanford.edu!elaine42.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: test script attempt
Date: Tue, 20 Jan 2004 16:35:22 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <bujlca$s78$1@news.Stanford.EDU>
References: <buillr$m84$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine42.stanford.edu
X-Trace: news.Stanford.EDU 1074616522 28904 171.64.15.117 (20 Jan 2004 16:35:22 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5367


>I tried running my program again without changes but then it again asked for
>a key-

It sounds like you must have submitted a different set of code this time,
which would count against your quota...

.

Path: shelby.stanford.edu!elaine42.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: test script "cached results" ??
Date: Tue, 20 Jan 2004 16:38:28 +0000 (UTC)
Lines: 20
Distribution: su
Message-ID: <bujli4$scj$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401200057540.23530-100000@elaine30.Stanford.EDU>
NNTP-Posting-Host: elaine42.stanford.edu
X-Trace: news.Stanford.EDU 1074616708 29075 171.64.15.117 (20 Jan 2004 16:38:28 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5368



>My concern is : Is my code being tested ?

Yes--if it says "OK," chances are excellent that you are indeed alright.

>What does "using cached results from prev run" mean ? Is it referring
>to "my code" or the "expected response" as being cached ? and where is the
>cache it's using the results from ? How does it know it's up to date ? In
>fact I changed my code "slightly" and did a "make clean" and removed the
>grading_src directory and I STILL get this..

The script runs ftpcopy against each of the servers being tested, saving
the downloaded directory tree.  It then checks this tree for correctness
in various test cases--e.g. any file downloaded, any matching file
downloaded, etc.  There's no need to re-run the ftpcopy for each of these.

>Should I be concerned ? Or I am overly paranoid ?

Just paranoid. :-)
.

Path: shelby.stanford.edu!elaine42.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: What should be done if ftpcopy fails to create directory on the local host?
Date: Tue, 20 Jan 2004 16:39:31 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <bujlk3$sga$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401200048060.11036-100000@elaine18.Stanford.EDU>
NNTP-Posting-Host: elaine42.stanford.edu
X-Trace: news.Stanford.EDU 1074616771 29194 171.64.15.117 (20 Jan 2004 16:39:31 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5369



>What should be done if ftpcopy fails to create directory on the local
>host?

>(1) terminate the program and printout error, or
>(2) silently go the next entry in the list and continue.

You should make your own judgement about these kinds of issues.  But does
it seem reasonable to you that the program would silently continue without
warning the user that something's wrong?

.

Path: shelby.stanford.edu!elaine42.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: pthreads on elaine
Date: Tue, 20 Jan 2004 16:42:58 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <bujlqi$smj$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401200047180.23541-100000@elaine30.Stanford.EDU>  <Pine.LNX.4.44.0401200756380.13796-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0401200813500.28741-100000@elaine1.Stanford.EDU>
NNTP-Posting-Host: elaine42.stanford.edu
X-Trace: news.Stanford.EDU 1074616978 29395 171.64.15.117 (20 Jan 2004 16:42:58 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5370


>Ah, forgot about the linking.  I'd have thought I would get a linking
>error if I made such a mistake :).

For some reason, Solaris seems to include stub versions of the pthreads
routines in the regular system libraries, which apparently do nothing but
return errors...

.

Path: shelby.stanford.edu!elaine42.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: no data transfered after LIST on ftp.slac.stanford.edu
Date: Tue, 20 Jan 2004 16:47:08 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <bujm2c$su8$1@news.Stanford.EDU>
References: <buir3h$ss6$1@news.Stanford.EDU> <buivpg$5ff$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine42.stanford.edu
X-Trace: news.Stanford.EDU 1074617228 29640 171.64.15.117 (20 Jan 2004 16:47:08 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5371


>If the pathname specifies a directory or other group of files, the server
>should transfer a list of files in the specified directory.

This may have been a very picky interpretation of the RFC by whomever
implemented the ftpd used by SLAC.  In general, RFCs are very clear about
whether a feature is required, strongly encouraged, or optional, by
using "MUST," "SHOULD," or "MAY."  (Often the words are capitalised, but
this convention doesn't seem to be used in the FTP RFC).  The wording above
suggests that most servers will probably return a directory listing if you
use "LIST dir", but that it's not strictly required.

.

Path: shelby.stanford.edu!elaine42.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Replies with data channels
Date: Tue, 20 Jan 2004 16:51:50 +0000 (UTC)
Lines: 26
Distribution: su
Message-ID: <bujmb6$17$1@news.Stanford.EDU>
References: <400CFABA.B9E9B48C@stanford.edu>
NNTP-Posting-Host: elaine42.stanford.edu
X-Trace: news.Stanford.EDU 1074617510 39 171.64.15.117 (20 Jan 2004 16:51:50 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5372


>In a passive mode, we get a directory list or a file like this:

>- send "LIST" or "RETR" command to the control channel
>- connect to the remote socket through the data channel
>- receive the reply from the control channel
>- receive data from the data channel
>- the server closes the data channel
>- receive the reply from the control channel

>So, we have to get two replies from the server.
>I found this out from experience; I tried to find it
>in the RFC but couldn't. What is the relevant section?

I didn't implement PASV mode, so you have as good an idea about this as
I do.  But my impression is that after the initial data connection
setup, there's little difference between using PASV and using PORT--in
which case, you should look at section 5.4 and the state diagrams in
section 6, and the assignment description itself.

>In addition, what happens if an error occurs
>while data is being received from the data channel with recv()?
>Do I have to wait for the second reply or not?

I would assume that you would get an error reply on the control channel.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: no data transfered after LIST on ftp.slac.stanford.edu
Date: Tue, 20 Jan 2004 09:01:47 -0800
Lines: 99
Distribution: su
Message-ID: <Pine.LNX.4.44.0401200855230.28648-100000@Xenon.Stanford.EDU>
References: <buir3h$ss6$1@news.Stanford.EDU> <buivpg$5ff$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074618110 765 171.64.66.201 (20 Jan 2004 17:01:50 GMT)
X-Complaints-To: news@news.stanford.edu
To: Dan Wendlandt <danwent@stanford.edu>
In-Reply-To: <buivpg$5ff$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5373


 Heya Dan,

  I'm not seeing the same problem you are.  If I run netcat (nc) locally,
  telnet into the ftp.slac.stanford.edu and issue commands I am able to illicit
  listings without changing the remote directory.

  e.g.

  PORT 171,64,74,49,19,7
  200 PORT command successful
  LIST /doc
  150 Opening ASCII mode data connection for file list
  226 Transfer complete.

  returned ...

  [casado@nity golden]$ nc -l -p 4871
  dr-xr-xr-x   2 ftp      ftp          2048 Jun 19  1995 .
  dr-xr-xr-x   3 ftp      ftp          2048 Jul 21  2003 ..
  dr-xr-xr-x   7 ftp      ftp          2048 Mar 13  1999 forms

  and

  PORT 171,64,74,49,19,8
  200 PORT command successful
  LIST /doc/forms
  150 Opening ASCII mode data connection for file list
  226 Transfer complete.

  returned

 casado@nity golden]$ nc -l -p 4872
 dr-xr-xr-x   7 ftp      ftp          2048 Mar 13  1999 .
 dr-xr-xr-x   2 ftp      ftp          2048 Jun 19  1995 ..
 dr-xr-xr-x   6 ftp      ftp          2048 Mar 15  1999 eval99
 dr-xr-xr-x   2 ftp      ftp          2048 Apr 14  1998 jobdesc
 dr-xr-xr-x   2 ftp      ftp          2048 Feb 18  1998 ppararchive
 dr-xr-xr-x   2 ftp      ftp          2048 Apr 14  1998 ppars98
 dr-xr-xr-x   2 ftp      ftp          2048 Jun  2  1998 trainreq
 [casado@nity golden]$

 
 .martin 

> is the "LIST <path>" notation not standard?  
> 
> according to the RFC:
> 
> If the pathname specifies a directory or other group of files, the server
> should transfer a list of files in the specified directory.
> 
> however, the only way I could get it working on ftp.slac.stanford.edu was to
> use CWD to move inside of the /docs directory, then issue the default
> "LIST" command.
> 
> - Dan
> 
> Dan Wendlandt wrote:
> 
> > ok, I'm at a loss on this one, so I thought I'd throw it out to the
> > newsgroup.
> > 
> > This never happens while testing with wu-ftpd, but I have noticed it on
> > ftp.slac.stanford.edu .  If I issue a simply "LIST" command, the server
> > returns the correct result, but if I send "LIST <path>", the server
> > connects but sends no data to my client.  The socket immeadiately returns
> > a
> > zero.  Oddly, after sending me no data, it then sends the "226 Transfer
> > complete" message over the control connection.  My reads and writes on the
> > control connection are detailed below.
> > 
> > any thoughts?
> > thanks,
> > 
> > Dan
> > 
> > 
> > <begin output>
> > WRITE (4): TYPE A
> > READ(4): 200 Type set to A
> > 
> > ip = 171,64,15,109 port = 37403
> > 
> > WRITE (4): PORT 171,64,15,109,146,27
> > READ(4): 200 PORT command successful
> > WRITE (4): LIST /doc
> > READ(4): 150 Opening ASCII mode data connection for file list
> > 
> > // in here the socket is read, and it immeadiately returns 0
> > completelyReadSocket: read 0 bytes
> > 
> > READ(4): 226 Transfer complete.
> > 
> > received reply of 0 bytes for list
> > <end output>
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Mike Hsieh" <mhsieh33@hotmail.com>
Newsgroups: su.class.cs244a
Subject: file extension
Date: Tue, 20 Jan 2004 10:20:33 -0800
Lines: 5
Distribution: su
Message-ID: <bujrhl$5tc$1@news.Stanford.EDU>
NNTP-Posting-Host: red33.stanford.edu
X-Trace: news.Stanford.EDU 1074622837 6060 128.12.59.103 (20 Jan 2004 18:20:37 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5374

just checking, should we copy over files which end in the extension if there
is no '.' before the extension?  For example is xtxt considered a 'txt'
file?


.

Path: shelby.stanford.edu!not-for-mail
From: Dan Wendlandt <danwent@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: no data transfered after LIST on ftp.slac.stanford.edu
Date: Tue, 20 Jan 2004 10:42:37 -0800
Organization: Soto House
Lines: 25
Distribution: su
Message-ID: <bujsu2$7cg$1@news.Stanford.EDU>
References: <buir3h$ss6$1@news.Stanford.EDU> <buivpg$5ff$1@news.Stanford.EDU> <bujm2c$su8$1@news.Stanford.EDU>
Reply-To: danwent@stanford.edu
NNTP-Posting-Host: hollander.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
X-Trace: news.Stanford.EDU 1074624259 7568 128.12.45.20 (20 Jan 2004 18:44:19 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: KNode/0.7.2
Xref: shelby.stanford.edu su.class.cs244a:5375

I found that my problem was in fact a trailing space in my list command. so
i was sending "LIST /doc \r\n".  Everything works now that I eliminated
that space.

Are you saying that I should not rely on this and should instead use CWD
commands to change into the directory before sending a "LIST" command?

thanks,

Dan

Matthew Jonathan Holliman wrote:

> 
>>If the pathname specifies a directory or other group of files, the server
>>should transfer a list of files in the specified directory.
> 
> This may have been a very picky interpretation of the RFC by whomever
> implemented the ftpd used by SLAC.  In general, RFCs are very clear about
> whether a feature is required, strongly encouraged, or optional, by
> using "MUST," "SHOULD," or "MAY."  (Often the words are capitalised, but
> this convention doesn't seem to be used in the FTP RFC).  The wording
> above suggests that most servers will probably return a directory listing
> if you use "LIST dir", but that it's not strictly required.

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: multiple hw1 submission
Date: Tue, 20 Jan 2004 11:05:45 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0401201044470.27740-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074625546 8967 171.64.15.106 (20 Jan 2004 19:05:46 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5376


can we run the submit script more than once incase we have some
modifications we want to turn in before the deadline?

--vishal


.

Path: shelby.stanford.edu!saga3.Stanford.EDU!odahroug
From: Omar Gawdat Dahroug <odahroug@stanford.edu>
Newsgroups: su.class.cs244a
Subject: #define vs. static const
Date: Tue, 20 Jan 2004 11:44:50 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.GSO.4.44.0401201137090.11429-100000@saga3.Stanford.EDU>
NNTP-Posting-Host: saga3.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074627895 12009 171.64.15.133 (20 Jan 2004 19:44:55 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5377

Hi there,

Regarding the coding guideline against the use of global variables. I
assume that this doesn't apply to static const variables. I mean, a
static const at file scope is better than a #define, and doesn't have the
usual problems associated with non-const globals.

Just wanted to confirm. Thanks,
0mar

.

Path: shelby.stanford.edu!elaine40.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: no data transfered after LIST on ftp.slac.stanford.edu
Date: Tue, 20 Jan 2004 20:25:52 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <buk2sg$epj$1@news.Stanford.EDU>
References: <buir3h$ss6$1@news.Stanford.EDU> <buivpg$5ff$1@news.Stanford.EDU> <bujm2c$su8$1@news.Stanford.EDU> <bujsu2$7cg$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine40.stanford.edu
X-Trace: news.Stanford.EDU 1074630352 15155 171.64.15.115 (20 Jan 2004 20:25:52 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5378


>Are you saying that I should not rely on this and should instead use CWD
>commands to change into the directory before sending a "LIST" command?

You're probably okay--most servers will implement the form you
describe--but yes, in general it would probably be safer to use CWD and
LIST.  But if your code's otherwise working, I wouldn't worry about it
too much.

.

Path: shelby.stanford.edu!elaine40.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: multiple hw1 submission
Date: Tue, 20 Jan 2004 20:27:02 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <buk2um$erc$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401201044470.27740-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine40.stanford.edu
X-Trace: news.Stanford.EDU 1074630422 15212 171.64.15.115 (20 Jan 2004 20:27:02 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5379

>can we run the submit script more than once incase we have some
>modifications we want to turn in before the deadline?

yes.

.

Path: shelby.stanford.edu!elaine40.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: #define vs. static const
Date: Tue, 20 Jan 2004 20:27:30 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <buk2vi$esc$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401201137090.11429-100000@saga3.Stanford.EDU>
NNTP-Posting-Host: elaine40.stanford.edu
X-Trace: news.Stanford.EDU 1074630450 15244 171.64.15.115 (20 Jan 2004 20:27:30 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5380


>Regarding the coding guideline against the use of global variables. I
>assume that this doesn't apply to static const variables. I mean, a
>static const at file scope is better than a #define, and doesn't have the
>usual problems associated with non-const globals.

Yep, correct.

.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: pthreads on elaine
Date: Tue, 20 Jan 2004 13:15:08 -0800
Lines: 46
Distribution: su
Message-ID: <buk5p6$i4s$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401200047180.23541-100000@elaine30.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074633320 18588 127.0.0.1 (20 Jan 2004 21:15:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5381

Mark,

This works for me.  Maybe you're not linking with -lpthread?

/* test.c */
#include <pthread.h>
#include <sys/errno.h>

void *myFunc(void *pArgs) {
        printf("hello world\n");
}
extern int errno;
int main(int argc, char **argv) {
        pthread_t  pt;
        pthread_create(&pt, 0, myFunc, 0);
        printf("goodbye world\n");
        sleep(60);
}

elaine3:~> gcc test.c -lpthread
elaine3:~> ./a.out
goodbye world
hello world
^C



"Mark Zavislak" <zavislak@elaine30.Stanford.EDU> wrote in message
news:Pine.GSO.4.44.0401200047180.23541-100000@elaine30.Stanford.EDU...
> Hi,
>
> I've been having trouble using pthreads at sweet hall.  I try to do a
> pthread_create() but it always fails with an unknown error.  On my OS X
> 10.3 powerbook, though, the code works perfectly fine.  This is annoying
> because I can't use purify on the running, threaded code.  Does anyone
> know what's up?  Can we use pthreads at the sweet hall cluster?
>
> This is what is failing me (returning non-zero):
>
> pthread_create(&entry->tid, NULL, sr_arpdaemon, args)
>
> Thanks!
> -Mark
>


.

Path: shelby.stanford.edu!saga16.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Waiting for 226 reply
Date: Tue, 20 Jan 2004 14:13:30 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.GSO.4.44.0401201405250.23032-100000@saga16.Stanford.EDU>
NNTP-Posting-Host: saga16.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074636812 22261 171.64.15.146 (20 Jan 2004 22:13:32 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5382


On the server ftp.slac.stanford.edu, I am running a test similiar to the
one in the test script and cannot figure out what is going on.

../ftpcopy mif 5 ftp.slac.stanford.edu /local_dir /doc

Using gdb, it looks like I am getting the list information correctly after
I issue the LIST command, but I am hung waiting on the control socket for
the 226 reply.

I don't understand how I could have read all of the directory information,
but still possibly have data to receive on the data connection (this is
the only scenario I can come up with).  Otherwise, why would the server
wait to send this response?

I checked that the 226 response is sent as expected by the server by doing
an actual ftp to it.

Anyone have any insight about what I might be doing wrong?

Thanks,
Barrett

.

Path: shelby.stanford.edu!elaine40.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Waiting for 226 reply
Date: Tue, 20 Jan 2004 22:24:09 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <buk9q9$mjf$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401201405250.23032-100000@saga16.Stanford.EDU>
NNTP-Posting-Host: elaine40.stanford.edu
X-Trace: news.Stanford.EDU 1074637449 23151 171.64.15.115 (20 Jan 2004 22:24:09 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5383



>Using gdb, it looks like I am getting the list information correctly after
>I issue the LIST command, but I am hung waiting on the control socket for
>the 226 reply.

Did you try the previous suggestions on the newsgroup (both this year
and last year's) about closing the data connection socket before reading
the reply on the control socket?

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: no reply to USER
Date: Tue, 20 Jan 2004 15:05:26 -0800
Lines: 14
Distribution: su
Message-ID: <bukc65$p9j$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1074639878 25907 128.12.61.97 (20 Jan 2004 23:04:38 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5384

I'm not getting a reply to a successful write of "USER anonymous\r\n"... I
doubt anyone can offer advice, but I've been banging my head over it for a
while.

I connect, read from the socket until I get a line with the 3rd 0-indexed
character as not a hyphen, then I write the USER command, then I read.  It's
on this last read that I hang immediately.

Any ideas?

Thanks,
Oded


.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftp.slac.stanford.edu: 230 response size is longer than 1024
Date: Tue, 20 Jan 2004 15:30:48 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.GSO.4.44.0401201524460.17593-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074641450 27571 171.64.15.118 (20 Jan 2004 23:30:50 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5385


As I understand, the assumption is that the FTP response sent within the
control control will be no longer than 1024.  However, when I tried to
test with ftp.slac.stanford.edu, the 230 response message is longer than
1024 bytes.  I increase the buffer size to 2048.

Is there any better approach?

-Laura

.

Path: shelby.stanford.edu!elaine27.Stanford.EDU!bahaa
From: Bahaa Eldin Yehia Fahim <bahaa@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Handout4, slide 42
Date: Tue, 20 Jan 2004 15:46:17 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0401201543470.9489-100000@elaine27.Stanford.EDU>
NNTP-Posting-Host: elaine27.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074642380 28666 171.64.15.102 (20 Jan 2004 23:46:20 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5386


I have a rather simple question about the ternary cam there. The 5th row
has the same port ( 4 ) as the one used for the 255.255.0.0 mask entry
just above it. shouldn't the port number be one more = 5 ?

Bahaa

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: no reply to USER
Date: Tue, 20 Jan 2004 17:07:29 -0800
Lines: 21
Distribution: su
Message-ID: <bukjb1$3tj$1@news.Stanford.EDU>
References: <bukc65$p9j$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1074647201 4019 128.12.61.97 (21 Jan 2004 01:06:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5387

Took a break, came back, and found misplaced parantheses.  All fixed.

Oded

> I'm not getting a reply to a successful write of "USER anonymous\r\n"... I
> doubt anyone can offer advice, but I've been banging my head over it for a
> while.
>
> I connect, read from the socket until I get a line with the 3rd 0-indexed
> character as not a hyphen, then I write the USER command, then I read.
It's
> on this last read that I hang immediately.
>
> Any ideas?
>
> Thanks,
> Oded
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: Tony Chun-hao Hsieh <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: case sensitive file extensions & closing connections on error
Date: Tue, 20 Jan 2004 18:30:32 -0800
Lines: 22
Distribution: su
Message-ID: <400DE448.6F2612DF@stanford.edu>
References: <pan.2004.01.20.05.09.29.549685@stanford.edu> <buighp$ede$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine20.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074652233 10864 171.64.15.85 (21 Jan 2004 02:30:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (X11; U; SunOS 5.8 sun4u)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:5388

In http://www.stanford.edu/class/cs244a/homeworks/hw1/hw1faq.html#Q17 it
has various servers and directory copies to try.  Under ftpcopy txt 5
ftp.microsoft.com localdir /peropsys/ie it copies the q240308.txt file
but the file on the server ends with .TXT.  The faq page seems to be
conflicting with what you say then.  Also just to let you know the
ftpcopy X 2 204.123.2.2 localdir /pub/comm no longer works because the
directory /pub/comm no longer exists on the FTP server.  Just wanted to
let people know in case they come across this faq page too!

Matthew Jonathan Holliman wrote:
> 
> >1. Should we assume file extensions are case sensitive or should we
> >download all files that match regardless of case?
> 
> Yep, they're case-sensitive.
> 
> >2. Is it necessary to close our open sockets when terminating on an error?
> 
> It's not strictly necessary, but it's a good practice.  We don't check this
> when grading (we *do* check on normal termination, of course), but it's a
> bit unfriendly to leave the other side of the connection open.  You may as
> well close the sockets and let the other side shut down gracefully...
.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ACCT?
Date: Tue, 20 Jan 2004 18:31:57 -0800
Lines: 9
Distribution: su
Message-ID: <buko9b$ake$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1074652267 10894 128.12.61.97 (21 Jan 2004 02:31:07 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5389

If we get:
>USER anonymous
<331 Password requires for anonymous
>PASS user@host
<332 (account required)

Are we required to deal with that?


.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: help on test E of testing script
Date: Tue, 20 Jan 2004 18:52:49 -0800
Lines: 30
Distribution: su
Message-ID: <bukphu$bpa$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1074653566 12074 128.12.173.169 (21 Jan 2004 02:52:46 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5390

Hi,

I am not able to pass Test E of the testing script and I was wondering if
some one could shed light on what is it that this test is trying to do and
where could the possible source of error lie in my code. Here's the output
snippet from the testing script run:

Test E [out of 2.5]
Checks whether ftpcopy relies on a particular site.

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

Output incorrect for server ftp.stanford.edu.

So somehow something is failing when ftpcopy is run with ftp.stanford.edu as
the server to contact. The only things I can think of is a) I am not passing
the cmds to the server in proper format b) I am making some error in the
interleaving of reads and close on data and control sockets.

I have checked by code and till now it seems to me that I am not committing
either of the two mistakes. And everything works fine when i connect to
other servers. If some one could shed some light on what this test is
looking for, it will be of great help to me in figuring out what is going
wrong with my code.

Thanks a lot

Kumar


.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: .Purify file
Date: Tue, 20 Jan 2004 18:55:57 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0401201853320.22234-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: epic6.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074653759 12199 171.64.15.39 (21 Jan 2004 02:55:59 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5391

This was already asked just wanted to confirm.

Handout says
..purify - Supress statements you used in generating purify.output

What exactly does this mean?  I recall someone suggested to just
touch .purify.  Is that right?

Thanks.


.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: checking local directory existance
Date: Tue, 20 Jan 2004 21:09:33 -0800
Lines: 4
Distribution: su
Message-ID: <bul1il$jjs$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074661781 20092 128.12.90.43 (21 Jan 2004 05:09:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5392

Is there a unix system call I can make to check if the local directory
exists?


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: checking local directory existance
Date: Tue, 20 Jan 2004 21:18:42 -0800
Lines: 11
Distribution: su
Message-ID: <bul221$k6a$1@news.Stanford.EDU>
References: <bul1il$jjs$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1074662273 20682 128.12.61.97 (21 Jan 2004 05:17:53 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5393

Dunno, but I think chdir() will return -1 if it fails (testing that part
right now)

"Eddy Wu" <ewu@stanford.edu> wrote in message
news:bul1il$jjs$1@news.Stanford.EDU...
> Is there a unix system call I can make to check if the local directory
> exists?
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: file extension
Date: Tue, 20 Jan 2004 21:24:04 -0800
Lines: 10
Distribution: su
Message-ID: <bul2dj$k7p$1@news.Stanford.EDU>
References: <bujrhl$5tc$1@news.Stanford.EDU>
NNTP-Posting-Host: agila.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074662643 20729 128.12.194.74 (21 Jan 2004 05:24:03 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2
X-Accept-Language: en-us, en
In-Reply-To: <bujrhl$5tc$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5394

Mike Hsieh wrote:
> just checking, should we copy over files which end in the extension if there
> is no '.' before the extension?  For example is xtxt considered a 'txt'
> file?
> 
> 
nope. xtxt is not a valid file.  check out the FAQ, question 20. :)

Paul E.

.

Path: shelby.stanford.edu!saga12.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Files marked unretrievable
Date: Tue, 20 Jan 2004 22:13:35 -0800
Lines: 27
Distribution: su
Message-ID: <Pine.GSO.4.44.0401202208200.17549-100000@saga12.Stanford.EDU>
NNTP-Posting-Host: saga12.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074665618 24799 171.64.15.142 (21 Jan 2004 06:13:38 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5395

I ran the grading script again tonight after my ftpcopy was passing
completely earlier today and it didn't pass for ftp.stanford.edu.

It said I was missing two gz files in /pub/packages/fping.
I ftped to ftp.stanford.edu and tried to manually ftp the files to look at
them. I got ths following error messages:

ftp> mget *.gz
200 PORT command successful.
550 /afs/.ir.stanford.edu/dist/ftp/pub/packages/fping/fping-2.0.tar.gz is
marked unretrievable
200 PORT command successful.
550 /afs/.ir.stanford.edu/dist/ftp/pub/packages/fping/fping-2.2b1.tar.gz
is marked unretrievable

I tried several times and getting those files failed but on fourth try I
ftp'ed them successfully.

Is this just the ftp server being flakey?

I mean this is happening using the solaris frp client, so it isn't
just my program.

Strange.

Edward G. Chron

.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: problem with ftp.stanford.edu
Date: Tue, 20 Jan 2004 22:22:41 -0800
Lines: 17
Distribution: su
Message-ID: <bul5rd$opk$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1074666157 25396 128.12.173.169 (21 Jan 2004 06:22:37 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5396

Hi,

I failed a few test cases on the testing script and the common server on
which my program failed was ftp.stanford.edu. So I decided to ftp into it
and copy some files from the usr/lib directory. First I tried running my
program and it did not copy any files as it reported 550 (permission denied)
on every file in that directory. Next, I telnetted to the server and tried
to copy the files, issuing first PASV and then PORT and both times, it gave
me 550 file marked unretrievable for all files. Is it happening to others
too? I am wondering if I failed the test cases (C and D) because these files
were retrievable before and somehow they have become unretrievable recently?

Thanks

Kumar


.

Path: shelby.stanford.edu!saga12.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problem with ftp.stanford.edu
Date: Tue, 20 Jan 2004 22:33:01 -0800
Lines: 34
Distribution: su
Message-ID: <Pine.GSO.4.44.0401202229320.17709-100000@saga12.Stanford.EDU>
References: <bul5rd$opk$1@news.Stanford.EDU>
NNTP-Posting-Host: saga12.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074666785 26006 171.64.15.142 (21 Jan 2004 06:33:05 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bul5rd$opk$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5397

I passed all tests earlier this afternoon but failed tonight and only on
the ftp.stanford.edu site so I think there is probably a problem here.
Maybe others will see this as well.
Leaves me concerned that if the TAs grade our work against this server and
it is flakey, you better hope it it doesn't flake on your run. :-(

On Tue, 20 Jan 2004, Murali Kumar wrote:

> Date: Tue, 20 Jan 2004 22:22:41 -0800
> From: Murali Kumar <kumarm@stanford.edu>
> Newsgroups: su.class.cs244a
> Subject: problem with ftp.stanford.edu
>
> Hi,
>
> I failed a few test cases on the testing script and the common server on
> which my program failed was ftp.stanford.edu. So I decided to ftp into it
> and copy some files from the usr/lib directory. First I tried running my
> program and it did not copy any files as it reported 550 (permission denied)
> on every file in that directory. Next, I telnetted to the server and tried
> to copy the files, issuing first PASV and then PORT and both times, it gave
> me 550 file marked unretrievable for all files. Is it happening to others
> too? I am wondering if I failed the test cases (C and D) because these files
> were retrievable before and somehow they have become unretrievable recently?
>
> Thanks
>
> Kumar
>
>
>

Edward G. Chron

.

Path: shelby.stanford.edu!not-for-mail
From: "Jaideep Ravela" <jaideep_ravela@hotmail.com>
Newsgroups: su.class.cs244a
Subject: STAT
Date: Tue, 20 Jan 2004 22:39:29 -0800
Lines: 8
Distribution: su
Message-ID: <bul6uq$prd$1@news.Stanford.EDU>
NNTP-Posting-Host: rains-02-28a.stanford.edu
X-Trace: news.Stanford.EDU 1074667290 26477 128.12.185.88 (21 Jan 2004 06:41:30 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5398

Are we allowed to use stat() to check if the local start directory specified
by the user exists? I know we are not allowed to use it on the servers as
its implementation varies.

Thanks,
Jaideep


.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: parsing command line for server address
Date: Tue, 20 Jan 2004 22:58:08 -0800
Lines: 28
Distribution: su
Message-ID: <400E2300.E7F2DF5F@stanford.edu>
References: <bug0bl$imr$1@news.Stanford.EDU> <400B8FEB.3000504@stanford.edu> <400BB0FF.AEB131E7@stanford.edu> <buh7j1$q4h$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074668289 27495 127.0.0.1 (21 Jan 2004 06:58:09 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U)
X-Accept-Language: ko,en
Xref: shelby.stanford.edu su.class.cs244a:5399

Matthew Jonathan Holliman wrote:
> 
> >Can't we just skip the call to inet_addr and use gethostbyname
> >directly? I've been doing that and found no problems so far.
> 
> I'm not sure if all systems support this--every example I can recall seeing
> has used both inet_addr() and gethostbyname().  I've certainly read of
> cases, e.g. with WinSock, where gethostbyname() has failed with a dotted
> decimal address.
> 
> So for portability's sake, you should probably use both.

I see.

By the way, UNP says (on p.71, 2nd ed.):
<quote>
Today inet_addr is deprecated and any new code should use inet_aton
instead. Better still is to use the newer functions described in the
next section, which handle both IPv4 and IPv6.
</quote>

So using inet_aton() or inet_pton() would be a better solution than
inet_addr(). Personally I found them also more convenient to use.

Just for your information. :)

-- 
Seungbeom Kim
.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problem with ftp.stanford.edu
Date: Tue, 20 Jan 2004 22:58:11 -0800
Lines: 55
Distribution: su
Message-ID: <bul7u4$qrc$1@news.Stanford.EDU>
References: <bul5rd$opk$1@news.Stanford.EDU> <Pine.GSO.4.44.0401202229320.17709-100000@saga12.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1074668292 27500 128.12.173.169 (21 Jan 2004 06:58:12 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5400

Wow ok...I wish I knew this before...I wasted 2 of my testing tries just to
figure out what was wrong with my code since it was failing on
ftp.stanford.edu. I hope the TAs will keep this flaky nature of
ftp.stanford.edu in mind when they grade our submissions. Could we please
get a TA to confirm this behavior with ftp.stanford.edu?

Thanks again.

Kumar

"Edward Chron" <echron@stanford.edu> wrote in message
news:Pine.GSO.4.44.0401202229320.17709-100000@saga12.Stanford.EDU...
> I passed all tests earlier this afternoon but failed tonight and only on
> the ftp.stanford.edu site so I think there is probably a problem here.
> Maybe others will see this as well.
> Leaves me concerned that if the TAs grade our work against this server and
> it is flakey, you better hope it it doesn't flake on your run. :-(
>
> On Tue, 20 Jan 2004, Murali Kumar wrote:
>
> > Date: Tue, 20 Jan 2004 22:22:41 -0800
> > From: Murali Kumar <kumarm@stanford.edu>
> > Newsgroups: su.class.cs244a
> > Subject: problem with ftp.stanford.edu
> >
> > Hi,
> >
> > I failed a few test cases on the testing script and the common server on
> > which my program failed was ftp.stanford.edu. So I decided to ftp into
it
> > and copy some files from the usr/lib directory. First I tried running my
> > program and it did not copy any files as it reported 550 (permission
denied)
> > on every file in that directory. Next, I telnetted to the server and
tried
> > to copy the files, issuing first PASV and then PORT and both times, it
gave
> > me 550 file marked unretrievable for all files. Is it happening to
others
> > too? I am wondering if I failed the test cases (C and D) because these
files
> > were retrievable before and somehow they have become unretrievable
recently?
> >
> > Thanks
> >
> > Kumar
> >
> >
> >
>
> Edward G. Chron
>


.

Path: shelby.stanford.edu!saga15.Stanford.EDU!spathak
From: Sumedh Pathak <spathak@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Open file descriptors in purify
Date: Tue, 20 Jan 2004 22:58:20 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.GSO.4.44.0401202255440.6415-100000@saga15.Stanford.EDU>
NNTP-Posting-Host: saga15.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074668301 27506 171.64.15.145 (21 Jan 2004 06:58:21 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5401


Hi,

Im getting a bunch of open file descriptors reported through Purify.
These are not that standard stdin/out etc. They are reported as being
created by my methods.
Basically, I create/open a data connection every time I retrieve a file. I
then close the fd's before exiting that method. However, I still get them
as open in purify.
Am I missing something here? Should I be doing something more than just
close()?

thanks,
Sumedh

.

Path: shelby.stanford.edu!elaine42.Stanford.EDU!spathak
From: Sumedh Pathak <spathak@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Open file descriptors in purify
Date: Tue, 20 Jan 2004 23:23:30 -0800
Lines: 27
Distribution: su
Message-ID: <Pine.GSO.4.44.0401202323030.15420-100000@elaine42.Stanford.EDU>
References: <Pine.GSO.4.44.0401202255440.6415-100000@saga15.Stanford.EDU>
NNTP-Posting-Host: elaine42.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074669812 29109 171.64.15.117 (21 Jan 2004 07:23:32 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0401202255440.6415-100000@saga15.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5402


umm,

never mind. found it.


sumedh

On Tue, 20 Jan 2004, Sumedh Pathak wrote:

>
> Hi,
>
> Im getting a bunch of open file descriptors reported through Purify.
> These are not that standard stdin/out etc. They are reported as being
> created by my methods.
> Basically, I create/open a data connection every time I retrieve a file. I
> then close the fd's before exiting that method. However, I still get them
> as open in purify.
> Am I missing something here? Should I be doing something more than just
> close()?
>
> thanks,
> Sumedh
>
>

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: checking local directory existance
Date: Tue, 20 Jan 2004 23:25:52 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0401202324430.24143-100000@Xenon.Stanford.EDU>
References: <bul1il$jjs$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074669954 29241 171.64.66.201 (21 Jan 2004 07:25:54 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <bul1il$jjs$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5403


 man -s 2 access

 .m

> Is there a unix system call I can make to check if the local directory
> exists?
> 
> 
> 


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: STAT
Date: Tue, 20 Jan 2004 23:28:13 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0401202327330.24143-100000@Xenon.Stanford.EDU>
References: <bul6uq$prd$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074670097 29324 171.64.66.201 (21 Jan 2004 07:28:17 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jaideep Ravela <jaideep_ravela@hotmail.com>
In-Reply-To: <bul6uq$prd$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5404


 I sould suggest you use access(2) instead. What servers aren't you allowed
 to use it on? I'm confused :-/

 .m

> Are we allowed to use stat() to check if the local start directory specified
> by the user exists? I know we are not allowed to use it on the servers as
> its implementation varies.
> 
> Thanks,
> Jaideep
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: 'Broken pipe' with ftpcopy.purify
Date: Tue, 20 Jan 2004 23:41:43 -0800
Lines: 9
Distribution: su
Message-ID: <400E2D37.3BB28A5D@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074670904 114 127.0.0.1 (21 Jan 2004 07:41:44 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U)
X-Accept-Language: ko,en
Xref: shelby.stanford.edu su.class.cs244a:5405

When I run ftpcopy.purify, it sometimes crashes with the message
"Broken Pipe". Even with the same set of arguments, it sometimes
crashes and sometimes works well.
It seems to happen at the call to send(), but I don't know why,
and I haven't seen it happen without purify.
So I guess it's a problem with purify; has anyone experienced this?

-- 
Seungbeom Kim
.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftp.stanford.edu again
Date: Wed, 21 Jan 2004 00:03:06 -0800
Lines: 10
Distribution: su
Message-ID: <bulbnn$21f$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1074672183 2095 128.12.173.169 (21 Jan 2004 08:03:03 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5406

Hi,

So apparently I pass all the test cases which i had failed earlier in the
afternoon when i ran it right now, without making any changes to my code. So
I guess there is some problem with ftp.stanford.edu because all cases I
failed earlier were related to ftp.stanford.edu

Kumar


.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: STAT
Date: Wed, 21 Jan 2004 00:45:40 -0800
Lines: 26
Distribution: su
Message-ID: <bule7t$4rh$1@news.Stanford.EDU>
References: <bul6uq$prd$1@news.Stanford.EDU> <Pine.LNX.4.44.0401202327330.24143-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074674749 4977 128.12.90.43 (21 Jan 2004 08:45:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5407

I think he has the unix stat() system call confused with the FTP STAT
command.

"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0401202327330.24143-100000@Xenon.Stanford.EDU...
>
>  I sould suggest you use access(2) instead. What servers aren't you
allowed
>  to use it on? I'm confused :-/
>
>  .m
>
> > Are we allowed to use stat() to check if the local start directory
specified
> > by the user exists? I know we are not allowed to use it on the servers
as
> > its implementation varies.
> >
> > Thanks,
> > Jaideep
> >
> >
> >
>


.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: STAT
Date: Wed, 21 Jan 2004 00:46:21 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.GSO.4.44.0401210043570.8423-100000@elaine43.Stanford.EDU>
References: <bul6uq$prd$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401202327330.24143-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074674785 5000 171.64.15.118 (21 Jan 2004 08:46:25 GMT)
X-Complaints-To: news@news.stanford.edu
Cc: Jaideep Ravela <jaideep_ravela@hotmail.com>
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0401202327330.24143-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5408

I think the assignement refers to STAT command in the FTP protocoal, not
stat() function.  i.e., we are not allowed to send the STAT command to the
FTP server; however, we should be able to use stat() function call to get
the file/dir information on the local host.  Can one of the TAs confirm
this assumption?

-Laura

 On Tue, 20 Jan 2004, Martin Casado wrote:

>
>  I sould suggest you use access(2) instead. What servers aren't you allowed
>  to use it on? I'm confused :-/
>
>  .m
>
> > Are we allowed to use stat() to check if the local start directory specified
> > by the user exists? I know we are not allowed to use it on the servers as
> > its implementation varies.
> >
> > Thanks,
> > Jaideep
> >
> >
> >
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: 'Broken pipe' with ftpcopy.purify
Date: Wed, 21 Jan 2004 01:02:29 -0800
Organization: Stanford University
Lines: 23
Distribution: su
Message-ID: <pan.2004.01.21.09.02.26.844378@stanford.edu>
References: <400E2D37.3BB28A5D@stanford.edu>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1074675749 6021 128.12.69.27 (21 Jan 2004 09:02:29 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Xref: shelby.stanford.edu su.class.cs244a:5409

Seungbeom--

Broken pipe generally means that the connection has unexpectedly been
closed.  The 'strace' utility in Linux (I don't know if there is something
similar for Sun; strace on elaine does something totally different) will
show you the signals (EPIPE, I think, in your case).  Also, I *think* that
if you turn on core dumps ('unlimit core' on elaine) the core and gdb
should tell you exactly where it happened.  This information, coupled with
an ethereal traffic trace (look in cs244a/bin) should let you know if this
is the problem.  Look for a FIN packet in the traffic dump at about the
same time when you see the broken pipe.

---Chris

On Tue, 20 Jan 2004 23:41:43 -0800, Seungbeom Kim wrote:

> When I run ftpcopy.purify, it sometimes crashes with the message
> "Broken Pipe". Even with the same set of arguments, it sometimes
> crashes and sometimes works well.
> It seems to happen at the call to send(), but I don't know why,
> and I haven't seen it happen without purify.
> So I guess it's a problem with purify; has anyone experienced this?

.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: 'Broken pipe' with ftpcopy.purify
Date: Wed, 21 Jan 2004 03:40:10 -0800
Lines: 22
Distribution: su
Message-ID: <400E651A.B3112FFF@stanford.edu>
References: <400E2D37.3BB28A5D@stanford.edu> <pan.2004.01.21.09.02.26.844378@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074685211 14179 127.0.0.1 (21 Jan 2004 11:40:11 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U)
X-Accept-Language: ko,en
Xref: shelby.stanford.edu su.class.cs244a:5410

Chris Edstrom wrote:
> 
> Seungbeom--
> 
> Broken pipe generally means that the connection has unexpectedly been
> closed.  The 'strace' utility in Linux (I don't know if there is something
> similar for Sun; strace on elaine does something totally different) will
> show you the signals (EPIPE, I think, in your case).  Also, I *think* that
> if you turn on core dumps ('unlimit core' on elaine) the core and gdb
> should tell you exactly where it happened.  This information, coupled with
> an ethereal traffic trace (look in cs244a/bin) should let you know if this
> is the problem.  Look for a FIN packet in the traffic dump at about the
> same time when you see the broken pipe.

Yes, the exit code 141(=128+13) tells that SIGPIPE(13) was generated,
and every time it crashes, purify tells me that it was at send().

I didn't try ethereal, but if send() fails for whatever reason,
shouldn't it just return -1 instead of generating a signal?

-- 
Seungbeom Kim
.

Path: shelby.stanford.edu!not-for-mail
From: "Michael Lyubomirskiy" <lyubomir@stanford.edu>
Newsgroups: su.class.cs244a
Subject: how do we find out permissions on file or directory?
Date: Wed, 21 Jan 2004 06:18:36 -0800
Lines: 11
Distribution: su
Message-ID: <bum1nu$n6q$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-50491.stanford.edu
X-Trace: news.Stanford.EDU 1074694718 23770 128.12.51.110 (21 Jan 2004 14:18:38 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5411

it has been mentioned that we should set permissions for files
appropriately. It seems that ftpparse does not extract permissions. Does it?
Should we parse for them ourselves? If so, which exactly permissions can we
extract from list data? Also, could you suggest some manual for interpreting
and parsing it?

Thanks,

Michael


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: how do we find out permissions on file or directory?
Date: Wed, 21 Jan 2004 06:41:20 -0800
Lines: 23
Distribution: su
Message-ID: <bum30s$o85$1@news.Stanford.EDU>
References: <bum1nu$n6q$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1074696028 24837 128.12.61.97 (21 Jan 2004 14:40:28 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5412

Point 6 in the problem description:
"All files should be created with the permissions S_IREAD and S_IWRITE."

I think all "appropriate permissions" means is to have these two set.

Oded

> it has been mentioned that we should set permissions for files
> appropriately. It seems that ftpparse does not extract permissions. Does
it?
> Should we parse for them ourselves? If so, which exactly permissions can
we
> extract from list data? Also, could you suggest some manual for
interpreting
> and parsing it?
>
> Thanks,
>
> Michael
>
>


.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!bergerj
From: Jonathan Berger <bergerj@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problem with ftp.stanford.edu
Date: Wed, 21 Jan 2004 08:14:29 -0800
Lines: 45
Sender: bergerj@elaine3.Stanford.EDU
Distribution: su
Message-ID: <Pine.GSO.4.44.0401210813340.2108-100000@elaine3.Stanford.EDU>
References: <bul5rd$opk$1@news.Stanford.EDU>
 <Pine.GSO.4.44.0401202229320.17709-100000@saga12.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074701671 29942 171.64.15.68 (21 Jan 2004 16:14:31 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0401202229320.17709-100000@saga12.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5413

Just a "me too" to say that I saw the same problem with ftp.stanford.edu
and my code.

I'm hoping the sparodic 550 reply is based upon everyone in the class
hitting the server at once, and so won't be a factor during grading.


On Tue, 20 Jan 2004, Edward Chron wrote:

> I passed all tests earlier this afternoon but failed tonight and only on
> the ftp.stanford.edu site so I think there is probably a problem here.
> Maybe others will see this as well.
> Leaves me concerned that if the TAs grade our work against this server and
> it is flakey, you better hope it it doesn't flake on your run. :-(
>
> On Tue, 20 Jan 2004, Murali Kumar wrote:
>
> > Date: Tue, 20 Jan 2004 22:22:41 -0800
> > From: Murali Kumar <kumarm@stanford.edu>
> > Newsgroups: su.class.cs244a
> > Subject: problem with ftp.stanford.edu
> >
> > Hi,
> >
> > I failed a few test cases on the testing script and the common server on
> > which my program failed was ftp.stanford.edu. So I decided to ftp into it
> > and copy some files from the usr/lib directory. First I tried running my
> > program and it did not copy any files as it reported 550 (permission denied)
> > on every file in that directory. Next, I telnetted to the server and tried
> > to copy the files, issuing first PASV and then PORT and both times, it gave
> > me 550 file marked unretrievable for all files. Is it happening to others
> > too? I am wondering if I failed the test cases (C and D) because these files
> > were retrievable before and somehow they have become unretrievable recently?
> >
> > Thanks
> >
> > Kumar
> >
> >
> >
>
> Edward G. Chron
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problem with ftp.stanford.edu
Date: Wed, 21 Jan 2004 08:19:50 -0800
Lines: 63
Distribution: su
Message-ID: <bum8ph$71$1@news.Stanford.EDU>
References: <bul5rd$opk$1@news.Stanford.EDU> <Pine.GSO.4.44.0401202229320.17709-100000@saga12.Stanford.EDU> <Pine.GSO.4.44.0401210813340.2108-100000@elaine3.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1074701937 225 128.12.61.97 (21 Jan 2004 16:18:57 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5414

This is not necessarily the problem you are all having, but I got 550's when
I accidentally wrote with \r\n\r\n.

Just in case that's the problem for someone out there...
Oded

> Just a "me too" to say that I saw the same problem with ftp.stanford.edu
> and my code.
>
> I'm hoping the sparodic 550 reply is based upon everyone in the class
> hitting the server at once, and so won't be a factor during grading.
>
>
> On Tue, 20 Jan 2004, Edward Chron wrote:
>
> > I passed all tests earlier this afternoon but failed tonight and only on
> > the ftp.stanford.edu site so I think there is probably a problem here.
> > Maybe others will see this as well.
> > Leaves me concerned that if the TAs grade our work against this server
and
> > it is flakey, you better hope it it doesn't flake on your run. :-(
> >
> > On Tue, 20 Jan 2004, Murali Kumar wrote:
> >
> > > Date: Tue, 20 Jan 2004 22:22:41 -0800
> > > From: Murali Kumar <kumarm@stanford.edu>
> > > Newsgroups: su.class.cs244a
> > > Subject: problem with ftp.stanford.edu
> > >
> > > Hi,
> > >
> > > I failed a few test cases on the testing script and the common server
on
> > > which my program failed was ftp.stanford.edu. So I decided to ftp into
it
> > > and copy some files from the usr/lib directory. First I tried running
my
> > > program and it did not copy any files as it reported 550 (permission
denied)
> > > on every file in that directory. Next, I telnetted to the server and
tried
> > > to copy the files, issuing first PASV and then PORT and both times, it
gave
> > > me 550 file marked unretrievable for all files. Is it happening to
others
> > > too? I am wondering if I failed the test cases (C and D) because these
files
> > > were retrievable before and somehow they have become unretrievable
recently?
> > >
> > > Thanks
> > >
> > > Kumar
> > >
> > >
> > >
> >
> > Edward G. Chron
> >
> >
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: What should be done if ftpcopy fails to create directory on the local host?
Date: Wed, 21 Jan 2004 09:07:25 -0800
Lines: 18
Distribution: su
Message-ID: <bumbio$2r6$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401200048060.11036-100000@elaine18.Stanford.EDU> <bujlk3$sga$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1074704792 2918 128.12.61.97 (21 Jan 2004 17:06:32 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5415

It doesn't make sense to silently ignore it and continue, but because we're
supposed to limit our output to one line only, we can't acknowledge it and
continue.  So as unfortunate as it may be, wouldn't we have to fail on this?

Oded

> >What should be done if ftpcopy fails to create directory on the local
> >host?
>
> >(1) terminate the program and printout error, or
> >(2) silently go the next entry in the list and continue.
>
> You should make your own judgement about these kinds of issues.  But does
> it seem reasonable to you that the program would silently continue without
> warning the user that something's wrong?
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ftp.slac.stanford.edu: 230 response size is longer than 1024
Date: Wed, 21 Jan 2004 10:08:37 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.LNX.4.44.0401211006590.26163-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401201524460.17593-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074708519 6790 171.64.66.201 (21 Jan 2004 18:08:39 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401201524460.17593-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5416


 The assumption is that each line will be no longer than 1024 ..... however,
 the response in total can be arbitrarily long.  Are you getting a line
 (delimited by \r\n) that is longer than 1024? This I haven't seen.

 .m

> 
> As I understand, the assumption is that the FTP response sent within the
> control control will be no longer than 1024.  However, when I tried to
> test with ftp.slac.stanford.edu, the 230 response message is longer than
> 1024 bytes.  I increase the buffer size to 2048.
> 
> Is there any better approach?
> 
> -Laura
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: case sensitive file extensions & closing connections on error
Date: Wed, 21 Jan 2004 10:16:37 -0800
Lines: 47
Distribution: su
Message-ID: <Pine.LNX.4.44.0401211010290.26163-100000@Xenon.Stanford.EDU>
References: <pan.2004.01.20.05.09.29.549685@stanford.edu> <buighp$ede$1@news.Stanford.EDU>
 <400DE448.6F2612DF@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074708999 7404 171.64.66.201 (21 Jan 2004 18:16:39 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tony Chun-hao Hsieh <thsieh@stanford.edu>
In-Reply-To: <400DE448.6F2612DF@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5417


 This is actually a good point.  Microsoft's ftp server is not case sensitive
 as can be shown as follows.

  ftp> dir INDEX.TXT
  200 PORT command successful.
  150 Opening ASCII mode data connection for /bin/ls.
  -r-xr-xr-x   1 owner    group              97 Sep 28  1993 INDEX.TXT
  226 Transfer complete.
  remote: INDEX.TXT
  ftp> get iNdEx.TxT
  200 PORT command successful.
  150 Opening ASCII mode data connection for iNdEx.TxT(97 bytes).
  226 Transfer complete.
  local: iNdEx.TxT remote: iNdEx.TxT
  97 bytes received in 0.0047 seconds (20.18 Kbytes/s)

 However, I think the FAQ is wrong and that you should never issue a 
 RETR on a file where the suffix has a different case. 

 .m


> In http://www.stanford.edu/class/cs244a/homeworks/hw1/hw1faq.html#Q17 it
> has various servers and directory copies to try.  Under ftpcopy txt 5
> ftp.microsoft.com localdir /peropsys/ie it copies the q240308.txt file
> but the file on the server ends with .TXT.  The faq page seems to be
> conflicting with what you say then.  Also just to let you know the
> ftpcopy X 2 204.123.2.2 localdir /pub/comm no longer works because the
> directory /pub/comm no longer exists on the FTP server.  Just wanted to
> let people know in case they come across this faq page too!
> 
> Matthew Jonathan Holliman wrote:
> > 
> > >1. Should we assume file extensions are case sensitive or should we
> > >download all files that match regardless of case?
> > 
> > Yep, they're case-sensitive.
> > 
> > >2. Is it necessary to close our open sockets when terminating on an error?
> > 
> > It's not strictly necessary, but it's a good practice.  We don't check this
> > when grading (we *do* check on normal termination, of course), but it's a
> > bit unfriendly to leave the other side of the connection open.  You may as
> > well close the sockets and let the other side shut down gracefully...
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ACCT?
Date: Wed, 21 Jan 2004 10:18:20 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.LNX.4.44.0401211016430.26163-100000@Xenon.Stanford.EDU>
References: <buko9b$ake$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074709102 7502 171.64.66.201 (21 Jan 2004 18:18:22 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <buko9b$ake$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5418


 Not really. You should be able to handle arbitrary (rfc compliant) replies
 from each command (crashing or hanging won't cut it) but in this case exiting
 is sufficient.

 .m

> If we get:
> >USER anonymous
> <331 Password requires for anonymous
> >PASS user@host
> <332 (account required)
> 
> Are we required to deal with that?
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: help on test E of testing script
Date: Wed, 21 Jan 2004 10:26:44 -0800
Lines: 38
Distribution: su
Message-ID: <Pine.LNX.4.44.0401211018330.26163-100000@Xenon.Stanford.EDU>
References: <bukphu$bpa$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074709609 8030 171.64.66.201 (21 Jan 2004 18:26:49 GMT)
X-Complaints-To: news@news.stanford.edu
To: Murali Kumar <kumarm@stanford.edu>
In-Reply-To: <bukphu$bpa$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5419


 As many have noted by now ... ftp.stanford.edu was acting funny last night. I
 haven't verified this yet ... getting to that.

 .m

> Hi,
> 
> I am not able to pass Test E of the testing script and I was wondering if
> some one could shed light on what is it that this test is trying to do and
> where could the possible source of error lie in my code. Here's the output
> snippet from the testing script run:
> 
> Test E [out of 2.5]
> Checks whether ftpcopy relies on a particular site.
> 
> Results:  NOT OK (passed only 4 out of 5 subtests)
> 
> Output incorrect for server ftp.stanford.edu.
> 
> So somehow something is failing when ftpcopy is run with ftp.stanford.edu as
> the server to contact. The only things I can think of is a) I am not passing
> the cmds to the server in proper format b) I am making some error in the
> interleaving of reads and close on data and control sockets.
> 
> I have checked by code and till now it seems to me that I am not committing
> either of the two mistakes. And everything works fine when i connect to
> other servers. If some one could shed some light on what this test is
> looking for, it will be of great help to me in figuring out what is going
> wrong with my code.
> 
> Thanks a lot
> 
> Kumar
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: .Purify file
Date: Wed, 21 Jan 2004 10:27:46 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.LNX.4.44.0401211026540.26163-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401201853320.22234-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074709668 8067 171.64.66.201 (21 Jan 2004 18:27:48 GMT)
X-Complaints-To: news@news.stanford.edu
To: Boris Senderzon <senderzo@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401201853320.22234-100000@epic6.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5420


 That is fine.  .purify is the file you use to place purify configuration.
 If you didn't use one, just touch it so the grading script can find it.

 .m

> This was already asked just wanted to confirm.
> 
> Handout says
> .purify - Supress statements you used in generating purify.output
> 
> What exactly does this mean?  I recall someone suggested to just
> touch .purify.  Is that right?
> 
> Thanks.
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: problem with ftp.stanford.edu
Date: Wed, 21 Jan 2004 10:31:04 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.LNX.4.44.0401211028050.26163-100000@Xenon.Stanford.EDU>
References: <bul5rd$opk$1@news.Stanford.EDU>
 <Pine.GSO.4.44.0401202229320.17709-100000@saga12.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074709866 8374 171.64.66.201 (21 Jan 2004 18:31:06 GMT)
X-Complaints-To: news@news.stanford.edu
To: Edward Chron <echron@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401202229320.17709-100000@saga12.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5421


> I passed all tests earlier this afternoon but failed tonight and only on
> the ftp.stanford.edu site so I think there is probably a problem here.
> Maybe others will see this as well.
> Leaves me concerned that if the TAs grade our work against this server and
> it is flakey, you better hope it it doesn't flake on your run. :-(

 Hehe, don't worry :) We aren't completely oblivious nor malicious.  We take
 time when grading your tests and if there is a problem  you will not be held
 accountable.  Thanks for pointing out the problems however, makes it easier
 for us

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: problem with ftp.stanford.edu
Date: Wed, 21 Jan 2004 10:31:55 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.LNX.4.44.0401211031220.26163-100000@Xenon.Stanford.EDU>
References: <bul5rd$opk$1@news.Stanford.EDU>
 <Pine.GSO.4.44.0401202229320.17709-100000@saga12.Stanford.EDU>
 <bul7u4$qrc$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074709917 8435 171.64.66.201 (21 Jan 2004 18:31:57 GMT)
X-Complaints-To: news@news.stanford.edu
To: Murali Kumar <kumarm@stanford.edu>
In-Reply-To: <bul7u4$qrc$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5422


> get a TA to confirm this behavior with ftp.stanford.edu?

  Seems to be acting OK this morning.  That doesn't mean there wasn't a
  problem last night however.

  .m

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftp.slac.stanford.edu
Date: Wed, 21 Jan 2004 10:33:37 -0800
Lines: 7
Distribution: su
Message-ID: <bumgka$89f$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1074709963 8495 128.12.61.97 (21 Jan 2004 18:32:43 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5423

I don't suppose someone can verify is ftp.slac.stanford.edu is acting up?
I'm failing all my tests on that server...

Thanks,
Oded


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Open file descriptors in purify
Date: Wed, 21 Jan 2004 10:33:25 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.LNX.4.44.0401211032000.26163-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401202255440.6415-100000@saga15.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074710007 8527 171.64.66.201 (21 Jan 2004 18:33:27 GMT)
X-Complaints-To: news@news.stanford.edu
To: Sumedh Pathak <spathak@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401202255440.6415-100000@saga15.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5424


  Closing should be enough.  Make sure you aren't doing something silly
  like on errors, returning before calling close. 

  .m

> 
> Hi,
> 
> Im getting a bunch of open file descriptors reported through Purify.
> These are not that standard stdin/out etc. They are reported as being
> created by my methods.
> Basically, I create/open a data connection every time I retrieve a file. I
> then close the fd's before exiting that method. However, I still get them
> as open in purify.
> Am I missing something here? Should I be doing something more than just
> close()?
> 
> thanks,
> Sumedh
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: STAT
Date: Wed, 21 Jan 2004 10:34:48 -0800
Lines: 35
Distribution: su
Message-ID: <Pine.LNX.4.44.0401211034010.26163-100000@Xenon.Stanford.EDU>
References: <bul6uq$prd$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401202327330.24143-100000@Xenon.Stanford.EDU>
 <bule7t$4rh$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074710090 8640 171.64.66.201 (21 Jan 2004 18:34:50 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bule7t$4rh$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5425

 
 Ahh! I get it (thanks Eddy).  Don't use the ftp command STAT, you may use the
 library call stat(..) if you wish.

 .m


> I think he has the unix stat() system call confused with the FTP STAT
> command.
> 
> "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> news:Pine.LNX.4.44.0401202327330.24143-100000@Xenon.Stanford.EDU...
> >
> >  I sould suggest you use access(2) instead. What servers aren't you
> allowed
> >  to use it on? I'm confused :-/
> >
> >  .m
> >
> > > Are we allowed to use stat() to check if the local start directory
> specified
> > > by the user exists? I know we are not allowed to use it on the servers
> as
> > > its implementation varies.
> > >
> > > Thanks,
> > > Jaideep
> > >
> > >
> > >
> >
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: 'Broken pipe' with ftpcopy.purify
Date: Wed, 21 Jan 2004 10:39:40 -0800
Lines: 32
Distribution: su
Message-ID: <Pine.LNX.4.44.0401211037580.26163-100000@Xenon.Stanford.EDU>
References: <400E2D37.3BB28A5D@stanford.edu> <pan.2004.01.21.09.02.26.844378@stanford.edu>
 <400E651A.B3112FFF@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074710382 8881 171.64.66.201 (21 Jan 2004 18:39:42 GMT)
X-Complaints-To: news@news.stanford.edu
To: Seungbeom Kim <sbkim@stanford.edu>
In-Reply-To: <400E651A.B3112FFF@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5426


 I'm not sure about solaris, but if the pier resets the connection, the second
 time to try and write to a socket you will get a SIGPIPE.  What I don't
 understand is why you are writing to a disconnected socket ... you should
 never write to the data socket ... and the control socket shouldn't close
 so it is unclear to me what is going on.  Where in the protocol is this
 happening?

 .m

> Chris Edstrom wrote:
> > 
> > Seungbeom--
> > 
> > Broken pipe generally means that the connection has unexpectedly been
> > closed.  The 'strace' utility in Linux (I don't know if there is something
> > similar for Sun; strace on elaine does something totally different) will
> > show you the signals (EPIPE, I think, in your case).  Also, I *think* that
> > if you turn on core dumps ('unlimit core' on elaine) the core and gdb
> > should tell you exactly where it happened.  This information, coupled with
> > an ethereal traffic trace (look in cs244a/bin) should let you know if this
> > is the problem.  Look for a FIN packet in the traffic dump at about the
> > same time when you see the broken pipe.
> 
> Yes, the exit code 141(=128+13) tells that SIGPIPE(13) was generated,
> and every time it crashes, purify tells me that it was at send().
> 
> I didn't try ethereal, but if send() fails for whatever reason,
> shouldn't it just return -1 instead of generating a signal?
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: problem with ftp.stanford.edu
Date: Wed, 21 Jan 2004 10:44:03 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.LNX.4.44.0401211039590.26163-100000@Xenon.Stanford.EDU>
References: <bul5rd$opk$1@news.Stanford.EDU>
 <Pine.GSO.4.44.0401202229320.17709-100000@saga12.Stanford.EDU>
 <Pine.GSO.4.44.0401210813340.2108-100000@elaine3.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074710646 9250 171.64.66.201 (21 Jan 2004 18:44:06 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jonathan Berger <bergerj@cs.stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401210813340.2108-100000@elaine3.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5427


> I'm hoping the sparodic 550 reply is based upon everyone in the class
> hitting the server at once, and so won't be a factor during grading.

 actually, due to grade inflation here at Stanford we've implemented a
 random lottery for .....

 err...

 don't worry you wont be deducted for flaky behavior on ftp.stanford.edu or
 any other server.  The tests are manually driven and inspected.

 :)
 .m

.

Path: shelby.stanford.edu!saga12.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: problem with ftp.stanford.edu
Date: Wed, 21 Jan 2004 11:44:08 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.GSO.4.44.0401211140480.27080-100000@saga12.Stanford.EDU>
References: <bul5rd$opk$1@news.Stanford.EDU>
 <Pine.GSO.4.44.0401202229320.17709-100000@saga12.Stanford.EDU>
 <bul7u4$qrc$1@news.Stanford.EDU> <Pine.LNX.4.44.0401211031220.26163-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: saga12.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074714250 14301 171.64.15.142 (21 Jan 2004 19:44:10 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0401211031220.26163-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5428

I re-ran the test script and my other tests this morning with the same
code and had no problems this time around.

Last night I was also having a hard time getting a connection to
ftp.microsoft.com but this morning I only got a 426 once.

Thanks,

Ed
On Wed, 21 Jan 2004, Martin Casado wrote:

> Date: Wed, 21 Jan 2004 10:31:55 -0800
> From: Martin Casado <casado@Xenon.Stanford.EDU>
> To: Murali Kumar <kumarm@stanford.edu>
> Newsgroups: su.class.cs244a
> Subject: Re: problem with ftp.stanford.edu
>
>
> > get a TA to confirm this behavior with ftp.stanford.edu?
>
>   Seems to be acting OK this morning.  That doesn't mean there wasn't a
>   problem last night however.
>
>   .m
>
>

Edward G. Chron

.

Path: shelby.stanford.edu!amy4.Stanford.EDU!dbentley
From: Daniel Timothy Bentley <dbentley@stanford.edu>
Newsgroups: su.class.cs244a
Subject: getservbyname failing
Date: Wed, 21 Jan 2004 12:30:10 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.GSO.4.44.0401211229400.24577-100000@amy4.Stanford.EDU>
NNTP-Posting-Host: amy4.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074717012 17378 171.64.15.165 (21 Jan 2004 20:30:12 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5429

My calls to getservbyname("ftp", "tcp") are returning NULL.  Anybody else
seeing this?

-D

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: grading script
Date: Wed, 21 Jan 2004 14:20:40 -0800
Lines: 11
Distribution: su
Message-ID: <bumtu1$n5n$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1074723585 23735 128.12.61.97 (21 Jan 2004 22:19:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5430

Hey folks,
I keep failing the grading script for ftp.slac.stanford.edu.  I'm failling
majorly on F.1, F.2, and K.  It says I'm not finding certain files.  When I
run it manually from all sorts of starting directories with all sorts of
depths, it works just fine and finds all the right files.

Anyone have any clue?  Please help.

Oded


.

Path: shelby.stanford.edu!elaine38.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: parsing command line for server address
Date: Wed, 21 Jan 2004 22:28:25 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <bumue9$nkr$1@news.Stanford.EDU>
References: <bug0bl$imr$1@news.Stanford.EDU> <400B8FEB.3000504@stanford.edu> <400BB0FF.AEB131E7@stanford.edu> <buh7j1$q4h$1@news.Stanford.EDU> <400E2300.E7F2DF5F@stanford.edu>
NNTP-Posting-Host: elaine38.stanford.edu
X-Trace: news.Stanford.EDU 1074724105 24219 171.64.15.113 (21 Jan 2004 22:28:25 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5431


>By the way, UNP says (on p.71, 2nd ed.):
><quote>
>Today inet_addr is deprecated and any new code should use inet_aton
>instead. Better still is to use the newer functions described in the
>next section, which handle both IPv4 and IPv6.
></quote>

>So using inet_aton() or inet_pton() would be a better solution than
>inet_addr(). Personally I found them also more convenient to use.

Yep, you're quite correct--many of the IPv4 APIs we're using are quite
antiquated by now.  (I haven't seen much code actually using the newer
versions though).

.

Path: shelby.stanford.edu!elaine38.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Handout4, slide 42
Date: Wed, 21 Jan 2004 22:31:27 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <bumujv$nri$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401201543470.9489-100000@elaine27.Stanford.EDU>
NNTP-Posting-Host: elaine38.stanford.edu
X-Trace: news.Stanford.EDU 1074724287 24434 171.64.15.113 (21 Jan 2004 22:31:27 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5432



>I have a rather simple question about the ternary cam there. The 5th row
>has the same port ( 4 ) as the one used for the 255.255.0.0 mask entry
>just above it. shouldn't the port number be one more = 5 ?

Nope, it could have any port--the values are sorted according to their
priority (i.e. length of a match), but the port associated with a match
doesn't occur in any particular order.  It just happens in that example
that the table shows an exact match for 10.1.1.32 going out of port 1, and
the least specific match of 10.x.x.x goes out of port 4.

.

Path: shelby.stanford.edu!elaine38.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Files marked unretrievable
Date: Wed, 21 Jan 2004 22:35:21 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <bumur9$o2q$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401202208200.17549-100000@saga12.Stanford.EDU>
NNTP-Posting-Host: elaine38.stanford.edu
X-Trace: news.Stanford.EDU 1074724521 24666 171.64.15.113 (21 Jan 2004 22:35:21 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5433


>I tried several times and getting those files failed but on fourth try I
>ftp'ed them successfully.

>Is this just the ftp server being flakey?

I think so--it works for me when I try now.

BTW--for anyone using the test script and encountering a flakey server,
keep in mind that you can rerun the test on the same source code without
penalty later on, when the server might be behaving better.  (The grading
script FAQ also describes how you can save source and its associated key
to retest, in case you want to make some changes in the meantime).
.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: grading script
Date: Wed, 21 Jan 2004 14:38:02 -0800
Lines: 21
Distribution: su
Message-ID: <bumuum$o5u$1@news.Stanford.EDU>
References: <bumtu1$n5n$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1074724630 24766 128.12.61.97 (21 Jan 2004 22:37:10 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5434

Finally found it, thanks to a friend who pointed out that 64 chacters is in
fact not enough for all arguments.

gg

Oded

> Hey folks,
> I keep failing the grading script for ftp.slac.stanford.edu.  I'm failling
> majorly on F.1, F.2, and K.  It says I'm not finding certain files.  When
I
> run it manually from all sorts of starting directories with all sorts of
> depths, it works just fine and finds all the right files.
>
> Anyone have any clue?  Please help.
>
> Oded
>
>


.

Path: shelby.stanford.edu!elaine38.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: case sensitive file extensions & closing connections on error
Date: Wed, 21 Jan 2004 22:40:37 +0000 (UTC)
Lines: 58
Distribution: su
Message-ID: <bumv55$odn$1@news.Stanford.EDU>
References: <pan.2004.01.20.05.09.29.549685@stanford.edu> <buighp$ede$1@news.Stanford.EDU>  <400DE448.6F2612DF@stanford.edu> <Pine.LNX.4.44.0401211010290.26163-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine38.stanford.edu
X-Trace: news.Stanford.EDU 1074724837 25015 171.64.15.113 (21 Jan 2004 22:40:37 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5435


Whether or not MS's ftp server is case-sensitive, you still wouldn't
attempt to retrieve INDEX.TXT if "txt" was the specified extension...
so I agree with Martin on this.

I hadn't seen that section of the FAQ before--it's old, and I'd be very
surprised if it has any relevance to the actual contents of ftp servers
now.  (At the time it was written, I'm positive that the file on the MS
server would have had a "txt" extension, not a "TXT" one, though).  Thanks
for pointing this out--I'll delete it.


> This is actually a good point.  Microsoft's ftp server is not case sensitive
> as can be shown as follows.

>  ftp> dir INDEX.TXT
>  200 PORT command successful.
>  150 Opening ASCII mode data connection for /bin/ls.
>  -r-xr-xr-x   1 owner    group              97 Sep 28  1993 INDEX.TXT
>  226 Transfer complete.
>  remote: INDEX.TXT
>  ftp> get iNdEx.TxT
>  200 PORT command successful.
>  150 Opening ASCII mode data connection for iNdEx.TxT(97 bytes).
>  226 Transfer complete.
>  local: iNdEx.TxT remote: iNdEx.TxT
>  97 bytes received in 0.0047 seconds (20.18 Kbytes/s)

> However, I think the FAQ is wrong and that you should never issue a 
> RETR on a file where the suffix has a different case. 

> .m


>> In http://www.stanford.edu/class/cs244a/homeworks/hw1/hw1faq.html#Q17 it
>> has various servers and directory copies to try.  Under ftpcopy txt 5
>> ftp.microsoft.com localdir /peropsys/ie it copies the q240308.txt file
>> but the file on the server ends with .TXT.  The faq page seems to be
>> conflicting with what you say then.  Also just to let you know the
>> ftpcopy X 2 204.123.2.2 localdir /pub/comm no longer works because the
>> directory /pub/comm no longer exists on the FTP server.  Just wanted to
>> let people know in case they come across this faq page too!
>> 
>> Matthew Jonathan Holliman wrote:
>> > 
>> > >1. Should we assume file extensions are case sensitive or should we
>> > >download all files that match regardless of case?
>> > 
>> > Yep, they're case-sensitive.
>> > 
>> > >2. Is it necessary to close our open sockets when terminating on an error?
>> > 
>> > It's not strictly necessary, but it's a good practice.  We don't check this
>> > when grading (we *do* check on normal termination, of course), but it's a
>> > bit unfriendly to leave the other side of the connection open.  You may as
>> > well close the sockets and let the other side shut down gracefully...
>> 

.

Path: shelby.stanford.edu!elaine10.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp.slac.stanford.edu: 230 response size is longer than 1024
Date: Wed, 21 Jan 2004 14:42:47 -0800
Lines: 25
Distribution: su
Message-ID: <Pine.GSO.4.44.0401211441400.7978-100000@elaine10.Stanford.EDU>
References: <Pine.GSO.4.44.0401201524460.17593-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0401211006590.26163-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine10.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074724971 25170 171.64.15.75 (21 Jan 2004 22:42:51 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0401211006590.26163-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5436

Ok, I guess I got the wrong idea about the complete size of the response
will not be longer than 1024.
On Wed, 21 Jan 2004, Martin Casado wrote:

>
>  The assumption is that each line will be no longer than 1024 ..... however,
>  the response in total can be arbitrarily long.  Are you getting a line
>  (delimited by \r\n) that is longer than 1024? This I haven't seen.
>
>  .m
>
> >
> > As I understand, the assumption is that the FTP response sent within the
> > control control will be no longer than 1024.  However, when I tried to
> > test with ftp.slac.stanford.edu, the 230 response message is longer than
> > 1024 bytes.  I increase the buffer size to 2048.
> >
> > Is there any better approach?
> >
> > -Laura
> >
> >
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Answer to Hw#1 Question 3b
Date: Wed, 21 Jan 2004 15:19:45 -0800
Organization: CS Masters Program
Lines: 37
Distribution: su
Message-ID: <bun1eq$r9e$1@news.Stanford.EDU>
References: <buespi$cv1$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1074727196 27950 127.0.0.1 (21 Jan 2004 23:19:56 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5437

I have the same question as Josh; I don't understand the solution to #3b.

Specifically, I don't understand why one can assume that the average queue
occupancy of the "second subsystem" is 750 KB, which is a key assumption in
the explanation:
       The faulty router can be considered as composing of two subsystems:
the first drops 25% of the packets, while the second is a perfect router
with arrival rate 25% less than the original router, i.e., 4.5 x 108
bits/second. Little's result applies to the second subsystem, implying that
the average delay is 750KB/(4.5 x 108 bits/second) = 13.3ms.

My thought on this problem is that the delay would go _down_ by 25%, to 7.5
ms, assuming the packets are dropped before they enter the queue.

If, on the other hand, the packets are dropped after going through the
queue, I would think the average delay would be unchanged. This would be the
case since we're just dropping the packet instead of forwarding it at the
very end, after the packet has worked its way through the queue.

Any help in understanding this would be greatly appreciated.
Thanks,

Greg

"Joshua Silver" <jmsilver@stanford.edu> wrote in message
news:buespi$cv1$1@news.Stanford.EDU...
> I don't understand the solution to question 3b.  According to the
solution,
> the same router as in part a) is getting 25% fewer packets and yet the
delay
> time goes up from 10ms to 13.3 ms.    What am I missing?
>
> Josh
>
>


.

Path: shelby.stanford.edu!elaine38.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Answer to Hw#1 Question 3b
Date: Wed, 21 Jan 2004 23:35:58 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <bun2cu$se5$1@news.Stanford.EDU>
References: <buespi$cv1$1@news.Stanford.EDU> <bun1eq$r9e$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine38.stanford.edu
X-Trace: news.Stanford.EDU 1074728158 29125 171.64.15.113 (21 Jan 2004 23:35:58 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5438


>If, on the other hand, the packets are dropped after going through the
>queue, I would think the average delay would be unchanged. This would be the
>case since we're just dropping the packet instead of forwarding it at the
>very end, after the packet has worked its way through the queue.

The assumption was just that the router would drop 25% of incoming packets,
but would still have a 750 KB queue length--it wasn't intended that it was
suddenly the dropping packets (in which case the queue occupancy may well
decrease, as you observe).  i.e., it's not really a continuation 
of part (a) so much as a separate problem--a router drops 25% of incoming
packets, has an average 750 KB queue length, so what's the delay?

Given the ambiguity in the wording, we were quite lenient in grading this.

(BTW--if you don't assume the interpretation I've given here, I don't
know if there's enough information given to determine a unique answer...
the answer would seem to depend on the particulars of the arrival process.)
.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: arp request or reply?
Date: Wed, 21 Jan 2004 20:02:14 -0800
Lines: 8
Distribution: su
Message-ID: <20040121200214.68567f4c.chanman@stanford.edu>
NNTP-Posting-Host: chanman.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074744230 28315 128.12.94.94 (22 Jan 2004 04:03:50 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-pc-linux-gnu)
Xref: shelby.stanford.edu su.class.cs244a:5439

In the hw2 description it says:

"Currently the stub code is event based. That is, code is executed each time a packet is received. This makes it impossible to correctly enforce timeouts. For example, if the router is waiting for an ARP request that doesn't come"

Why would you wait for an ARP request?  Or does it mean to wait for a reply?

Thanks,
William
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: arp request or reply?
Date: Wed, 21 Jan 2004 22:23:57 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.LNX.4.44.0401212221350.29992-100000@Xenon.Stanford.EDU>
References: <20040121200214.68567f4c.chanman@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074752639 25658 171.64.66.201 (22 Jan 2004 06:23:59 GMT)
X-Complaints-To: news@news.stanford.edu
To: William Chan <chanman@stanford.edu>
In-Reply-To: <20040121200214.68567f4c.chanman@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5440


> In the hw2 description it says:
> 
> "Currently the stub code is event based. That is, code is executed each time
> a packet is received. This makes it impossible to correctly enforce timeouts.
> For example, if the router is waiting for an ARP request that doesn't come"
> 
> Why would you wait for an ARP request?  Or does it mean to wait for a reply?

 Whoops, my fault.  Yes you are right .. and it is corrected.

 Thanks :)
 .m

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: parsing packet
Date: Thu, 22 Jan 2004 12:34:38 -0800
Lines: 27
Distribution: su
Message-ID: <Pine.GSO.4.44.0401221230080.19079-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074803681 17366 171.64.15.106 (22 Jan 2004 20:34:41 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5441


In sr_handlepacket, the argument 'packet' is a pointer to the ip
datagram that comes in, correct?

if so, can we do something like:

ip_hdr = (struct ip*)packet;

ip_payload = packet + sizeof (struct ip);

I was looking at a dump of an ARP packet that came into handle packet, and
i get something like the following:

(gdb) x/15x packet
0x276a8:        0xffffffff      0xffff00e0      0x810426d9      0x08060001
0x276b8:        0x08000604      0x000100e0      0x810426d9      0xac184a11
0x276c8:        0x00000000      0x0000ab43      0x47020000      0x00000000
0x276d8:        0x00000000      0x00000000      0x00000000

but the leading 0xffffffff  doesn't seem to fit the version/hlen and
type of service fields that the ip header should begin with...

what am i doing wrong?

--vishal


.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: parsing packet
Date: Thu, 22 Jan 2004 13:01:21 -0800
Lines: 33
Distribution: su
Message-ID: <bupdhr$i6h$2@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401221230080.19079-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: william.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074805115 18641 128.12.94.88 (22 Jan 2004 20:58:35 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030727 Thunderbird/0.1
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0401221230080.19079-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5443

it's the ip datagram wrapped in an ethernet frame, so the first bytes 
are from the ethernet header

--will

Vishal Patel wrote:
> In sr_handlepacket, the argument 'packet' is a pointer to the ip
> datagram that comes in, correct?
> 
> if so, can we do something like:
> 
> ip_hdr = (struct ip*)packet;
> 
> ip_payload = packet + sizeof (struct ip);
> 
> I was looking at a dump of an ARP packet that came into handle packet, and
> i get something like the following:
> 
> (gdb) x/15x packet
> 0x276a8:        0xffffffff      0xffff00e0      0x810426d9      0x08060001
> 0x276b8:        0x08000604      0x000100e0      0x810426d9      0xac184a11
> 0x276c8:        0x00000000      0x0000ab43      0x47020000      0x00000000
> 0x276d8:        0x00000000      0x00000000      0x00000000
> 
> but the leading 0xffffffff  doesn't seem to fit the version/hlen and
> type of service fields that the ip header should begin with...
> 
> what am i doing wrong?
> 
> --vishal
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: parsing packet
Date: Thu, 22 Jan 2004 14:17:47 -0800
Lines: 52
Distribution: su
Message-ID: <Pine.LNX.4.44.0401221411400.13291-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401221230080.19079-100000@elaine31.Stanford.EDU>
 <bupdhr$i6h$2@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074809868 24532 171.64.66.201 (22 Jan 2004 22:17:48 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bupdhr$i6h$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5444

On Thu, 22 Jan 2004, William Chan wrote:

> the first bytes  are from the ethernet header

right. it also helps to clarify that it need not necessarily be an ip 
packet inside the ethernet frame. (e.g., it can also be an arp packet.) 

Shankar

> 
> --will
> 
> Vishal Patel wrote:
> > In sr_handlepacket, the argument 'packet' is a pointer to the ip
> > datagram that comes in, correct?
> > 
> > if so, can we do something like:
> > 
> > ip_hdr = (struct ip*)packet;
> > 
> > ip_payload = packet + sizeof (struct ip);
> > 
> > I was looking at a dump of an ARP packet that came into handle packet, and
> > i get something like the following:
> > 
> > (gdb) x/15x packet
> > 0x276a8:        0xffffffff      0xffff00e0      0x810426d9      0x08060001
> > 0x276b8:        0x08000604      0x000100e0      0x810426d9      0xac184a11
> > 0x276c8:        0x00000000      0x0000ab43      0x47020000      0x00000000
> > 0x276d8:        0x00000000      0x00000000      0x00000000
> > 
> > but the leading 0xffffffff  doesn't seem to fit the version/hlen and
> > type of service fields that the ip header should begin with...
> > 
> > what am i doing wrong?
> > 
> > --vishal
> > 
> > 
> 
> 

-- 

Shankar Ponnekanti

PhD CS Student
#252, Gates Building, Stanford
E-mail : pshankar@stanford.edu, pshankar@cs.stanford.edu
Phone (evening)  : 650-497-4390
      (daytime)  : 650-725-3053

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: parsing packet
Date: Thu, 22 Jan 2004 14:24:59 -0800
Lines: 50
Distribution: su
Message-ID: <Pine.LNX.4.44.0401221421150.3240-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401221230080.19079-100000@elaine31.Stanford.EDU>
 <bupdhr$i6h$2@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074810301 25023 171.64.66.201 (22 Jan 2004 22:25:01 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <bupdhr$i6h$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5445


 Will's correct.

 You can see that the first 6 bytes are broadcast, the second 6 bytes are
 the source address of the firewall and so on.  Assuming that all traffic
 received is IP is incorrect.  You will want to look at the ethertype
 to see what type of packet you really have (in this case, it isn't
 IP).

 Also, I've now mailed out the topology descriptions.  Please use your assigned
 topology for development .. and let me know if you have problems.

 Thanks!!
 .m

> it's the ip datagram wrapped in an ethernet frame, so the first bytes 
> are from the ethernet header
> 
> --will
> 
> Vishal Patel wrote:
> > In sr_handlepacket, the argument 'packet' is a pointer to the ip
> > datagram that comes in, correct?
> > 
> > if so, can we do something like:
> > 
> > ip_hdr = (struct ip*)packet;
> > 
> > ip_payload = packet + sizeof (struct ip);
> > 
> > I was looking at a dump of an ARP packet that came into handle packet, and
> > i get something like the following:
> > 
> > (gdb) x/15x packet
> > 0x276a8:        0xffffffff      0xffff00e0      0x810426d9      0x08060001
> > 0x276b8:        0x08000604      0x000100e0      0x810426d9      0xac184a11
> > 0x276c8:        0x00000000      0x0000ab43      0x47020000      0x00000000
> > 0x276d8:        0x00000000      0x00000000      0x00000000
> > 
> > but the leading 0xffffffff  doesn't seem to fit the version/hlen and
> > type of service fields that the ip header should begin with...
> > 
> > what am i doing wrong?
> > 
> > --vishal
> > 
> > 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Woodley Packard <sweagles@stanford.edu>
Newsgroups: su.class.cs244a
Subject: packet dumping
Date: Thu, 22 Jan 2004 18:15:54 -0800
Lines: 6
Distribution: su
Message-ID: <buq04q$9o5$1@news.Stanford.EDU>
Reply-To:  sweagles@stanford.edu
NNTP-Posting-Host: raptor15.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074824154 9989 171.64.12.176 (23 Jan 2004 02:15:54 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5446

Hi, what's the difference between the "caplen" and "len" fields in a 
pcap_pkthdr structure? They seem to come out the same for simple tests I 
tried.

-Woodley Packard

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: packet dumping
Date: Thu, 22 Jan 2004 18:28:05 -0800
Lines: 26
Distribution: su
Message-ID: <Pine.LNX.4.44.0401221825030.3754-100000@Xenon.Stanford.EDU>
References: <buq04q$9o5$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074824888 11109 171.64.66.201 (23 Jan 2004 02:28:08 GMT)
X-Complaints-To: news@news.stanford.edu
To: Woodley Packard <sweagles@stanford.edu>
In-Reply-To: <buq04q$9o5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5447


 caplen is the packet capture length  which may be less than the actual packet
 length as it arrived on the interface (len).

 from the pcap man page...

        caplen a bpf_u_int32 giving the number of bytes  of  the  packet
                that are available from the capture

         len    a  bpf_u_int32  giving the length of the packet, in bytes
                (which might be more than the number of  bytes  available
                from  the  capture, if the length of the packet is larger
                than the maximum number of bytes to capture)

 libpcap is the packet capture library used by tcpdump.

 .m

> Hi, what's the difference between the "caplen" and "len" fields in a 
> pcap_pkthdr structure? They seem to come out the same for simple tests I 
> tried.
> 
> -Woodley Packard
> 
> 

.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Graded HW
Date: Fri, 23 Jan 2004 19:36:57 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.GSO.4.44.0401231936280.22960-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: epic6.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074915418 16747 171.64.15.39 (24 Jan 2004 03:36:58 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5448

Where can I pick up graded hw?
Is ther a bin somewhere?

Thanks.  Boris.

.

Path: shelby.stanford.edu!elaine10.Stanford.EDU!spathak
From: Sumedh Pathak <spathak@stanford.edu>
Newsgroups: su.class.cs244a
Subject: CIDR
Date: Fri, 23 Jan 2004 20:32:06 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.GSO.4.44.0401232030080.18426-100000@elaine10.Stanford.EDU>
NNTP-Posting-Host: elaine10.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074918728 19758 171.64.15.75 (24 Jan 2004 04:32:08 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5449


Hi,

Im still kinda confused as to how CIDR actually alleviates the problem of
IP addresses running out.
Subnetting seems like a more fluid version of Class based addressing, so
there are still 2^32 unique addresses.

So, how does this work?

Sumedh

.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine29.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Graded HW
Date: 23 Jan 2004 20:41:07 -0800
Organization: Stanford University, CA, USA
Lines: 5
Distribution: su
Message-ID: <snnvfn27ycc.fsf@elaine29.Stanford.EDU>
References: <Pine.GSO.4.44.0401231936280.22960-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: elaine29.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1074919267 20098 171.64.15.104 (24 Jan 2004 04:41:07 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5450

Boris Senderzon <senderzo@stanford.edu> writes:

Please read the announcements on the cs244a web page.

Susan
.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!bahaa
From: Bahaa Eldin Yehia Fahim <bahaa@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Graded HW
Date: Fri, 23 Jan 2004 21:15:07 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.GSO.4.44.0401232114360.11344-100000@elaine28.Stanford.EDU>
References: <Pine.GSO.4.44.0401231936280.22960-100000@epic6.Stanford.EDU>
 <snnvfn27ycc.fsf@elaine29.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074921311 22163 171.64.15.103 (24 Jan 2004 05:15:11 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <snnvfn27ycc.fsf@elaine29.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5451


What about SCPD ?

Thanks,
Bahaa

On 23 Jan 2004, Susan Noreen Shepard wrote:

> Boris Senderzon <senderzo@stanford.edu> writes:
>
> Please read the announcements on the cs244a web page.
>
> Susan
>

.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!bahaa
From: Bahaa Eldin Yehia Fahim <bahaa@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Hw1, 3.a
Date: Fri, 23 Jan 2004 21:33:02 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0401232124490.11621-100000@elaine28.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074922384 23474 171.64.15.103 (24 Jan 2004 05:33:04 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5452


Regarding prob 3(a) for the HW1. The solution says that the size of
the router is 750kbytes = 750 * 1000 bytes. I'm confused : I thought that
when we're taking about BW ( ex. bits/sec ) K = 1000 , but when we're
taking about storage K =  2^10.

Quoting from the problem "the buffer in a router contains, on averge 750
kbytes of data..." . why is 750Kbytes = 750 * 1000 and not 750 * 2^10 ???

What's wrong in my understanding of this ? Any help is appreciated..

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: CIDR
Date: Fri, 23 Jan 2004 22:51:44 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0401232247470.17804-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401232030080.18426-100000@elaine10.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074927106 27886 171.64.66.201 (24 Jan 2004 06:51:46 GMT)
X-Complaints-To: news@news.stanford.edu
To: Sumedh Pathak <spathak@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401232030080.18426-100000@elaine10.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5453


 CIDR simply increases the efficiency of dolling out IP addresses, it doesn't
 increase the number.  With this more efficient allocation scheme, however,
 IPv4 has outlived many earlier projections.

 .m

> 
> Hi,
> 
> Im still kinda confused as to how CIDR actually alleviates the problem of
> IP addresses running out.
> Subnetting seems like a more fluid version of Class based addressing, so
> there are still 2^32 unique addresses.
> 
> So, how does this work?
> 
> Sumedh
> 
> 

.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Handout 4, Page. 16
Date: Sat, 24 Jan 2004 00:08:19 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.GSO.4.44.0401240004060.14653-100000@elaine28.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074931702 2294 171.64.15.103 (24 Jan 2004 08:08:22 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5454


On page 16 of Handout 4, the third bullet, it says "x/y ... , y indicates
the lenght of the segment".
However, when the professor explained the "142.12/19" example, he
mentioned that the "19" stands for the length of the prefix.
How are these two statements related to each other? Which one is correct?

-Laura

.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS #2, Q8 Bonus
Date: Sat, 24 Jan 2004 08:21:13 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <but9tp$315$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
X-Trace: news.Stanford.EDU 1074932473 3109 171.64.15.100 (24 Jan 2004 08:21:13 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5455

I wonder if a traceroute that returns an extensive number of "NN: * * *" still counts as a valid solution? I can easily find hosts that exceed 200 such 
hops. According to the traceroute man page, such response is a valid gateway that just doesn't send ICMP "time exceeded" messages.

Or do you require all gateways along the trace to be resolvable?

Jason
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS #2, Q8 Bonus
Date: Sat, 24 Jan 2004 09:39:36 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.LNX.4.44.0401240938200.8372-100000@Xenon.Stanford.EDU>
References: <but9tp$315$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074965978 1157 171.64.66.201 (24 Jan 2004 17:39:38 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jason Ying Li <jasonyli@Stanford.EDU>
In-Reply-To: <but9tp$315$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5456


 If you get a continuation of "* * *" that just means the destination host
 isn't responding or that there isn't a destination so traceroute continues
 to try with increasingly large TTLs

 .m

> I wonder if a traceroute that returns an extensive number of "NN: * * *" still counts as a valid solution? I can easily find hosts that exceed 200 such 
> hops. According to the traceroute man page, such response is a valid gateway that just doesn't send ICMP "time exceeded" messages.
> 
> Or do you require all gateways along the trace to be resolvable?
> 
> Jason
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS #2, Q8 Bonus
Date: Sat, 24 Jan 2004 18:26:06 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <buudbu$3bu$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine13.stanford.edu
X-Trace: news.Stanford.EDU 1074968766 3454 171.64.15.78 (24 Jan 2004 18:26:06 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))
Xref: shelby.stanford.edu su.class.cs244a:5457

I am sure that the destination host exists and at least port 80 http is 
open. It went through about 18 good hops and starting from 19 to 200+ it's 
all * * *. So I suppose they are just not responding to ICMP messages?

In that case, that would make this trace invalid then?

Jason
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine29.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Graded HW
Date: 24 Jan 2004 10:30:45 -0800
Organization: Stanford University, CA, USA
Lines: 8
Distribution: su
Message-ID: <snnr7xp8ai2.fsf@elaine29.Stanford.EDU>
References: <Pine.GSO.4.44.0401231936280.22960-100000@epic6.Stanford.EDU> <snnvfn27ycc.fsf@elaine29.Stanford.EDU> <Pine.GSO.4.44.0401232114360.11344-100000@elaine28.Stanford.EDU>
NNTP-Posting-Host: elaine29.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1074969045 3813 171.64.15.104 (24 Jan 2004 18:30:45 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5458

Bahaa Eldin Yehia Fahim <bahaa@stanford.edu> writes:

> What about SCPD ?

I'll double-check with the rest of the staff, but I'm pretty sure the
homeworks get returned via courier.

Susan
.

Path: shelby.stanford.edu!elaine29.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: reference route
Date: Sat, 24 Jan 2004 11:03:08 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.GSO.4.44.0401241100270.10375-100000@elaine29.Stanford.EDU>
NNTP-Posting-Host: elaine29.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074970990 5728 171.64.15.104 (24 Jan 2004 19:03:10 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5459

According to hw2 spec, there should be a reference router runing on
topology 2 and the IPs are 171.67.71.45 to .49

I tried to ping those IPs and seems they are not giving responses. Am I
doing anything wrong?

Thanks

Lin

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ethereal
Date: Sat, 24 Jan 2004 11:11:46 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0401241110080.25502-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074971507 6232 171.64.15.106 (24 Jan 2004 19:11:47 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5460


Can anyone point me to a reference on how to use ethereal

Also, where can i find the program (the directory) on the elaine's?

--v

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ARP timeouts, etc
Date: Sat, 24 Jan 2004 11:10:04 -0800
Lines: 21
Distribution: su
Message-ID: <buug7c$65k$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074971692 6324 128.12.90.43 (24 Jan 2004 19:14:52 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5461

I just wanted to confirm if some of the information from previous years'
newgroups is still valid, since they didn't have to enforce timeouts on ARP
requests:

-The ARP timeout (length of time to wait before resending an ARP request) is
200 - 500 milliseconds.
-The ARP cache should expire every 15 seconds (does this mean that an
individual entry expires after 15 seconds or the entire cache should be
cleared every 15 seconds?)

On a related question, if one ARP request comes in, and we add it to the
request queue and send out a request of our own, if another ARP request
comes in for the same destination MAC address while the first one is still
in the queue, can we service them both when the first response comes in, or
do we have to issue another duplicate ARP request just in case it changes
from the time we got the first one to the time we got the second one.
Logically it would seem to me like it should be serviced at the same time,
since the first request would result in the destination MAC being cached,
and subsequent requests to that IP should be serviced from the cache.


.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ICMP port unreachable?
Date: Sat, 24 Jan 2004 11:14:05 -0800
Lines: 9
Distribution: su
Message-ID: <buug7d$65k$2@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074971693 6324 128.12.90.43 (24 Jan 2004 19:14:53 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5462

In the assignment spec, there is the following line:

"The router handles tcp/udp packets sent to one of its interfaces. In this
case the router should respond with an ICMP port unreachable. "

Am I missing something here? Isn't tcp/udp just regular IP traffic? why
would we respond with port unreachable?


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ethereal
Date: Sat, 24 Jan 2004 11:57:09 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0401241155370.7656-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401241110080.25502-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074974231 8522 171.64.66.201 (24 Jan 2004 19:57:11 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401241110080.25502-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5463


www.ethereal.com

/usr/class/cs244a/bin/ethereal 

..m

> 
> Can anyone point me to a reference on how to use ethereal
> 
> Also, where can i find the program (the directory) on the elaine's?
> 
> --v
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ARP timeouts, etc
Date: Sat, 24 Jan 2004 12:09:14 -0800
Lines: 43
Distribution: su
Message-ID: <Pine.LNX.4.44.0401241157180.7656-100000@Xenon.Stanford.EDU>
References: <buug7c$65k$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074974955 9255 171.64.66.201 (24 Jan 2004 20:09:15 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <buug7c$65k$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5464


> I just wanted to confirm if some of the information from previous years'
> newgroups is still valid, since they didn't have to enforce timeouts on ARP
> requests:
> 
> -The ARP timeout (length of time to wait before resending an ARP request) is
> 200 - 500 milliseconds.
 
 sure .. 

> -The ARP cache should expire every 15 seconds (does this mean that an
> individual entry expires after 15 seconds or the entire cache should be
> cleared every 15 seconds?)

 It doesn't make much sense to clear the entire cache, does it?  For example,
 if you get an ARP reply, milliseconds before you clear the cache ...   Each
 cache entry should be individually timestamped.

> On a related question, if one ARP request comes in, and we add it to the
> request queue

 Request queue?  Why not service the request emmediately?

> and send out a request of our own, 

 An unrelated request? I don't think I follow...

> if another ARP request
> comes in for the same destination MAC address while the first one is still
> in the queue, can we service them both when the first response comes in, or
> do we have to issue another duplicate ARP request just in case it changes
> from the time we got the first one to the time we got the second one.
> Logically it would seem to me like it should be serviced at the same time,
> since the first request would result in the destination MAC being cached,
> and subsequent requests to that IP should be serviced from the cache.

 I'm a little confused about what you are asking here.  I would suggest you
 service any ARP reply that comes in right away.  You don't have to pair
 replies with requests that you sent out (most OSs accept gratuitous ARPs
 by default).

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ICMP port unreachable?
Date: Sat, 24 Jan 2004 12:10:32 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.LNX.4.44.0401241209250.7656-100000@Xenon.Stanford.EDU>
References: <buug7d$65k$2@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074975033 9450 171.64.66.201 (24 Jan 2004 20:10:33 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <buug7d$65k$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5465


 Any tcp or udp packet destined to one of the router's interfaces
 isn't forwarded ... the correct response since you are not implemented
 a transport layer is to send an ICMP port unreachable ... this is required
 to get some implementations of traceroute to work btw.

 .m

> In the assignment spec, there is the following line:
> 
> "The router handles tcp/udp packets sent to one of its interfaces. In this
> case the router should respond with an ICMP port unreachable. "
> 
> Am I missing something here? Isn't tcp/udp just regular IP traffic? why
> would we respond with port unreachable?
> 
> 
> 

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: #defines in sr_protocol.h
Date: Sat, 24 Jan 2004 12:17:15 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0401241211130.27553-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074975437 9808 171.64.15.106 (24 Jan 2004 20:17:17 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5466

Questions on the following #define's for sr_protocol.h

1. #define ARPHDR_ETHER    1  /* What is this used for???*/

2. Is it true that the following 3 will be used for the 'ether_type' value
of the struct sr_ethernet_hdr, or is it the case that IPPROTO_ICMP
protocol must
be wrapped inside of a IP datagram...in which case ether_type can only
either be ETHERTYPE_ARP or ETHERTYPE_IP?

#define IPPROTO_ICMP            0x0001  /* ICMP protocol */
#define ETHERTYPE_IP            0x0800  /* IP protocol */
#define ETHERTYPE_ARP           0x0806  /* Addr. resolution protocol */


thanx
--vp

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP timeouts, etc
Date: Sat, 24 Jan 2004 12:29:47 -0800
Lines: 54
Distribution: su
Message-ID: <buukl1$aer$1@news.Stanford.EDU>
References: <buug7c$65k$1@news.Stanford.EDU> <Pine.LNX.4.44.0401241157180.7656-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074976225 10715 128.12.90.43 (24 Jan 2004 20:30:25 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5467

I guess I didn't phrase this very clearly. So, when an ARP request comes in,

1) Check if it is our ARP cache, if so, send out te ARP reply.
2) If not, we need to send our own ARP request. While we are doing this, we
keep track of the ARP request that we had received, and we continue to
service other incoming packets.
3) When we receive the ARP reply from the destination host, we then go back
to the ARP request that came in from the firewall or whatever, and we send
an ARP reply back to them.

My question is, let's say we get an ARP request for IP address 1.2.3.4
(Packet A). We don't have it in the cache, so we send out an ARP request for
1.2.3.4. (Packet B)
Then, we get another request for 1.2.3.4. We haven't gotten the reply for
Packet B yet, so we still don't know the correct MAC address. In this case,
should we send a second ARP for 1.2.3.4? Or just wait for the first ARP
reply to come in (or timeout), and at that time respond to both of the ARP
requests that we received for 1.2.3.4.

"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0401241157180.7656-100000@Xenon.Stanford.EDU...
> > On a related question, if one ARP request comes in, and we add it to the
> > request queue
>
>  Request queue?  Why not service the request emmediately?
>
> > and send out a request of our own,
>
>  An unrelated request? I don't think I follow...
>
> > if another ARP request
> > comes in for the same destination MAC address while the first one is
still
> > in the queue, can we service them both when the first response comes in,
or
> > do we have to issue another duplicate ARP request just in case it
changes
> > from the time we got the first one to the time we got the second one.
> > Logically it would seem to me like it should be serviced at the same
time,
> > since the first request would result in the destination MAC being
cached,
> > and subsequent requests to that IP should be serviced from the cache.
>
>  I'm a little confused about what you are asking here.  I would suggest
you
>  service any ARP reply that comes in right away.  You don't have to pair
>  replies with requests that you sent out (most OSs accept gratuitous ARPs
>  by default).
>
>  .m
>


.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: using htonX and ntohX
Date: Sat, 24 Jan 2004 13:32:35 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0401241330130.28053-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074979962 14305 171.64.15.100 (24 Jan 2004 21:32:42 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5468


When do we need to use these functions?

more specifically, do I need to do a ntoh on the
sr_ethernet_hdr.ether_type before I use it?
should we be doing this for all values we extract from ethernet/ip/arp
headers?

--vishal


.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Hw1, 3.a
Date: Sat, 24 Jan 2004 22:01:11 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <buupv7$g67$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401232124490.11621-100000@elaine28.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1074981671 16583 171.64.15.103 (24 Jan 2004 22:01:11 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5469


>Regarding prob 3(a) for the HW1. The solution says that the size of
>the router is 750kbytes = 750 * 1000 bytes. I'm confused : I thought that
>when we're taking about BW ( ex. bits/sec ) K = 1000 , but when we're
>taking about storage K =  2^10.

>Quoting from the problem "the buffer in a router contains, on averge 750
>kbytes of data..." . why is 750Kbytes = 750 * 1000 and not 750 * 2^10 ???

>What's wrong in my understanding of this ? Any help is appreciated..

Nothing--you're correct.  The posted solution has a bug.
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: #defines in sr_protocol.h
Date: Sat, 24 Jan 2004 14:39:29 -0800
Lines: 26
Distribution: su
Message-ID: <Pine.LNX.4.44.0401241434110.12202-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401241211130.27553-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074983971 18966 171.64.66.201 (24 Jan 2004 22:39:31 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401241211130.27553-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5470


> Questions on the following #define's for sr_protocol.h
> 
> 1. #define ARPHDR_ETHER    1  /* What is this used for???*/

 ARP hardware address type. 
 
> 2. Is it true that the following 3 will be used for the 'ether_type' value
> of the struct sr_ethernet_hdr, or is it the case that IPPROTO_ICMP
> protocol must
> be wrapped inside of a IP datagram...in which case ether_type can only
> either be ETHERTYPE_ARP or ETHERTYPE_IP?
> 
> #define IPPROTO_ICMP            0x0001  /* ICMP protocol */
> #define ETHERTYPE_IP            0x0800  /* IP protocol */
> #define ETHERTYPE_ARP           0x0806  /* Addr. resolution protocol */

 the latter.

 You don't have to use anything in sr_protocol.h they are simply there for
 your convenience.  You should also take a look at networksorcery before
 posting, all the header fields are described in detail there.

 .m


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ARP timeouts, etc
Date: Sat, 24 Jan 2004 14:42:50 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.LNX.4.44.0401241439340.12202-100000@Xenon.Stanford.EDU>
References: <buug7c$65k$1@news.Stanford.EDU> <Pine.LNX.4.44.0401241157180.7656-100000@Xenon.Stanford.EDU>
 <buukl1$aer$1@news.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074984173 19222 171.64.66.201 (24 Jan 2004 22:42:53 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <buukl1$aer$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5471


> I guess I didn't phrase this very clearly. So, when an ARP request comes in,
> 
> 1) Check if it is our ARP cache, if so, send out te ARP reply.

 Why would you cache out an ARP request?  ARP requests are sent to 
 broadcast looking for a particulary IP address, what would you cache?

> 2) If not, we need to send our own ARP request. While we are doing this, we
> keep track of the ARP request that we had received, and we continue to
> service other incoming packets.

 Why would you send out an ARP request on receipt of another ARP request?
 You only send out an ARP request when you want to find the hardware address
 for an IP.  I think you might want to take another look at how ARP works.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: using htonX and ntohX
Date: Sat, 24 Jan 2004 14:44:43 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0401241442550.12202-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401241330130.28053-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1074984286 19338 171.64.66.201 (24 Jan 2004 22:44:46 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401241330130.28053-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5472


> 
> more specifically, do I need to do a ntoh on the
> sr_ethernet_hdr.ether_type before I use it?
> should we be doing this for all values we extract from ethernet/ip/arp
> headers?

 All protocol header fields must be in network byte order on the wire.

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine29.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ethereal
Date: 24 Jan 2004 15:09:34 -0800
Organization: Stanford University, CA, USA
Lines: 4
Distribution: su
Message-ID: <snnhdyl3pw1.fsf@elaine29.Stanford.EDU>
References: <Pine.GSO.4.44.0401241110080.25502-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine29.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1074985774 20420 171.64.15.104 (24 Jan 2004 23:09:34 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Xref: shelby.stanford.edu su.class.cs244a:5473

I agree it seems to be down.  Let us look into it.  We'll post again once
we have more information.

Susan
.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP timeouts, etc
Date: Sat, 24 Jan 2004 16:15:34 -0800
Lines: 35
Distribution: su
Message-ID: <buv1sc$o52$1@news.Stanford.EDU>
References: <buug7c$65k$1@news.Stanford.EDU> <Pine.LNX.4.44.0401241157180.7656-100000@Xenon.Stanford.EDU> <buukl1$aer$1@news.Stanford.EDU> <Pine.LNX.4.44.0401241439340.12202-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074989772 24738 128.12.90.43 (25 Jan 2004 00:16:12 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: shelby.stanford.edu su.class.cs244a:5474

Oh, ok. My mistake, I thought ARP worked like DNS, where if you don't know
you forward it on.

I guess my question, then, is if my router needs a MAC address for a given
IP, and I send out an ARP request, and while I am waiting for the ARP reply,
I need to send another packet to that IP (whose MAC address I still do not
know), should I send out another request, or just wait for the first one to
reply/timeout.


"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0401241439340.12202-100000@Xenon.Stanford.EDU...
>
> > I guess I didn't phrase this very clearly. So, when an ARP request comes
in,
> >
> > 1) Check if it is