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 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!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: using htonX and ntohX
Date: Sat, 24 Jan 2004 16:52:09 -0800
Lines: 20
Distribution: su
Message-ID: <buv40v$qfp$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401241330130.28053-100000@elaine25.Stanford.EDU> <Pine.LNX.4.44.0401241442550.12202-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1074991967 27129 128.12.90.43 (25 Jan 2004 00:52: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:5475

How do we convert byte orders for the 8-bit fields? (like the hardware
address length and protocol address length in the ARP header). This is just
for error checking purposes.


"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0401241442550.12202-100000@Xenon.Stanford.EDU...
>
> >
> > 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!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 17:01:21 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.LNX.4.44.0401241657550.13697-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> <Pine.LNX.4.44.0401241439340.12202-100000@Xenon.Stanford.EDU>
 <buv1sc$o52$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 1074992485 27686 171.64.66.201 (25 Jan 2004 01:01:25 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <buv1sc$o52$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5476


 
> 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.

  You may do either, that depends on implementation decisions you will
  make when building your arp subsystem .... do you plan on retaining
  state for all pending ARP requests?  Both approaches are reasonable.

  .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 17:03:25 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0401241701270.13697-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401241330130.28053-100000@elaine25.Stanford.EDU>
 <Pine.LNX.4.44.0401241442550.12202-100000@Xenon.Stanford.EDU>
 <buv40v$qfp$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 1074992606 27839 171.64.66.201 (25 Jan 2004 01:03:26 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <buv40v$qfp$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5477


 Byter ordering refers to the ordering of bytes ...

 a la ..

 |1|2|3|4  vs |4|3|2|1

 therefore there are no byte ordering issues with 1 byte (9 bit fields)

 .m

> How do we convert byte orders for the 8-bit fields? (like the hardware
> address length and protocol address length in the ARP header). This is just
> for error checking purposes.
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: sumeet shendrikar <sumeets@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: using htonX and ntohX - sr_if.h/c
Date: Sat, 24 Jan 2004 18:50:13 -0800
Lines: 7
Distribution: su
Message-ID: <buvat7$479$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401241330130.28053-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-60149.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1074999015 4329 128.12.197.131 (25 Jan 2004 02:50:15 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5478

what byte order is the ip address stored as in the interface list?

it's declared uint32_t, and i can't find if there's any conversion done.

thanks,
sumeet

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: using htonX and ntohX
Date: Sat, 24 Jan 2004 19:12:05 -0800
Lines: 25
Distribution: su
Message-ID: <buvc7c$5s9$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401241330130.28053-100000@elaine25.Stanford.EDU> <Pine.LNX.4.44.0401241442550.12202-100000@Xenon.Stanford.EDU> <buv40v$qfp$1@news.Stanford.EDU> <Pine.LNX.4.44.0401241701270.13697-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1075000364 6025 128.12.90.43 (25 Jan 2004 03:12: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:5479

How about with the char arrays which the hardware addresses are stored in?
The actual field is a pointer, so do we need to convert the byte order?

"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0401241701270.13697-100000@Xenon.Stanford.EDU...
>
>  Byter ordering refers to the ordering of bytes ...
>
>  a la ..
>
>  |1|2|3|4  vs |4|3|2|1
>
>  therefore there are no byte ordering issues with 1 byte (9 bit fields)
>
>  .m
>
> > How do we convert byte orders for the 8-bit fields? (like the hardware
> > address length and protocol address length in the ARP header). This is
just
> > for error checking purposes.
> >
> >
>


.

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 - sr_if.h/c
Date: Sat, 24 Jan 2004 20:02:22 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0401242001500.21177-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401241330130.28053-100000@elaine25.Stanford.EDU>
 <buvat7$479$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 1075003346 9078 171.64.66.201 (25 Jan 2004 04:02:26 GMT)
X-Complaints-To: news@news.stanford.edu
To: sumeet shendrikar <sumeets@stanford.edu>
In-Reply-To: <buvat7$479$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5480


 network byte order.  
 .m

> what byte order is the ip address stored as in the interface list?
> 
> it's declared uint32_t, and i can't find if there's any conversion done.
> 
> thanks,
> sumeet
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: parsing Ethernet frame
Date: Sun, 25 Jan 2004 04:02:56 +0000 (UTC)
Lines: 17
Distribution: su
Message-ID: <buvf5g$8jm$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine10.stanford.edu
X-Trace: news.Stanford.EDU 1075003376 8822 171.64.15.75 (25 Jan 2004 04:02:56 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:5481

I've tried casting various spaces within the packet buffer to the 
sr_ethernet_hdr structure, but find nowhere with the expected results.

Doing a complete dump of the buffer (being sent pings) yields:

ff ff ff ff ff ff  0 e0 81  4 
26 d9  8  6  0  1  8  0  6  4 
 0  1  0 e0 81  4 26 d9 ac 18 
4a 11  0  0  0  0  0  0 c0 a8 
81 38  0  0  0  0  0  0  0  0 
 0  0  0  0  0  0  0  0  0  0 

This is to a router with ethernet address 70:00:00:a2:00:01.  Shouldn't 
that be the destination address of the frame?  Yet I don't see that byte 
sequence anywhere.

Tyrone
.

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 20:06:32 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.LNX.4.44.0401242002270.21177-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401241330130.28053-100000@elaine25.Stanford.EDU>
 <Pine.LNX.4.44.0401241442550.12202-100000@Xenon.Stanford.EDU>
 <buv40v$qfp$1@news.Stanford.EDU> <Pine.LNX.4.44.0401241701270.13697-100000@Xenon.Stanford.EDU>
 <buvc7c$5s9$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 1075003595 9362 171.64.66.201 (25 Jan 2004 04:06:35 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <buvc7c$5s9$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5482


> How about with the char arrays which the hardware addresses are stored in?
> The actual field is a pointer, so do we need to convert the byte order?

  You are correct, the hardware address is not considered multi-byte 
  numerical data.

  .m

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: parsing Ethernet frame
Date: Sat, 24 Jan 2004 20:12:21 -0800
Lines: 26
Distribution: su
Message-ID: <buvfqr$60v$1@news.Stanford.EDU>
References: <buvf5g$8jm$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075004059 6175 127.0.0.1 (25 Jan 2004 04:14:19 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4
X-Accept-Language: en-us, en
In-Reply-To: <buvf5g$8jm$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5483

Note the ff ff ff ff ff ff, that's the broadcast address.  They're 
broadcasting an ARP request, precisely because they do not yet know the 
ethernet address yet, so you cannot expect the ethernet address to show 
up.  You're supposed to ARP reply with your ethernet address so they can 
learn it.

Will

Tyrone Nicholas wrote:
> I've tried casting various spaces within the packet buffer to the 
> sr_ethernet_hdr structure, but find nowhere with the expected results.
> 
> Doing a complete dump of the buffer (being sent pings) yields:
> 
> ff ff ff ff ff ff  0 e0 81  4 
> 26 d9  8  6  0  1  8  0  6  4 
>  0  1  0 e0 81  4 26 d9 ac 18 
> 4a 11  0  0  0  0  0  0 c0 a8 
> 81 38  0  0  0  0  0  0  0  0 
>  0  0  0  0  0  0  0  0  0  0 
> 
> This is to a router with ethernet address 70:00:00:a2:00:01.  Shouldn't 
> that be the destination address of the frame?  Yet I don't see that byte 
> sequence anywhere.
> 
> Tyrone
.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: ARP cache
Date: Sun, 25 Jan 2004 05:16:49 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <buvjg1$ctr$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine10.stanford.edu
X-Trace: news.Stanford.EDU 1075007809 13243 171.64.15.75 (25 Jan 2004 05:16:49 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:5484

How are we to implement the ARP cache?  Do we create a global variable, or 
add a field to the sr_instance struct?  Both seem forbidden by the 
assignment rules.

Tyrone
.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Ethernet MTU
Date: Sat, 24 Jan 2004 22:12:29 -0800
Lines: 6
Distribution: su
Message-ID: <buvmpk$fo0$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1075011188 16128 128.12.90.43 (25 Jan 2004 06:13: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:5485

The Peterson/Davie book, on page 242 seems to imply that the MTU for
ethernet is 1500 bytes, but according to networksorcery just the data field
of the ethernet packet can be up to 1500 bytes, in addition to all the
headers, etc. Which is correct?


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ARP cache
Date: Sat, 24 Jan 2004 22:53:57 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0401242252530.27499-100000@Xenon.Stanford.EDU>
References: <buvjg1$ctr$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 1075013639 18053 171.64.66.201 (25 Jan 2004 06:53:59 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <buvjg1$ctr$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5486


 Good point Tyrone.  Add a field to sr_instance .. I should amend
 the web page to reflect that this is OK.

 .m

> How are we to implement the ARP cache?  Do we create a global variable, or 
> add a field to the sr_instance struct?  Both seem forbidden by the 
> assignment rules.
> 
> Tyrone
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Ethernet MTU
Date: Sat, 24 Jan 2004 23:01:29 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0401242255180.27499-100000@Xenon.Stanford.EDU>
References: <buvmpk$fo0$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 1075014091 18469 171.64.66.201 (25 Jan 2004 07:01:31 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <buvmpk$fo0$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5487


 Standard ethernet MTU is 1500, however it is not uncommon to see an ethernet
 packet that is 1504 (VLAN).  The MTU is actually configurable, (for example
 >ifconfig mtu).  For the purposes of this assignment, you can assume that the
 maximum packet will be 1500 .. however since we pass you the len, it shouldn't
 be an issue.

 .m

> The Peterson/Davie book, on page 242 seems to imply that the MTU for
> ethernet is 1500 bytes, but according to networksorcery just the data field
> of the ethernet packet can be up to 1500 bytes, in addition to all the
> headers, etc. Which is correct?
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Ethernet MTU
Date: Sat, 24 Jan 2004 23:03:00 -0800
Lines: 30
Distribution: su
Message-ID: <buvpob$i3r$1@news.Stanford.EDU>
References: <buvmpk$fo0$1@news.Stanford.EDU> <Pine.LNX.4.44.0401242255180.27499-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1075014219 18555 128.12.90.43 (25 Jan 2004 07:03: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:5488

The reason I ask is because in the FAQ question 17, it asks what kind of
sanity checks we should perform on the incoming packet, and it mentions that
we should make sure it's less than the Ethernet MTU.

"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0401242255180.27499-100000@Xenon.Stanford.EDU...
>
>  Standard ethernet MTU is 1500, however it is not uncommon to see an
ethernet
>  packet that is 1504 (VLAN).  The MTU is actually configurable, (for
example
>  >ifconfig mtu).  For the purposes of this assignment, you can assume that
the
>  maximum packet will be 1500 .. however since we pass you the len, it
shouldn't
>  be an issue.
>
>  .m
>
> > The Peterson/Davie book, on page 242 seems to imply that the MTU for
> > ethernet is 1500 bytes, but according to networksorcery just the data
field
> > of the ethernet packet can be up to 1500 bytes, in addition to all the
> > headers, etc. Which is correct?
> >
> >
> >
>


.

Path: shelby.stanford.edu!elaine11.Stanford.EDU!bahaa
From: Bahaa Eldin Yehia Fahim <bahaa@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Hw1, 2c
Date: Sat, 24 Jan 2004 23:16:31 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0401242301470.3310-100000@elaine11.Stanford.EDU>
NNTP-Posting-Host: elaine11.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075014994 19203 171.64.15.76 (25 Jan 2004 07:16:34 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5489


Hi,

Regarding #2c, Peterson & Davie's book says that the speed of light in
fiber is 2*(10^8) m/s ( Page 42, 4th line ),  which makes sense because
it's unrealistic to assume that the speed of light is the same in all mediums.
Yet, the solution of 2c says that the speed of light in fiber = speed of
light in vacuum = 3*(10^8) m/s.

The problem does not ask to assume that the speed of light is always the
same value.

Which is correct ? Or am I missing something ?

Thanks,
Bahaa


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Hw1, 2c
Date: Sat, 24 Jan 2004 23:38:22 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.LNX.4.44.0401242333410.2314-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401242301470.3310-100000@elaine11.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075016305 20139 171.64.66.201 (25 Jan 2004 07:38:25 GMT)
X-Complaints-To: news@news.stanford.edu
To: Bahaa Eldin Yehia Fahim <bahaa@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401242301470.3310-100000@elaine11.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5490


 This exact question was asked on the newsgroup and answered by the
 TAs stating that you should use 3*10^8.  The actual speed is an
 approximation and not particularly relevant to the question.  If
 you think you deserve a regrade you are more than welcome to 
 submit your HW to your TA.

 .m

> 
> Hi,
> 
> Regarding #2c, Peterson & Davie's book says that the speed of light in
> fiber is 2*(10^8) m/s ( Page 42, 4th line ),  which makes sense because
> it's unrealistic to assume that the speed of light is the same in all mediums.
> Yet, the solution of 2c says that the speed of light in fiber = speed of
> light in vacuum = 3*(10^8) m/s.
> 
> The problem does not ask to assume that the speed of light is always the
> same value.
> 
> Which is correct ? Or am I missing something ?
> 
> Thanks,
> Bahaa
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Ethernet MTU
Date: Sat, 24 Jan 2004 23:41:19 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.LNX.4.44.0401242338400.2314-100000@Xenon.Stanford.EDU>
References: <buvmpk$fo0$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401242255180.27499-100000@Xenon.Stanford.EDU>
 <buvpob$i3r$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 1075016481 20300 171.64.66.201 (25 Jan 2004 07:41:21 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <buvpob$i3r$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5491


 I see :) then officialy, ethernet MTU is 1500 for this assignment.

 .m

> The reason I ask is because in the FAQ question 17, it asks what kind of
> sanity checks we should perform on the incoming packet, and it mentions that
> we should make sure it's less than the Ethernet MTU.
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: reference route
Date: Sun, 25 Jan 2004 07:57:30 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <buvsta$kk1$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine24.stanford.edu
X-Trace: news.Stanford.EDU 1075017450 21121 171.64.15.99 (25 Jan 2004 07:57: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:5492

Same here, they don't seem reachable for me. Just so you are not alone 
there... Having reference router does help the assignment a lot.

Jason

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: reference route
Date: Sun, 25 Jan 2004 00:24:09 -0800
Lines: 41
Distribution: su
Message-ID: <Pine.LNX.4.44.0401250015400.11138-100000@Xenon.Stanford.EDU>
References: <buvsta$kk1$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 1075019051 23400 171.64.66.201 (25 Jan 2004 08:24:11 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jason Ying Li <jasonyli@Stanford.EDU>
In-Reply-To: <buvsta$kk1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5493


 I can't reproduce this, as far as I can tell the reference router is up ..


[casado@nity ~]$ ping 171.67.71.45
PING 171.67.71.45 (171.67.71.45) 56(84) bytes of data.
64 bytes from 171.67.71.45: icmp_seq=1 ttl=62 time=0.457 ms

--- 171.67.71.45 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.457/0.457/0.457/0.000 ms
[casado@nity ~]$ ping 171.67.71.46
PING 171.67.71.46 (171.67.71.46) 56(84) bytes of data.
64 bytes from 171.67.71.45: icmp_seq=1 ttl=62 time=0.662 ms

--- 171.67.71.46 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.662/0.662/0.662/0.000 ms
[casado@nity ~]$ ping 171.67.71.48
PING 171.67.71.48 (171.67.71.48) 56(84) bytes of data.
64 bytes from 171.67.71.45: icmp_seq=1 ttl=62 time=0.546 ms

--- 171.67.71.48 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.546/0.546/0.546/0.000 ms
[casado@nity ~]$ 

Traceroute works for me as well.  The routes to the application
serevers aren't up.. but you should be able to reach all of
the interfaces.

..m 


> Same here, they don't seem reachable for me. Just so you are not alone 
> there... Having reference router does help the assignment a lot.
> 
> Jason
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: reference route
Date: Sun, 25 Jan 2004 00:24:51 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.LNX.4.44.0401250024270.11138-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401241100270.10375-100000@elaine29.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075019093 23427 171.64.66.201 (25 Jan 2004 08:24:53 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lin Chan <linchan@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401241100270.10375-100000@elaine29.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5494


 Sorry about skipping this one ... lost in the shuffle.  Router
 is up as far as I can tell.  Which machine are you pinging from?

 .m

> 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!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: reference route
Date: Sun, 25 Jan 2004 08:30:09 +0000 (UTC)
Lines: 2
Distribution: su
Message-ID: <buvuqh$muv$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine34.stanford.edu
X-Trace: news.Stanford.EDU 1075019409 23519 171.64.15.109 (25 Jan 2004 08:30:09 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:5495

Tried from the elaine machines. Traceroute seems to be working. But ping 
is not.
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: reference route
Date: Sun, 25 Jan 2004 00:41:21 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0401250040330.16359-100000@Xenon.Stanford.EDU>
References: <buvuqh$muv$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 1075020083 24054 171.64.66.201 (25 Jan 2004 08:41:23 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jason Ying Li <jasonyli@Stanford.EDU>
In-Reply-To: <buvuqh$muv$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5496


 Ahh,

 I get the same results from the elaines, was testing from
 my office workstation.  Must be a firewall issue, will
 look at it tomorrow.  Thanks for letting me know.

 .m

> Tried from the elaine machines. Traceroute seems to be working. But ping 
> is not.
> 

.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Handout 4, Page. 16
Date: Sun, 25 Jan 2004 18:04:49 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <bv10g1$ogg$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401240004060.14653-100000@elaine28.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1075053889 25104 171.64.15.98 (25 Jan 2004 18:04:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5497



>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?


They're both correct.  The y is the prefix length of the address, but
this divisioning of IP addresses can be interpreted graphically, as the
figure on that slide indicates--hence the line segment reference.
.

Path: shelby.stanford.edu!saga12.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Requesting topology
Date: Sun, 25 Jan 2004 11:19:30 -0800
Lines: 22
Distribution: su
Message-ID: <Pine.GSO.4.44.0401251115010.8263-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 1075058372 29067 171.64.15.142 (25 Jan 2004 19:19:32 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5498

When I try and connect to my topology (153) if hangs with the following:

Client echron connecting to Server vns-1.stanford.edu:12345
Requesting topology 153

This happens trying to connect to either vns server.

I'm trying from elaine35

elaine35:~/ee284/hw2/stub> ./sr -t 153 -s vns-1.stanford.edu
Destination: 0.0.0.0
  Gateway : 172.24.74.17
  Mask : 0.0.0.0
  Interface : eth0
Client echron connecting to Server vns-1.stanford.edu:12345

Is something down or have I messed something up?

Thanks,

Edward G. Chron

.

Path: shelby.stanford.edu!elaine32.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Requesting topology
Date: Sun, 25 Jan 2004 11:22:12 -0800
Lines: 45
Distribution: su
Message-ID: <Pine.GSO.4.44.0401251120590.18150-100000@elaine32.Stanford.EDU>
References: <Pine.GSO.4.44.0401251115010.8263-100000@saga12.Stanford.EDU>
NNTP-Posting-Host: elaine32.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075058537 29253 171.64.15.107 (25 Jan 2004 19:22:17 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0401251115010.8263-100000@saga12.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5499


I am having the same problems from both elaine and saga

I tried pinging vns-1 and vns-2 and it says "no reply"

PING vns-1.Stanford.EDU (171.67.71.18): 56 data bytes
no reply from vns-1.Stanford.EDU within 1 sec
no reply from vns-1.Stanford.EDU within 1 sec
^C
---- vns-1.Stanford.EDU (171.67.71.18) PING Statistics ----
3 packets transmitted, 0 packets received, 100% packet loss
saga14:~/private/cs244a/ass2> ping vns-2
PING vns-2.Stanford.EDU (171.67.71.19): 56 data bytes
no reply from vns-2.Stanford.EDU within 1 sec
no reply from vns-2.Stanford.EDU within 1 sec

--vishal


On Sun, 25 Jan 2004, Edward Chron wrote:

> When I try and connect to my topology (153) if hangs with the following:
>
> Client echron connecting to Server vns-1.stanford.edu:12345
> Requesting topology 153
>
> This happens trying to connect to either vns server.
>
> I'm trying from elaine35
>
> elaine35:~/ee284/hw2/stub> ./sr -t 153 -s vns-1.stanford.edu
> Destination: 0.0.0.0
>   Gateway : 172.24.74.17
>   Mask : 0.0.0.0
>   Interface : eth0
> Client echron connecting to Server vns-1.stanford.edu:12345
>
> Is something down or have I messed something up?
>
> Thanks,
>
> Edward G. Chron
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: reference route
Date: Sun, 25 Jan 2004 19:55:23 +0000 (UTC)
Lines: 3
Distribution: su
Message-ID: <bv16vb$nk$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine8.stanford.edu
X-Trace: news.Stanford.EDU 1075060523 756 171.64.15.73 (25 Jan 2004 19:55:23 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:5500

Exact same problem for me. Just so you are not alone.

Jason
.

Path: shelby.stanford.edu!epic1.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Question concerning global variables
Date: Sun, 25 Jan 2004 12:29:22 -0800
Lines: 42
Distribution: su
Message-ID: <Pine.GSO.4.44.0401251200130.8381-100000@epic1.Stanford.EDU>
NNTP-Posting-Host: epic1.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075062564 2920 171.64.15.34 (25 Jan 2004 20:29:24 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5501

The grading policy regarding global variable use has been made quite
clear--we will lose points for having any.  The primary reason for this
rule seems to be that global variables can be a crutch for badly
architected code.  I could not agree more.

There are instances, however, when globals, particularly if they are
declared static, can be an aid to a well designed module.  Consider for
instance a generic linked list module.  There will be (probably) three
typical operations:

void insert(key, elem);
void delete(key);
elem *lookup(key);

In order to present the cleanest interface, one may wish to keep static
globals to store the head (or tail) of the list to allow each of the
operations equal access to the list.

One obvious deficiency, as I'm sure you can see, is that the generic list
can be used only once in a program.  Let's fix that and remove the globals
in the module by adding another operation:

list *new_list();

The list can be a opaque reference to a structure holding the same data as
was previously in global data in the module.  This does not completely fix
the problem, however.

Consider a module with multiple entry points which must share a single
list.  How can we do this without storing the 'list' reference in a static
global variable?  The only way would be to wrap it into another structure
which becomes part of every consumer module call into this module, or even
worse, expose the list reference directly to each consumer.  This method
overcomplicates the design.

So, in general, I do agree about inappropriate use of globals.  I just
want to know if I will lose points for what I see as appropriate use, as
I have described above.

Thanks,
Barrett

.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Question concerning global variables
Date: Sun, 25 Jan 2004 21:01:15 +0000 (UTC)
Lines: 31
Distribution: su
Message-ID: <bv1aqr$4rk$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401251200130.8381-100000@epic1.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1075064475 4980 171.64.15.98 (25 Jan 2004 21:01:15 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5502


>Consider a module with multiple entry points which must share a single
>list.  How can we do this without storing the 'list' reference in a static
>global variable?  The only way would be to wrap it into another structure
>which becomes part of every consumer module call into this module, or even
>worse, expose the list reference directly to each consumer.  This method
>overcomplicates the design.

I disagree--if the module has working state that should be shared between
functions, a struct encapsulating that state seems the natural approach to
me.

Suppose you have a global static list in your module, and then you decide
you need to reuse the module in some other code.  You then have to go and
hack your original list implementation to keep some local state, rather than
the single global state you had originally.  You also have to go and hack
all your code that called the list functions originally to use the new
interfaces.  I don't see how you can possibly argue that this is a good
idea.

>So, in general, I do agree about inappropriate use of globals.  I just
>want to know if I will lose points for what I see as appropriate use, as
>I have described above.

Not necessarily--I agree that occasionally globals may be the cleanest,
sometimes only, solution.  But in general, if you find that this is the
case, it should probably suggest to you that you should restructure your
code in some way.  At least, I find the example you give to be
unconvincing.  (Nothing we do in this class should require you to
use globals to solve the problem).

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Requesting topology
Date: Sun, 25 Jan 2004 21:35:05 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <bv1cq9$6bq$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401251115010.8263-100000@saga12.Stanford.EDU> <Pine.GSO.4.44.0401251120590.18150-100000@elaine32.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1075066505 6522 171.64.15.72 (25 Jan 2004 21:35: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:5503

I also can't connect to either vns-1 or vns-2.  I'd guess that means they 
are both down.

Tyrone

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Requesting topology
Date: Sun, 25 Jan 2004 13:47:56 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.LNX.4.44.0401251347390.11924-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401251115010.8263-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 1075067278 7336 171.64.66.201 (25 Jan 2004 21:47:58 GMT)
X-Complaints-To: news@news.stanford.edu
To: Edward Chron <echron@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401251115010.8263-100000@saga12.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5504


 Whoa .. looks like the network is down.  Working on it.

 .m

> When I try and connect to my topology (153) if hangs with the following:
> 
> Client echron connecting to Server vns-1.stanford.edu:12345
> Requesting topology 153
> 
> This happens trying to connect to either vns server.
> 
> I'm trying from elaine35
> 
> elaine35:~/ee284/hw2/stub> ./sr -t 153 -s vns-1.stanford.edu
> Destination: 0.0.0.0
>   Gateway : 172.24.74.17
>   Mask : 0.0.0.0
>   Interface : eth0
> Client echron connecting to Server vns-1.stanford.edu:12345
> 
> Is something down or have I messed something up?
> 
> 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: Requesting topology
Date: Sun, 25 Jan 2004 14:00:37 -0800
Lines: 37
Distribution: su
Message-ID: <Pine.LNX.4.44.0401251400080.15556-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401251115010.8263-100000@saga12.Stanford.EDU>
 <Pine.LNX.4.44.0401251347390.11924-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 1075068040 8031 171.64.66.201 (25 Jan 2004 22:00:40 GMT)
X-Complaints-To: news@news.stanford.edu
To: Edward Chron <echron@stanford.edu>
In-Reply-To: <Pine.LNX.4.44.0401251347390.11924-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5505


 Found the problem, will take 20 min or so to fix.  Firewall
 crashed sometime this morning.

 .m

> 
>  Whoa .. looks like the network is down.  Working on it.
> 
>  .m
> 
> > When I try and connect to my topology (153) if hangs with the following:
> > 
> > Client echron connecting to Server vns-1.stanford.edu:12345
> > Requesting topology 153
> > 
> > This happens trying to connect to either vns server.
> > 
> > I'm trying from elaine35
> > 
> > elaine35:~/ee284/hw2/stub> ./sr -t 153 -s vns-1.stanford.edu
> > Destination: 0.0.0.0
> >   Gateway : 172.24.74.17
> >   Mask : 0.0.0.0
> >   Interface : eth0
> > Client echron connecting to Server vns-1.stanford.edu:12345
> > 
> > Is something down or have I messed something up?
> > 
> > Thanks,
> > 
> > Edward G. Chron
> > 
> > 
> 
> 

.

Path: shelby.stanford.edu!saga12.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Requesting topology
Date: Sun, 25 Jan 2004 14:02:21 -0800
Lines: 51
Distribution: su
Message-ID: <Pine.GSO.4.44.0401251401260.9650-100000@saga12.Stanford.EDU>
References: <Pine.GSO.4.44.0401251115010.8263-100000@saga12.Stanford.EDU>
 <Pine.LNX.4.44.0401251347390.11924-100000@Xenon.Stanford.EDU>
 <Pine.LNX.4.44.0401251400080.15556-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 1075068143 8092 171.64.15.142 (25 Jan 2004 22:02:23 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@CS.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0401251400080.15556-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5506

Thanks for fixing the problem so we don't lose any more time for testing.

Ed Chron
On Sun, 25 Jan 2004, Martin Casado wrote:

> Date: Sun, 25 Jan 2004 14:00:37 -0800 (PST)
> From: Martin Casado <casado@CS.Stanford.EDU>
> To: Edward Chron <echron@stanford.edu>
> Newsgroups: su.class.cs244a
> Subject: Re: Requesting topology
>
>
>  Found the problem, will take 20 min or so to fix.  Firewall
>  crashed sometime this morning.
>
>  .m
>
> >
> >  Whoa .. looks like the network is down.  Working on it.
> >
> >  .m
> >
> > > When I try and connect to my topology (153) if hangs with the following:
> > >
> > > Client echron connecting to Server vns-1.stanford.edu:12345
> > > Requesting topology 153
> > >
> > > This happens trying to connect to either vns server.
> > >
> > > I'm trying from elaine35
> > >
> > > elaine35:~/ee284/hw2/stub> ./sr -t 153 -s vns-1.stanford.edu
> > > Destination: 0.0.0.0
> > >   Gateway : 172.24.74.17
> > >   Mask : 0.0.0.0
> > >   Interface : eth0
> > > Client echron connecting to Server vns-1.stanford.edu:12345
> > >
> > > Is something down or have I messed something up?
> > >
> > > Thanks,
> > >
> > > Edward G. Chron
> > >
> > >
> >
> >
>

Edward G. Chron

.

Path: shelby.stanford.edu!saga12.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: pragma ident warning
Date: Sun, 25 Jan 2004 14:11:48 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.GSO.4.44.0401251409080.9850-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 1075068710 8660 171.64.15.142 (25 Jan 2004 22:11:50 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5507

Anyone know how to shut this noise off?

(It is generated when building the pristine stub code)

gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_router.c -o sr_router.o
In file included from sr_if.h:20,
                 from sr_router.c:18:
/usr/include/sys/int_types.h:9: warning: ignoring #pragma ident

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: Requesting topology
Date: Sun, 25 Jan 2004 15:08:41 -0800
Lines: 59
Distribution: su
Message-ID: <Pine.LNX.4.44.0401251508070.32217-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401251115010.8263-100000@saga12.Stanford.EDU>
 <Pine.LNX.4.44.0401251347390.11924-100000@Xenon.Stanford.EDU>
 <Pine.LNX.4.44.0401251400080.15556-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401251401260.9650-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 1075072123 11437 171.64.66.201 (25 Jan 2004 23:08:43 GMT)
X-Complaints-To: news@news.stanford.edu
Cc: Martin Casado <casado@CS.Stanford.EDU>
To: Edward Chron <echron@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401251401260.9650-100000@saga12.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5508


 OK things should be back up. Thanks for letting me know.  If, in the future
 you have problems connecting, please email me directly.

 .m

> Thanks for fixing the problem so we don't lose any more time for testing.
> 
> Ed Chron
> On Sun, 25 Jan 2004, Martin Casado wrote:
> 
> > Date: Sun, 25 Jan 2004 14:00:37 -0800 (PST)
> > From: Martin Casado <casado@CS.Stanford.EDU>
> > To: Edward Chron <echron@stanford.edu>
> > Newsgroups: su.class.cs244a
> > Subject: Re: Requesting topology
> >
> >
> >  Found the problem, will take 20 min or so to fix.  Firewall
> >  crashed sometime this morning.
> >
> >  .m
> >
> > >
> > >  Whoa .. looks like the network is down.  Working on it.
> > >
> > >  .m
> > >
> > > > When I try and connect to my topology (153) if hangs with the following:
> > > >
> > > > Client echron connecting to Server vns-1.stanford.edu:12345
> > > > Requesting topology 153
> > > >
> > > > This happens trying to connect to either vns server.
> > > >
> > > > I'm trying from elaine35
> > > >
> > > > elaine35:~/ee284/hw2/stub> ./sr -t 153 -s vns-1.stanford.edu
> > > > Destination: 0.0.0.0
> > > >   Gateway : 172.24.74.17
> > > >   Mask : 0.0.0.0
> > > >   Interface : eth0
> > > > Client echron connecting to Server vns-1.stanford.edu:12345
> > > >
> > > > Is something down or have I messed something up?
> > > >
> > > > Thanks,
> > > >
> > > > Edward G. Chron
> > > >
> > > >
> > >
> > >
> >
> 
> Edward G. Chron
> 
> 

.

Path: shelby.stanford.edu!elaine39.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP cache
Date: Sun, 25 Jan 2004 15:29:59 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.GSO.4.44.0401251528540.27963-100000@elaine39.Stanford.EDU>
References: <buvjg1$ctr$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401242252530.27499-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine39.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075073401 12637 171.64.15.114 (25 Jan 2004 23:30:01 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0401242252530.27499-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5509

So this means we can make changes to sr_router.h? And if i wish to add a
new struct, should I put it in sr_router.c or .h?

Thanks

Lin

On Sat, 24 Jan 2004, Martin Casado wrote:

>
>  Good point Tyrone.  Add a field to sr_instance .. I should amend
>  the web page to reflect that this is OK.
>
>  .m
>
> > How are we to implement the ARP cache?  Do we create a global variable, or
> > add a field to the sr_instance struct?  Both seem forbidden by the
> > assignment rules.
> >
> > Tyrone
> >
>
>

.

Path: shelby.stanford.edu!elaine39.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: header checksum
Date: Sun, 25 Jan 2004 15:35:18 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.GSO.4.44.0401251534350.27963-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 1075073719 12854 171.64.15.114 (25 Jan 2004 23:35:19 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5510

just wondering if there is any function call that I can easily compute the
checksum of the headers instead of writing one myself. Thanks

Lin

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ARP cache
Date: Sun, 25 Jan 2004 15:42:18 -0800
Lines: 34
Distribution: su
Message-ID: <Pine.LNX.4.44.0401251541260.8039-100000@Xenon.Stanford.EDU>
References: <buvjg1$ctr$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401242252530.27499-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401251528540.27963-100000@elaine39.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075074140 13184 171.64.66.201 (25 Jan 2004 23:42:20 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lin Chan <linchan@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401251528540.27963-100000@elaine39.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5511


 Please limit changes to adding a field to sr_instance.  Everything else
 should be in seperate files.  The reason for this is it simply makes it
 much, much easier for us to grade.

 Thanks :)
 .m

> So this means we can make changes to sr_router.h? And if i wish to add a
> new struct, should I put it in sr_router.c or .h?
> 
> Thanks
> 
> Lin
> 
> On Sat, 24 Jan 2004, Martin Casado wrote:
> 
> >
> >  Good point Tyrone.  Add a field to sr_instance .. I should amend
> >  the web page to reflect that this is OK.
> >
> >  .m
> >
> > > How are we to implement the ARP cache?  Do we create a global variable, or
> > > add a field to the sr_instance struct?  Both seem forbidden by the
> > > assignment rules.
> > >
> > > Tyrone
> > >
> >
> >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: header checksum
Date: Sun, 25 Jan 2004 15:42:42 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0401251542240.8039-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401251534350.27963-100000@elaine39.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075074164 13228 171.64.66.201 (25 Jan 2004 23:42:44 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lin Chan <linchan@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401251534350.27963-100000@elaine39.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5512


 Nope, you should write your own.

 .m

> just wondering if there is any function call that I can easily compute the
> checksum of the headers instead of writing one myself. Thanks
> 
> Lin
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Update
Date: Sun, 25 Jan 2004 15:52:03 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.LNX.4.44.0401251550030.9329-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 1075074724 13689 171.64.66.201 (25 Jan 2004 23:52:04 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5513


  OK, some of you might have noticed some bumps sunday morning.  It turns out
  the firewall croaked.  Everything is back up now and the reference solution
  is responding to ping.

  The reference solution's IPs have changed so check the web-page for the
  updated IPs, you can also contact the app servers etc. so it should be
  fully functional.

  If you have any problems, let me know.

  Thanks :)
  .martin

.

Path: shelby.stanford.edu!elaine39.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: header checksum
Date: Sun, 25 Jan 2004 16:16:12 -0800
Lines: 25
Distribution: su
Message-ID: <Pine.GSO.4.44.0401251612570.28128-100000@elaine39.Stanford.EDU>
References: <Pine.GSO.4.44.0401251534350.27963-100000@elaine39.Stanford.EDU>
 <Pine.LNX.4.44.0401251542240.8039-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine39.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075076174 15007 171.64.15.114 (26 Jan 2004 00:16:14 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0401251542240.8039-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5514

Ok. The networksorcery page said the checksum is "A 16 bit one's
complement checksum of the IP header and IP options." So I do once
complement of the header 16 bits by 16 bits? The p&D book p95 talks about
CRC checksum. Can anyone do a further explaination of this?

Thanks

Lin

On Sun, 25 Jan 2004, Martin Casado wrote:

>
>  Nope, you should write your own.
>
>  .m
>
> > just wondering if there is any function call that I can easily compute the
> > checksum of the headers instead of writing one myself. Thanks
> >
> > Lin
> >
> >
>
>

.

Path: shelby.stanford.edu!elaine39.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: routing table
Date: Sun, 25 Jan 2004 16:21:41 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0401251618350.28128-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 1075076502 15330 171.64.15.114 (26 Jan 2004 00:21:42 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5515

currently the routing table is initialized by reading a file and the
orginal file contains only one entry. Does it mean we have to dynamically
build up our own routing table? Or we simply need to modify the "rtable"
file ourselves to create a static routing table for our own project?
Thanks

Lin

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: header checksum
Date: Sun, 25 Jan 2004 16:24:01 -0800
Lines: 35
Distribution: su
Message-ID: <bv1mn2$f2k$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401251534350.27963-100000@elaine39.Stanford.EDU> <Pine.LNX.4.44.0401251542240.8039-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0401251612570.28128-100000@elaine39.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1075076642 15444 128.12.90.43 (26 Jan 2004 00:24: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:5516

I think the page number in the FAQ is from another version of the book. In
the 3rd edition, the source code is on page 91.

-Eddy

"Lin Chan" <linchan@stanford.edu> wrote in message
news:Pine.GSO.4.44.0401251612570.28128-100000@elaine39.Stanford.EDU...
> Ok. The networksorcery page said the checksum is "A 16 bit one's
> complement checksum of the IP header and IP options." So I do once
> complement of the header 16 bits by 16 bits? The p&D book p95 talks about
> CRC checksum. Can anyone do a further explaination of this?
>
> Thanks
>
> Lin
>
> On Sun, 25 Jan 2004, Martin Casado wrote:
>
> >
> >  Nope, you should write your own.
> >
> >  .m
> >
> > > just wondering if there is any function call that I can easily compute
the
> > > checksum of the headers instead of writing one myself. Thanks
> > >
> > > Lin
> > >
> > >
> >
> >
>


.

Path: shelby.stanford.edu!elaine39.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ARP and interface
Date: Sun, 25 Jan 2004 16:30:09 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.GSO.4.44.0401251625300.28128-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 1075077010 15819 171.64.15.114 (26 Jan 2004 00:30:10 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5517

When we received an ARP request on one of our interfaces, do we care from
which interface this ARP packet is from? I mean do we only give ARP reply
if the ARP request on MAC addr of eth0 is actually from interface eth0
only?

If an ARP is not asking for any of the routers interface, we simply drop
the packet right?

Thanks

Lin

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: header checksum
Date: Sun, 25 Jan 2004 16:31:25 -0800
Lines: 32
Distribution: su
Message-ID: <Pine.LNX.4.44.0401251631070.19697-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401251534350.27963-100000@elaine39.Stanford.EDU>
 <Pine.LNX.4.44.0401251542240.8039-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401251612570.28128-100000@elaine39.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075077088 15879 171.64.66.201 (26 Jan 2004 00:31:28 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lin Chan <linchan@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401251612570.28128-100000@elaine39.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5518


 Steven's has an example of the checksum.  Might just want to reference that.

 .m

> Ok. The networksorcery page said the checksum is "A 16 bit one's
> complement checksum of the IP header and IP options." So I do once
> complement of the header 16 bits by 16 bits? The p&D book p95 talks about
> CRC checksum. Can anyone do a further explaination of this?
> 
> Thanks
> 
> Lin
> 
> On Sun, 25 Jan 2004, Martin Casado wrote:
> 
> >
> >  Nope, you should write your own.
> >
> >  .m
> >
> > > just wondering if there is any function call that I can easily compute the
> > > checksum of the headers instead of writing one myself. Thanks
> > >
> > > Lin
> > >
> > >
> >
> >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: routing table
Date: Sun, 25 Jan 2004 16:31:49 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.LNX.4.44.0401251631340.19697-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401251618350.28128-100000@elaine39.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075077111 15905 171.64.66.201 (26 Jan 2004 00:31:51 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lin Chan <linchan@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401251618350.28128-100000@elaine39.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5519


 The latter :)  Just add the routes to the rtable file.

 .m

> currently the routing table is initialized by reading a file and the
> orginal file contains only one entry. Does it mean we have to dynamically
> build up our own routing table? Or we simply need to modify the "rtable"
> file ourselves to create a static routing table for our own project?
> Thanks
> 
> Lin
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: header checksum
Date: Sun, 25 Jan 2004 16:32:12 -0800
Lines: 42
Distribution: su
Message-ID: <Pine.LNX.4.44.0401251631590.19697-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401251534350.27963-100000@elaine39.Stanford.EDU>
 <Pine.LNX.4.44.0401251542240.8039-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401251612570.28128-100000@elaine39.Stanford.EDU>
 <bv1mn2$f2k$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 1075077135 15915 171.64.66.201 (26 Jan 2004 00:32:15 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <bv1mn2$f2k$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5520


 Thanks Eddy. We should update this on the FAQ.

 .m

> I think the page number in the FAQ is from another version of the book. In
> the 3rd edition, the source code is on page 91.
> 
> -Eddy
> 
> "Lin Chan" <linchan@stanford.edu> wrote in message
> news:Pine.GSO.4.44.0401251612570.28128-100000@elaine39.Stanford.EDU...
> > Ok. The networksorcery page said the checksum is "A 16 bit one's
> > complement checksum of the IP header and IP options." So I do once
> > complement of the header 16 bits by 16 bits? The p&D book p95 talks about
> > CRC checksum. Can anyone do a further explaination of this?
> >
> > Thanks
> >
> > Lin
> >
> > On Sun, 25 Jan 2004, Martin Casado wrote:
> >
> > >
> > >  Nope, you should write your own.
> > >
> > >  .m
> > >
> > > > just wondering if there is any function call that I can easily compute
> the
> > > > checksum of the headers instead of writing one myself. Thanks
> > > >
> > > > Lin
> > > >
> > > >
> > >
> > >
> >
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ARP and interface
Date: Sun, 25 Jan 2004 16:34:00 -0800
Lines: 25
Distribution: su
Message-ID: <Pine.LNX.4.44.0401251632260.19697-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401251625300.28128-100000@elaine39.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075077241 15982 171.64.66.201 (26 Jan 2004 00:34:01 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lin Chan <linchan@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401251625300.28128-100000@elaine39.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5521


 Good question.  If you receive and ARP requests you assume it is
 from a machine on your network ... the VNS will ensure you will
 only see ARPs coming from machines on your topology.

 If the ARP is not asking for the exact interface that it came in on,
 drop it.  Servicing an ARP from an interface other than the one it
 came in on is an error.

 .m

> When we received an ARP request on one of our interfaces, do we care from
> which interface this ARP packet is from? I mean do we only give ARP reply
> if the ARP request on MAC addr of eth0 is actually from interface eth0
> only?
> 
> If an ARP is not asking for any of the routers interface, we simply drop
> the packet right?
> 
> Thanks
> 
> Lin
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: IP header padding
Date: Sun, 25 Jan 2004 16:56:19 -0800
Lines: 4
Distribution: su
Message-ID: <bv1ojl$go6$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1075078581 17158 128.12.90.43 (26 Jan 2004 00:56: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:5522

For the checksum function, can we assume that the IP header has been padded
to a 32-bit boundary?


.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP and interface
Date: Sun, 25 Jan 2004 17:00:16 -0800
Lines: 34
Distribution: su
Message-ID: <bv1or3$h08$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401251625300.28128-100000@elaine39.Stanford.EDU> <Pine.LNX.4.44.0401251632260.19697-100000@Xenon.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075078819 17416 127.0.0.1 (26 Jan 2004 01:00: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:5523

Isn't this already  handled in your function sr_arp_req_not_for_us().


"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0401251632260.19697-100000@Xenon.Stanford.EDU...
>
>  Good question.  If you receive and ARP requests you assume it is
>  from a machine on your network ... the VNS will ensure you will
>  only see ARPs coming from machines on your topology.
>
>  If the ARP is not asking for the exact interface that it came in on,
>  drop it.  Servicing an ARP from an interface other than the one it
>  came in on is an error.
>
>  .m
>
> > When we received an ARP request on one of our interfaces, do we care
from
> > which interface this ARP packet is from? I mean do we only give ARP
reply
> > if the ARP request on MAC addr of eth0 is actually from interface eth0
> > only?
> >
> > If an ARP is not asking for any of the routers interface, we simply drop
> > the packet right?
> >
> > Thanks
> >
> > Lin
> >
> >
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: IP header length variable
Date: Sun, 25 Jan 2004 17:02:15 -0800
Lines: 7
Distribution: su
Message-ID: <bv1ouo$h37$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1075078936 17511 128.12.90.43 (26 Jan 2004 01:02: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:5524

In struct ip in sr_protocol.h, the ip_hl variable is declared as :

unsigned int ip_hl:4 , which I assume means that it is a 4 bit integer. I'm
not particularly familiar with this usage.. does it still behave like a
normal integer under arithmetic operations?


.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: IP header padding
Date: Mon, 26 Jan 2004 01:06:49 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <bv1p79$hcs$1@news.Stanford.EDU>
References: <bv1ojl$go6$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1075079209 17820 171.64.15.103 (26 Jan 2004 01: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:5525


>For the checksum function, can we assume that the IP header has been padded
>to a 32-bit boundary?

You can find the IP header format in RFC 791.
.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: IP header length variable
Date: Mon, 26 Jan 2004 01:07:10 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <bv1p7u$hd8$1@news.Stanford.EDU>
References: <bv1ouo$h37$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1075079230 17832 171.64.15.103 (26 Jan 2004 01:07:10 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5526



>unsigned int ip_hl:4 , which I assume means that it is a 4 bit integer. I'm
>not particularly familiar with this usage.. does it still behave like a
>normal integer under arithmetic operations?

Yep.
.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: pragma ident warning
Date: Mon, 26 Jan 2004 01:12:34 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <bv1pi2$hr2$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401251409080.9850-100000@saga12.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1075079554 18274 171.64.15.103 (26 Jan 2004 01:12:34 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5527


>Anyone know how to shut this noise off?

>(It is generated when building the pristine stub code)

>gcc -c -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_router.c -o sr_router.o
>In file included from sr_if.h:20,
>                 from sr_router.c:18:
>/usr/include/sys/int_types.h:9: warning: ignoring #pragma ident


Adding -Wno-unknown-pragmas to your CFLAGS should do the trick.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ARP and interface
Date: Sun, 25 Jan 2004 18:03:23 -0800
Lines: 47
Distribution: su
Message-ID: <Pine.LNX.4.44.0401251754060.8898-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401251625300.28128-100000@elaine39.Stanford.EDU>
 <Pine.LNX.4.44.0401251632260.19697-100000@Xenon.Stanford.EDU>
 <bv1or3$h08$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 1075082604 21245 171.64.66.201 (26 Jan 2004 02:03:24 GMT)
X-Complaints-To: news@news.stanford.edu
To: Joshua Silver <jmsilver@stanford.edu>
In-Reply-To: <bv1or3$h08$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5528


 
 It does.  I suppose it is silly to reimplement that, the reason it is there
 and hidden in sr_vns_comm instead of sr_router is that students kept replying
 to ARPs not for them and poisening the firewalls arp cache.

 .m




> Isn't this already  handled in your function sr_arp_req_not_for_us().
> 
> 
> "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> news:Pine.LNX.4.44.0401251632260.19697-100000@Xenon.Stanford.EDU...
> >
> >  Good question.  If you receive and ARP requests you assume it is
> >  from a machine on your network ... the VNS will ensure you will
> >  only see ARPs coming from machines on your topology.
> >
> >  If the ARP is not asking for the exact interface that it came in on,
> >  drop it.  Servicing an ARP from an interface other than the one it
> >  came in on is an error.
> >
> >  .m
> >
> > > When we received an ARP request on one of our interfaces, do we care
> from
> > > which interface this ARP packet is from? I mean do we only give ARP
> reply
> > > if the ARP request on MAC addr of eth0 is actually from interface eth0
> > > only?
> > >
> > > If an ARP is not asking for any of the routers interface, we simply drop
> > > the packet right?
> > >
> > > Thanks
> > >
> > > Lin
> > >
> > >
> >
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Modifying provided files
Date: Sun, 25 Jan 2004 19:14:55 -0800
Lines: 5
Distribution: su
Message-ID: <bv20ni$okg$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1075086898 25232 128.12.90.43 (26 Jan 2004 03:14: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:5529

Is it acceptable for me to add a #define for the ARP cache size to
sr_router.h as well, in addition to the addition of the cache field to
sr_instance?


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Modifying provided files
Date: Sun, 25 Jan 2004 19:23:37 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0401251923080.28477-100000@Xenon.Stanford.EDU>
References: <bv20ni$okg$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 1075087418 25697 171.64.66.201 (26 Jan 2004 03:23:38 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <bv20ni$okg$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5530


 We'd rather that you create an sr_arp.h or equivalent.
 You may include this file in sr_router.h if you need to.

 .m

> Is it acceptable for me to add a #define for the ARP cache size to
> sr_router.h as well, in addition to the addition of the cache field to
> sr_instance?
> 
> 
> 

.

Path: shelby.stanford.edu!elaine33.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Modifying provided files
Date: Sun, 25 Jan 2004 20:41:55 -0800
Lines: 25
Distribution: su
Message-ID: <Pine.GSO.4.44.0401252040390.29152-100000@elaine33.Stanford.EDU>
References: <bv20ni$okg$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401251923080.28477-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075092117 402 171.64.15.108 (26 Jan 2004 04:41:57 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0401251923080.28477-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5531

Actually in the FAQ, it says we can update sr_router.c and sr_router.h. So
do you think we should add our own files or just constraint all our
changes to these two files?

Thanks

Lin

On Sun, 25 Jan 2004, Martin Casado wrote:

>
>  We'd rather that you create an sr_arp.h or equivalent.
>  You may include this file in sr_router.h if you need to.
>
>  .m
>
> > Is it acceptable for me to add a #define for the ARP cache size to
> > sr_router.h as well, in addition to the addition of the cache field to
> > sr_instance?
> >
> >
> >
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP cache
Date: Sun, 25 Jan 2004 21:07:10 -0800
Lines: 42
Distribution: su
Message-ID: <bv27ao$1p7$1@news.Stanford.EDU>
References: <buvjg1$ctr$1@news.Stanford.EDU> <Pine.LNX.4.44.0401242252530.27499-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0401251528540.27963-100000@elaine39.Stanford.EDU> <Pine.LNX.4.44.0401251541260.8039-100000@Xenon.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075093659 1831 127.0.0.1 (26 Jan 2004 05: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:5532

I think we'll also need to add a line in sr_init_instance() to initialize
our cache.

"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0401251541260.8039-100000@Xenon.Stanford.EDU...
>
>  Please limit changes to adding a field to sr_instance.  Everything else
>  should be in seperate files.  The reason for this is it simply makes it
>  much, much easier for us to grade.
>
>  Thanks :)
>  .m
>
> > So this means we can make changes to sr_router.h? And if i wish to add a
> > new struct, should I put it in sr_router.c or .h?
> >
> > Thanks
> >
> > Lin
> >
> > On Sat, 24 Jan 2004, Martin Casado wrote:
> >
> > >
> > >  Good point Tyrone.  Add a field to sr_instance .. I should amend
> > >  the web page to reflect that this is OK.
> > >
> > >  .m
> > >
> > > > How are we to implement the ARP cache?  Do we create a global
variable, or
> > > > add a field to the sr_instance struct?  Both seem forbidden by the
> > > > assignment rules.
> > > >
> > > > Tyrone
> > > >
> > >
> > >
> >
> >
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Lei Zhang" <lei.zhang@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 6.b solution
Date: Sun, 25 Jan 2004 21:07:51 -0800
Lines: 10
Distribution: su
Message-ID: <bv27bf$1q5$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075093682 1861 127.0.0.1 (26 Jan 2004 05:08: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:5533

It seems that the solution assumes the service rate is C when packet is
arriving. Should the service rate be 0 before the last bit arrives, since it
is a store-and-forward router? If the above is correct, the figure does not
look quite right. And should the answer to (b) become L/C rather than
L(1/C-1/R) ?

Thanks,
Lei


.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Port unreachable vs. Protocol unreachable
Date: Sun, 25 Jan 2004 21:27:06 -0800
Lines: 9
Distribution: su
Message-ID: <bv28fc$2tr$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1075094828 3003 128.12.90.43 (26 Jan 2004 05:27: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:5534

Just out of curiosity, why are we returning an ICMP port unreachable rather
than an ICMP protocol unreachable when we receive a TCP or UDP packet on one
of our routers interfaces? The RFC doesn't make it spectacularly clear what
the difference between the two is.

Thanks,
Eddy


.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sending ICMP
Date: Sun, 25 Jan 2004 22:06:30 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.GSO.4.44.0401252203020.13902-100000@elaine41.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075097192 5087 171.64.15.116 (26 Jan 2004 06:06:32 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5535

While try9ing to send an ICMP packet, do we need to go through our routing
table and arp cache again to figure out the mac address we need to send
to, or we can simply send it to the mac address of the packet where it
come from?

Thanks

Lin

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: assuming defualt route
Date: Sun, 25 Jan 2004 22:11:57 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0401252209190.13915-100000@elaine41.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075097519 5457 171.64.15.116 (26 Jan 2004 06:11:59 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5536

Should we assume that there is always a default routing entry in our
routing table? If there is no default entry, we need to send ICMP message
if we don't know how to route, right?

Thanks

Lin

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Modifying provided files
Date: Sun, 25 Jan 2004 23:35:45 -0800
Lines: 34
Distribution: su
Message-ID: <Pine.LNX.4.44.0401252334140.22613-100000@Xenon.Stanford.EDU>
References: <bv20ni$okg$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401251923080.28477-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401252040390.29152-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 1075102547 9896 171.64.66.201 (26 Jan 2004 07:35:47 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lin Chan <linchan@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401252040390.29152-100000@elaine33.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5537


 I think you should definately add your own files if you feel necessary.
 Putting everything in sr_router may make things a tad crowded.
 You are right about the FAQ so go ahead and modify sr_router.*

 .m

> Actually in the FAQ, it says we can update sr_router.c and sr_router.h. So
> do you think we should add our own files or just constraint all our
> changes to these two files?
> 
> Thanks
> 
> Lin
> 
> On Sun, 25 Jan 2004, Martin Casado wrote:
> 
> >
> >  We'd rather that you create an sr_arp.h or equivalent.
> >  You may include this file in sr_router.h if you need to.
> >
> >  .m
> >
> > > Is it acceptable for me to add a #define for the ARP cache size to
> > > sr_router.h as well, in addition to the addition of the cache field to
> > > sr_instance?
> > >
> > >
> > >
> >
> >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ARP cache
Date: Sun, 25 Jan 2004 23:36:46 -0800
Lines: 49
Distribution: su
Message-ID: <Pine.LNX.4.44.0401252336150.22613-100000@Xenon.Stanford.EDU>
References: <buvjg1$ctr$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401242252530.27499-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401251528540.27963-100000@elaine39.Stanford.EDU>
 <Pine.LNX.4.44.0401251541260.8039-100000@Xenon.Stanford.EDU>
 <bv27ao$1p7$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 1075102608 9975 171.64.66.201 (26 Jan 2004 07:36:48 GMT)
X-Complaints-To: news@news.stanford.edu
To: Joshua Silver <jmsilver@stanford.edu>
In-Reply-To: <bv27ao$1p7$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5538


 No, you should add your initialization code to sr_init() in sr_router.c

 .m

> I think we'll also need to add a line in sr_init_instance() to initialize
> our cache.
> 
> "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> news:Pine.LNX.4.44.0401251541260.8039-100000@Xenon.Stanford.EDU...
> >
> >  Please limit changes to adding a field to sr_instance.  Everything else
> >  should be in seperate files.  The reason for this is it simply makes it
> >  much, much easier for us to grade.
> >
> >  Thanks :)
> >  .m
> >
> > > So this means we can make changes to sr_router.h? And if i wish to add a
> > > new struct, should I put it in sr_router.c or .h?
> > >
> > > Thanks
> > >
> > > Lin
> > >
> > > On Sat, 24 Jan 2004, Martin Casado wrote:
> > >
> > > >
> > > >  Good point Tyrone.  Add a field to sr_instance .. I should amend
> > > >  the web page to reflect that this is OK.
> > > >
> > > >  .m
> > > >
> > > > > How are we to implement the ARP cache?  Do we create a global
> variable, or
> > > > > add a field to the sr_instance struct?  Both seem forbidden by the
> > > > > assignment rules.
> > > > >
> > > > > Tyrone
> > > > >
> > > >
> > > >
> > >
> > >
> >
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Port unreachable vs. Protocol unreachable
Date: Sun, 25 Jan 2004 23:39:02 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.LNX.4.44.0401252337080.22613-100000@Xenon.Stanford.EDU>
References: <bv28fc$2tr$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 1075102744 10137 171.64.66.201 (26 Jan 2004 07:39:04 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <bv28fc$2tr$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5539


 No real reason.  It is really rare to see ICMP protocol unreachable on
 the net, even if you set the ip protocol to something unsupported.  ICMP
 port unreachable packets are common responses for UDP packets sent to
 closed ports and traceroute looks for them.

 .m

> Just out of curiosity, why are we returning an ICMP port unreachable rather
> than an ICMP protocol unreachable when we receive a TCP or UDP packet on one
> of our routers interfaces? The RFC doesn't make it spectacularly clear what
> the difference between the two is.
> 
> Thanks,
> Eddy
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: sending ICMP
Date: Sun, 25 Jan 2004 23:45:59 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0401252339120.22613-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401252203020.13902-100000@elaine41.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075103159 10511 171.64.66.201 (26 Jan 2004 07:45:59 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lin Chan <linchan@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401252203020.13902-100000@elaine41.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5540


 It is a mistake to think routes are symmetric.  Another question you
 might want to ask yourself is, what should the source IP be?

 .m

> While try9ing to send an ICMP packet, do we need to go through our routing
> table and arp cache again to figure out the mac address we need to send
> to, or we can simply send it to the mac address of the packet where it
> come from?
> 
> Thanks
> 
> Lin
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: assuming defualt route
Date: Sun, 25 Jan 2004 23:48:01 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0401252346090.22613-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401252209190.13915-100000@elaine41.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075103282 10597 171.64.66.201 (26 Jan 2004 07:48:02 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lin Chan <linchan@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401252209190.13915-100000@elaine41.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5541


 No there is no reason to make this assumption.  If there is no default route
 and you cannot route the packet you drop it.  You can as well send an ICMP no
 route to host, but this isn't required.

 .m

> Should we assume that there is always a default routing entry in our
> routing table? If there is no default entry, we need to send ICMP message
> if we don't know how to route, right?
> 
> Thanks
> 
> Lin
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: sr_protocol vs ip.h
Date: Mon, 26 Jan 2004 08:38:46 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <bv2jmm$dt5$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1075106326 14245 171.64.15.116 (26 Jan 2004 08:38: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:5542

If I #include <netinet/ip.h> in order to get the various IP constants 
defined there, its definition of struct ip conflicts with that in 
sr_protocol.h (which appears to be a cut-and-paste of the original).  Can 
I remove it from sr_protocol?

Tyrone
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: sr_protocol vs ip.h
Date: Mon, 26 Jan 2004 00:48:50 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.LNX.4.44.0401260047100.5977-100000@Xenon.Stanford.EDU>
References: <bv2jmm$dt5$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 1075106932 14914 171.64.66.201 (26 Jan 2004 08:48:52 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <bv2jmm$dt5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5543


 Yes there will be conflicts.  Which constants do you need from
 netinet/ip.h that aren't in sr_protocol?

 .m

> If I #include <netinet/ip.h> in order to get the various IP constants 
> defined there, its definition of struct ip conflicts with that in 
> sr_protocol.h (which appears to be a cut-and-paste of the original).  Can 
> I remove it from sr_protocol?
> 
> Tyrone
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS1 6.b solution
Date: Mon, 26 Jan 2004 10:16:33 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.LNX.4.44.0401261012540.24101-100000@Xenon.Stanford.EDU>
References: <bv27bf$1q5$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 1075140995 16505 171.64.66.201 (26 Jan 2004 18:16:35 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lei Zhang <lei.zhang@cs.stanford.edu>
In-Reply-To: <bv27bf$1q5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5544


 The solution only shows D(T) to be C after the packet has fully arrived, (at
 time t= L/R).  After which, if you assume worst case scenario, the previous
 packets finishes exiting exactly when the next pack is fully read into the
 router so D(T) remains constant at the egress rate of C.

 .m

> It seems that the solution assumes the service rate is C when packet is
> arriving. Should the service rate be 0 before the last bit arrives, since it
> is a store-and-forward router? If the above is correct, the figure does not
> look quite right. And should the answer to (b) become L/C rather than
> L(1/C-1/R) ?
> 
> Thanks,
> Lei
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: sr_protocol vs ip.h
Date: Mon, 26 Jan 2004 19:04:43 +0000 (UTC)
Lines: 20
Distribution: su
Message-ID: <bv3ocb$jri$1@news.Stanford.EDU>
References: <bv2jmm$dt5$1@news.Stanford.EDU> <Pine.LNX.4.44.0401260047100.5977-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1075143883 20338 171.64.15.67 (26 Jan 2004 19:04:43 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:5545

So far, only

IPVERSION
IPTOS_PREC_ROUTINE
MAXTTL
IPTTLDEC

and possibly others if necessary for specifying other header fields.

I suppose I could always redefine these constants myself, but I wouldn't 
consider that good practice.

Martin Casado <casado@xenon.stanford.edu> wrote:

>  Yes there will be conflicts.  Which constants do you need from
>  netinet/ip.h that aren't in sr_protocol?

>  .m


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: sr_protocol vs ip.h
Date: Mon, 26 Jan 2004 15:01:07 -0800
Lines: 26
Distribution: su
Message-ID: <Pine.LNX.4.44.0401261445270.12881-100000@Xenon.Stanford.EDU>
References: <bv2jmm$dt5$1@news.Stanford.EDU> <Pine.LNX.4.44.0401260047100.5977-100000@Xenon.Stanford.EDU>
 <bv3ocb$jri$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 1075158070 9110 171.64.66.201 (26 Jan 2004 23:01:10 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <bv3ocb$jri$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5546



> So far, only
> 
> IPVERSION
> IPTOS_PREC_ROUTINE
> MAXTTL
> IPTTLDEC
> 
> and possibly others if necessary for specifying other header fields.
> 
> I suppose I could always redefine these constants myself, but I wouldn't 
> consider that good practice.

  We would rather you didn't modify sr_protocol.h.  You make a good point that
  redefining constants is typically a no-no, but in this particular case
  we are more interested in you developing your own networking infrastructure
  than using the existing system.  What we should do in the future is not
  include sr_protocol.h at all and let the students use/develop/create whatever
  they want.  For now, please add any constants to sr_router.h or another
  header that you create and don't include netinet/ip.h.

  .m

  btw, you really don't have to worry about the precedence TOS.

.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question concerning global variables
Date: Mon, 26 Jan 2004 16:48:27 -0800
Lines: 42
Distribution: su
Message-ID: <bv4cgu$g6e$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401251200130.8381-100000@epic1.Stanford.EDU> <bv1aqr$4rk$1@news.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1075164510 16590 128.12.44.20 (27 Jan 2004 00:48: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:5547

I would assume that "int errno;" is one of the acceptable globals?

- Sean

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:bv1aqr$4rk$1@news.Stanford.EDU...
>
> >Consider a module with multiple entry points which must share a single
> >list.  How can we do this without storing the 'list' reference in a
static
> >global variable?  The only way would be to wrap it into another structure
> >which becomes part of every consumer module call into this module, or
even
> >worse, expose the list reference directly to each consumer.  This method
> >overcomplicates the design.
>
> I disagree--if the module has working state that should be shared between
> functions, a struct encapsulating that state seems the natural approach to
> me.
>
> Suppose you have a global static list in your module, and then you decide
> you need to reuse the module in some other code.  You then have to go and
> hack your original list implementation to keep some local state, rather
than
> the single global state you had originally.  You also have to go and hack
> all your code that called the list functions originally to use the new
> interfaces.  I don't see how you can possibly argue that this is a good
> idea.
>
> >So, in general, I do agree about inappropriate use of globals.  I just
> >want to know if I will lose points for what I see as appropriate use, as
> >I have described above.
>
> Not necessarily--I agree that occasionally globals may be the cleanest,
> sometimes only, solution.  But in general, if you find that this is the
> case, it should probably suggest to you that you should restructure your
> code in some way.  At least, I find the example you give to be
> unconvincing.  (Nothing we do in this class should require you to
> use globals to solve the problem).
>


.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Question concerning global variables
Date: Tue, 27 Jan 2004 00:50:04 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <bv4cjs$gek$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401251200130.8381-100000@epic1.Stanford.EDU> <bv1aqr$4rk$1@news.Stanford.EDU> <bv4cgu$g6e$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
X-Trace: news.Stanford.EDU 1075164604 16852 171.64.15.101 (27 Jan 2004 00:50:04 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5548


>I would assume that "int errno;" is one of the acceptable globals?

Considering that's a glibc-provided hack, we don't really have a choice...

.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question concerning global variables
Date: Mon, 26 Jan 2004 16:50:58 -0800
Lines: 13
Distribution: su
Message-ID: <bv4cll$ghb$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401251200130.8381-100000@epic1.Stanford.EDU> <bv1aqr$4rk$1@news.Stanford.EDU> <bv4cgu$g6e$1@news.Stanford.EDU> <bv4cjs$gek$1@news.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1075164661 16939 128.12.44.20 (27 Jan 2004 00:51: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:5549

Thanks, just checking (since I used it in my last program :P).

- Sean

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:bv4cjs$gek$1@news.Stanford.EDU...
>
> >I would assume that "int errno;" is one of the acceptable globals?
>
> Considering that's a glibc-provided hack, we don't really have a choice...
>


.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: TTL
Date: Tue, 27 Jan 2004 01:05:06 +0000 (UTC)
Lines: 2
Distribution: su
Message-ID: <bv4dg2$hjq$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine40.stanford.edu
X-Trace: news.Stanford.EDU 1075165506 18042 171.64.15.115 (27 Jan 2004 01:05: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:5550

What value should we set TTL to in new packets?

.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: TTL
Date: Tue, 27 Jan 2004 01:06:06 +0000 (UTC)
Lines: 4
Distribution: su
Message-ID: <bv4dhu$hn5$1@news.Stanford.EDU>
References: <bv4dg2$hjq$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
X-Trace: news.Stanford.EDU 1075165566 18149 171.64.15.101 (27 Jan 2004 01:06:06 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5551


>What value should we set TTL to in new packets?

This is answered in the FAQ.
.

Path: shelby.stanford.edu!epic14.Stanford.EDU!casado
From: Martin Casado <casado@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: TTL
Date: Mon, 26 Jan 2004 18:58:33 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.GSO.4.44.0401261857470.3501-100000@epic14.Stanford.EDU>
References: <bv4dg2$hjq$1@news.Stanford.EDU>
NNTP-Posting-Host: epic14.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075172315 26203 171.64.15.47 (27 Jan 2004 02:58:35 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <bv4dg2$hjq$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5552


 Please refer to #10 on the FAQ.

 .m

> What value should we set TTL to in new packets?
>
>

.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: using OS headers
Date: Mon, 26 Jan 2004 19:25:59 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0401261923250.18572-100000@elaine2.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075173960 27957 171.64.15.67 (27 Jan 2004 03:26:00 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5553

Martin,

Can we take your answer on whether we could use OS supplied message
headers instead of writing our own as something to be
enforced in the future and not in the current assignment or class?

In particular, can we use netinet/ip_icmp.h header?

Thanks.
Boris.

.

Path: shelby.stanford.edu!epic18.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: using OS headers
Date: Mon, 26 Jan 2004 19:41:18 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.GSO.4.44.0401261938250.12269-100000@epic18.Stanford.EDU>
References: <Pine.GSO.4.44.0401261923250.18572-100000@elaine2.Stanford.EDU>
NNTP-Posting-Host: epic18.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075174881 29010 171.64.15.53 (27 Jan 2004 03:41:21 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0401261923250.18572-100000@elaine2.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5554

On a related note, assuming an affirmative reply the to question below:

Anyone know where the types n_short and n_time are defined?  They are used in
the struct icmp definition.  Perhaps a compile flag can cause these to be
defined?

Thanks,
Barrett

On Mon, 26 Jan 2004, Boris Senderzon wrote:

> Martin,
>
> Can we take your answer on whether we could use OS supplied message
> headers instead of writing our own as something to be
> enforced in the future and not in the current assignment or class?
>
> In particular, can we use netinet/ip_icmp.h header?
>
> Thanks.
> Boris.
>
>

.

Path: shelby.stanford.edu!epic14.Stanford.EDU!casado
From: Martin Casado <casado@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: using OS headers
Date: Mon, 26 Jan 2004 20:03:34 -0800
Lines: 27
Distribution: su
Message-ID: <Pine.GSO.4.44.0401261955270.3868-100000@epic14.Stanford.EDU>
References: <Pine.GSO.4.44.0401261923250.18572-100000@elaine2.Stanford.EDU>
NNTP-Posting-Host: epic14.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075176216 521 171.64.15.47 (27 Jan 2004 04:03:36 GMT)
X-Complaints-To: news@news.stanford.edu
To: Boris Senderzon <senderzo@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401261923250.18572-100000@elaine2.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5555


 Here are the rules.

 Use whatever you want .... don't modify any files outside of sr_router.[c,h]

 Yes, this is a bit inconsistent because netinet/ip.h will cause problems, and
 some of the constants are copied into sr_protocol.h.  sr_protocol is a bad
 legacy of the router code 3 years ago and should be removed .. but for now
 you'll have to work with/around it.

 .m



> Martin,
>
> Can we take your answer on whether we could use OS supplied message
> headers instead of writing our own as something to be
> enforced in the future and not in the current assignment or class?
>
> In particular, can we use netinet/ip_icmp.h header?
>
> Thanks.
> Boris.
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: sumeet shendrikar <sumeets@stanford.edu>
Newsgroups: su.class.cs244a
Subject: topology & application servers
Date: Mon, 26 Jan 2004 21:59:16 -0800
Lines: 8
Distribution: su
Message-ID: <bv4unk$8mu$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-60149.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075183156 8926 128.12.197.131 (27 Jan 2004 05:59:16 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5556

do both application servers on our topologies run the same services?

i'm able to ftp/http into one of the servers, but only able to ftp into 
the other, though it is reachable (ping/traceroute works).

thanks,
sumeet

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: topology & application servers
Date: Mon, 26 Jan 2004 22:12:17 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0401262211280.901-100000@Xenon.Stanford.EDU>
References: <bv4unk$8mu$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 1075183942 9970 171.64.66.201 (27 Jan 2004 06:12:22 GMT)
X-Complaints-To: news@news.stanford.edu
To: sumeet shendrikar <sumeets@stanford.edu>
In-Reply-To: <bv4unk$8mu$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5557


 Yup thats right.  I'll probably have apache going on the second server
 at some point... but its presence should have no bearing on your
 assignment.

 .m

> do both application servers on our topologies run the same services?
> 
> i'm able to ftp/http into one of the servers, but only able to ftp into 
> the other, though it is reachable (ping/traceroute works).
> 
> thanks,
> sumeet
> 
> 

.

Path: shelby.stanford.edu!elaine17.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: error handling
Date: Mon, 26 Jan 2004 22:15:36 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.GSO.4.44.0401262208010.6105-100000@elaine17.Stanford.EDU>
NNTP-Posting-Host: elaine17.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075184138 10191 171.64.15.82 (27 Jan 2004 06:15:38 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5558

I have the following questions regarding error handling in this project.

1. When we got error from malloc and other system call, we can simply
output a message and then exit, right?

2. The sr_send_packet will return 0 or -1. When -1 is returned, how should
we handle it? Output msg and exit or just print the error and drop the
packet then continue?

3. Do we have to check if the len given in IP header matches the size of
the packet we received? If we do the check and it does not match(also if
the checksum is wrong), we should simply drop the packet right?

Thanks

Lin

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: error handling
Date: Mon, 26 Jan 2004 22:44:57 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.LNX.4.44.0401262242130.8227-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401262208010.6105-100000@elaine17.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075185899 12611 171.64.66.201 (27 Jan 2004 06:44:59 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lin Chan <linchan@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401262208010.6105-100000@elaine17.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5559


> I have the following questions regarding error handling in this project.
> 
> 1. When we got error from malloc and other system call, we can simply
> output a message and then exit, right?

 Yup.
 
> 2. The sr_send_packet will return 0 or -1. When -1 is returned, how should
> we handle it? Output msg and exit or just print the error and drop the
> packet then continue?

 You should probably just exit, thist shouldn't happen .. if it doesn't
 it probably means the connection to the server was broken which means
 having the router up is pointless anyways.

> 3. Do we have to check if the len given in IP header matches the size of
> the packet we received? If we do the check and it does not match(also if
> the checksum is wrong), we should simply drop the packet right?

 Yes and yes.

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: sumeet shendrikar <sumeets@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: error handling
Date: Tue, 27 Jan 2004 02:23:33 -0800
Lines: 25
Distribution: su
Message-ID: <bv5e76$q8o$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401262208010.6105-100000@elaine17.Stanford.EDU> <Pine.LNX.4.44.0401262242130.8227-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-60149.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075199014 26904 128.12.197.131 (27 Jan 2004 10:23:34 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5560

one question about checking the len given in the IP header... how do we 
account for this with the padding done by the OS?

i.e. ... sr_handlepacket receives an ethernet packet of length 60 bytes, 
but the length given in the IP header of the inner IP packet is only 40 
bytes, and the minimum size of ethernet data is 46 bytes.

Do we just assume that any IP packet where the length is less than the 
minimum size for ethernet is valid (as far as length is concerned)?

hope I asked that clearly.

thanks,
sumeet

>>3. Do we have to check if the len given in IP header matches the size of
>>the packet we received? If we do the check and it does not match(also if
>>the checksum is wrong), we should simply drop the packet right?
> 
> 
>  Yes and yes.
> 
>  .m
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Choosing the correct interface
Date: Tue, 27 Jan 2004 08:34:14 -0800
Lines: 42
Distribution: su
Message-ID: <bv63u8$ff9$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075221256 15849 127.0.0.1 (27 Jan 2004 16:34: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:5561

I'm confused on how to choose the correct interface.    Based on the data
below, how would I know that my app server on 192.168.129.93 is connected to
eth1?


Destination: 0.0.0.0
  Gateway : 172.24.74.17
  Mask : 0.0.0.0
  Interface : eth0
Client jmsilver connecting to Server vns-2.stanford.edu:12345
Requesting topology 169
Sending c_open (type=1 len=108)
Received Hardware Info with 18 entries
INTERFACE: eth0
Speed: 0
Hardware Address: 70:00:00:a9:00:01
Ethernet IP: 192.168.129.91
Subnet: 0.0.0.0
Mask: 0.0.0.0
INTERFACE: eth1
Speed: 0
Hardware Address: 70:00:00:a9:00:02
Ethernet IP: 192.168.129.92
Subnet: 0.0.0.0
Mask: 0.0.0.0
INTERFACE: eth2
Speed: 0
Hardware Address: 70:00:00:a9:00:06
Ethernet IP: 192.168.129.94
Subnet: 0.0.0.0
Mask: 0.0.0.0
Interface: eth0
  hardware address 70:00:00:a9:00:01
  ip address 192.168.129.91
Interface: eth1
  hardware address 70:00:00:a9:00:02
  ip address 192.168.129.92
Interface: eth2
  hardware address 70:00:00:a9:00:06
  ip address 192.168.129.94


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: error handling
Date: Tue, 27 Jan 2004 08:55:43 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0401270838200.3820-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401262208010.6105-100000@elaine17.Stanford.EDU>
 <Pine.LNX.4.44.0401262242130.8227-100000@Xenon.Stanford.EDU>
 <bv5e76$q8o$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 1075222546 16867 171.64.66.201 (27 Jan 2004 16:55:46 GMT)
X-Complaints-To: news@news.stanford.edu
To: sumeet shendrikar <sumeets@stanford.edu>
In-Reply-To: <bv5e76$q8o$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5562


> 
> Do we just assume that any IP packet where the length is less than the 
> minimum size for ethernet is valid (as far as length is concerned)?

 Yes and no.  If the header length says it is smaller than ethernet
 min data, and the packet you get is large, this is obviously an error.
 Conversely if you get a min data size packet and the header says it is
 large .. this is an error.  But no, you are not expected to peer into
 padded packets.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Choosing the correct interface
Date: Tue, 27 Jan 2004 08:57:59 -0800
Lines: 53
Distribution: su
Message-ID: <Pine.LNX.4.44.0401270857210.8975-100000@Xenon.Stanford.EDU>
References: <bv63u8$ff9$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 1075222681 16974 171.64.66.201 (27 Jan 2004 16:58:01 GMT)
X-Complaints-To: news@news.stanford.edu
To: Joshua Silver <jmsilver@stanford.edu>
In-Reply-To: <bv63u8$ff9$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5563


 Because the email told you.

 You set up the routing table by hand and that is what makes the decision
 where to send the packets.

 :)
 .m

> I'm confused on how to choose the correct interface.    Based on the data
> below, how would I know that my app server on 192.168.129.93 is connected to
> eth1?
> 
> 
> Destination: 0.0.0.0
>   Gateway : 172.24.74.17
>   Mask : 0.0.0.0
>   Interface : eth0
> Client jmsilver connecting to Server vns-2.stanford.edu:12345
> Requesting topology 169
> Sending c_open (type=1 len=108)
> Received Hardware Info with 18 entries
> INTERFACE: eth0
> Speed: 0
> Hardware Address: 70:00:00:a9:00:01
> Ethernet IP: 192.168.129.91
> Subnet: 0.0.0.0
> Mask: 0.0.0.0
> INTERFACE: eth1
> Speed: 0
> Hardware Address: 70:00:00:a9:00:02
> Ethernet IP: 192.168.129.92
> Subnet: 0.0.0.0
> Mask: 0.0.0.0
> INTERFACE: eth2
> Speed: 0
> Hardware Address: 70:00:00:a9:00:06
> Ethernet IP: 192.168.129.94
> Subnet: 0.0.0.0
> Mask: 0.0.0.0
> Interface: eth0
>   hardware address 70:00:00:a9:00:01
>   ip address 192.168.129.91
> Interface: eth1
>   hardware address 70:00:00:a9:00:02
>   ip address 192.168.129.92
> Interface: eth2
>   hardware address 70:00:00:a9:00:06
>   ip address 192.168.129.94
> 
> 
> 

.

Path: shelby.stanford.edu!elaine24.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Choosing the correct interface
Date: Tue, 27 Jan 2004 09:18:58 -0800
Lines: 51
Distribution: su
Message-ID: <Pine.GSO.4.44.0401270918120.768-100000@elaine24.Stanford.EDU>
References: <bv63u8$ff9$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine24.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075223939 18096 171.64.15.99 (27 Jan 2004 17:18:59 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bv63u8$ff9$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5564

I guess you need to manually configure your 'rtable' file to include those
destinations.

Lin

On Tue, 27 Jan 2004, Joshua Silver wrote:

> I'm confused on how to choose the correct interface.    Based on the data
> below, how would I know that my app server on 192.168.129.93 is connected to
> eth1?
>
>
> Destination: 0.0.0.0
>   Gateway : 172.24.74.17
>   Mask : 0.0.0.0
>   Interface : eth0
> Client jmsilver connecting to Server vns-2.stanford.edu:12345
> Requesting topology 169
> Sending c_open (type=1 len=108)
> Received Hardware Info with 18 entries
> INTERFACE: eth0
> Speed: 0
> Hardware Address: 70:00:00:a9:00:01
> Ethernet IP: 192.168.129.91
> Subnet: 0.0.0.0
> Mask: 0.0.0.0
> INTERFACE: eth1
> Speed: 0
> Hardware Address: 70:00:00:a9:00:02
> Ethernet IP: 192.168.129.92
> Subnet: 0.0.0.0
> Mask: 0.0.0.0
> INTERFACE: eth2
> Speed: 0
> Hardware Address: 70:00:00:a9:00:06
> Ethernet IP: 192.168.129.94
> Subnet: 0.0.0.0
> Mask: 0.0.0.0
> Interface: eth0
>   hardware address 70:00:00:a9:00:01
>   ip address 192.168.129.91
> Interface: eth1
>   hardware address 70:00:00:a9:00:02
>   ip address 192.168.129.92
> Interface: eth2
>   hardware address 70:00:00:a9:00:06
>   ip address 192.168.129.94
>
>
>

.

Path: shelby.stanford.edu!elaine24.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: empty ip packet
Date: Tue, 27 Jan 2004 09:30:54 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0401270929420.768-100000@elaine24.Stanford.EDU>
NNTP-Posting-Host: elaine24.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075224655 18798 171.64.15.99 (27 Jan 2004 17:30:55 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5565

Is it possible for an IP packet to have no data section? I mean is it
possible to receive an IP packet that has header only?

Thanks

Lin

.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: using OS headers
Date: Tue, 27 Jan 2004 09:35:35 -0800
Lines: 32
Distribution: su
Message-ID: <Pine.GSO.4.44.0401270935190.24476-100000@epic6.Stanford.EDU>
References: <Pine.GSO.4.44.0401261923250.18572-100000@elaine2.Stanford.EDU>
 <Pine.GSO.4.44.0401261938250.12269-100000@epic18.Stanford.EDU>
NNTP-Posting-Host: epic6.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075224936 19001 171.64.15.39 (27 Jan 2004 17:35:36 GMT)
X-Complaints-To: news@news.stanford.edu
To: Barrett Trask <btrask@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401261938250.12269-100000@epic18.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5566

Look in /usr/include/netinet

Boris.

On Mon, 26 Jan 2004, Barrett Trask wrote:

> On a related note, assuming an affirmative reply the to question below:
>
> Anyone know where the types n_short and n_time are defined?  They are used in
> the struct icmp definition.  Perhaps a compile flag can cause these to be
> defined?
>
> Thanks,
> Barrett
>
> On Mon, 26 Jan 2004, Boris Senderzon wrote:
>
> > Martin,
> >
> > Can we take your answer on whether we could use OS supplied message
> > headers instead of writing our own as something to be
> > enforced in the future and not in the current assignment or class?
> >
> > In particular, can we use netinet/ip_icmp.h header?
> >
> > Thanks.
> > Boris.
> >
> >
>
>

.

Path: shelby.stanford.edu!elaine24.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ICMP header
Date: Tue, 27 Jan 2004 09:45:52 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0401270944230.768-100000@elaine24.Stanford.EDU>
NNTP-Posting-Host: elaine24.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075225553 19538 171.64.15.99 (27 Jan 2004 17:45:53 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5567

I am just wondering if the identifier and seq num of echo request and
reply message counted as part of the header? When we are calculating
checksum, should we include these two fields?

Thanks

Lin

.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ICMP replies to ICMP packets
Date: Tue, 27 Jan 2004 09:46:03 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.GSO.4.44.0401270938090.24476-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 1075225564 19541 171.64.15.39 (27 Jan 2004 17:46:04 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5568

When we get an ICMP packet destined to us, we know what interface
the packet arrived from, IP address of the sender and MAC address of
previoius hop.  Given all of this, we could turn around and send
ICMP reply.  However, when ICMP packet arrives, link layer
strips ethrenet header and passes just the IP packet packet.
IP layer strips the IP header and passes ICMP packet plus IP address
of the source.  At this point we don't know the interface and the MAC
address of the previous host.  As such if look into our routing
table to find out how to route packet back to the source. Next hop
could be different from where the packet originally arrived.

Is this a problem for any programs, perhaps traceroute?  In addition,
how is this done in real routers?

Thanks,
Boris.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: empty ip packet
Date: Tue, 27 Jan 2004 09:48:01 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0401270945470.22591-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401270929420.768-100000@elaine24.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075225684 19621 171.64.66.201 (27 Jan 2004 17:48:04 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lin Chan <linchan@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401270929420.768-100000@elaine24.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5569


 That would be a strange IP packet indeed ... of course you can create
 arbitrary packets, though no legitimate traffic has a packet consisting solely
 of an ip header.

 .m

> Is it possible for an IP packet to have no data section? I mean is it
> possible to receive an IP packet that has header only?
> 
> Thanks
> 
> Lin
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ICMP replies to ICMP packets
Date: Tue, 27 Jan 2004 10:49:04 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0401271012050.30615-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401270938090.24476-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 1075229346 23684 171.64.66.201 (27 Jan 2004 18:49:06 GMT)
X-Complaints-To: news@news.stanford.edu
To: Boris Senderzon <senderzo@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401270938090.24476-100000@epic6.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5570


> When we get an ICMP packet destined to us, we know what interface
> the packet arrived from, IP address of the sender and MAC address of
> previoius hop.  Given all of this, we could turn around and send
> ICMP reply.  However, when ICMP packet arrives, link layer
> strips ethrenet header and passes just the IP packet packet.
> IP layer strips the IP header and passes ICMP packet plus IP address
> of the source.  At this point we don't know the interface and the MAC
> address of the previous host.  As such if look into our routing
> table to find out how to route packet back to the source. Next hop
> could be different from where the packet originally arrived.

 Yup, and that is OK, routes are not necessarily symmetric.  A more interesting
 question is, however, what IP address to use as the source address.

 .m 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ICMP header
Date: Tue, 27 Jan 2004 10:52:01 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0401271049130.30615-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401270944230.768-100000@elaine24.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075229523 23955 171.64.66.201 (27 Jan 2004 18:52:03 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lin Chan <linchan@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401270944230.768-100000@elaine24.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5571


> I am just wondering if the identifier and seq num of echo request and
> reply message counted as part of the header? When we are calculating
> checksum, should we include these two fields?

  Consult the ICMP rfc (or networksorcery) to determine how to correctly
  calculate the ICMP checksum.  ethereal will tell you whether it is correct
  or not.

  .m

.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP replies to ICMP packets
Date: Tue, 27 Jan 2004 11:03:25 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.GSO.4.44.0401271051260.24946-100000@epic6.Stanford.EDU>
References: <Pine.GSO.4.44.0401270938090.24476-100000@epic6.Stanford.EDU>
 <Pine.LNX.4.44.0401271012050.30615-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: epic6.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075230206 24664 171.64.15.39 (27 Jan 2004 19:03:26 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@CS.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0401271012050.30615-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5572

Does it matter?  ICMP messages that were generated
as a result of an error, contain original IP header.

On Tue, 27 Jan 2004, Martin Casado wrote:

>
> > When we get an ICMP packet destined to us, we know what interface
> > the packet arrived from, IP address of the sender and MAC address of
> > previoius hop.  Given all of this, we could turn around and send
> > ICMP reply.  However, when ICMP packet arrives, link layer
> > strips ethrenet header and passes just the IP packet packet.
> > IP layer strips the IP header and passes ICMP packet plus IP address
> > of the source.  At this point we don't know the interface and the MAC
> > address of the previous host.  As such if look into our routing
> > table to find out how to route packet back to the source. Next hop
> > could be different from where the packet originally arrived.
>
>  Yup, and that is OK, routes are not necessarily symmetric.  A more interesting
>  question is, however, what IP address to use as the source address.
>
>  .m
>

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!hcpang
From: Hoi-Cheung Pang <hcpang@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sr_send_packet and MT
Date: Tue, 27 Jan 2004 12:52:06 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0401271251220.2377-100000@elaine7.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075236728 1315 171.64.15.72 (27 Jan 2004 20:52:08 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5573

Hi,

Is the function sr_send_packet multi-thread safe?

Thanks,
Jimmy

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: sr_send_packet and MT
Date: Tue, 27 Jan 2004 13:14:06 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.LNX.4.44.0401271310570.32441-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401271251220.2377-100000@elaine7.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075238047 2600 171.64.66.201 (27 Jan 2004 21:14:07 GMT)
X-Complaints-To: news@news.stanford.edu
To: Hoi-Cheung Pang <hcpang@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401271251220.2377-100000@elaine7.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5574


 It is if you are.  That is, you pass in memory which it uses ... so
 if the buffer you are passing in is modified while sr_send_packet is
 doing its thing you will have problems.  Secondly, there is no guarontee
 that dumping packets for the log file will be correct.

 You are probably best to restrict access to one thread at a time.

 .m

> Hi,
> 
> Is the function sr_send_packet multi-thread safe?
> 
> Thanks,
> Jimmy
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: HW2 Review Session slides posted
Date: Tue, 27 Jan 2004 13:20:28 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.LNX.4.44.0401271320030.2805-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 1075238430 3166 171.64.66.201 (27 Jan 2004 21:20:30 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5575


 like the subject says.

 .martin

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ICMP replies to ICMP packets
Date: Tue, 27 Jan 2004 21:41:53 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <bv6lv1$4at$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401270938090.24476-100000@epic6.Stanford.EDU>  <Pine.LNX.4.44.0401271012050.30615-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0401271051260.24946-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1075239713 4445 171.64.15.118 (27 Jan 2004 21:41:53 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5576


>Does it matter?  ICMP messages that were generated
>as a result of an error, contain original IP header.

Yes, but those go in an IP packet's payload...

.

Path: shelby.stanford.edu!not-for-mail
From: Sumeet Shendrikar <sumeets@stanford.edu>
Newsgroups: su.class.cs244a
Subject: routing table vs. arp cache question
Date: Tue, 27 Jan 2004 14:48:03 -0800
Lines: 20
Distribution: su
Message-ID: <bv6poi$8sr$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab404653.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075243602 9115 171.64.70.83 (27 Jan 2004 22:46:42 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
Xref: shelby.stanford.edu su.class.cs244a:5577

for this assignment, we use a static routing table (i.e. it's read from 
a file but never updated during execution), and the ARP cache is 
generated dynamically.   Do we have to consider the case where a machine 
will be associated with a specific interface in the routing table but 
could be associated with another interface in the ARP cache?

i.e.

- routing table has host1, outgoing interface eth0
- host1 sends ARP request on eth1
- sr router responds, sends ARP reply on eth1, but also adds host1 to 
ARP cache on interface eth1
- if a packet arrives from some other host for host1, do we strictly 
follow the routing table or the ARP cache?

also, in general, what happens in routers with dynamically updated 
routing tables if such a conflict exists?

thanks,
sumeet
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: routing table vs. arp cache question
Date: Tue, 27 Jan 2004 15:29:41 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.LNX.4.44.0401271521020.14826-100000@Xenon.Stanford.EDU>
References: <bv6poi$8sr$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 1075246182 12616 171.64.66.201 (27 Jan 2004 23:29:42 GMT)
X-Complaints-To: news@news.stanford.edu
To: Sumeet Shendrikar <sumeets@stanford.edu>
In-Reply-To: <bv6poi$8sr$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5578



> for this assignment, we use a static routing table (i.e. it's read from 
> a file but never updated during execution), and the ARP cache is 
> generated dynamically.   Do we have to consider the case where a machine 
> will be associated with a specific interface in the routing table but 
> could be associated with another interface in the ARP cache?
> 
> i.e.
> 
> - routing table has host1, outgoing interface eth0

 I'm assuming you mean, the routing table has prefix 1 going out of
 interface eth0.

> - host1 sends ARP request on eth1
> - sr router responds, sends ARP reply on eth1, but also adds host1 to 
> ARP cache on interface eth1

 You don't add arp requests to your ARP cache.

> - if a packet arrives from some other host for host1, do we strictly 
> follow the routing table or the ARP cache?

 lookup in routing table ---> check arp cache for hw address .. if you
 don't have it for the outgoing interface you must ARP for it.  There
 really is no conflict that I can see.

 .m

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: routing table vs. arp cache question
Date: Tue, 27 Jan 2004 16:45:26 -0800
Lines: 50
Distribution: su
Message-ID: <Pine.GSO.4.44.0401271640170.12445-100000@elaine31.Stanford.EDU>
References: <bv6poi$8sr$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401271521020.14826-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 1075250728 17832 171.64.15.106 (28 Jan 2004 00:45:28 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0401271521020.14826-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5579

>  You don't add arp requests to your ARP cache.

hmm, but the 'RFC 826: An Ethernet Address Resolution Protocol', under
section: Packet Reception:, has an algorithm outlined where you would
potentially add information from an ARP request into your arp cache...

I followed this algorithm...do I have to change it, or did I read the RFC
incorrectly?

"?Am I the target protocol address?
    Yes:
      If Merge_flag is false, add the triplet <protocol type,
          sender protocol address, sender hardware address> to
	  the translation table.
"
--vishal

On Tue, 27 Jan 2004, Martin Casado wrote:

>
>
> > for this assignment, we use a static routing table (i.e. it's read from
> > a file but never updated during execution), and the ARP cache is
> > generated dynamically.   Do we have to consider the case where a machine
> > will be associated with a specific interface in the routing table but
> > could be associated with another interface in the ARP cache?
> >
> > i.e.
> >
> > - routing table has host1, outgoing interface eth0
>
>  I'm assuming you mean, the routing table has prefix 1 going out of
>  interface eth0.
>
> > - host1 sends ARP request on eth1
> > - sr router responds, sends ARP reply on eth1, but also adds host1 to
> > ARP cache on interface eth1
>
>
> > - if a packet arrives from some other host for host1, do we strictly
> > follow the routing table or the ARP cache?
>
>  lookup in routing table ---> check arp cache for hw address .. if you
>  don't have it for the outgoing interface you must ARP for it.  There
>  really is no conflict that I can see.
>
>  .m
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Packet ID
Date: Wed, 28 Jan 2004 02:00:07 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <bv7537$28j$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1075255207 2323 171.64.15.118 (28 Jan 2004 02:00: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:5580

How do we generate the packet ID?  Can a static counter be used?  Or a 
random number generator?

Tyrone

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Adding fields to sr_instance
Date: Wed, 28 Jan 2004 03:05:04 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <bv78t0$8ke$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1075259104 8846 171.64.15.118 (28 Jan 2004 03:05: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:5581

In general, can we add fields to sr_instance as necessary?  Specifically, 
I am looking for somewhere to store a list of outgoing packets waiting for 
an ARP reply.

Tyrone
.

Path: shelby.stanford.edu!epic16.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Adding fields to sr_instance
Date: Tue, 27 Jan 2004 19:33:32 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.GSO.4.44.0401271930140.5181-100000@epic16.Stanford.EDU>
References: <bv78t0$8ke$1@news.Stanford.EDU>
NNTP-Posting-Host: epic16.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075260813 10530 171.64.15.49 (28 Jan 2004 03:33:33 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bv78t0$8ke$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5582


I was wondering about storing some data in the sr_if definition.  Can we
get clarification about what structures we can modify?

Thanks,
Barrett

On Wed, 28 Jan 2004, Tyrone Nicholas wrote:

> In general, can we add fields to sr_instance as necessary?  Specifically,
> I am looking for somewhere to store a list of outgoing packets waiting for
> an ARP reply.
>
> Tyrone
>

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: routing table vs. arp cache question
Date: Tue, 27 Jan 2004 19:49:31 -0800
Lines: 27
Distribution: su
Message-ID: <Pine.LNX.4.44.0401271933310.2061-100000@Xenon.Stanford.EDU>
References: <bv6poi$8sr$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401271521020.14826-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401271640170.12445-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 1075261772 11557 171.64.66.201 (28 Jan 2004 03:49:32 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401271640170.12445-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5583

On Tue, 27 Jan 2004, Vishal Patel wrote:

> >  You don't add arp requests to your ARP cache.
> 
> hmm, but the 'RFC 826: An Ethernet Address Resolution Protocol', under
> section: Packet Reception:, has an algorithm outlined where you would
> potentially add information from an ARP request into your arp cache...
> 
> I followed this algorithm...do I have to change it, or did I read the RFC
> incorrectly?
> 
> "?Am I the target protocol address?
>     Yes:
>       If Merge_flag is false, add the triplet <protocol type,
>           sender protocol address, sender hardware address> to
> 	  the translation table.
> "
> --vishal

 Perhaps I should clarify, you do not add arbitrary ARP requests to
 the ARP cache.  Since ARP requests are sent to broadcast you may receive
 them from anyone.  If however the incoming interface has the correct IP
 you should cache the request.  If the ARP request isn't for you, but you
 have the triplet in your cache, you should update it.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Packet ID
Date: Tue, 27 Jan 2004 19:50:08 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0401271949360.2061-100000@Xenon.Stanford.EDU>
References: <bv7537$28j$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 1075261810 11635 171.64.66.201 (28 Jan 2004 03:50:10 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <bv7537$28j$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5584


 Choose one and explain your reasoning in your write-up.

 .m

> How do we generate the packet ID?  Can a static counter be used?  Or a 
> random number generator?
> 
> Tyrone
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Adding fields to sr_instance
Date: Tue, 27 Jan 2004 19:51:02 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0401271950190.2061-100000@Xenon.Stanford.EDU>
References: <bv78t0$8ke$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 1075261864 11702 171.64.66.201 (28 Jan 2004 03:51:04 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <bv78t0$8ke$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5585


 Sure. sr_router.[c,h] on in bounds.

 .m

> In general, can we add fields to sr_instance as necessary?  Specifically, 
> I am looking for somewhere to store a list of outgoing packets waiting for 
> an ARP reply.
> 
> Tyrone
> 

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: phone call during office hours
Date: Tue, 27 Jan 2004 20:25:59 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.GSO.4.44.0401272023170.10586-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 1075263961 13613 171.64.15.100 (28 Jan 2004 04:26:01 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5586

Hello,

I am a remote student and it would help if we can call the TA's to ask
question during their office hours.  Is there any chance of this, or too
troublesome?

--vp


.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: OS thread limit
Date: Tue, 27 Jan 2004 20:34:05 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0401272029510.10586-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 1075264448 14037 171.64.15.100 (28 Jan 2004 04:34:08 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5587


I can dream up some implementatoin that requires spawning a thread
every time we need to do an arp request and wait for a reply

This seems to make management of the ARP request timeouts easier, but
one down fall of this is if too many packets come in, it is possible
to run up against the OS limit of max number of threads...should I be
concerned about this for the purpose of this assignment?

--v

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: OS thread limit
Date: Tue, 27 Jan 2004 20:56:29 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0401272053370.24770-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401272029510.10586-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 1075265791 15370 171.64.66.201 (28 Jan 2004 04:56:31 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401272029510.10586-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5588


> 
> I can dream up some implementatoin that requires spawning a thread
> every time we need to do an arp request and wait for a reply

  ouch, this is a nightmare. 
 
> This seems to make management of the ARP request timeouts easier, but
> one down fall of this is if too many packets come in, it is possible
> to run up against the OS limit of max number of threads...should I be
> concerned about this for the purpose of this assignment?

 Yes, you certainly should.  Spawning a thread per arp request is
 not a very reasonable implementation.

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: arp hdr sanity check
Date: Tue, 27 Jan 2004 21:07:17 -0800
Lines: 8
Distribution: su
Message-ID: <bv7g6h$h5$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075266578 549 127.0.0.1 (28 Jan 2004 05:09:38 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5589

Does the source ethernet address of the ethernet header have to match 
the source hardware address in the arp header (assuming the arp message 
was issued over an ethernet network)?  I don't know a reason why it 
would be allowed for them to be different and it seems like a security 
risk.  If it's unallowed, do we just drop the arp message?

Thanks,
William
.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: OS thread limit
Date: Tue, 27 Jan 2004 21:15:27 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.GSO.4.44.0401272113280.25286-100000@elaine31.Stanford.EDU>
References: <Pine.GSO.4.44.0401272029510.10586-100000@elaine25.Stanford.EDU>
 <Pine.LNX.4.44.0401272053370.24770-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 1075266928 16352 171.64.15.106 (28 Jan 2004 05:15:28 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0401272053370.24770-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5590

hmm,

then I might need a nudge in the right direction...the only other
way i can think of handling the timeouts is to have a queue of oustanding
packets and one thread that wakes up every so often and manages it...am i
totally lost?

--vp


On Tue, 27 Jan 2004, Martin Casado wrote:

>
> >
> > I can dream up some implementatoin that requires spawning a thread
> > every time we need to do an arp request and wait for a reply
>
>   ouch, this is a nightmare.
>
> > This seems to make management of the ARP request timeouts easier, but
> > one down fall of this is if too many packets come in, it is possible
> > to run up against the OS limit of max number of threads...should I be
> > concerned about this for the purpose of this assignment?
>
>  Yes, you certainly should.  Spawning a thread per arp request is
>  not a very reasonable implementation.
>
>  .m
>

.

Path: shelby.stanford.edu!elaine12.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Bellman-Ford counting to infinity
Date: Wed, 28 Jan 2004 05:21:45 +0000 (UTC)
Lines: 37
Distribution: su
Message-ID: <bv7gt9$gb6$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine12.stanford.edu
X-Trace: news.Stanford.EDU 1075267305 16742 171.64.15.77 (28 Jan 2004 05:21:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5591


Someone had asked me in office hours to construct an example of
how Bellman-Ford is subject to the "count-to-infinity" problem,
so I thought I'd post it here in case anyone else had found this
a bit confusing as well.  I hope this helps...

Suppose you have a network with associated link costs as follows:

   1     1     1
A-----B-----C-----D

The forwarding information at each node to reach D after the algorithm
converges will be [in the form of (next hop, cost)]:
A: (B, 3)   B: (C, 2)   C: (D, 1)

Now suppose the C-D link goes down, so C can no longer reach D via C-D.
The routers will thus see the following (only C notices the failure):
A: (B, 3)   B: (C, 2)   C: (D, inf)

At the next routing table exchange, C will receive B's advertised cost of 2
to reach D, and so it will use B as the next hop for D, with an associated
cost of 2+1=3 (C will use B as the next hop rather than D since 3 < inf).
The tables are thus as follows:
A: (B, 3)   B: (C, 2)   C: (B, 3)   [A, B remain unchanged]

Next routing table exchange (that last update to C propagates to B;
B's next hop for D is C, so it must update its weight now):
A: (B, 3)   B: (C, 4)   C: (B, 3)   [A remains unchanged]

Next routing table exchange (that last update to B propagates to A and C;
A's next hop for D is B, so it must update its weight now.
And similarly, since C's next hop is B, it must use 4+1=5 as its
cost to reach D):
A: (B, 5)   B: (C, 4)   C: (B, 5)

And you can see how this process will continue, with costs -> \infty.

.

Path: shelby.stanford.edu!elaine12.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: OS thread limit
Date: Wed, 28 Jan 2004 05:23:15 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <bv7h03$gcn$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401272029510.10586-100000@elaine25.Stanford.EDU>  <Pine.LNX.4.44.0401272053370.24770-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0401272113280.25286-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine12.stanford.edu
X-Trace: news.Stanford.EDU 1075267395 16791 171.64.15.77 (28 Jan 2004 05:23:15 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5592



>then I might need a nudge in the right direction...the only other
>way i can think of handling the timeouts is to have a queue of oustanding
>packets and one thread that wakes up every so often and manages it...am i
>totally lost?

that sounds like a more reasonable strategy...

.

Path: shelby.stanford.edu!elaine12.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: phone call during office hours
Date: Wed, 28 Jan 2004 05:26:00 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <bv7h58$gjp$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401272023170.10586-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine12.stanford.edu
X-Trace: news.Stanford.EDU 1075267560 17017 171.64.15.77 (28 Jan 2004 05:26:00 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5593



>I am a remote student and it would help if we can call the TA's to ask
>question during their office hours.  Is there any chance of this, or too
>troublesome?

At least I have no phone in Sweet Hall--but you could certainly send a
message to us via zwrite if you wanted to 'talk' in real-time.  or if you
let one of us know your phone number, and absolutely can't discuss
something via e-mail or the newsgroup, we could call you if need be...

.

Path: shelby.stanford.edu!not-for-mail
From: "Gaj" <gajapati@nortelnetworks.com>
Newsgroups: su.class.cs244a
Subject: tcpdump permission denied
Date: Tue, 27 Jan 2004 22:00:48 -0800
Lines: 9
Distribution: su
Message-ID: <bv7j6l$ige$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075269655 18958 127.0.0.1 (28 Jan 2004 06:00: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:5594

Hi

I am not able to execute tcpdump command from /usr/class/cs244a/bin. It says
permission denied.Anyboduy else see this problem?

Thanks,
Gaj


.

Path: shelby.stanford.edu!not-for-mail
From: Abhyudaya Sravanth Chodisetti <sravanth@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Signal
Date: Tue, 27 Jan 2004 22:06:41 -0800
Lines: 16
Distribution: su
Message-ID: <40175171.8084C0A4@stanford.edu>
NNTP-Posting-Host: elaine12.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075270001 19213 171.64.15.77 (28 Jan 2004 06:06:41 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:5595

Hi,

I am planning to use SIGALRM in signal library for managing timeouts.
But as the first alarm goes off and generates SIGALRM, recv() in
sr_vns_comm.c is interrupted and since the condition there does not test
if errno is EINTR, the program simply aborts with the following message.

recv(..):sr_client.c::sr_read_from_server: Interrupted system call
sr_destroy_INSTANCE leaking memory     

Can I fix the code? 
Is signalling a good approach for timeouts?

Thanks,

Abhyudaya
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: arp hdr sanity check
Date: Tue, 27 Jan 2004 22:20:20 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.LNX.4.44.0401272218420.15322-100000@Xenon.Stanford.EDU>
References: <bv7g6h$h5$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 1075270823 19916 171.64.66.201 (28 Jan 2004 06:20:23 GMT)
X-Complaints-To: news@news.stanford.edu
To: William Chan <chanman@stanford.edu>
In-Reply-To: <bv7g6h$h5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5596


 It is a security risk and commonly used in layer 2 attacks.  For example,
 bypassing port security on a switch and poisening the target's arp
 cache.  However you don't have to ensure they match (though you may if
 you'd like).

 .m

> Does the source ethernet address of the ethernet header have to match 
> the source hardware address in the arp header (assuming the arp message 
> was issued over an ethernet network)?  I don't know a reason why it 
> would be allowed for them to be different and it seems like a security 
> risk.  If it's unallowed, do we just drop the arp message?
> 
> Thanks,
> William
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: OS thread limit
Date: Tue, 27 Jan 2004 22:20:51 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0401272220300.15322-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401272029510.10586-100000@elaine25.Stanford.EDU>
 <Pine.LNX.4.44.0401272053370.24770-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401272113280.25286-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 1075270856 19946 171.64.66.201 (28 Jan 2004 06:20:56 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401272113280.25286-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5597


> hmm,
> 
> then I might need a nudge in the right direction...the only other
> way i can think of handling the timeouts is to have a queue of oustanding
> packets and one thread that wakes up every so often and manages it...am i
> totally lost?

 sounds reasonable to me, what is wrong with that?

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: tcpdump permission denied
Date: Tue, 27 Jan 2004 22:22:25 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.LNX.4.44.0401272221240.15322-100000@Xenon.Stanford.EDU>
References: <bv7j6l$ige$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 1075270948 20015 171.64.66.201 (28 Jan 2004 06:22:28 GMT)
X-Complaints-To: news@news.stanford.edu
To: Gaj <gajapati@nortelnetworks.com>
In-Reply-To: <bv7j6l$ige$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5598


 You will need to use tcpdump on your trace log ... say you ran your router
 with

 ./sr -l mylogfile

 then use tcpdump with

 tcpdump <args> -r mylogfile

 .m

> Hi
> 
> I am not able to execute tcpdump command from /usr/class/cs244a/bin. It says
> permission denied.Anyboduy else see this problem?
> 
> Thanks,
> Gaj
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Signal
Date: Tue, 27 Jan 2004 22:24:23 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.LNX.4.44.0401272222430.15322-100000@Xenon.Stanford.EDU>
References: <40175171.8084C0A4@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075271067 20119 171.64.66.201 (28 Jan 2004 06:24:27 GMT)
X-Complaints-To: news@news.stanford.edu
To: Abhyudaya Sravanth Chodisetti <sravanth@stanford.edu>
In-Reply-To: <40175171.8084C0A4@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5599


 Sure, throw in a patch and send it to me.  SIGALRM is  perfectly
 reasonable approach.

 .m

> Hi,
> 
> I am planning to use SIGALRM in signal library for managing timeouts.
> But as the first alarm goes off and generates SIGALRM, recv() in
> sr_vns_comm.c is interrupted and since the condition there does not test
> if errno is EINTR, the program simply aborts with the following message.
> 
> recv(..):sr_client.c::sr_read_from_server: Interrupted system call
> sr_destroy_INSTANCE leaking memory     
> 
> Can I fix the code? 
> Is signalling a good approach for timeouts?
> 
> Thanks,
> 
> Abhyudaya
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: empty ip packet
Date: Wed, 28 Jan 2004 14:26:20 +0800
Lines: 25
Distribution: su
Message-ID: <4017560C.6AEFFD9D@leland.stanford.edu>
References: <Pine.GSO.4.44.0401270929420.768-100000@elaine24.Stanford.EDU> <Pine.LNX.4.44.0401270945470.22591-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075271211 20073 128.12.196.85 (28 Jan 2004 06:26:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:5600

So if we did encounter such a packet, and we have to construct an ICMP destination
unreachable message. According to the RFC, we need to include the IP header and
first 64 bits of data into the ICMP message. What do we do if the 64 bits do not
exist?

Thanks,
Jimmy

Martin Casado wrote:

>  That would be a strange IP packet indeed ... of course you can create
>  arbitrary packets, though no legitimate traffic has a packet consisting solely
>  of an ip header.
>
>  .m
>
> > Is it possible for an IP packet to have no data section? I mean is it
> > possible to receive an IP packet that has header only?
> >
> > Thanks
> >
> > Lin
> >
> >

.

Path: shelby.stanford.edu!not-for-mail
From: "Tony Hsieh" <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: OS thread limit
Date: Tue, 27 Jan 2004 23:17:14 -0800
Lines: 31
Distribution: su
Message-ID: <bv7nm2$mio$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401272029510.10586-100000@elaine25.Stanford.EDU> <Pine.LNX.4.44.0401272053370.24770-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0401272113280.25286-100000@elaine31.Stanford.EDU> <Pine.LNX.4.44.0401272220300.15322-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: acc2a179.ipt.aol.com
X-Trace: news.Stanford.EDU 1075274244 23128 172.194.161.121 (28 Jan 2004 07:17: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:5601

i'm not quite sure i understand this.  say i have a queue of outstanding
packets and a thread that wakes up every so often.  while the thread is
sleeping, if i receive an arp reply, the corresponding packet will be
removed from the queue and sent.  when the thread wakes up again, how do i
know that a reply came in for the arp request i sent out and a timeout did
not occur?  it then seems that i need to keep track of some sort of time
that each outstanding packet was placed in the queue and when the thread
wakes up again, to check the current time against the times of all packets
in the queue and resend an arp request if too much time has passed,  is this
right? should we also place locks around our queue b/c we don't want it to
be edited by the main thread and the timer thread at the same time?


"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0401272220300.15322-100000@Xenon.Stanford.EDU...
>
> > hmm,
> >
> > then I might need a nudge in the right direction...the only other
> > way i can think of handling the timeouts is to have a queue of
oustanding
> > packets and one thread that wakes up every so often and manages it...am
i
> > totally lost?
>
>  sounds reasonable to me, what is wrong with that?
>
>  .m
>


.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ARP and interface
Date: Wed, 28 Jan 2004 00:41:28 -0800
Lines: 57
Distribution: su
Message-ID: <Pine.GSO.4.44.0401280039410.27384-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0401251625300.28128-100000@elaine39.Stanford.EDU>
 <Pine.LNX.4.44.0401251632260.19697-100000@Xenon.Stanford.EDU>
 <bv1or3$h08$1@news.Stanford.EDU> <Pine.LNX.4.44.0401251754060.8898-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 1075279291 28937 171.64.15.118 (28 Jan 2004 08:41:31 GMT)
X-Complaints-To: news@news.stanford.edu
Cc: Joshua Silver <jmsilver@stanford.edu>
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0401251754060.8898-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5602


If I understand it correctly, the ARP request packet is passed to the
sr_handlepacket() after it is checked against the sr_arp_req_not_for_us();
therefore, in our router code, we do not have to check it again.  Please
confirm.

On Sun, 25 Jan 2004, Martin Casado wrote:

>
>
>  It does.  I suppose it is silly to reimplement that, the reason it is there
>  and hidden in sr_vns_comm instead of sr_router is that students kept replying
>  to ARPs not for them and poisening the firewalls arp cache.
>
>  .m
>
>
>
>
> > Isn't this already  handled in your function sr_arp_req_not_for_us().
> >
> >
> > "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> > news:Pine.LNX.4.44.0401251632260.19697-100000@Xenon.Stanford.EDU...
> > >
> > >  Good question.  If you receive and ARP requests you assume it is
> > >  from a machine on your network ... the VNS will ensure you will
> > >  only see ARPs coming from machines on your topology.
> > >
> > >  If the ARP is not asking for the exact interface that it came in on,
> > >  drop it.  Servicing an ARP from an interface other than the one it
> > >  came in on is an error.
> > >
> > >  .m
> > >
> > > > When we received an ARP request on one of our interfaces, do we care
> > from
> > > > which interface this ARP packet is from? I mean do we only give ARP
> > reply
> > > > if the ARP request on MAC addr of eth0 is actually from interface eth0
> > > > only?
> > > >
> > > > If an ARP is not asking for any of the routers interface, we simply drop
> > > > the packet right?
> > > >
> > > > Thanks
> > > >
> > > > Lin
> > > >
> > > >
> > >
> >
> >
> >
>
>

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Support more than Ethernet for ARP
Date: Wed, 28 Jan 2004 01:24:56 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.GSO.4.44.0401280121190.28487-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 1075281905 1215 171.64.15.118 (28 Jan 2004 09:25:05 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5603


According to the ARP protocol, we should be storing and handling different
hardware protocol since the HardwareType field can be assigned value other
than 1.  Now, the current data structure "sr_arphdr" assumes the ethernet
address (using ETHER_ADDR_LEN).  So, are we required to support any other
Hardware type for the ARP?  Or should we limit the support to the
ethernet?

-Laura

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: traceroute explanation
Date: Wed, 28 Jan 2004 08:33:35 -0800
Lines: 15
Distribution: su
Message-ID: <bv8o01$njo$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1075307330 24184 128.12.189.163 (28 Jan 2004 16:28: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:5604

Hi,
The man page of traceroute shows this sample :
[yak 72]% traceroute allspice.lcs.mit.edu.
          traceroute to allspice.lcs.mit.edu (18.26.0.115), 30 hops max
           1  helios.ee.lbl.gov (128.3.112.1)  0 ms  0 ms  0 ms
           2  lilac-dmc.Berkeley.EDU (128.32.216.1)  19 ms  19 ms  19 ms
           3  lilac-dmc.Berkeley.EDU (128.32.216.1)  39 ms  19 ms  19 ms
           4  ccngw-ner-cc.Berkeley.EDU (128.32.136.23)  19 ms  39 ms  39 ms
           5  ccn-nerif22.Berkeley.EDU (128.32.168.22)  20 ms  39 ms  39 ms
           6  128.32.197.4 (128.32.197.4)  59 ms  119 ms  39 ms
For each router 3 times are displayed.What are each of those?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: empty ip packet
Date: Wed, 28 Jan 2004 08:40:21 -0800
Lines: 32
Distribution: su
Message-ID: <Pine.LNX.4.44.0401280831480.3126-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401270929420.768-100000@elaine24.Stanford.EDU>
 <Pine.LNX.4.44.0401270945470.22591-100000@Xenon.Stanford.EDU>
 <4017560C.6AEFFD9D@leland.stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075308023 24784 171.64.66.201 (28 Jan 2004 16:40:23 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jimmy Pang <hcpang@leland.stanford.edu>
In-Reply-To: <4017560C.6AEFFD9D@leland.stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5605


 Your decision.

 .m

> So if we did encounter such a packet, and we have to construct an ICMP destination
> unreachable message. According to the RFC, we need to include the IP header and
> first 64 bits of data into the ICMP message. What do we do if the 64 bits do not
> exist?
> 
> Thanks,
> Jimmy
> 
> Martin Casado wrote:
> 
> >  That would be a strange IP packet indeed ... of course you can create
> >  arbitrary packets, though no legitimate traffic has a packet consisting solely
> >  of an ip header.
> >
> >  .m
> >
> > > Is it possible for an IP packet to have no data section? I mean is it
> > > possible to receive an IP packet that has header only?
> > >
> > > Thanks
> > >
> > > Lin
> > >
> > >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: OS thread limit
Date: Wed, 28 Jan 2004 08:44:35 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.LNX.4.44.0401280840300.3126-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401272029510.10586-100000@elaine25.Stanford.EDU>
 <Pine.LNX.4.44.0401272053370.24770-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401272113280.25286-100000@elaine31.Stanford.EDU>
 <Pine.LNX.4.44.0401272220300.15322-100000@Xenon.Stanford.EDU>
 <bv7nm2$mio$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 1075308278 24915 171.64.66.201 (28 Jan 2004 16:44:38 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tony Hsieh <thsieh@stanford.edu>
In-Reply-To: <bv7nm2$mio$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5606


> should we also place locks around our queue b/c we don't want it to
> be edited by the main thread and the timer thread at the same time?

 Yes!

 :)
 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ARP and interface
Date: Wed, 28 Jan 2004 08:45:36 -0800
Lines: 68
Distribution: su
Message-ID: <Pine.LNX.4.44.0401280844490.3126-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401251625300.28128-100000@elaine39.Stanford.EDU>
 <Pine.LNX.4.44.0401251632260.19697-100000@Xenon.Stanford.EDU>
 <bv1or3$h08$1@news.Stanford.EDU> <Pine.LNX.4.44.0401251754060.8898-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401280039410.27384-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 1075308338 25006 171.64.66.201 (28 Jan 2004 16:45:38 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0401280039410.27384-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5607


 Here's the deal, arp_req_not_for_us(..) was a safety measure to keepstudents
from doing bad things with other peoples arp requests (likeredirecting streams)
and is not really suppose to be part of the router.But since it is already
there .. it seems a bit silly to have tore-implement it so, no you don't have
to.. 

 .m

> 
> If I understand it correctly, the ARP request packet is passed to the
> sr_handlepacket() after it is checked against the sr_arp_req_not_for_us();
> therefore, in our router code, we do not have to check it again.  Please
> confirm.
> 
> On Sun, 25 Jan 2004, Martin Casado wrote:
> 
> >
> >
> >  It does.  I suppose it is silly to reimplement that, the reason it is there
> >  and hidden in sr_vns_comm instead of sr_router is that students kept replying
> >  to ARPs not for them and poisening the firewalls arp cache.
> >
> >  .m
> >
> >
> >
> >
> > > Isn't this already  handled in your function sr_arp_req_not_for_us().
> > >
> > >
> > > "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> > > news:Pine.LNX.4.44.0401251632260.19697-100000@Xenon.Stanford.EDU...
> > > >
> > > >  Good question.  If you receive and ARP requests you assume it is
> > > >  from a machine on your network ... the VNS will ensure you will
> > > >  only see ARPs coming from machines on your topology.
> > > >
> > > >  If the ARP is not asking for the exact interface that it came in on,
> > > >  drop it.  Servicing an ARP from an interface other than the one it
> > > >  came in on is an error.
> > > >
> > > >  .m
> > > >
> > > > > When we received an ARP request on one of our interfaces, do we care
> > > from
> > > > > which interface this ARP packet is from? I mean do we only give ARP
> > > reply
> > > > > if the ARP request on MAC addr of eth0 is actually from interface eth0
> > > > > only?
> > > > >
> > > > > If an ARP is not asking for any of the routers interface, we simply drop
> > > > > the packet right?
> > > > >
> > > > > Thanks
> > > > >
> > > > > Lin
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> >
> >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Support more than Ethernet for ARP
Date: Wed, 28 Jan 2004 08:46:26 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0401280845550.3126-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401280121190.28487-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 1075308388 25114 171.64.66.201 (28 Jan 2004 16:46:28 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401280121190.28487-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5608


 Ethernet only. 
 .m

> 
> According to the ARP protocol, we should be storing and handling different
> hardware protocol since the HardwareType field can be assigned value other
> than 1.  Now, the current data structure "sr_arphdr" assumes the ethernet
> address (using ETHER_ADDR_LEN).  So, are we required to support any other
> Hardware type for the ARP?  Or should we limit the support to the
> ethernet?
> 
> -Laura
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: traceroute explanation
Date: Wed, 28 Jan 2004 08:46:55 -0800
Lines: 22
Distribution: su
Message-ID: <Pine.LNX.4.44.0401280846410.3126-100000@Xenon.Stanford.EDU>
References: <bv8o01$njo$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 1075308418 25133 171.64.66.201 (28 Jan 2004 16:46:58 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bv8o01$njo$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5609


 traceroute sends three probes per hop.

 .m

> Hi,
> The man page of traceroute shows this sample :
> [yak 72]% traceroute allspice.lcs.mit.edu.
>           traceroute to allspice.lcs.mit.edu (18.26.0.115), 30 hops max
>            1  helios.ee.lbl.gov (128.3.112.1)  0 ms  0 ms  0 ms
>            2  lilac-dmc.Berkeley.EDU (128.32.216.1)  19 ms  19 ms  19 ms
>            3  lilac-dmc.Berkeley.EDU (128.32.216.1)  39 ms  19 ms  19 ms
>            4  ccngw-ner-cc.Berkeley.EDU (128.32.136.23)  19 ms  39 ms  39 ms
>            5  ccn-nerif22.Berkeley.EDU (128.32.168.22)  20 ms  39 ms  39 ms
>            6  128.32.197.4 (128.32.197.4)  59 ms  119 ms  39 ms
> For each router 3 times are displayed.What are each of those?
> Thanks,
> Haripriya
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Question about routing table
Date: Wed, 28 Jan 2004 09:34:28 -0800
Lines: 16
Distribution: su
Message-ID: <bv8rr9$ren$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075311274 28119 127.0.0.1 (28 Jan 2004 17:34:34 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:5610

One of Martin's slides is titled "Routing Table".

In the first row, suppose he's got:

IP address = 192.168.128.51
Next-Hop IP address = 192.168.128.51
Network Mask = 255.255.255.0  <==== note this is changed from the slide
Outgoing interface= eth1

and our router got a packet destined for 192.168.128.100,  would we send the
packet to the ethernet address corresponding to 192.168.128.100 or
192.168.128.51?   In other words, how do we know which hosts are directly
connected to our network?



.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Question about routing table
Date: Wed, 28 Jan 2004 09:46:09 -0800
Lines: 32
Distribution: su
Message-ID: <Pine.LNX.4.44.0401280943390.22128-100000@Xenon.Stanford.EDU>
References: <bv8rr9$ren$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 1075311971 28952 171.64.66.201 (28 Jan 2004 17:46:11 GMT)
X-Complaints-To: news@news.stanford.edu
To: Joshua Silver <jmsilver@stanford.edu>
In-Reply-To: <bv8rr9$ren$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5611


 You would send it to 51 since that is the next hop field.  However, you
 raise a good point, often you will have a full subnet directly off of an
 interface ... and you don't want to have an entry in the table for each
 host, so there has to be a way for the router to say "next hop is the
 destination". 

 One obvious, and simple, way to do this is to set the next hop to 0.

 Make sure you're logic checks for this .. if so, the next hop is assumed
 to be the destination of the packet.

 .m

> One of Martin's slides is titled "Routing Table".
> 
> In the first row, suppose he's got:
> 
> IP address = 192.168.128.51
> Next-Hop IP address = 192.168.128.51
> Network Mask = 255.255.255.0  <==== note this is changed from the slide
> Outgoing interface= eth1
> 
> and our router got a packet destined for 192.168.128.100,  would we send the
> packet to the ethernet address corresponding to 192.168.128.100 or
> 192.168.128.51?   In other words, how do we know which hosts are directly
> connected to our network?
> 
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question about routing table
Date: Wed, 28 Jan 2004 09:55:48 -0800
Lines: 41
Distribution: su
Message-ID: <bv8t7k$h5$2@news.Stanford.EDU>
References: <bv8rr9$ren$1@news.Stanford.EDU> <Pine.LNX.4.44.0401280943390.22128-100000@Xenon.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075312692 549 127.0.0.1 (28 Jan 2004 17:58:12 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4
X-Accept-Language: en-us, en
In-Reply-To: <Pine.LNX.4.44.0401280943390.22128-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5612

Why would you send a packet destined for 192.168.128.100 to 
192.168.128.51?  In the example he's got, the net mask is 255.255.255.0, 
so 192.168.128.100 & 255.255.255.0 = 192.168.128.0.  Since there is no 
entry matching that, it should be sent to the default router right?

--Will

Martin Casado wrote:
>  You would send it to 51 since that is the next hop field.  However, you
>  raise a good point, often you will have a full subnet directly off of an
>  interface ... and you don't want to have an entry in the table for each
>  host, so there has to be a way for the router to say "next hop is the
>  destination". 
> 
>  One obvious, and simple, way to do this is to set the next hop to 0.
> 
>  Make sure you're logic checks for this .. if so, the next hop is assumed
>  to be the destination of the packet.
> 
>  .m
> 
> 
>>One of Martin's slides is titled "Routing Table".
>>
>>In the first row, suppose he's got:
>>
>>IP address = 192.168.128.51
>>Next-Hop IP address = 192.168.128.51
>>Network Mask = 255.255.255.0  <==== note this is changed from the slide
>>Outgoing interface= eth1
>>
>>and our router got a packet destined for 192.168.128.100,  would we send the
>>packet to the ethernet address corresponding to 192.168.128.100 or
>>192.168.128.51?   In other words, how do we know which hosts are directly
>>connected to our network?
>>
>>
>>
>>
> 
> 
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Question about routing table
Date: Wed, 28 Jan 2004 10:50:05 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.LNX.4.44.0401281043070.8990-100000@Xenon.Stanford.EDU>
References: <bv8rr9$ren$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401280943390.22128-100000@Xenon.Stanford.EDU>
 <bv8t7k$h5$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 1075315806 3588 171.64.66.201 (28 Jan 2004 18:50:06 GMT)
X-Complaints-To: news@news.stanford.edu
To: William Chan <chanman@stanford.edu>
In-Reply-To: <bv8t7k$h5$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5613




> Why would you send a packet destined for 192.168.128.100 to 
> 192.168.128.51?  In the example he's got, the net mask is 255.255.255.0, 
> so 192.168.128.100 & 255.255.255.0 = 192.168.128.0.  Since there is no 
> entry matching that, it should be sent to the default router right?

  Most hosts will not allow you to add a prefix with nonzero values in
  the host postion:

  ex:

  [root@nity casado]# route add 1.2.3.4 netmask 255.255.255.0
  route: netmask 000000ff doesn't make sense with host route

  so you wouldn't get the posted routing table to begin with.  However,
  others allow arbitrary values in prefix and compare by anding with 
  the mask

  if (rtabel.dest & rtable.mask ==
      iphdr.dest  & rtable.mask)

  since we don't check the validity of the routes coming in, you should
  and your prefix with the mask when comparing

  .m

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: ICMP through different interface
Date: Wed, 28 Jan 2004 19:35:17 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <bv92tl$6a0$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine29.stanford.edu
X-Trace: news.Stanford.EDU 1075318517 6464 171.64.15.104 (28 Jan 2004 19:35: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:5614

Suppose one interface receives an ICMP message addressed to another 
interface on the same router.  Does it respond to it directly?  or forward 
it to itself?


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ICMP through different interface
Date: Wed, 28 Jan 2004 13:10:02 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0401281308490.31625-100000@Xenon.Stanford.EDU>
References: <bv92tl$6a0$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 1075324204 13075 171.64.66.201 (28 Jan 2004 21:10:04 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <bv92tl$6a0$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5615


 I'm not sure if your question makes sense .. what is the difference
 between "respond to it directly" and "forward it to itself"?

 .m

> Suppose one interface receives an ICMP message addressed to another 
> interface on the same router.  Does it respond to it directly?  or forward 
> it to itself?
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Policy on using 3rd-party code/libraries for common data structures?
Date: Wed, 28 Jan 2004 13:17:48 -0800
Organization: CS Masters Program
Lines: 12
Distribution: su
Message-ID: <bv98u3$dft$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075324677 13821 127.0.0.1 (28 Jan 2004 21:17: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:5616

Let's say I want to use a hash table in my code. Do I have to write the hash
table from scratch, or is it acceptable to use a freely-available
implementation of one?

Can you state a general policy regarding use of third-party libraries or
source code?

Thanks,

Greg


.

Path: shelby.stanford.edu!elaine39.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Policy on using 3rd-party code/libraries for common data structures?
Date: Wed, 28 Jan 2004 21:43:00 +0000 (UTC)
Lines: 16
Distribution: su
Message-ID: <bv9ad4$fal$1@news.Stanford.EDU>
References: <bv98u3$dft$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine39.stanford.edu
X-Trace: news.Stanford.EDU 1075326180 15701 171.64.15.114 (28 Jan 2004 21:43:00 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5617


>Let's say I want to use a hash table in my code. Do I have to write the hash
>table from scratch, or is it acceptable to use a freely-available
>implementation of one?

Yes, you should write this from scratch--this shouldn't take you long.
(I know it may be a bit annoying, especially if you're used to using STL,
but there's a steep slippery slope if we start permitting this kind of
thing).

>Can you state a general policy regarding use of third-party libraries or
>source code?

Yep--
You shouldn't use them in this class.

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: assuming defualt route
Date: Thu, 29 Jan 2004 07:46:22 +0800
Lines: 24
Distribution: su
Message-ID: <401849CE.18092E28@leland.stanford.edu>
References: <Pine.GSO.4.44.0401252209190.13915-100000@elaine41.Stanford.EDU> <Pine.LNX.4.44.0401252346090.22613-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075333612 23852 128.12.196.85 (28 Jan 2004 23:46:52 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:5618

What is the exact type and code for ICMP no route to host? Is it the same as host
unreachable? or is it something else?

Thanks,
Jimmy

Martin Casado wrote:

>  No there is no reason to make this assumption.  If there is no default route
>  and you cannot route the packet you drop it.  You can as well send an ICMP no
>  route to host, but this isn't required.
>
>  .m
>
> > Should we assume that there is always a default routing entry in our
> > routing table? If there is no default entry, we need to send ICMP message
> > if we don't know how to route, right?
> >
> > Thanks
> >
> > Lin
> >
> >

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP through different interface
Date: Wed, 28 Jan 2004 16:13:05 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.GSO.4.44.0401281612270.24565-100000@elaine31.Stanford.EDU>
References: <bv92tl$6a0$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401281308490.31625-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 1075335187 25838 171.64.15.106 (29 Jan 2004 00:13:07 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0401281308490.31625-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5619

I think I understand the initial question, but is that
even possible...wouldn't the vns route the packet properly to the
interface corresponding to the ip in the first place?



On Wed, 28 Jan 2004, Martin Casado wrote:

>
>  I'm not sure if your question makes sense .. what is the difference
>  between "respond to it directly" and "forward it to itself"?
>
>  .m
>
> > Suppose one interface receives an ICMP message addressed to another
> > interface on the same router.  Does it respond to it directly?  or forward
> > it to itself?
> >
> >
> >
>
>

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: handling ip packets to router
Date: Wed, 28 Jan 2004 16:15:58 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0401281613090.24565-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 1075335362 26172 171.64.15.106 (29 Jan 2004 00:16:02 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5620


If you get a ip packet addressed to the router (on of the router
interfaces)

then do the following;

  if packet->protocol is ICMP echo request -->
    respond w/ ICMP echo reply

  else if packet->protocol is UDP or TCP -->
    respond w/ ICMP host unreachable

  else ???
    /* WHAT TO DO???*/  .. can we just drop the packet???

--v


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: assuming defualt route
Date: Wed, 28 Jan 2004 17:35:03 -0800
Lines: 31
Distribution: su
Message-ID: <Pine.LNX.4.44.0401281731250.25439-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401252209190.13915-100000@elaine41.Stanford.EDU>
 <Pine.LNX.4.44.0401252346090.22613-100000@Xenon.Stanford.EDU>
 <401849CE.18092E28@leland.stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075340106 1415 171.64.66.201 (29 Jan 2004 01:35:06 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jimmy Pang <hcpang@leland.stanford.edu>
In-Reply-To: <401849CE.18092E28@leland.stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5621


 same 
 
 .m

> What is the exact type and code for ICMP no route to host? Is it the same as host
> unreachable? or is it something else?
> 
> Thanks,
> Jimmy
> 
> Martin Casado wrote:
> 
> >  No there is no reason to make this assumption.  If there is no default route
> >  and you cannot route the packet you drop it.  You can as well send an ICMP no
> >  route to host, but this isn't required.
> >
> >  .m
> >
> > > Should we assume that there is always a default routing entry in our
> > > routing table? If there is no default entry, we need to send ICMP message
> > > if we don't know how to route, right?
> > >
> > > Thanks
> > >
> > > Lin
> > >
> > >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ICMP through different interface
Date: Wed, 28 Jan 2004 17:41:26 -0800
Lines: 37
Distribution: su
Message-ID: <Pine.LNX.4.44.0401281735120.25439-100000@Xenon.Stanford.EDU>
References: <bv92tl$6a0$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401281308490.31625-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401281612270.24565-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 1075340488 1891 171.64.66.201 (29 Jan 2004 01:41:28 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401281612270.24565-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5622


 

> I think I understand the initial question, but is that
> even possible...wouldn't the vns route the packet properly to the
> interface corresponding to the ip in the first place?
> 

 The VNS doesn't do routing, you do.  Even internally, it isn't
 as if each "interface" gets a packet (as you know) ... packets come
 in from the same method.  So I'm not exactly sure what "responds to
 it directly" means ... yes the router needs to respond to it ...
 to "forward to itself" ? Certainly you will need to use the routing
 table to determine the outgoing interface.

 .m
 
> 
> On Wed, 28 Jan 2004, Martin Casado wrote:
> 
> >
> >  I'm not sure if your question makes sense .. what is the difference
> >  between "respond to it directly" and "forward it to itself"?
> >
> >  .m
> >
> > > Suppose one interface receives an ICMP message addressed to another
> > > interface on the same router.  Does it respond to it directly?  or forward
> > > it to itself?
> > >
> > >
> > >
> >
> >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: assuming defualt route
Date: Wed, 28 Jan 2004 17:41:47 -0800
Lines: 35
Distribution: su
Message-ID: <Pine.LNX.4.44.0401281741310.25439-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401252209190.13915-100000@elaine41.Stanford.EDU>
 <Pine.LNX.4.44.0401252346090.22613-100000@Xenon.Stanford.EDU>
 <401849CE.18092E28@leland.stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075340509 1908 171.64.66.201 (29 Jan 2004 01:41:49 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jimmy Pang <hcpang@leland.stanford.edu>
In-Reply-To: <401849CE.18092E28@leland.stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5623


 Better yet ...

 rfc 1812

 4.3.3.1

 .m

> What is the exact type and code for ICMP no route to host? Is it the same as host
> unreachable? or is it something else?
> 
> Thanks,
> Jimmy
> 
> Martin Casado wrote:
> 
> >  No there is no reason to make this assumption.  If there is no default route
> >  and you cannot route the packet you drop it.  You can as well send an ICMP no
> >  route to host, but this isn't required.
> >
> >  .m
> >
> > > Should we assume that there is always a default routing entry in our
> > > routing table? If there is no default entry, we need to send ICMP message
> > > if we don't know how to route, right?
> > >
> > > Thanks
> > >
> > > Lin
> > >
> > >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: handling ip packets to router
Date: Wed, 28 Jan 2004 17:43:18 -0800
Lines: 26
Distribution: su
Message-ID: <Pine.LNX.4.44.0401281742070.25439-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401281613090.24565-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 1075340599 1975 171.64.66.201 (29 Jan 2004 01:43:19 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401281613090.24565-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5624


 dropping it is fine, alternatively you can send an ICMP protocol
 unreachable.  Your  choice.

 .m

> 
> If you get a ip packet addressed to the router (on of the router
> interfaces)
> 
> then do the following;
> 
>   if packet->protocol is ICMP echo request -->
>     respond w/ ICMP echo reply
> 
>   else if packet->protocol is UDP or TCP -->
>     respond w/ ICMP host unreachable
> 
>   else ???
>     /* WHAT TO DO???*/  .. can we just drop the packet???
> 
> --v
> 
> 
> 

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP through different interface
Date: Wed, 28 Jan 2004 18:13:29 -0800
Lines: 54
Distribution: su
Message-ID: <Pine.GSO.4.44.0401281804300.29076-100000@elaine31.Stanford.EDU>
References: <bv92tl$6a0$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401281308490.31625-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401281612270.24565-100000@elaine31.Stanford.EDU>
 <Pine.LNX.4.44.0401281735120.25439-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 1075342411 4065 171.64.15.106 (29 Jan 2004 02:13:31 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0401281735120.25439-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5625


> "it isn't as if each "interface" gets a packet"

but then what is the 'interface' parameter passed into sr_handlepacket
correspond to...

would you ever have the case that a ip packet destined for eth1
first arrives to eth0 of our router?  if so, what is the mechanism we
would use to 'forward' this packet from eth0 to eth1...

--v


On Wed, 28 Jan 2004, Martin Casado wrote:

>
>
>
> > I think I understand the initial question, but is that
> > even possible...wouldn't the vns route the packet properly to the
> > interface corresponding to the ip in the first place?
> >
>
>  The VNS doesn't do routing, you do.  Even internally, it isn't
>  as if each "interface" gets a packet (as you know) ... packets come
>  in from the same method.  So I'm not exactly sure what "responds to
>  it directly" means ... yes the router needs to respond to it ...
>  to "forward to itself" ? Certainly you will need to use the routing
>  table to determine the outgoing interface.
>
>  .m
>
> >
> > On Wed, 28 Jan 2004, Martin Casado wrote:
> >
> > >
> > >  I'm not sure if your question makes sense .. what is the difference
> > >  between "respond to it directly" and "forward it to itself"?
> > >
> > >  .m
> > >
> > > > Suppose one interface receives an ICMP message addressed to another
> > > > interface on the same router.  Does it respond to it directly?  or forward
> > > > it to itself?
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Jeremy Slade <jeremy@jkslade.net>
Newsgroups: su.class.cs244a
Subject: Re: OS thread limit
Date: 28 Jan 2004 20:15:28 -0700
Lines: 34
Sender: jeremy@dad.jkslade.net
Distribution: su
Message-ID: <m37jzbv41b.fsf@dad.jkslade.net>
References: <Pine.GSO.4.44.0401272029510.10586-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1075345964 4984 171.64.15.74 (29 Jan 2004 03:12:44 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)
Xref: shelby.stanford.edu su.class.cs244a:5626


From the discussions I've seen, it seems like most people are planning
to use multiple threads for this project.  I just want to make sure
that single-threaded implementations are also acceptable?
Multithreading is not the only way to implement timeouts, and the
complications of locking, etc seem like too much hassle to me for this
assignment.

On a somewhat related note: I would think that throughput of our
router is not going to be terribly important -- there is only a single
pipe in and out (the socket connection to the server), that will be
the bottleneck long before performance of the router implementation
itself becomes critical.  Thoughts on that?


Jeremy


Vishal Patel <vishalp@stanford.edu> writes:

> I can dream up some implementatoin that requires spawning a thread
> every time we need to do an arp request and wait for a reply
> 
> This seems to make management of the ARP request timeouts easier, but
> one down fall of this is if too many packets come in, it is possible
> to run up against the OS limit of max number of threads...should I be
> concerned about this for the purpose of this assignment?
> 
> --v
> 

-- 
Jeremy Slade
jeremy@jkslade.net
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ICMP through different interface
Date: Wed, 28 Jan 2004 19:15:56 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.LNX.4.44.0401281913300.25487-100000@Xenon.Stanford.EDU>
References: <bv92tl$6a0$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401281308490.31625-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401281612270.24565-100000@elaine31.Stanford.EDU>
 <Pine.LNX.4.44.0401281735120.25439-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401281804300.29076-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 1075346162 8311 171.64.66.201 (29 Jan 2004 03:16:02 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401281804300.29076-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5627


> 
> > "it isn't as if each "interface" gets a packet"
> 
> but then what is the 'interface' parameter passed into sr_handlepacket
> correspond to...

 I guess that is my point ... of course the router mimics a real router
 in that it packets come in on interfaces (from the interface field) but
 there is no abstract notion of interface in the code that handles
 each packet individually ... at least in the stub code.  How you wish
 to implement it is your choice.
 
> would you ever have the case that a ip packet destined for eth1
> first arrives to eth0 of our router?  

 Yes of course.

  .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: OS thread limit
Date: Wed, 28 Jan 2004 19:20:02 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0401281916140.25487-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401272029510.10586-100000@elaine25.Stanford.EDU>
 <m37jzbv41b.fsf@dad.jkslade.net>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075346405 8623 171.64.66.201 (29 Jan 2004 03:20:05 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jeremy Slade <jeremy@jkslade.net>
In-Reply-To: <m37jzbv41b.fsf@dad.jkslade.net>
Xref: shelby.stanford.edu su.class.cs244a:5628


> 
> From the discussions I've seen, it seems like most people are planning
> to use multiple threads for this project.  I just want to make sure
> that single-threaded implementations are also acceptable?
> Multithreading is not the only way to implement timeouts, and the
> complications of locking, etc seem like too much hassle to me for this
> assignment.

  However you'd like ... as long as it fuctions correctly. 
 
> On a somewhat related note: I would think that throughput of our
> router is not going to be terribly important -- there is only a single
> pipe in and out (the socket connection to the server), that will be
> the bottleneck long before performance of the router implementation
> itself becomes critical.  Thoughts on that?

  exactly.

  .martin

.

Path: shelby.stanford.edu!fable5.Stanford.EDU!spathak
From: Sumedh Pathak <spathak@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP through different interface
Date: Wed, 28 Jan 2004 19:48:21 -0800
Lines: 39
Distribution: su
Message-ID: <Pine.GSO.4.44.0401281944100.21227-100000@fable5.Stanford.EDU>
References: <bv92tl$6a0$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401281308490.31625-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401281612270.24565-100000@elaine31.Stanford.EDU>
 <Pine.LNX.4.44.0401281735120.25439-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401281804300.29076-100000@elaine31.Stanford.EDU>
 <Pine.LNX.4.44.0401281913300.25487-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: fable5.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075348103 10202 171.64.12.134 (29 Jan 2004 03:48:23 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0401281913300.25487-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5629



I think the problem is that when I ping either of the interface, it always
comes through eth0. (thats how the topology is set up i guess)
So how do I handle that case?
i.e.
if I receive a packet meant for eth1 on eth0, I dont really need to
do anything, cos the packet is already 'there'.


To check if a packet is meant for the router, do I just iterate through
all interfaces and check if the dest of the packet matches one of them?

Sumedh

On Wed, 28 Jan 2004, Martin Casado wrote:

>
> >
> > > "it isn't as if each "interface" gets a packet"
> >
> > but then what is the 'interface' parameter passed into sr_handlepacket
> > correspond to...
>
>  I guess that is my point ... of course the router mimics a real router
>  in that it packets come in on interfaces (from the interface field) but
>  there is no abstract notion of interface in the code that handles
>  each packet individually ... at least in the stub code.  How you wish
>  to implement it is your choice.
>
> > would you ever have the case that a ip packet destined for eth1
> > first arrives to eth0 of our router?
>
>  Yes of course.
>
>   .m
>
>

.

Path: shelby.stanford.edu!fable8.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Tcpdump content
Date: Wed, 28 Jan 2004 20:45:59 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.GSO.4.44.0401282043440.15280-100000@fable8.Stanford.EDU>
NNTP-Posting-Host: fable8.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075351559 14683 171.64.12.155 (29 Jan 2004 04:45:59 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5630


When use tcpdump with the original sr_router code, the log file contains
the following lines for the first packet. For a ARP-typed packet we should
not have any data portion in the Ethernet packet. so what is the
following content? Thanks!

20:42:57.393062 0:e0:81:4:26:d9 Broadcast arp 84: arp who-has
www-sidj.Stanford.EDU tell vns-firewall.Stanford.EDU
                         0001 0800 0604 0001 00e0 8104 26d9 ac18
                         4a11 0000 0000 0000 c0a8 80f6 0000 0000
                         0000 0000 0000 0000 0000 0000 0000 7000
                         0095 0000 0238 0000 0000 0002 99f8 0000
                         0000 0000 0000


.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Tcpdump content
Date: Wed, 28 Jan 2004 20:59:35 -0800
Lines: 20
Distribution: su
Message-ID: <bva449$h5$3@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401282043440.15280-100000@fable8.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075352521 549 127.0.0.1 (29 Jan 2004 05:02:01 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0401282043440.15280-100000@fable8.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5631

The ethernet data is the arp header if I'm not mistaken.  Check 
sr_protocol struct sr_arphdr.

--William

Yuhui Jin wrote:
> When use tcpdump with the original sr_router code, the log file contains
> the following lines for the first packet. For a ARP-typed packet we should
> not have any data portion in the Ethernet packet. so what is the
> following content? Thanks!
> 
> 20:42:57.393062 0:e0:81:4:26:d9 Broadcast arp 84: arp who-has
> www-sidj.Stanford.EDU tell vns-firewall.Stanford.EDU
>                          0001 0800 0604 0001 00e0 8104 26d9 ac18
>                          4a11 0000 0000 0000 c0a8 80f6 0000 0000
>                          0000 0000 0000 0000 0000 0000 0000 7000
>                          0095 0000 0238 0000 0000 0002 99f8 0000
>                          0000 0000 0000
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: routing table format
Date: Wed, 28 Jan 2004 23:32:00 -0800
Lines: 19
Distribution: su
Message-ID: <bvacmq$o18$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1075361306 24616 128.12.189.163 (29 Jan 2004 07:28: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:5632

Hi,
Just clarifying on how the routing table should be:
My topology says I have 192.168.128.201, 202 & 204 as my eth0 eth1 & eth2
resp.
My application servers are 192.168.128.203 & 205
So I will have 4 entries in my rtable file-
3 for each of the above & the 4th is one which already exists in the rtable
file.
Now when i connect to the server, I get the IPaddress, mask & interface name
of all my interfaces.
How do I decide the gateway(ie the next hop address)?

Also i was trying to ping my interface 201
My IP packet says src & dest address are 201
So do i just send it back on eth0?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!fable8.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: interface parameter format
Date: Thu, 29 Jan 2004 00:25:03 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.GSO.4.44.0401290017001.16399-100000@fable8.Stanford.EDU>
NNTP-Posting-Host: fable8.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075364704 28681 171.64.12.155 (29 Jan 2004 08:25:04 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5633


I am not sure about some of the data fields of the interface struct:

1)
struct sr_if
{
    char name[sr_IFACE_NAMELEN];
    unsigned char addr[6];
    uint32_t ip;
    uint32_t speed;
    struct sr_if* next;
};

The "name" is supposed to be "eth0", right? And what is the "addr" field?


2) in the funtion sr_handlepacket(..), does the parameter "char
*interface" store the name of the interface right?

thanks!!


-Yuhui

.

Path: shelby.stanford.edu!elaine24.Stanford.EDU!hcpang
From: Hoi-Cheung Pang <hcpang@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Purify outputs
Date: Thu, 29 Jan 2004 02:10:00 -0800
Lines: 47
Distribution: su
Message-ID: <Pine.GSO.4.44.0401290205420.8810-100000@elaine24.Stanford.EDU>
NNTP-Posting-Host: elaine24.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075371012 5060 171.64.15.99 (29 Jan 2004 10:10:12 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5634

Hi,

I ran purify on my sr, and found the following errors. They seem to be
caused by the stub code. Do we have to make sure that purify doesn't
complain for this assignment?

****  Purify instrumented sr.purify (pid 9430)  ****
ABR: Array bounds read:
  * This is occurring while in:
        memcpy         [rtlib.o]
        _memcpy        [rtlib.o]
        _fwrite_unlocked [libc.so.1]
        fwrite         [libc.so.1]
        sr_dump        [sr_dumper.c:63]
        sr_log_packet  [sr_vns_comm.c:449]
  * Reading 84 bytes from 0xa5da0 in the heap (24 bytes at 0xa5ddc
illegal).
  * Address 0xa5da0 is 24 bytes into a malloc'd block at 0xa5d88 of 84
bytes.
  * This block was allocated from:
        malloc         [rtlib.o]
        sr_read_from_server [sr_vns_comm.c:229]
        main           [sr_main.c:146]
        _start         [crt1.o]

****  Purify instrumented sr.purify (pid 9430)  ****
UMR: Uninitialized memory read:
  * This is occurring while in:
        _write         [libc.so.1]
        _xflsbuf       [libc.so.1]
        _fflush_u      [libc.so.1]
        fflush         [libc.so.1]
        sr_log_packet  [sr_vns_comm.c:450]
        sr_read_from_server [sr_vns_comm.c:274]
  * Reading 124 bytes from 0x9e7f4 in the heap (24 bytes at 0x9e858
uninit).
  * Address 0x9e7f4 is 4 bytes into a malloc'd block at 0x9e7f0 of 8200
bytes.
  * This block was allocated from:
        malloc         [rtlib.o]
        _findbuf       [libc.so.1]
        _wrtchk        [libc.so.1]
        _fwrite_unlocked [libc.so.1]
        fwrite         [libc.so.1]
        sf_write_header [sr_dumper.c:21]


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ICMP through different interface
Date: Thu, 29 Jan 2004 02:26:14 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.LNX.4.44.0401290225400.12270-100000@Xenon.Stanford.EDU>
References: <bv92tl$6a0$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401281308490.31625-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401281612270.24565-100000@elaine31.Stanford.EDU>
 <Pine.LNX.4.44.0401281735120.25439-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401281804300.29076-100000@elaine31.Stanford.EDU>
 <Pine.LNX.4.44.0401281913300.25487-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401281944100.21227-100000@fable5.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075371976 5805 171.64.66.201 (29 Jan 2004 10:26:16 GMT)
X-Complaints-To: news@news.stanford.edu
To: Sumedh Pathak <spathak@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401281944100.21227-100000@fable5.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5635


> 
> 
> To check if a packet is meant for the router, do I just iterate through
> all interfaces and check if the dest of the packet matches one of them?

 yup.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Tcpdump content
Date: Thu, 29 Jan 2004 02:30:19 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.LNX.4.44.0401290226530.12270-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401282043440.15280-100000@fable8.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075372221 6035 171.64.66.201 (29 Jan 2004 10:30:21 GMT)
X-Complaints-To: news@news.stanford.edu
To: Yuhui Jin <yhjin@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401282043440.15280-100000@fable8.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5636


 That is a valid ARP packet.  You might want to take a peak at question 19 on
 the FAQ.

 .m

> 
> When use tcpdump with the original sr_router code, the log file contains
> the following lines for the first packet. For a ARP-typed packet we should
> not have any data portion in the Ethernet packet. so what is the
> following content? Thanks!
> 
> 20:42:57.393062 0:e0:81:4:26:d9 Broadcast arp 84: arp who-has
> www-sidj.Stanford.EDU tell vns-firewall.Stanford.EDU
>                          0001 0800 0604 0001 00e0 8104 26d9 ac18
>                          4a11 0000 0000 0000 c0a8 80f6 0000 0000
>                          0000 0000 0000 0000 0000 0000 0000 7000
>                          0095 0000 0238 0000 0000 0002 99f8 0000
>                          0000 0000 0000
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: routing table format
Date: Thu, 29 Jan 2004 02:32:42 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.LNX.4.44.0401290230420.12270-100000@Xenon.Stanford.EDU>
References: <bvacmq$o18$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 1075372365 6154 171.64.66.201 (29 Jan 2004 10:32:45 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bvacmq$o18$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5637


> Hi,
> Just clarifying on how the routing table should be:
> My topology says I have 192.168.128.201, 202 & 204 as my eth0 eth1 & eth2
> resp.
> My application servers are 192.168.128.203 & 205
> So I will have 4 entries in my rtable file-
> 3 for each of the above & the 4th is one which already exists in the rtable
> file.

 You only want an entry in your routing table for destinations (not
 interfaces).

> Now when i connect to the server, I get the IPaddress, mask & interface name
> of all my interfaces.
> How do I decide the gateway(ie the next hop address)?

 You should be able to determine this from your topology.

> Also i was trying to ping my interface 201
> My IP packet says src & dest address are 201
> So do i just send it back on eth0?

 I don't understand how your packet says src & dest are 201, you 
 must be looking at your packet incorrectly.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: interface parameter format
Date: Thu, 29 Jan 2004 02:33:11 -0800
Lines: 27
Distribution: su
Message-ID: <Pine.LNX.4.44.0401290232540.12270-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401290017001.16399-100000@fable8.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075372392 6171 171.64.66.201 (29 Jan 2004 10:33:12 GMT)
X-Complaints-To: news@news.stanford.edu
To: Yuhui Jin <yhjin@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401290017001.16399-100000@fable8.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5638

On Thu, 29 Jan 2004, Yuhui Jin wrote:

> 
> I am not sure about some of the data fields of the interface struct:
> 
> 1)
> struct sr_if
> {
>     char name[sr_IFACE_NAMELEN];
>     unsigned char addr[6];
>     uint32_t ip;
>     uint32_t speed;
>     struct sr_if* next;
> };
> 
> The "name" is supposed to be "eth0", right? And what is the "addr" field?

 The hardware address.
 
> 
> 2) in the funtion sr_handlepacket(..), does the parameter "char
> *interface" store the name of the interface right?

 yup

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Purify outputs
Date: Thu, 29 Jan 2004 02:34:11 -0800
Lines: 54
Distribution: su
Message-ID: <Pine.LNX.4.44.0401290233220.12270-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401290205420.8810-100000@elaine24.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075372452 6206 171.64.66.201 (29 Jan 2004 10:34:12 GMT)
X-Complaints-To: news@news.stanford.edu
To: Hoi-Cheung Pang <hcpang@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401290205420.8810-100000@elaine24.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5639


 Don't worry about purify errors in the stub code

 .m

> Hi,
> 
> I ran purify on my sr, and found the following errors. They seem to be
> caused by the stub code. Do we have to make sure that purify doesn't
> complain for this assignment?
> 
> ****  Purify instrumented sr.purify (pid 9430)  ****
> ABR: Array bounds read:
>   * This is occurring while in:
>         memcpy         [rtlib.o]
>         _memcpy        [rtlib.o]
>         _fwrite_unlocked [libc.so.1]
>         fwrite         [libc.so.1]
>         sr_dump        [sr_dumper.c:63]
>         sr_log_packet  [sr_vns_comm.c:449]
>   * Reading 84 bytes from 0xa5da0 in the heap (24 bytes at 0xa5ddc
> illegal).
>   * Address 0xa5da0 is 24 bytes into a malloc'd block at 0xa5d88 of 84
> bytes.
>   * This block was allocated from:
>         malloc         [rtlib.o]
>         sr_read_from_server [sr_vns_comm.c:229]
>         main           [sr_main.c:146]
>         _start         [crt1.o]
> 
> ****  Purify instrumented sr.purify (pid 9430)  ****
> UMR: Uninitialized memory read:
>   * This is occurring while in:
>         _write         [libc.so.1]
>         _xflsbuf       [libc.so.1]
>         _fflush_u      [libc.so.1]
>         fflush         [libc.so.1]
>         sr_log_packet  [sr_vns_comm.c:450]
>         sr_read_from_server [sr_vns_comm.c:274]
>   * Reading 124 bytes from 0x9e7f4 in the heap (24 bytes at 0x9e858
> uninit).
>   * Address 0x9e7f4 is 4 bytes into a malloc'd block at 0x9e7f0 of 8200
> bytes.
>   * This block was allocated from:
>         malloc         [rtlib.o]
>         _findbuf       [libc.so.1]
>         _wrtchk        [libc.so.1]
>         _fwrite_unlocked [libc.so.1]
>         fwrite         [libc.so.1]
>         sf_write_header [sr_dumper.c:21]
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: header checksum
Date: Thu, 29 Jan 2004 04:55:25 -0800
Organization: Stanford University
Lines: 13
Distribution: su
Message-ID: <pan.2004.01.29.12.55.23.513788@stanford.edu>
References: <Pine.GSO.4.44.0401251534350.27963-100000@elaine39.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 1075380925 14328 128.12.69.27 (29 Jan 2004 12:55:25 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:5640

do we have to calculate the ethernet checksum?  I noticed that on your
packets, the checksum is just 0.  Also, this CRC-32 business looks like no
fun.

--Chris

On Sun, 25 Jan 2004 15:35:18 -0800, Lin Chan wrote:

> just wondering if there is any function call that I can easily compute the
> checksum of the headers instead of writing one myself. Thanks
> 
> Lin

.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: header checksum
Date: Thu, 29 Jan 2004 05:10:44 -0800
Organization: Stanford University
Lines: 19
Distribution: su
Message-ID: <pan.2004.01.29.13.10.42.775377@stanford.edu>
References: <Pine.GSO.4.44.0401251534350.27963-100000@elaine39.Stanford.EDU> <pan.2004.01.29.12.55.23.513788@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 1075381844 15341 128.12.69.27 (29 Jan 2004 13:10:44 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:5641

forget I asked.  I just read the faq :-[.

--Chris

On Thu, 29 Jan 2004 04:55:25 -0800, Chris Edstrom wrote:

> do we have to calculate the ethernet checksum?  I noticed that on your
> packets, the checksum is just 0.  Also, this CRC-32 business looks like no
> fun.
> 
> --Chris
> 
> On Sun, 25 Jan 2004 15:35:18 -0800, Lin Chan wrote:
> 
>> just wondering if there is any function call that I can easily compute the
>> checksum of the headers instead of writing one myself. Thanks
>> 
>> Lin

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: header checksum
Date: Thu, 29 Jan 2004 10:50:58 -0800
Lines: 25
Distribution: su
Message-ID: <Pine.LNX.4.44.0401291050490.2976-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401251534350.27963-100000@elaine39.Stanford.EDU>
 <pan.2004.01.29.12.55.23.513788@stanford.edu> <pan.2004.01.29.13.10.42.775377@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075402262 4376 171.64.66.201 (29 Jan 2004 18:51:02 GMT)
X-Complaints-To: news@news.stanford.edu
To: Chris Edstrom <cedstrom@stanford.edu>
In-Reply-To: <pan.2004.01.29.13.10.42.775377@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5642


 :)
 .m

> forget I asked.  I just read the faq :-[.
> 
> --Chris
> 
> On Thu, 29 Jan 2004 04:55:25 -0800, Chris Edstrom wrote:
> 
> > do we have to calculate the ethernet checksum?  I noticed that on your
> > packets, the checksum is just 0.  Also, this CRC-32 business looks like no
> > fun.
> > 
> > --Chris
> > 
> > On Sun, 25 Jan 2004 15:35:18 -0800, Lin Chan wrote:
> > 
> >> just wondering if there is any function call that I can easily compute the
> >> checksum of the headers instead of writing one myself. Thanks
> >> 
> >> Lin
> 
> 

.

Path: shelby.stanford.edu!epic25.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Arp to "internet"
Date: Thu, 29 Jan 2004 11:03:38 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0401291058490.29702-100000@epic25.Stanford.EDU>
NNTP-Posting-Host: epic25.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075403020 5106 171.64.15.62 (29 Jan 2004 19:03:40 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5643


What IP address should we use for a packet destined for the "internet"?  I
was expecting it to be the one listed on my topology over the label
"internet" (e.g 192.168.128.77 for topo 115).  Is this not correct?

If it is correct, can someone see why I would not receive a reply from the
following ARP request?

10:44:51.219561 70:0:0:73:0:1 Broadcast arp 42: arp who-has
skrufi-router-1.Stanford.EDU tell sidj-router-1.Stanford.EDU
                         0001 0800 0604 0001 7000 0073 0001 c0a8
                         804c 0000 0000 0000 c0a8 804d

Thanks,
Barrett



.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Arp to "internet"
Date: Thu, 29 Jan 2004 11:15:47 -0800
Lines: 24
Distribution: su
Message-ID: <bvbm9p$nnd$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401291058490.29702-100000@epic25.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075403897 24301 127.0.0.1 (29 Jan 2004 19:18:17 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0401291058490.29702-100000@epic25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5644

192.168.128.77 is your eth1 interface ip address.

You probably want 172.24.74.17, the default entry in your routing table.

--William

Barrett Trask wrote:
> What IP address should we use for a packet destined for the "internet"?  I
> was expecting it to be the one listed on my topology over the label
> "internet" (e.g 192.168.128.77 for topo 115).  Is this not correct?
> 
> If it is correct, can someone see why I would not receive a reply from the
> following ARP request?
> 
> 10:44:51.219561 70:0:0:73:0:1 Broadcast arp 42: arp who-has
> skrufi-router-1.Stanford.EDU tell sidj-router-1.Stanford.EDU
>                          0001 0800 0604 0001 7000 0073 0001 c0a8
>                          804c 0000 0000 0000 c0a8 804d
> 
> Thanks,
> Barrett
> 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Tony Hsieh <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: mask in routing table?
Date: Thu, 29 Jan 2004 11:54:24 -0800
Lines: 7
Distribution: su
Message-ID: <401964F0.5070207@stanford.edu>
NNTP-Posting-Host: perch.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075406038 7937 171.64.75.22 (29 Jan 2004 19:53:58 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5645

Hi,

I'm not exactly sure what we're supposed to do with the mask in the 
routing table.  Where do we use it?  Thanks.

-Tony

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: dest & source address
Date: Thu, 29 Jan 2004 12:03:28 -0800
Lines: 22
Distribution: su
Message-ID: <bvbom5$82g$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1075406341 8272 128.12.189.163 (29 Jan 2004 19:59: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:5646

Hi,
I was trying to print my source & dest address in the packets.I do a
inet_ntoa(iptr->ip_src) & similarly for destination address
but it always prints the same address ie the address in ping command.
My tcpdump is:
11:51:30.426429 0:e0:81:4:26:d9 70:0:0:8c:0:1 ip 122: cardinal5.Stanford.EDU
> mmahathi-router-2.Stanford.EDU: icmp: echo request (DF) (ttl 61, id 0, len
84)
                         4500 0054 0000 4000 3d01 40f8 ab40 0ffd
                         c0a8 80cb 0800 65ed 8a1e 3f01 4264 1940
                         7d4b 0500 0809 0a0b 0c0d 0e0f 1011 1213
                         1415 1617 1819 1a1b 1c1d 1e1f 2021 2223
                         2425 2627 2829 2a2b 2c2d 2e2f 3031 3233
                         3435 3637 80c9 0000 0000 0000 0210 0000
                         0000 0002 b0b0 0000 0000 0000

Is it that I am printing otu the destination in a wrong way?
Please help!
Thanks,
Haripriya


.

Path: shelby.stanford.edu!elaine14.Stanford.EDU!hcpang
From: Hoi-Cheung Pang <hcpang@stanford.edu>
Newsgroups: su.class.cs244a
Subject: rtable lookup
Date: Thu, 29 Jan 2004 13:31:55 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.GSO.4.44.0401291330110.19575-100000@elaine14.Stanford.EDU>
NNTP-Posting-Host: elaine14.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075411916 14526 171.64.15.79 (29 Jan 2004 21:31:56 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5647

Hi,

Can we assume that the routing table is set up so that when there's more
than one match the 'more specific' match is always listed on top of the
other matches? Or do we have to check for all matches in the code and pick
the 'most specific' one?

Thanks,
Jimmy~

.

Path: shelby.stanford.edu!elaine32.Stanford.EDU!rameshk
From: Ramesh Kumar <rameshk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Policy on using 3rd-party code/libraries for common data
 structures?
Date: Thu, 29 Jan 2004 13:38:04 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.GSO.4.44.0401291333410.715-100000@elaine32.Stanford.EDU>
References: <bv98u3$dft$1@news.Stanford.EDU> <bv9ad4$fal$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 1075412286 14905 171.64.15.107 (29 Jan 2004 21:38:06 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bv9ad4$fal$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5648


I had written a hashtable and dynamic array (darray) in C for CS107
(Programming Paradigms) course taught here in Stanford when I took it some
time back. I wrote it completely and independantly on my own and I have the
full source code. Can I use it in this assignment if necessary.

Thanks,
Ramesh.







.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Arp to "internet"
Date: Thu, 29 Jan 2004 13:52:02 -0800
Lines: 26
Distribution: su
Message-ID: <Pine.LNX.4.44.0401291350590.9755-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401291058490.29702-100000@epic25.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075413124 15968 171.64.66.201 (29 Jan 2004 21:52:04 GMT)
X-Complaints-To: news@news.stanford.edu
To: Barrett Trask <btrask@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401291058490.29702-100000@epic25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5649


  The default route should already be set up in the rtable file in the stub
  code.

  .m

> 
> What IP address should we use for a packet destined for the "internet"?  I
> was expecting it to be the one listed on my topology over the label
> "internet" (e.g 192.168.128.77 for topo 115).  Is this not correct?
> 
> If it is correct, can someone see why I would not receive a reply from the
> following ARP request?
> 
> 10:44:51.219561 70:0:0:73:0:1 Broadcast arp 42: arp who-has
> skrufi-router-1.Stanford.EDU tell sidj-router-1.Stanford.EDU
>                          0001 0800 0604 0001 7000 0073 0001 c0a8
>                          804c 0000 0000 0000 c0a8 804d
> 
> Thanks,
> Barrett
> 
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: mask in routing table?
Date: Thu, 29 Jan 2004 13:52:40 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0401291352130.9755-100000@Xenon.Stanford.EDU>
References: <401964F0.5070207@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075413163 16012 171.64.66.201 (29 Jan 2004 21:52:43 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tony Hsieh <thsieh@stanford.edu>
In-Reply-To: <401964F0.5070207@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5650


> Hi,
> 
> I'm not exactly sure what we're supposed to do with the mask in the 
> routing table.  Where do we use it?  Thanks.

 To check if the destination IP of the packet to be forwarded is on
 the given prefix for that routing entry.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: dest & source address
Date: Thu, 29 Jan 2004 13:53:08 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.LNX.4.44.0401291352430.9755-100000@Xenon.Stanford.EDU>
References: <bvbom5$82g$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 1075413191 16041 171.64.66.201 (29 Jan 2004 21:53:11 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bvbom5$82g$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5651


 As you can see from the tcpdump the source and destination addresses
 are intact.  There is something wrong with your code.

 .m

> Hi,
> I was trying to print my source & dest address in the packets.I do a
> inet_ntoa(iptr->ip_src) & similarly for destination address
> but it always prints the same address ie the address in ping command.
> My tcpdump is:
> 11:51:30.426429 0:e0:81:4:26:d9 70:0:0:8c:0:1 ip 122: cardinal5.Stanford.EDU
> > mmahathi-router-2.Stanford.EDU: icmp: echo request (DF) (ttl 61, id 0, len
> 84)
>                          4500 0054 0000 4000 3d01 40f8 ab40 0ffd
>                          c0a8 80cb 0800 65ed 8a1e 3f01 4264 1940
>                          7d4b 0500 0809 0a0b 0c0d 0e0f 1011 1213
>                          1415 1617 1819 1a1b 1c1d 1e1f 2021 2223
>                          2425 2627 2829 2a2b 2c2d 2e2f 3031 3233
>                          3435 3637 80c9 0000 0000 0000 0210 0000
>                          0000 0002 b0b0 0000 0000 0000
> 
> Is it that I am printing otu the destination in a wrong way?
> Please help!
> Thanks,
> Haripriya
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: rtable lookup
Date: Thu, 29 Jan 2004 13:53:39 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.LNX.4.44.0401291353120.9755-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401291330110.19575-100000@elaine14.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075413221 16083 171.64.66.201 (29 Jan 2004 21:53:41 GMT)
X-Complaints-To: news@news.stanford.edu
To: Hoi-Cheung Pang <hcpang@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401291330110.19575-100000@elaine14.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5652


 Good question, you don't have to support longest common prefix, so the
 former is fine.

 .m

> Hi,
> 
> Can we assume that the routing table is set up so that when there's more
> than one match the 'more specific' match is always listed on top of the
> other matches? Or do we have to check for all matches in the code and pick
> the 'most specific' one?
> 
> Thanks,
> Jimmy~
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Policy on using 3rd-party code/libraries for common data
 structures?
Date: Thu, 29 Jan 2004 13:54:51 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.LNX.4.44.0401291353520.9755-100000@Xenon.Stanford.EDU>
References: <bv98u3$dft$1@news.Stanford.EDU> <bv9ad4$fal$1@news.Stanford.EDU>
 <Pine.GSO.4.44.0401291333410.715-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 1075413293 16156 171.64.66.201 (29 Jan 2004 21:54:53 GMT)
X-Complaints-To: news@news.stanford.edu
To: Ramesh Kumar <rameshk@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401291333410.715-100000@elaine32.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5653


 You may, but I would like to warn you against code bloat.  If your
 addition substantially increases your code base you run the risk of
 loosing a style point.

 .m

> 
> I had written a hashtable and dynamic array (darray) in C for CS107
> (Programming Paradigms) course taught here in Stanford when I took it some
> time back. I wrote it completely and independantly on my own and I have the
> full source code. Can I use it in this assignment if necessary.
> 
> Thanks,
> Ramesh.
> 
> 
> 
> 
> 
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Tim Grow" <grow@stanford.edu>
Newsgroups: su.class.cs244a
Subject: find all machines on local subnet
Date: Thu, 29 Jan 2004 14:29:25 -0800
Lines: 15
Distribution: su
Message-ID: <bvc1g5$ih8$1@news.Stanford.EDU>
NNTP-Posting-Host: grow.stanford.edu
X-Trace: news.Stanford.EDU 1075415365 18984 128.12.191.36 (29 Jan 2004 22:29: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:5654

Hi-

Does anyone know how to find the hardware addresses of all machines on a
local subnet?  You can use the unix/windows command "arp -a" to see the
contents of the arp cache, but that doesn't necessarily include everything
on the subnet.

This actually isn't related to CS244A per se, but su.class.cs244a seems like
a good forum for this question.  Plus, this seems like something everyone in
CS244A should know if they ever want to configure their own personal or
corporate network.

Tim


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: find all machines on local subnet
Date: Thu, 29 Jan 2004 15:00:28 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.LNX.4.44.0401291444080.446-100000@Xenon.Stanford.EDU>
References: <bvc1g5$ih8$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 1075417229 21238 171.64.66.201 (29 Jan 2004 23:00:29 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tim Grow <grow@stanford.edu>
In-Reply-To: <bvc1g5$ih8$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5655


> Hi-
> 
> Does anyone know how to find the hardware addresses of all machines on a
> local subnet?  You can use the unix/windows command "arp -a" to see the
> contents of the arp cache, but that doesn't necessarily include everything
> on the subnet.

 A typical method, if you have access to a machine on the collision domain, is
 to do an arp scan for all IPs on the subnet. (this is also commonly done for
 live host enumeration)

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: find all machines on local subnet
Date: Thu, 29 Jan 2004 15:20:44 -0800
Lines: 23
Distribution: su
Message-ID: <bvc4gn$lvc$1@news.Stanford.EDU>
References: <bvc1g5$ih8$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075418457 22508 127.0.0.1 (29 Jan 2004 23:20: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:5656

ping 255.255.255.255

"Tim Grow" <grow@stanford.edu> wrote in message
news:bvc1g5$ih8$1@news.Stanford.EDU...
> Hi-
>
> Does anyone know how to find the hardware addresses of all machines on a
> local subnet?  You can use the unix/windows command "arp -a" to see the
> contents of the arp cache, but that doesn't necessarily include everything
> on the subnet.
>
> This actually isn't related to CS244A per se, but su.class.cs244a seems
like
> a good forum for this question.  Plus, this seems like something everyone
in
> CS244A should know if they ever want to configure their own personal or
> corporate network.
>
> Tim
>
>


.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: pthread_timed_wait "not signal safe"
Date: Thu, 29 Jan 2004 16:28:22 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.GSO.4.44.0401291626260.43-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 1075422504 27532 171.64.15.106 (30 Jan 2004 00:28:24 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5657


in looking at pthread api documentation,

it seems like this would be a good function to use, however, it does
mention that it is not 'Signal Safe'

I'm not exactly sure what that means...should I worry about that for this
assignment?

--vishal


.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: pthread_timed_wait "not signal safe"
Date: Thu, 29 Jan 2004 16:30:00 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0401291629450.43-100000@elaine31.Stanford.EDU>
References: <Pine.GSO.4.44.0401291626260.43-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 1075422601 27716 171.64.15.106 (30 Jan 2004 00:30:01 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0401291626260.43-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5658

Woops, i meant 'pthread_cond_timedwait'...

On Thu, 29 Jan 2004, Vishal Patel wrote:

>
> in looking at pthread api documentation,
>
> it seems like this would be a good function to use, however, it does
> mention that it is not 'Signal Safe'
>
> I'm not exactly sure what that means...should I worry about that for this
> assignment?
>
> --vishal
>
>
>

.

Path: shelby.stanford.edu!elaine15.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: pthread_timed_wait "not signal safe"
Date: Fri, 30 Jan 2004 00:38:46 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <bvc92m$rid$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401291626260.43-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine15.stanford.edu
X-Trace: news.Stanford.EDU 1075423126 28237 171.64.15.80 (30 Jan 2004 00:38:46 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5659



>I'm not exactly sure what that means...should I worry about that for this
>assignment?

It just means you shouldn't call it from inside a signal handler.  Using
it in regular code is fine.

.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: handling ip packets to router
Date: Thu, 29 Jan 2004 16:42:13 -0800
Organization: Stanford University
Lines: 25
Distribution: su
Message-ID: <pan.2004.01.30.00.42.11.930631@stanford.edu>
References: <Pine.GSO.4.44.0401281613090.24565-100000@elaine31.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 1075423333 28412 128.12.69.27 (30 Jan 2004 00:42:13 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:5660

What about if that UDP packet is a traceroute request?  Don't we have to
at least handle that subset of UDP?  tracert (in windows) uses ICMP, but
most (all?) unicies use UDP traceroute.

--Chris

On Wed, 28 Jan 2004 16:15:58 -0800, Vishal Patel wrote:

> 
> If you get a ip packet addressed to the router (on of the router
> interfaces)
> 
> then do the following;
> 
>   if packet->protocol is ICMP echo request -->
>     respond w/ ICMP echo reply
> 
>   else if packet->protocol is UDP or TCP -->
>     respond w/ ICMP host unreachable
> 
>   else ???
>     /* WHAT TO DO???*/  .. can we just drop the packet???
> 
> --v

.

Path: shelby.stanford.edu!elaine15.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: handling ip packets to router
Date: Fri, 30 Jan 2004 00:51:01 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <bvc9pl$sh5$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401281613090.24565-100000@elaine31.Stanford.EDU> <pan.2004.01.30.00.42.11.930631@stanford.edu>
NNTP-Posting-Host: elaine15.stanford.edu
X-Trace: news.Stanford.EDU 1075423861 29221 171.64.15.80 (30 Jan 2004 00:51:01 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5661


>What about if that UDP packet is a traceroute request?  Don't we have to
>at least handle that subset of UDP?  tracert (in windows) uses ICMP, but
>most (all?) unicies use UDP traceroute.

traceroute sends a UDP datagram to a random (likely unused) port, expecting
an ICMP unreachable response... how were you planning to "handle" that?

.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: handling ip packets to router
Date: Thu, 29 Jan 2004 17:00:56 -0800
Lines: 28
Distribution: su
Message-ID: <bvcacd$2b$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401281613090.24565-100000@elaine31.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075424461 75 127.0.0.1 (30 Jan 2004 01:01: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:5662

Why don't routers allow TCP or UDP packets destined to one of their
interfaces?  Don't they have to respond to TCP packets sometimes to handle
telnet'ing/ssh'ing into them.  Are they essentially doing what a normal host
would do if there's no one bind'd/listening to an address?


"Vishal Patel" <vishalp@stanford.edu> wrote in message
news:Pine.GSO.4.44.0401281613090.24565-100000@elaine31.Stanford.EDU...
>
> If you get a ip packet addressed to the router (on of the router
> interfaces)
>
> then do the following;
>
>   if packet->protocol is ICMP echo request -->
>     respond w/ ICMP echo reply
>
>   else if packet->protocol is UDP or TCP -->
>     respond w/ ICMP host unreachable
>
>   else ???
>     /* WHAT TO DO???*/  .. can we just drop the packet???
>
> --v
>
>


.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: handling ip packets to router
Date: Fri, 30 Jan 2004 01:06:38 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <bvcamu$f0$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401281613090.24565-100000@elaine31.Stanford.EDU> <bvcacd$2b$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1075424798 480 171.64.15.84 (30 Jan 2004 01:06:38 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5663


>Why don't routers allow TCP or UDP packets destined to one of their
>interfaces?  Don't they have to respond to TCP packets sometimes to handle
>telnet'ing/ssh'ing into them.  Are they essentially doing what a normal host
>would do if there's no one bind'd/listening to an address?

Yep.  A router would typically provide some sort of remote interface--and
like a regular host, if it weren't listening on a particular port, it would
respond with the ICMP unreachable.  In 'sr', of course, we don't have any
kind of service running, so the check is simpler--we know there's no
application to which to pass up a transport layer packet...

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: timeouts
Date: Thu, 29 Jan 2004 17:13:24 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0401291711490.1420-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 1075425205 999 171.64.15.106 (30 Jan 2004 01:13:25 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5664


The assignment does specify 15 seconds before an arp cache entry
gets stale

however, it doesn't give any specific time we must wait for arp
replies...does this mean we can pick whatever...i would choose
1 sec since this makes the coding easier..is that ok???

--vishal


.

Path: shelby.stanford.edu!not-for-mail
From: Tony Hsieh <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sending arp request
Date: Thu, 29 Jan 2004 17:58:21 -0800
Lines: 9
Distribution: su
Message-ID: <4019BA3D.4020007@stanford.edu>
NNTP-Posting-Host: perch.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075427875 3915 171.64.75.22 (30 Jan 2004 01:57:55 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5665

Hi,

When we send arp requests, do we send it out every interface in our 
router?  If so, do we use each interface's hardware and IP address as 
the sender hardware address and sender ip address in the ARP request 
packet?  Thanks.

-Tony

.

Path: shelby.stanford.edu!not-for-mail
From: Tony Hsieh <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: MAC addresses
Date: Thu, 29 Jan 2004 18:09:44 -0800
Lines: 7
Distribution: su
Message-ID: <4019BCE8.4030409@stanford.edu>
NNTP-Posting-Host: perch.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075428557 4886 171.64.75.22 (30 Jan 2004 02:09:17 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5666

Hi,

How do I construct a unsigned char addr[6] so that it will have a MAC 
address of 00:00:00:00:00:00?  or ff:ff:ff:ff:ff:ff?  Thanks.

-Tony

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: timeouts
Date: Thu, 29 Jan 2004 18:13:46 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0401291813120.12226-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401291711490.1420-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 1075428829 5374 171.64.66.201 (30 Jan 2004 02:13:49 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401291711490.1420-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5667


> 
> The assignment does specify 15 seconds before an arp cache entry
> gets stale
> 
> however, it doesn't give any specific time we must wait for arp
> replies...does this mean we can pick whatever...i would choose
> 1 sec since this makes the coding easier..is that ok???

 1 second is fine.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: sending arp request
Date: Thu, 29 Jan 2004 18:14:06 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.LNX.4.44.0401291813520.12226-100000@Xenon.Stanford.EDU>
References: <4019BA3D.4020007@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075428848 5385 171.64.66.201 (30 Jan 2004 02:14:08 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tony Hsieh <thsieh@stanford.edu>
In-Reply-To: <4019BA3D.4020007@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5668


> Hi,
> 
> When we send arp requests, do we send it out every interface in our 
> router?

 no.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: For those who want to use alarm(..)
Date: Thu, 29 Jan 2004 18:41:01 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.LNX.4.44.0401291830510.22211-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 1075430464 7594 171.64.66.201 (30 Jan 2004 02:41:04 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5669


 I've taken Abhyudaya's patch and added it to the stub code so that
 SIGALRM won't break the recv(..) in sr_vns_comm.c.  If anyone is thinking
 of using alarm(..) to handle timeouts, email me and I'll send you the
 patched code.  This hasn't been extensively tested so I want to keep
 tabs on whose using it.

 .m

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: strange pthreads compiler warning
Date: Thu, 29 Jan 2004 19:06:58 -0800
Lines: 38
Distribution: su
Message-ID: <Pine.GSO.4.44.0401291856570.15641-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 1075432020 10114 171.64.15.100 (30 Jan 2004 03:07:00 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5670


I've been staring at this thing for hours, but can't seem to figure it
out...

sr_outq.c: In function `sr_outq_cond_timedwait':
sr_outq.c:46: warning: passing arg 3 of `pthread_cond_timedwait' from
incompatible pointer type

here is the snipet of code...
     39   int rc;
     40   struct timespec timespec;
     41
     42   memset( ×pec, 0, sizeof timespec );
     43   timespec.tv_sec = time(0) + wait_seconds;
     44   timespec.tv_nsec = 0;
     45
     46   rc = pthread_cond_timedwait( &oq->cond, &oq->mutex, ×pec );
     47

furthermore, i double checked what the prototype of pthread_cond_timedwait
was using the preprocessor:

gcc -E -g -Wall -ansi -D_DEBUG_ -D_SOLARIS_ sr_outq.c -o sr_outq.E

and examined the sr_outq.E file, here is a copy/paste of the prototype
pthread_cond_timedwait

extern int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *,
                                        const struct timespec *);

So I have no clue why that warning is popping up, any ideas???

Thanx
--vishal

PS. the code still seems to be working ok, but I'm a little nervous
nevertheless

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ip options
Date: Thu, 29 Jan 2004 19:46:00 -0800
Lines: 10
Distribution: su
Message-ID: <bvcjpj$c6v$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1075434100 12511 128.12.189.163 (30 Jan 2004 03:41:40 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:5671

Hi,
The FAQ says that it is acceptable to drop packets with ip options.
Does this mean I can always consider that my IP header will be a fixed 20
bytes & if I get any other size I may just drop the packet?
Also if I get an ICMP message addressed to me but which is not an echo
request do i drop it?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: topology 2
Date: Thu, 29 Jan 2004 20:28:28 -0800
Lines: 13
Distribution: su
Message-ID: <bvcm98$f28$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1075436648 15432 128.12.189.163 (30 Jan 2004 04:24: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:5672

Hi,
When I try to telnet to the interface eth1
>telnet 171.67.71.46
Trying 171.67.71.46...

It just stays in this state displaying nothing till I terminate the
command.Is this how our program is supposed to handle it too?
So if  my router similarly gets a TCP/UDP packet & I respond with an ICMP
port unreachable, how do i test to see if my router is doing so correctly
when I telnet to it?



.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: IP options and checksum
Date: Fri, 30 Jan 2004 04:40:56 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <bvcn8o$frf$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine12.stanford.edu
X-Trace: news.Stanford.EDU 1075437656 16239 171.64.15.77 (30 Jan 2004 04:40:56 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:5673

Why is there no options field in the struct ip?

Networksorcery says that options have to be included in the checksum 
calcuation.  Should we append a single null byte?

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ip options
Date: Thu, 29 Jan 2004 20:47:04 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.LNX.4.44.0401292046280.666-100000@Xenon.Stanford.EDU>
References: <bvcjpj$c6v$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 1075438024 16956 171.64.66.201 (30 Jan 2004 04:47:04 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bvcjpj$c6v$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5674


> Hi,
> The FAQ says that it is acceptable to drop packets with ip options.
> Does this mean I can always consider that my IP header will be a fixed 20
> bytes & if I get any other size I may just drop the packet?
 
 yes.

> Also if I get an ICMP message addressed to me but which is not an echo
> request do i drop it?

 That is one option.
 
  .m

.

Path: shelby.stanford.edu!not-for-mail
From: "Abhyudaya Chodisetti" <sravanth@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Qz 1 Review Questions
Date: Thu, 29 Jan 2004 20:50:00 -0800
Lines: 37
Distribution: su
Message-ID: <bvcnpp$glu$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-63403.stanford.edu
X-Trace: news.Stanford.EDU 1075438201 17086 128.12.194.37 (30 Jan 2004 04:50:01 GMT)
X-Complaints-To: news@news.stanford.edu
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:5675

> The Rise of Worse is Better:
Is "worse is better" really a design pholosophy? Argue.

>Therac:
What are some of the lessons learned from Therac accidents?

>Eraser:
Explain the issues in porting Eraser to an x86 architecture.

>Mesa:
The wait and notify look similar to semaphore's P and V operations.
Compare and contrast condition variables and semaphores.

>Duality:
What are some of the issues in a procedure-oriented system with
priorities? How are priorities handled in a message oriented system?

>Capriccio:
Explain scenarios where linked-stack management  wastes
(a) processor cycles (b) space

>VMS:
Give a case where local page replacement leads to thrashing unlike a
global replacement policy. So why did the designers chose to use
local replacement policy? Which generally gives more throughput?

>Superpages:
Explain the issue with multiple mappings of a file in the context of
superpaging. What is the solution proposed in the paper?

>ESX:
We have seen that VMs introduce an extra level of indirection making
the system slower. Can they be used to improve performance at all?

-Abhyudaya Chodisetti


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: topology 2
Date: Thu, 29 Jan 2004 20:50:51 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.LNX.4.44.0401292050300.666-100000@Xenon.Stanford.EDU>
References: <bvcm98$f28$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 1075438252 17192 171.64.66.201 (30 Jan 2004 04:50:52 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bvcm98$f28$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5676


 A better test is to traceroute directly to your router.

 .m

> Hi,
> When I try to telnet to the interface eth1
> >telnet 171.67.71.46
> Trying 171.67.71.46...
> 
> It just stays in this state displaying nothing till I terminate the
> command.Is this how our program is supposed to handle it too?
> So if  my router similarly gets a TCP/UDP packet & I respond with an ICMP
> port unreachable, how do i test to see if my router is doing so correctly
> when I telnet to it?
> 
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: IP options and checksum
Date: Thu, 29 Jan 2004 20:51:49 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0401292050580.666-100000@Xenon.Stanford.EDU>
References: <bvcn8o$frf$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 1075438311 17241 171.64.66.201 (30 Jan 2004 04:51:51 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <bvcn8o$frf$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5677


 assume no options.

 directly from the FAQ

Do I have to be able to handle IP Options

No, other than that your client may not crash if it receives a packet with ip
options, you don't have to do anything  with them. You don't have to parse them
and it is acceptable to drop such packets or generate incorrect checksums for
them. 

..m

> Why is there no options field in the struct ip?
> 
> Networksorcery says that options have to be included in the checksum 
> calcuation.  Should we append a single null byte?
> 
> 

.

Path: shelby.stanford.edu!elaine15.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: strange pthreads compiler warning
Date: Fri, 30 Jan 2004 04:56:56 +0000 (UTC)
Lines: 21
Distribution: su
Message-ID: <bvco6o$h1o$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401291856570.15641-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine15.stanford.edu
X-Trace: news.Stanford.EDU 1075438616 17464 171.64.15.80 (30 Jan 2004 04:56:56 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5678


>I've been staring at this thing for hours, but can't seem to figure it
>out...

I remember encountering the same problem before--I don't think I ever
figured out what it was complaining about, but eventually it went away
(completely by accident, so I don't recall what the fix was).

BTW, a simple test program doesn't seem to give the warning--I'd guess gcc
gets confused with more complex logic...

The good news is that you can ignore the warning.  One idea:  Does
rewriting your code to something like

struct timespec *ts_ptr = ×pec;

pthread_cond_timedwait(..., ts_ptr);

avoid the warning?  This is a bit inelegant, but if it works around the
compiler behaviour, may be preferable...

.

Path: shelby.stanford.edu!elaine15.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: MAC addresses
Date: Fri, 30 Jan 2004 04:57:26 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <bvco7m$h2q$1@news.Stanford.EDU>
References: <4019BCE8.4030409@stanford.edu>
NNTP-Posting-Host: elaine15.stanford.edu
X-Trace: news.Stanford.EDU 1075438646 17498 171.64.15.80 (30 Jan 2004 04:57:26 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5679


>How do I construct a unsigned char addr[6] so that it will have a MAC 
>address of 00:00:00:00:00:00?  or ff:ff:ff:ff:ff:ff?  Thanks.

You can initialise that array the same way you would any other array in C...
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Pthread Tutorial
Date: Thu, 29 Jan 2004 21:00:42 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0401292057430.4202-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 1075438844 17809 171.64.66.201 (30 Jan 2004 05:00:44 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5680


 Due to outstanding demand, I will be giving a short pthreads tutorial
 tomorrow during the review session (along with some basic routing, tcp stuff )

 So if you are

 anxious, worried, perplexed, confused, bemused, confounded, irritated,
 dewildered, aghast, at a lost or stunned by the prospect of adding
 a thread to your code .. fear not :)

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: tcp/udp packets
Date: Thu, 29 Jan 2004 21:52:30 -0800
Lines: 13
Distribution: su
Message-ID: <bvcr6r$kgs$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1075441691 21020 128.12.189.163 (30 Jan 2004 05:48: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:5681

Hi,
Suppose  I have 3 interfaces eth0 201,eth1 202, eth2 204
I telnet to 202.This packet comes in through 201.
I assume that my router should send an ICMP port unreachable back to the
host on the same interface ie 201.
When I try to do so calling sr_send_packet, i get an error saying
"interface eth0 doesn't exist"
Any clues?
Thanks,
Haripriya



.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: tcp/udp packets
Date: Thu, 29 Jan 2004 21:50:06 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.LNX.4.44.0401292149350.19059-100000@Xenon.Stanford.EDU>
References: <bvcr6r$kgs$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 1075441809 21257 171.64.66.201 (30 Jan 2004 05:50:09 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bvcr6r$kgs$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5682


 Do you have a space in your char buffer? Or something of that nature?

 .m

> Hi,
> Suppose  I have 3 interfaces eth0 201,eth1 202, eth2 204
> I telnet to 202.This packet comes in through 201.
> I assume that my router should send an ICMP port unreachable back to the
> host on the same interface ie 201.
> When I try to do so calling sr_send_packet, i get an error saying
> "interface eth0 doesn't exist"
> Any clues?
> Thanks,
> Haripriya
> 
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Grading guidelines, test script
Date: Fri, 30 Jan 2004 08:16:13 +0000 (UTC)
Lines: 3
Distribution: su
Message-ID: <bvd3sd$256$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine12.stanford.edu
X-Trace: news.Stanford.EDU 1075450573 2214 171.64.15.77 (30 Jan 2004 08:16: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:5683

Will either of these be available for Assignment 2, as they were for #1?


.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ntoh and hton
Date: Fri, 30 Jan 2004 00:30:25 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.GSO.4.44.0401300022190.1165-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 1075451427 3110 171.64.15.118 (30 Jan 2004 08:30:27 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5684


My understanding is: if I store the ip address(in network byte order) in
the ARP cache, so long as I compare it always with the ip address in
network byte order (which is natural order in the incoming ARP message),
I do not need to call ntohl(), before storing or before comparing.

The only time the ntoh or hton is needed is when comparing the incoming
bytes with a real number on the host, such as the op code.

Is this the correct assumption?

If it is, can I assume the same for the information stored in the
struct sr_if, particularly the ip address, i.e. it will be in the network
byte order?

.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question about routing table
Date: Fri, 30 Jan 2004 01:56:29 -0800
Organization: Stanford University
Lines: 32
Distribution: su
Message-ID: <pan.2004.01.30.09.56.27.477948@stanford.edu>
References: <bv8rr9$ren$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 1075456589 8020 128.12.69.27 (30 Jan 2004 09:56: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:5685

So the format of the routing table is (ip gateway mask interface)

So does that mean that if appserver with ip 4.4.4.4 is attached to eth1
with ip 3.3.3.3

the routing table entry should look like:

4.4.4.4 3.3.3.3 255.255.255.255 eth1

?

I.e., is the gateway the ip of the local interface that the appserver is
connected to?

Thanks for any help.

On Wed, 28 Jan 2004 09:34:28 -0800, Joshua Silver wrote:

> One of Martin's slides is titled "Routing Table".
> 
> In the first row, suppose he's got:
> 
> IP address = 192.168.128.51
> Next-Hop IP address = 192.168.128.51
> Network Mask = 255.255.255.0  <==== note this is changed from the slide
> Outgoing interface= eth1
> 
> and our router got a packet destined for 192.168.128.100,  would we send the
> packet to the ethernet address corresponding to 192.168.128.100 or
> 192.168.128.51?   In other words, how do we know which hosts are directly
> connected to our network?

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Grading guidelines, test script
Date: Fri, 30 Jan 2004 08:43:09 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.LNX.4.44.0401300841160.6055-100000@Xenon.Stanford.EDU>
References: <bvd3sd$256$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 1075480991 3240 171.64.66.201 (30 Jan 2004 16:43:11 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <bvd3sd$256$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5686



> Will either of these be available for Assignment 2, as they were for #1?

  Nope.  Basic coding design and style guidlines do apply however.

  .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ntoh and hton
Date: Fri, 30 Jan 2004 08:48:01 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.LNX.4.44.0401300843200.6055-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401300022190.1165-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 1075481282 3472 171.64.66.201 (30 Jan 2004 16:48:02 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401300022190.1165-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5687


> 
> My understanding is: if I store the ip address(in network byte order) in
> the ARP cache, so long as I compare it always with the ip address in
> network byte order (which is natural order in the incoming ARP message),
> I do not need to call ntohl(), before storing or before comparing.

 correct
 
> The only time the ntoh or hton is needed is when comparing the incoming
> bytes with a real number on the host, such as the op code.
>
> Is this the correct assumption?

 I'm not sure what "a real number of the host" is.  The only time you need
 to use ntoh or hton is to convert a number stored in one byte ordering
 to another.  If you initially received the value from a packet, from
 the network, and you haven't done any conversions on it, it will be
 in nbo. Otherwise .. if you sending the value on the network, you should
 hton it.

> 
> If it is, can I assume the same for the information stored in the
> struct sr_if, particularly the ip address, i.e. it will be in the network
> byte order?

 This should be easy for you to determine.

  .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Question about routing table
Date: Fri, 30 Jan 2004 08:49:41 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.LNX.4.44.0401300848070.6055-100000@Xenon.Stanford.EDU>
References: <bv8rr9$ren$1@news.Stanford.EDU> <pan.2004.01.30.09.56.27.477948@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075481382 3612 171.64.66.201 (30 Jan 2004 16:49:43 GMT)
X-Complaints-To: news@news.stanford.edu
To: Chris Edstrom <cedstrom@stanford.edu>
In-Reply-To: <pan.2004.01.30.09.56.27.477948@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5688


> So the format of the routing table is (ip gateway mask interface)
> 
> So does that mean that if appserver with ip 4.4.4.4 is attached to eth1
> with ip 3.3.3.3
> 
> the routing table entry should look like:
> 
> 4.4.4.4 3.3.3.3 255.255.255.255 eth1

 No, that line says ... 'to get to ip 4.4.4.4 the next hop is 3.3.3.3 which
 can be found off of eth1'

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: clarification needed
Date: Fri, 30 Jan 2004 09:40:56 -0800
Lines: 16
Distribution: su
Message-ID: <bve4nd$6l7$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1075484205 6823 128.12.189.163 (30 Jan 2004 17:36: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:5689

Hi,
Can someoe explain this to me?
The FAQ says this:
"Routes where the next hop is '0.0.0.0' which denotes that all matches to
this route lie in the collision domain of the interface associated with the
route. In this case, the next hop is the destination address of the IP
packet. "
My understanding here is that anything which does not match the prefix
before the default entry for the firewall reaches the casefor '0.0.0.0' and
so as the routing table says that the next hop is the firewall, we should
send the packets to the firewall .
Am I right?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: clarification needed
Date: Fri, 30 Jan 2004 09:42:53 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0401300941510.28433-100000@Xenon.Stanford.EDU>
References: <bve4nd$6l7$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 1075484576 7358 171.64.66.201 (30 Jan 2004 17:42:56 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bve4nd$6l7$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5690


> Hi,
> Can someoe explain this to me?
> The FAQ says this:
> "Routes where the next hop is '0.0.0.0' which denotes that all matches to
> this route lie in the collision domain of the interface associated with the
> route. In this case, the next hop is the destination address of the IP
> packet. "

> My understanding here is that anything which does not match the prefix
> before the default entry for the firewall reaches the casefor '0.0.0.0' and
> so as the routing table says that the next hop is the firewall, we should
> send the packets to the firewall .
> Am I right?

 This is referring to the next hop field, not the destination field.  If the
 next hop field is 0.0.0.0 that means the destination is in the same collision
 domain as the interface and you arp for it directly.

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: reference route prob?
Date: Fri, 30 Jan 2004 09:53:55 -0800
Lines: 6
Distribution: su
Message-ID: <bve5sf$76k$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075485391 7380 127.0.0.1 (30 Jan 2004 17:56:31 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5691

Hi,

I can't ping/traceroute the router or the app servers on the reference 
route from the elaines.  Anyone else have this prob?

--Will
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: reference route prob?
Date: Fri, 30 Jan 2004 10:22:21 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.LNX.4.44.0401301021530.12458-100000@Xenon.Stanford.EDU>
References: <bve5sf$76k$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 1075486942 10168 171.64.66.201 (30 Jan 2004 18:22:22 GMT)
X-Complaints-To: news@news.stanford.edu
To: William Chan <chanman@stanford.edu>
In-Reply-To: <bve5sf$76k$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5692


[casado@nity ~]$ ping 192.168.129.221
PING 192.168.129.221 (192.168.129.221) 56(84) bytes of data.
64 bytes from 192.168.129.221: icmp_seq=1 ttl=62 time=0.454 ms
64 bytes from 192.168.129.221: icmp_seq=2 ttl=62 time=0.444 ms

[casado@nity ~]$ traceroute -n 192.168.129.223
traceroute to 192.168.129.223 (192.168.129.223), 30 hops max, 38 byte packets
 1  171.64.74.1  1.633 ms  0.345 ms  0.276 ms
 2  172.24.74.11  0.313 ms  0.229 ms  0.227 ms
 3  192.168.129.221  0.423 ms  0.555 ms  0.398 ms
 4  192.168.129.223  0.956 ms  0.560 ms  0.541 ms
[casado@nity ~]$

..m

> Hi,
> 
> I can't ping/traceroute the router or the app servers on the reference 
> route from the elaines.  Anyone else have this prob?
> 
> --Will
> 

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: reference route prob?
Date: Fri, 30 Jan 2004 10:21:48 -0800
Lines: 61
Distribution: su
Message-ID: <bve7go$76k$2@news.Stanford.EDU>
References: <bve5sf$76k$1@news.Stanford.EDU> <Pine.LNX.4.44.0401301021530.12458-100000@Xenon.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075487064 7380 127.0.0.1 (30 Jan 2004 18:24:24 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4
X-Accept-Language: en-us, en
In-Reply-To: <Pine.LNX.4.44.0401301021530.12458-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5693

elaine13:~/cs244a/hw2> traceroute 192.168.128.221
traceroute to priyanka-router-2.Stanford.EDU (192.168.128.221): 1-30 
hops, 38 byte packets
  1  sweet-rtr.Stanford.EDU (171.64.15.65)  0.682 ms  0.362 ms  0.336 ms
  2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.514 ms  0.626 ms  0.396 ms
  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.409 ms (ttl=62!)  0.392 
ms (ttl=62!)  0.429 ms (ttl=62!)
  4  vns-firewall.Stanford.EDU (172.24.74.11)  2995 ms (ttl=62!) !H 
3001 ms (ttl=62!) !H  3001 ms (ttl=62!) !H
elaine13:~/cs244a/hw2> ping 192.168.128.221
PING priyanka-router-2.Stanford.EDU (192.168.128.221): 56 data bytes
no reply from priyanka-router-2.Stanford.EDU within 1 sec
no reply from priyanka-router-2.Stanford.EDU within 1 sec
no reply from priyanka-router-2.Stanford.EDU within 1 sec
packet seq=1 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host 
unreachable
packet seq=2 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host 
unreachable
packet seq=3 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host 
unreachable
no reply from priyanka-router-2.Stanford.EDU within 1 sec
^C
---- Waiting for outstanding packets ----
no reply from priyanka-router-2.Stanford.EDU within 1 sec
packet seq=4 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host 
unreachable
packet seq=5 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host 
unreachable

---- priyanka-router-2.Stanford.EDU (192.168.128.221) PING Statistics ----
6 packets transmitted, 5 packets bounced, 0 packets received, 100% 
packet loss

--Will

Martin Casado wrote:
> [casado@nity ~]$ ping 192.168.129.221
> PING 192.168.129.221 (192.168.129.221) 56(84) bytes of data.
> 64 bytes from 192.168.129.221: icmp_seq=1 ttl=62 time=0.454 ms
> 64 bytes from 192.168.129.221: icmp_seq=2 ttl=62 time=0.444 ms
> 
> [casado@nity ~]$ traceroute -n 192.168.129.223
> traceroute to 192.168.129.223 (192.168.129.223), 30 hops max, 38 byte packets
>  1  171.64.74.1  1.633 ms  0.345 ms  0.276 ms
>  2  172.24.74.11  0.313 ms  0.229 ms  0.227 ms
>  3  192.168.129.221  0.423 ms  0.555 ms  0.398 ms
>  4  192.168.129.223  0.956 ms  0.560 ms  0.541 ms
> [casado@nity ~]$
> 
> .m
> 
> 
>>Hi,
>>
>>I can't ping/traceroute the router or the app servers on the reference 
>>route from the elaines.  Anyone else have this prob?
>>
>>--Will
>>
> 
> 
.

Path: shelby.stanford.edu!elaine35.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Grading guidelines, test script
Date: Fri, 30 Jan 2004 18:28:03 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <bve7nj$a9s$1@news.Stanford.EDU>
References: <bvd3sd$256$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine35.stanford.edu
X-Trace: news.Stanford.EDU 1075487283 10556 171.64.15.110 (30 Jan 2004 18:28:03 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5694


>Will either of these be available for Assignment 2, as they were for #1?

The tests we do during HW2 grading won't be any different than those you
do yourself during development, e.g. traceroute, ftp, etc.--so there's
not much gained by having access to the script.

The grading script will make its reappearance for HW3.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: reference route prob?
Date: Fri, 30 Jan 2004 10:39:21 -0800
Lines: 68
Distribution: su
Message-ID: <Pine.LNX.4.44.0401301039030.19068-100000@Xenon.Stanford.EDU>
References: <bve5sf$76k$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401301021530.12458-100000@Xenon.Stanford.EDU>
 <bve7go$76k$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 1075487963 11349 171.64.66.201 (30 Jan 2004 18:39:23 GMT)
X-Complaints-To: news@news.stanford.edu
To: William Chan <chanman@stanford.edu>
In-Reply-To: <bve7go$76k$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5695


 Heh, recheck your IP :)

  .m

> elaine13:~/cs244a/hw2> traceroute 192.168.128.221
> traceroute to priyanka-router-2.Stanford.EDU (192.168.128.221): 1-30 
> hops, 38 byte packets
>   1  sweet-rtr.Stanford.EDU (171.64.15.65)  0.682 ms  0.362 ms  0.336 ms
>   2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.514 ms  0.626 ms  0.396 ms
>   3  vns-firewall.Stanford.EDU (172.24.74.11)  0.409 ms (ttl=62!)  0.392 
> ms (ttl=62!)  0.429 ms (ttl=62!)
>   4  vns-firewall.Stanford.EDU (172.24.74.11)  2995 ms (ttl=62!) !H 
> 3001 ms (ttl=62!) !H  3001 ms (ttl=62!) !H
> elaine13:~/cs244a/hw2> ping 192.168.128.221
> PING priyanka-router-2.Stanford.EDU (192.168.128.221): 56 data bytes
> no reply from priyanka-router-2.Stanford.EDU within 1 sec
> no reply from priyanka-router-2.Stanford.EDU within 1 sec
> no reply from priyanka-router-2.Stanford.EDU within 1 sec
> packet seq=1 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host 
> unreachable
> packet seq=2 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host 
> unreachable
> packet seq=3 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host 
> unreachable
> no reply from priyanka-router-2.Stanford.EDU within 1 sec
> ^C
> ---- Waiting for outstanding packets ----
> no reply from priyanka-router-2.Stanford.EDU within 1 sec
> packet seq=4 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host 
> unreachable
> packet seq=5 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host 
> unreachable
> 
> ---- priyanka-router-2.Stanford.EDU (192.168.128.221) PING Statistics ----
> 6 packets transmitted, 5 packets bounced, 0 packets received, 100% 
> packet loss
> 
> --Will
> 
> Martin Casado wrote:
> > [casado@nity ~]$ ping 192.168.129.221
> > PING 192.168.129.221 (192.168.129.221) 56(84) bytes of data.
> > 64 bytes from 192.168.129.221: icmp_seq=1 ttl=62 time=0.454 ms
> > 64 bytes from 192.168.129.221: icmp_seq=2 ttl=62 time=0.444 ms
> > 
> > [casado@nity ~]$ traceroute -n 192.168.129.223
> > traceroute to 192.168.129.223 (192.168.129.223), 30 hops max, 38 byte packets
> >  1  171.64.74.1  1.633 ms  0.345 ms  0.276 ms
> >  2  172.24.74.11  0.313 ms  0.229 ms  0.227 ms
> >  3  192.168.129.221  0.423 ms  0.555 ms  0.398 ms
> >  4  192.168.129.223  0.956 ms  0.560 ms  0.541 ms
> > [casado@nity ~]$
> > 
> > .m
> > 
> > 
> >>Hi,
> >>
> >>I can't ping/traceroute the router or the app servers on the reference 
> >>route from the elaines.  Anyone else have this prob?
> >>
> >>--Will
> >>
> > 
> > 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ntoh and hton
Date: Fri, 30 Jan 2004 10:39:47 -0800
Lines: 38
Distribution: su
Message-ID: <bve8dr$b4t$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401300022190.1165-100000@elaine43.Stanford.EDU> <Pine.LNX.4.44.0401300843200.6055-100000@Xenon.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075487997 11421 127.0.0.1 (30 Jan 2004 18:39: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:5696

Why don't checksums need to be converted to/from network byte order when
comparing the computed value to the received value?

"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0401300843200.6055-100000@Xenon.Stanford.EDU...
>
> >
> > My understanding is: if I store the ip address(in network byte order) in
> > the ARP cache, so long as I compare it always with the ip address in
> > network byte order (which is natural order in the incoming ARP message),
> > I do not need to call ntohl(), before storing or before comparing.
>
>  correct
>
> > The only time the ntoh or hton is needed is when comparing the incoming
> > bytes with a real number on the host, such as the op code.
> >
> > Is this the correct assumption?
>
>  I'm not sure what "a real number of the host" is.  The only time you need
>  to use ntoh or hton is to convert a number stored in one byte ordering
>  to another.  If you initially received the value from a packet, from
>  the network, and you haven't done any conversions on it, it will be
>  in nbo. Otherwise .. if you sending the value on the network, you should
>  hton it.
>
> >
> > If it is, can I assume the same for the information stored in the
> > struct sr_if, particularly the ip address, i.e. it will be in the
network
> > byte order?
>
>  This should be easy for you to determine.
>
>   .m
>


.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: reference route prob?
Date: Fri, 30 Jan 2004 10:37:57 -0800
Lines: 72
Distribution: su
Message-ID: <bve8f1$76k$3@news.Stanford.EDU>
References: <bve5sf$76k$1@news.Stanford.EDU> <Pine.LNX.4.44.0401301021530.12458-100000@Xenon.Stanford.EDU> <bve7go$76k$2@news.Stanford.EDU> <Pine.LNX.4.44.0401301039030.19068-100000@Xenon.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075488033 7380 127.0.0.1 (30 Jan 2004 18:40:33 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4
X-Accept-Language: en-us, en
In-Reply-To: <Pine.LNX.4.44.0401301039030.19068-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5697

Sigh =/

Martin Casado wrote:
>  Heh, recheck your IP :)
> 
>   .m
> 
> 
>>elaine13:~/cs244a/hw2> traceroute 192.168.128.221
>>traceroute to priyanka-router-2.Stanford.EDU (192.168.128.221): 1-30 
>>hops, 38 byte packets
>>  1  sweet-rtr.Stanford.EDU (171.64.15.65)  0.682 ms  0.362 ms  0.336 ms
>>  2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.514 ms  0.626 ms  0.396 ms
>>  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.409 ms (ttl=62!)  0.392 
>>ms (ttl=62!)  0.429 ms (ttl=62!)
>>  4  vns-firewall.Stanford.EDU (172.24.74.11)  2995 ms (ttl=62!) !H 
>>3001 ms (ttl=62!) !H  3001 ms (ttl=62!) !H
>>elaine13:~/cs244a/hw2> ping 192.168.128.221
>>PING priyanka-router-2.Stanford.EDU (192.168.128.221): 56 data bytes
>>no reply from priyanka-router-2.Stanford.EDU within 1 sec
>>no reply from priyanka-router-2.Stanford.EDU within 1 sec
>>no reply from priyanka-router-2.Stanford.EDU within 1 sec
>>packet seq=1 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host 
>>unreachable
>>packet seq=2 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host 
>>unreachable
>>packet seq=3 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host 
>>unreachable
>>no reply from priyanka-router-2.Stanford.EDU within 1 sec
>>^C
>>---- Waiting for outstanding packets ----
>>no reply from priyanka-router-2.Stanford.EDU within 1 sec
>>packet seq=4 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host 
>>unreachable
>>packet seq=5 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host 
>>unreachable
>>
>>---- priyanka-router-2.Stanford.EDU (192.168.128.221) PING Statistics ----
>>6 packets transmitted, 5 packets bounced, 0 packets received, 100% 
>>packet loss
>>
>>--Will
>>
>>Martin Casado wrote:
>>
>>>[casado@nity ~]$ ping 192.168.129.221
>>>PING 192.168.129.221 (192.168.129.221) 56(84) bytes of data.
>>>64 bytes from 192.168.129.221: icmp_seq=1 ttl=62 time=0.454 ms
>>>64 bytes from 192.168.129.221: icmp_seq=2 ttl=62 time=0.444 ms
>>>
>>>[casado@nity ~]$ traceroute -n 192.168.129.223
>>>traceroute to 192.168.129.223 (192.168.129.223), 30 hops max, 38 byte packets
>>> 1  171.64.74.1  1.633 ms  0.345 ms  0.276 ms
>>> 2  172.24.74.11  0.313 ms  0.229 ms  0.227 ms
>>> 3  192.168.129.221  0.423 ms  0.555 ms  0.398 ms
>>> 4  192.168.129.223  0.956 ms  0.560 ms  0.541 ms
>>>[casado@nity ~]$
>>>
>>>.m
>>>
>>>
>>>
>>>>Hi,
>>>>
>>>>I can't ping/traceroute the router or the app servers on the reference 
>>>>route from the elaines.  Anyone else have this prob?
>>>>
>>>>--Will
>>>>
>>>
>>>
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ARP request
Date: Fri, 30 Jan 2004 11:07:31 -0800
Lines: 7
Distribution: su
Message-ID: <bve9pp$co8$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1075489401 13064 128.12.189.163 (30 Jan 2004 19:03: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:5698

Hi,
When I send an ARP request  for a packet ,do I send it to the same interface
from where I got the packet or can i choose anyinterface at random?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ARP request
Date: Fri, 30 Jan 2004 11:06:08 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0401301104580.31890-100000@Xenon.Stanford.EDU>
References: <bve9pp$co8$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 1075489570 13229 171.64.66.201 (30 Jan 2004 19:06:10 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bve9pp$co8$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5699


> Hi,
> When I send an ARP request  for a packet ,do I send it to the same interface
> from where I got the packet or can i choose anyinterface at random?

 You normally don't send it on the interface from where you got the packet,
 nor do you choose any interface at random.  You send it out on the interface
 where the next hop is thought to be (based on the routing table).

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ntoh and hton
Date: Fri, 30 Jan 2004 11:07:12 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0401301106120.31890-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401300022190.1165-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0401300843200.6055-100000@Xenon.Stanford.EDU>
 <bve8dr$b4t$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 1075489634 13272 171.64.66.201 (30 Jan 2004 19:07:14 GMT)
X-Complaints-To: news@news.stanford.edu
To: Joshua Silver <jmsilver@stanford.edu>
In-Reply-To: <bve8dr$b4t$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5700


> Why don't checksums need to be converted to/from network byte order when
> comparing the computed value to the received value?
> 

 Since you are summing over the header in network byte order, your checksum
 will be computed in network byte order.  If you wanted to print out the
 actual, readable value you would need to ntohs(..) but in the case  of
 a checksum the actual value is irrelevant.

 .m

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: next-hop MTU on icmp messages
Date: Fri, 30 Jan 2004 15:23:14 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.GSO.4.44.0401301522390.13781-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 1075504996 1374 171.64.15.100 (30 Jan 2004 23:23:16 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5701


We can just use 1500 for this field in the ICMP header, correct?

--vishal

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: next-hop MTU on icmp messages
Date: Fri, 30 Jan 2004 15:44:55 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0401301544490.26578-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401301522390.13781-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 1075506296 3002 171.64.66.201 (30 Jan 2004 23:44:56 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401301522390.13781-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5702


 Sure :)

 .m

> 
> We can just use 1500 for this field in the ICMP header, correct?
> 
> --vishal
> 
> 

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ttl == 0 for packets destined for router
Date: Fri, 30 Jan 2004 16:34:04 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.GSO.4.44.0401301628010.16287-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 1075509245 6583 171.64.15.100 (31 Jan 2004 00:34:05 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5703

the assignment says send a timeout if ( "TTL of arriving packet in one or
zero" ), does this apply to the following case:

ttl==0 but the packet is destined to one of the router interfaces  ( ie... echo request or TCP/UDP
packet )

since ttl is a hop count, and this packet doesn't have to hop anywhere
else, can't we service the request?

--vishal


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ttl == 0 for packets destined for router
Date: Fri, 30 Jan 2004 16:49:16 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0401301646270.23809-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401301628010.16287-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 1075510158 7500 171.64.66.201 (31 Jan 2004 00:49:18 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401301628010.16287-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5704


 Perhaps the assignment as bit ambiguous on this point.  You should only
 check the TTL when the packet is being forwarded.  In this case you are
 not forwarding the packet so you must service it.

 .m

> the assignment says send a timeout if ( "TTL of arriving packet in one or
> zero" ), does this apply to the following case:
> 
> ttl==0 but the packet is destined to one of the router interfaces  ( ie... echo request or TCP/UDP
> packet )
> 
> since ttl is a hop count, and this packet doesn't have to hop anywhere
> else, can't we service the request?
> 
> --vishal
> 
> 
> 

.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Questions about routing table.
Date: Fri, 30 Jan 2004 17:21:12 -0800
Lines: 33
Distribution: su
Message-ID: <Pine.GSO.4.44.0401301656470.10294-100000@elaine23.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075512074 10144 171.64.15.98 (31 Jan 2004 01:21:14 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5705

As I understand it, the default routing table given
will always send packets not destined to our router
to the firewall.

This is because mask is 0.0.0.0.  Any IP address will
match this entry.  Do we need anything else?  We could
use this entry to send packets to and from application
servers.

I guess we could add entries in the table to indicate the
next hop as being the application servers themselves
but since we know that they sit on the same network as
the router we could send packets directly.

In the FAQ it says that we need to handle case when next hop
address is 0.0.0.0.  This means that packet should be sent
to host that sits on on the same network as one of the router's
interfaces, is this right?
Would the entry look like this...
SUBNETID 0.0.0.0 MASK INTERFACE

Isn't it equivalent to taking an IP address of the packet,
ANDing it with mask of each of the interfaces of our router
and if subnet IDs match, then that's the interface on which the
packet should be sent out?

Is it because our interface data structures don't contain mask that
we don't use method described above?


Thanks,
Boris.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Questions about routing table.
Date: Fri, 30 Jan 2004 17:26:38 -0800
Lines: 53
Distribution: su
Message-ID: <Pine.LNX.4.44.0401301722060.7374-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401301656470.10294-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 1075512399 10379 171.64.66.201 (31 Jan 2004 01:26:39 GMT)
X-Complaints-To: news@news.stanford.edu
To: Boris Senderzon <senderzo@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401301656470.10294-100000@elaine23.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5706


> As I understand it, the default routing table given
> will always send packets not destined to our router
> to the firewall.

 Correct.
 
> This is because mask is 0.0.0.0.  Any IP address will
> match this entry.  Do we need anything else?  We could
> use this entry to send packets to and from application
> servers.

 Err, it is because the prefix is 0.0.0.0 and the
 netmask is 0.0.0.0 so all packets, when anded with the
 netmask will match the prefix.  You will need to add
 routes to each of your application servers to the rtable file.

> I guess we could add entries in the table to indicate the
> next hop as being the application servers themselves
> but since we know that they sit on the same network as
> the router we could send packets directly.

 Correct however you will still have to direct the packets to
 the correct interface so you will need at least two additional
 entries.

> 
> In the FAQ it says that we need to handle case when next hop
> address is 0.0.0.0.  This means that packet should be sent
> to host that sits on on the same network as one of the router's
> interfaces, is this right?
> Would the entry look like this...
> SUBNETID 0.0.0.0 MASK INTERFACE

 Perfect.

> Isn't it equivalent to taking an IP address of the packet,
> ANDing it with mask of each of the interfaces of our router
> and if subnet IDs match, then that's the interface on which the
> packet should be sent out?

 No exactly.  If the gateway is 0.0.0.0 that indicates that the
 next hop is the same as the destination ID on the packet.

> Is it because our interface data structures don't contain mask that
> we don't use method described above?

 Not really.  The routing table is somewhat independent of the interface mask.
 The routing table will tell you what the next hop is for a destination, 
 an interface obviously cannot do this for you.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: FYI: Source address on ICMP Echo
Date: Fri, 30 Jan 2004 18:49:22 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0401301848250.6964-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 1075517363 16614 171.64.66.201 (31 Jan 2004 02:49:23 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5707


 From rfc 1812

       "The IP source address in an ICMP Echo Reply MUST be the same as the
       specific-destination address of the corresponding ICMP EchoRequest
       message."

 All other packets that you generate, simply use the departing interface
 IP.

 .m

.

Path: shelby.stanford.edu!saga3.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: uintX_t types
Date: Fri, 30 Jan 2004 21:28:10 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0401302126560.29064-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 1075526891 27051 171.64.15.133 (31 Jan 2004 05:28:11 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5708


Just want to make sure that when I use malloc to copy a packet. Do I just
treat uint8_t as char? That is, does the following syntax
acceptable/correct?

uint8_t *new_packet = (uint8_t *) malloc(sizeof(uint8_t) * len);

And what about uint32_t? is it same as a four-byte char type?

Thanks!

.

Path: shelby.stanford.edu!saga4.Stanford.EDU!mylesw
From: mylesw@Stanford.EDU (Myles Barrett Williams)
Newsgroups: su.class.cs244a
Subject: Source routing
Date: Sat, 31 Jan 2004 05:36:06 +0000 (UTC)
Organization: Stanford University, CA 94305, USA
Lines: 4
Distribution: su
Message-ID: <bvfes6$qsm$1@news.Stanford.EDU>
NNTP-Posting-Host: saga4.stanford.edu
X-Trace: news.Stanford.EDU 1075527366 27542 171.64.15.134 (31 Jan 2004 05:36:06 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5709

I don't see anything in the assignment sheet or FAQ about source routing. Is
this required?

Myles
.

Path: shelby.stanford.edu!saga3.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: arp hdr sanity check
Date: Fri, 30 Jan 2004 21:50:04 -0800
Lines: 33
Distribution: su
Message-ID: <Pine.GSO.4.44.0401302141120.29064-100000@saga3.Stanford.EDU>
References: <bv7g6h$h5$1@news.Stanford.EDU> <Pine.LNX.4.44.0401272218420.15322-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: saga3.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075528205 28495 171.64.15.133 (31 Jan 2004 05:50:05 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0401272218420.15322-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5710


It seems to me we now have two duplicate Source hardware addresses in both
the Ethernet header and the ARP header. When setting the Dest hardware
address in the Ethernet header for the ARP reply packet, which one shall
we use? Based on your answer it seems either one is fine for the
assignment, is that right?


Thanks!


On Tue, 27 Jan 2004, Martin Casado wrote:

>
>  It is a security risk and commonly used in layer 2 attacks.  For example,
>  bypassing port security on a switch and poisening the target's arp
>  cache.  However you don't have to ensure they match (though you may if
>  you'd like).
>
>  .m
>
> > Does the source ethernet address of the ethernet header have to match
> > the source hardware address in the arp header (assuming the arp message
> > was issued over an ethernet network)?  I don't know a reason why it
> > would be allowed for them to be different and it seems like a security
> > risk.  If it's unallowed, do we just drop the arp message?
> >
> > Thanks,
> > William
> >
>
>

.

Path: shelby.stanford.edu!saga3.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: where to free memory?
Date: Fri, 30 Jan 2004 23:04:54 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.GSO.4.44.0401302301120.2075-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 1075532697 3011 171.64.15.133 (31 Jan 2004 07:04:57 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5711


This may be a very trivial question. Where are we supposed to free memory
such as the arp cache we maintained? coz it seems there's no way to exit
the sr program?


-Yuhui


.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: performance
Date: Fri, 30 Jan 2004 23:42:57 -0800
Lines: 5
Distribution: su
Message-ID: <bvfmf5$p4l$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075535141 25749 127.0.0.1 (31 Jan 2004 07:45:41 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5712

is hw2 graded purely on functionality and not performance?  i can't seem 
to get even near the reference router's speed, my router is consistently 
several times slower.  is this reasonable?

--will
.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: purify
Date: Fri, 30 Jan 2004 23:50:22 -0800
Lines: 21
Distribution: su
Message-ID: <bvfmo6$5us$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc406.stanford.edu
X-Trace: news.Stanford.EDU 1075535430 6108 128.12.196.6 (31 Jan 2004 07:50: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:5713

I am getting a lot of unitialized memory reads and array bounds reads when i
run purify.  A lot of them aren't even in my code.  Does purify have issues
with memcpy?

For instance, purify says i have an unitialized memory read here:


struct sr_ethernet_hdr ehdr;

memcpy(&ehdr, packet, sizeof(ehdr));

return(ntohs(ehdr.ether_type));   <---- UMR here


I don't get it, the struct is on the stack.  Am I doing something wrong?

Thanks,

Justin


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: uintX_t types
Date: Sat, 31 Jan 2004 01:05:07 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.LNX.4.44.0401310059460.22020-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401302126560.29064-100000@saga3.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075539909 12110 171.64.66.201 (31 Jan 2004 09:05:09 GMT)
X-Complaints-To: news@news.stanford.edu
To: Yuhui Jin <yhjin@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401302126560.29064-100000@saga3.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5714


 uint8_t  is an unsigned 8 bit integer 
 uint16_t is an unsigned 16 bit integer 
 uint32_t is an unsigned 32 bit integer

 

> 
> Just want to make sure that when I use malloc to copy a packet. Do I just
> treat uint8_t as char? That is, does the following syntax
> acceptable/correct?
> 
> uint8_t *new_packet = (uint8_t *) malloc(sizeof(uint8_t) * len);

 thats fine
 
  .martin

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Source routing
Date: Sat, 31 Jan 2004 01:05:24 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0401310105170.22020-100000@Xenon.Stanford.EDU>
References: <bvfes6$qsm$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 1075539927 12124 171.64.66.201 (31 Jan 2004 09:05:27 GMT)
X-Complaints-To: news@news.stanford.edu
To: Myles Barrett Williams <mylesw@Stanford.EDU>
In-Reply-To: <bvfes6$qsm$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5715


 Nope.

 .m

> I don't see anything in the assignment sheet or FAQ about source routing. Is
> this required?
> 
> Myles
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: arp hdr sanity check
Date: Sat, 31 Jan 2004 01:05:52 -0800
Lines: 40
Distribution: su
Message-ID: <Pine.LNX.4.44.0401310105400.22020-100000@Xenon.Stanford.EDU>
References: <bv7g6h$h5$1@news.Stanford.EDU> <Pine.LNX.4.44.0401272218420.15322-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401302141120.29064-100000@saga3.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075539955 12142 171.64.66.201 (31 Jan 2004 09:05:55 GMT)
X-Complaints-To: news@news.stanford.edu
To: Yuhui Jin <yhjin@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401302141120.29064-100000@saga3.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5716


 Use the hardare address in the arp header.

 .m

> 
> It seems to me we now have two duplicate Source hardware addresses in both
> the Ethernet header and the ARP header. When setting the Dest hardware
> address in the Ethernet header for the ARP reply packet, which one shall
> we use? Based on your answer it seems either one is fine for the
> assignment, is that right?
> 
> 
> Thanks!
> 
> 
> On Tue, 27 Jan 2004, Martin Casado wrote:
> 
> >
> >  It is a security risk and commonly used in layer 2 attacks.  For example,
> >  bypassing port security on a switch and poisening the target's arp
> >  cache.  However you don't have to ensure they match (though you may if
> >  you'd like).
> >
> >  .m
> >
> > > Does the source ethernet address of the ethernet header have to match
> > > the source hardware address in the arp header (assuming the arp message
> > > was issued over an ethernet network)?  I don't know a reason why it
> > > would be allowed for them to be different and it seems like a security
> > > risk.  If it's unallowed, do we just drop the arp message?
> > >
> > > Thanks,
> > > William
> > >
> >
> >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: where to free memory?
Date: Sat, 31 Jan 2004 01:08:01 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.LNX.4.44.0401310106010.22020-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401302301120.2075-100000@saga3.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075540084 12244 171.64.66.201 (31 Jan 2004 09:08:04 GMT)
X-Complaints-To: news@news.stanford.edu
To: Yuhui Jin <yhjin@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401302301120.2075-100000@saga3.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5717


 Don't worry so much about freeing memory as not loosing references
 to it.  That is, if I test your implementation with a 1 gig file,
 it shouldn't continuosly grow in memory usage

 .m

> 
> This may be a very trivial question. Where are we supposed to free memory
> such as the arp cache we maintained? coz it seems there's no way to exit
> the sr program?
> 
> 
> -Yuhui
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: performance
Date: Sat, 31 Jan 2004 01:09:34 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.LNX.4.44.0401310108120.22020-100000@Xenon.Stanford.EDU>
References: <bvfmf5$p4l$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 1075540177 12300 171.64.66.201 (31 Jan 2004 09:09:37 GMT)
X-Complaints-To: news@news.stanford.edu
To: William Chan <chanman@stanford.edu>
In-Reply-To: <bvfmf5$p4l$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5718


 Anything below 10 milliseconds is reasonable don't worry too much
 about performance.  The reference router is running on the same
 machine as the server :)

 .m

> is hw2 graded purely on functionality and not performance?  i can't seem 
> to get even near the reference router's speed, my router is consistently 
> several times slower.  is this reasonable?
> 
> --will
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: purify
Date: Sat, 31 Jan 2004 01:10:52 -0800
Lines: 32
Distribution: su
Message-ID: <Pine.LNX.4.44.0401310109460.22020-100000@Xenon.Stanford.EDU>
References: <bvfmo6$5us$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 1075540255 12440 171.64.66.201 (31 Jan 2004 09:10:55 GMT)
X-Complaints-To: news@news.stanford.edu
To: Justin <justinfw@stanford.edu>
In-Reply-To: <bvfmo6$5us$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5719


 If its a UMR its worried about reading so you might want to check
 packet.

 Don't worry about purify warnings/errors in the stub code.  There
 are some in sr_dumper which haven't been cleaned up.

 .m

> I am getting a lot of unitialized memory reads and array bounds reads when i
> run purify.  A lot of them aren't even in my code.  Does purify have issues
> with memcpy?
> 
> For instance, purify says i have an unitialized memory read here:
> 
> 
> struct sr_ethernet_hdr ehdr;
> 
> memcpy(&ehdr, packet, sizeof(ehdr));
> 
> return(ntohs(ehdr.ether_type));   <---- UMR here
> 
> 
> I don't get it, the struct is on the stack.  Am I doing something wrong?
> 
> Thanks,
> 
> Justin
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: routing table checking
Date: Sat, 31 Jan 2004 09:26:54 -0800
Lines: 14
Distribution: su
Message-ID: <bvgo7m$d3r$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1075569718 13435 128.12.189.163 (31 Jan 2004 17:21: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:5720

Hi,
I need to check in the routing table for every outbound packet.
Now if I don't get an interface from  the routing table, then I have to drop
the packet & generate an ICMP host  unreachable packet.(that's what the
assignment says)
I cannot again check this in the routing table or it will go into an
infinite loop.
So is it fine if I assume that the interface through which I got my packet
is the same one I use to send out this ICMP host unreachable out  and not
check the routing table for this one?
Thanks,
haripriya


.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Cache questions
Date: Sat, 31 Jan 2004 10:27:12 -0800
Lines: 10
Distribution: su
Message-ID: <bvgroq$h6u$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1075573338 17630 128.12.189.163 (31 Jan 2004 18:22: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:5721

Hi,
If my cache is full ,is it ok if I use a LRU replacement policy ?
And a pthread Q(as I am a novice at this)- When a mutex is used to lock my
cache, is it a read lock too?ie if I had some code in my main program which
also uses the cache, will it be able to read the cache while the thread has
locked the cache?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!not-for-mail
From: "Ryan" <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Problem Set
Date: Sat, 31 Jan 2004 12:39:23 -0800
Lines: 11
Distribution: su
Message-ID: <bvh3ps$ps0$1@news.Stanford.EDU>
NNTP-Posting-Host: ryan05.stanford.edu
X-Trace: news.Stanford.EDU 1075581564 26496 128.12.21.88 (31 Jan 2004 20:39: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:5722

I noticed that on the course web site it says that the problem set is due
February 6th. It also says that the problem set is due on February 6th on
the problem set itself.  However, just recently I noticed it says that the
problem set is due Wed., February 6th.  February 6th is actually a Friday.
Am I correct in going by the date on the schedule page and assuming the
problem set is due on Feb. 6th (and that Wed. is a typo)?

Thanks,
Ryan


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: routing table checking
Date: Sat, 31 Jan 2004 12:44:45 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0401311242140.26472-100000@Xenon.Stanford.EDU>
References: <bvgo7m$d3r$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 1075581886 26876 171.64.66.201 (31 Jan 2004 20:44:46 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bvgo7m$d3r$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5723


> Hi,
> I need to check in the routing table for every outbound packet.
> Now if I don't get an interface from  the routing table, then I have to drop
> the packet & generate an ICMP host  unreachable packet.(that's what the
> assignment says)
> I cannot again check this in the routing table or it will go into an
> infinite loop.
> So is it fine if I assume that the interface through which I got my packet
> is the same one I use to send out this ICMP host unreachable out  and not
> check the routing table for this one?

 No, that is not the correct way to handle this.  If you do not have a route
 to the recipient of the host unreach, you cannot send it.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Cache questions
Date: Sat, 31 Jan 2004 12:47:08 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0401311244560.26472-100000@Xenon.Stanford.EDU>
References: <bvgroq$h6u$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 1075582029 27045 171.64.66.201 (31 Jan 2004 20:47:09 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bvgroq$h6u$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5724


> Hi,
> If my cache is full ,is it ok if I use a LRU replacement policy ?
 
 sure!

> And a pthread Q(as I am a novice at this)- When a mutex is used to lock my
> cache, is it a read lock too?ie if I had some code in my main program which
> also uses the cache, will it be able to read the cache while the thread has
> locked the cache?

 A mutex, once locked, will stop any thread that tries to lock it, and won't
 let that thread pass until it is unlocked.  You should use this to ensure only
 one thread is accessing your mutable data structure at any point in time

 .m

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: granularity of 15 second arp cache timeout
Date: Sat, 31 Jan 2004 13:34:38 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.GSO.4.44.0401311329390.2710-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 1075584879 126 171.64.15.106 (31 Jan 2004 21:34:39 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5725


What granularity should we enforce this timeout...

in other words, some entries may take up to
16 seconds to timeout (but no longer), is that ok

--vishal


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: granularity of 15 second arp cache timeout
Date: Sat, 31 Jan 2004 13:39:54 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0401311339230.13633-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401311329390.2710-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 1075585195 440 171.64.66.201 (31 Jan 2004 21:39:55 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401311329390.2710-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5726



 Thats fine :)

  .m

> 
> What granularity should we enforce this timeout...
> 
> in other words, some entries may take up to
> 16 seconds to timeout (but no longer), is that ok
> 
> --vishal
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: purify UMR warning in sr_vns_comm fix + EINTR support
Date: Sat, 31 Jan 2004 13:43:03 -0800
Lines: 377
Distribution: su
Message-ID: <Pine.LNX.4.44.0401311339570.13633-200000@Xenon.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="1085000002-185555476-1075585383=:13633"
X-Trace: news.Stanford.EDU 1075585385 739 171.64.66.201 (31 Jan 2004 21:43:05 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5727

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--1085000002-185555476-1075585383=:13633
Content-Type: TEXT/PLAIN; charset=US-ASCII


 For those who are interested:

  - patch for purify UMR in sr_vns_comm submitted by William Chan
  - patch for catching recv(..) interrupts submitted by Abhyudaya Chodisetti

  cheers,
  Martin

--1085000002-185555476-1075585383=:13633
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="sr_vns_comm.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0401311343030.13633@Xenon.Stanford.EDU>
Content-Description: 
Content-Disposition: attachment; filename="sr_vns_comm.c"

LyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KICogRmlsZTog
c3Jfdm5zX2NvbW0uYyANCiAqIERhdGU6IFNwcmluZyAyMDAyIA0KICogQXV0
aG9yczogR3VpZG8gQXBhbnplbGxlciwgVmlrcmFtIFZpamF5YXJhZ2hhdmVu
LCBNYXJ0aW4gQ2FzYWRvDQogKiBDb250YWN0OiBjYXNhZG9Ac3RhbmZvcmQu
ZWR1DQogKg0KICogQmFzZWQgb24gbWFueSBnZW5lcmF0aW9ucyBvZiBzciBj
bGllbnRzIGluY2x1ZGluZyB0aGUgb3JpZ2luYWwgYyBjbGllbnQNCiAqIGFu
ZCBiZXJ0Lg0KICogDQogKiAyMDAzLURlYy0wMyAwOTowMDo1MiBBTSA6DQog
KiAgIC0gYnVnIHNlbmRpbmcgcGFja2V0cyByZWFkIGZyb20gY2xpZW50IHRv
IHNyX2xvZ19wYWNrZXQuICBQYWNrZXQgd2FzDQogKiAgICAgc2VudCBpbiBu
ZXR3b3JrIGJ5dGUgb3JkZXIgLi4uIGV4cGVjdGVkIGhvc3QgYnl0ZSBvcmRl
ci4NCiAqICAgICBSZXBvcnRlZCBieSBNYXR0IEhvbGxpbWFuICYgU2FtIFNt
YWxsLiAvbWMNCiAqDQogKiAgMjAwNC1KYW4tMjkgMDc6MDk6MjggUE0gIA0K
ICogICAtIGFkZGVkIGNoZWNrIHRvIGhhbmRsZSBzaWduYWwgaW50ZXJydXB0
cyBvbiByZWN2IChmb3IgdXNlIHdpdGgNCiAqICAgICBhbGFybSguLikgZm9y
IHRpbWVvdXRzLiAgRml4ZXMgYXJlIGJhc2VkIG9uIHBhdGNoIGJ5DQogKiAg
ICAgQWJoeXVkYXlhIENob2Rpc2V0dGkgPHNyYXZhbnRoQHN0YW5mb3JkLmVk
dT4gL21jDQogKg0KICogICAyMDA0LUphbi0zMSAwMToyNzo1NCBQTSANCiAq
ICAgIC0gV2lsbGlhbSBDaGFuIChjaGFubWFuQHN0YW5mb3JkLmVkdSkgc3Vi
bWl0dGVkIHBhdGNoIGZvciBVTVIgb24NCiAqICAgICAgc3JfZHVtcF9wYWNr
ZXQoLi4pDQogKg0KICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0q
Lw0KDQojaW5jbHVkZSA8c3RkaW8uaD4NCiNpbmNsdWRlIDxzdGRsaWIuaD4N
CiNpbmNsdWRlIDxhc3NlcnQuaD4NCiNpbmNsdWRlIDxzdHJpbmcuaD4NCiNp
bmNsdWRlIDx1bmlzdGQuaD4NCiNpbmNsdWRlIDxuZXRkYi5oPg0KI2luY2x1
ZGUgPGVycm5vLmg+DQoNCiNpbmNsdWRlIDxzeXMvc29ja2V0Lmg+DQojaW5j
bHVkZSA8bmV0aW5ldC9pbi5oPg0KI2luY2x1ZGUgPGFycGEvaW5ldC5oPg0K
I2luY2x1ZGUgPHN5cy90aW1lLmg+DQoNCiNpbmNsdWRlICJzcl9kdW1wZXIu
aCINCiNpbmNsdWRlICJzcl9yb3V0ZXIuaCINCiNpbmNsdWRlICJzcl9pZi5o
Ig0KI2luY2x1ZGUgInNyX3Byb3RvY29sLmgiDQoNCiNpbmNsdWRlICJ2bnNj
b21tYW5kLmgiDQoNCnN0YXRpYyB2b2lkIHNyX2xvZ19wYWNrZXQoc3RydWN0
IHNyX2luc3RhbmNlKiAsIHVpbnQ4X3QqICwgaW50ICk7DQpzdGF0aWMgaW50
ICBzcl9hcnBfcmVxX25vdF9mb3JfdXMoc3RydWN0IHNyX2luc3RhbmNlKiBz
ciwgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDhf
dCAqIHBhY2tldCAvKiBsZW50ICovLA0KICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIHVuc2lnbmVkIGludCBsZW4sDQogICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgY2hhciogaW50ZXJmYWNlICAvKiBsZW50
ICovKTsNCg0KLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0K
ICogTWV0aG9kOiBzcl9jb25uZWN0X3RvX3NlcnZlcigpDQogKiBTY29wZTog
R2xvYmFsIA0KICoNCiAqIENvbm5lY3QgdG8gdGhlIHZpcnR1YWwgc2VydmVy
DQogKiANCiAqIFJFVFVSTiBWQUxVRVM6DQogKg0KICogIDAgb24gc3VjY2Vz
cyANCiAqICBzb21ldGhpbmcgb3RoZXIgdGhhbiB6ZXJvIG9uIGVycm9yDQog
Kg0KICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLw0KDQppbnQg
c3JfY29ubmVjdF90b19zZXJ2ZXIoc3RydWN0IHNyX2luc3RhbmNlKiBzcix1
bnNpZ25lZCBzaG9ydCBwb3J0LA0KICAgICAgICAgICAgICAgICAgICAgICAg
IGNoYXIqIHNlcnZlcikNCnsNCiAgICBzdHJ1Y3QgaG9zdGVudCAqaHA7DQog
ICAgY19vcGVuIGNvbW1hbmQ7DQoNCiAgICAvKiBSRVFVSVJFUyAqLw0KICAg
IGFzc2VydChzcik7DQogICAgYXNzZXJ0KHNlcnZlcik7DQoNCiAgICAvKiBw
dXJpZnkgVU1SIGJlIGdvbmUgISAqLw0KICAgIG1lbXNldCgodm9pZCopJmNv
bW1hbmQsMCxzaXplb2YoY19vcGVuKSk7DQoNCiAgICAvKiB6ZXJvIG91dCBz
ZXJ2ZXIgYWRkcmVzcyBzdHJ1Y3QgKi8NCiAgICBtZW1zZXQoJihzci0+c3Jf
YWRkciksMCxzaXplb2Yoc3RydWN0IHNvY2thZGRyX2luKSk7DQoNCiAgICBz
ci0+c3JfYWRkci5zaW5fZmFtaWx5ID0gQUZfSU5FVDsNCiAgICBzci0+c3Jf
YWRkci5zaW5fcG9ydCA9IGh0b25zKHBvcnQpOw0KDQogICAgLyogZ3JhYiBo
b3N0cyBhZGRyZXNzIGZyb20gZG9tYWluIG5hbWUgKi8NCiAgICBpZiAoKGhw
ID0gZ2V0aG9zdGJ5bmFtZShzZXJ2ZXIpKT09MCkgDQogICAgew0KICAgICAg
ICBwZXJyb3IoImdldGhvc3RieW5hbWU6c3JfY2xpZW50LmM6OnNyX2Nvbm5l
Y3RfdG9fc2VydmVyKC4uKSIpOw0KICAgICAgICByZXR1cm4gLTE7DQogICAg
fQ0KDQogICAgLyogc2V0IHNlcnZlciBhZGRyZXNzICovDQogICAgbWVtY3B5
KCYoc3ItPnNyX2FkZHIuc2luX2FkZHIpLGhwLT5oX2FkZHIsaHAtPmhfbGVu
Z3RoKTsNCg0KICAgIC8qIGNyZWF0ZSBzb2NrZXQgKi8NCiAgICBpZiAoKHNy
LT5zb2NrZmQgPSBzb2NrZXQoQUZfSU5FVCwgU09DS19TVFJFQU0sIDApKSA8
IDApDQogICAgew0KICAgICAgICBwZXJyb3IoInNvY2tldCguLik6c3JfY2xp
ZW50LmM6OnNyX2Nvbm5lY3RfdG9fc2VydmVyKC4uKSIpOw0KICAgICAgICBy
ZXR1cm4gLTE7DQogICAgfQ0KDQogICAgLyogYXR0ZW1wdCB0byBjb25uZWN0
IHRvIHRoZSBzZXJ2ZXIgKi8NCiAgICBpZiAoY29ubmVjdChzci0+c29ja2Zk
LCAoc3RydWN0IHNvY2thZGRyICopJihzci0+c3JfYWRkciksIA0KICAgICAg
ICAgICAgICAgIHNpemVvZihzci0+c3JfYWRkcikpIDwgMCkNCiAgICB7DQog
ICAgICAgIHBlcnJvcigiY29ubmVjdCguLik6c3JfY2xpZW50LmM6OnNyX2Nv
bm5lY3RfdG9fc2VydmVyKC4uKSIpOw0KICAgICAgICBjbG9zZShzci0+c29j
a2ZkKTsNCiAgICAgICAgcmV0dXJuIC0xOw0KICAgIH0NCg0KICAgIC8qIHNl
bmQgc3JfT1BFTiBtZXNzYWdlIHRvIHNlcnZlciAqLyANCiAgICBjb21tYW5k
Lm1MZW4gICA9IGh0b25sKHNpemVvZihjX29wZW4pKTsNCiAgICBjb21tYW5k
Lm1UeXBlICA9IGh0b25sKFZOU09QRU4pOw0KICAgIGNvbW1hbmQudG9wb0lE
ID0gaHRvbnMoc3ItPnRvcG9faWQpOw0KICAgIHN0cm5jcHkoIGNvbW1hbmQu
bVZpcnR1YWxIb3N0SUQsIHNyLT5ob3N0LCAgSURTSVpFKTsNCiAgICBzdHJu
Y3B5KCBjb21tYW5kLm1VSUQsIHNyLT51c2VyLCBJRFNJWkUpOw0KDQogICAg
cHJpbnRmKCJTZW5kaW5nIGNfb3BlbiAodHlwZT0lZCBsZW49JWQpXG4iLCBo
dG9ubChjb21tYW5kLm1UeXBlKSwgaHRvbmwoY29tbWFuZC5tTGVuKSApOw0K
DQogICAgaWYgKHNlbmQoc3ItPnNvY2tmZCwgKHZvaWQgKikmY29tbWFuZCwg
c2l6ZW9mKGNfb3BlbiksIDApICE9IHNpemVvZihjX29wZW4pKQ0KICAgIHsN
CiAgICAgICAgcGVycm9yKCJzZW5kKC4uKTpzcl9jbGllbnQuYzo6c3JfY29u
bmVjdF90b19zZXJ2ZXIoKSIpOw0KICAgICAgICByZXR1cm4gLTE7DQogICAg
fQ0KDQogICAgcmV0dXJuIDA7DQp9IC8qIC0tIHNyX2Nvbm5lY3RfdG9fc2Vy
dmVyIC0tICovDQoNCi8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0NCiAqIE1ldGhvZDogc3JfaGFuZGxlX2h3aW5mbyguLikgDQogKiBzY29w
ZTogZ2xvYmFsIA0KICoNCiAqDQogKiBSZWFkLCBmcm9tIHRoZSBzZXJ2ZXIs
IHRoZSBoYXJkd2FyZSBpbmZvcm1hdGlvbiBmb3IgdGhlIHJlc2VydmVkIGhv
c3QuDQogKg0KICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLw0K
DQppbnQgc3JfaGFuZGxlX2h3aW5mbyhzdHJ1Y3Qgc3JfaW5zdGFuY2UqIHNy
LCBjX2h3aW5mbyogaHdpbmZvKQ0Kew0KICAgIGludCBudW1fZW50cmllczsN
CiAgICBpbnQgaSA9IDA7DQoNCiAgICAvKiBSRVFVSVJFUyAqLw0KICAgIGFz
c2VydChzcik7DQogICAgYXNzZXJ0KGh3aW5mbyk7DQoNCiAgICBudW1fZW50
cmllcyA9IChudG9obChod2luZm8tPm1MZW4pIC0gKDIqc2l6ZW9mKHVpbnQz
Ml90KSkpL3NpemVvZihjX2h3X2VudHJ5KTsNCiAgICBEZWJ1ZygiUmVjZWl2
ZWQgSGFyZHdhcmUgSW5mbyB3aXRoICVkIGVudHJpZXNcbiIsbnVtX2VudHJp
ZXMpOyANCg0KICAgIGZvciAoIGk9MDsgaTxudW1fZW50cmllczsgaSsrICkN
CiAgICB7DQogICAgICAgIHN3aXRjaCggbnRvaGwoaHdpbmZvLT5tSFdJbmZv
W2ldLm1LZXkpKQ0KICAgICAgICB7DQogICAgICAgICAgICBjYXNlIEhXRklY
RURJUDoNCiAgICAgICAgICAgICAgICBEZWJ1ZygiRml4ZWQgSVA6ICVzXG4i
LGluZXRfbnRvYSgNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKChz
dHJ1Y3QgaW5fYWRkciopKGh3aW5mby0+bUhXSW5mb1tpXS52YWx1ZSkpKSk7
DQogICAgICAgICAgICAgICAgYnJlYWs7ICAgIA0KICAgICAgICAgICAgY2Fz
ZSBIV0lOVEVSRkFDRTogICAgDQogICAgICAgICAgICAgICAgRGVidWcoIklO
VEVSRkFDRTogJXNcbiIsaHdpbmZvLT5tSFdJbmZvW2ldLnZhbHVlKTsNCiAg
ICAgICAgICAgICAgICBzcl9hZGRfaW50ZXJmYWNlKHNyLGh3aW5mby0+bUhX
SW5mb1tpXS52YWx1ZSk7DQogICAgICAgICAgICAgICAgYnJlYWs7DQogICAg
ICAgICAgICBjYXNlIEhXU1BFRUQ6ICAgIA0KICAgICAgICAgICAgICAgIERl
YnVnKCJTcGVlZDogJWRcbiIsDQogICAgICAgICAgICAgICAgICAgICAgICBu
dG9obCgqKCh1bnNpZ25lZCBpbnQqKWh3aW5mby0+bUhXSW5mb1tpXS52YWx1
ZSkpKTsNCiAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgIGNh
c2UgSFdTVUJORVQ6DQogICAgICAgICAgICAgICAgRGVidWcoIlN1Ym5ldDog
JXNcbiIsaW5ldF9udG9hKA0KICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICooKHN0cnVjdCBpbl9hZGRyKikoaHdpbmZvLT5tSFdJbmZvW2ldLnZhbHVl
KSkpKTsNCiAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgIGNh
c2UgSFdNQVNLOg0KICAgICAgICAgICAgICAgIERlYnVnKCJNYXNrOiAlc1xu
IixpbmV0X250b2EoDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgKigo
c3RydWN0IGluX2FkZHIqKShod2luZm8tPm1IV0luZm9baV0udmFsdWUpKSkp
Ow0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgY2FzZSBI
V0VUSElQOiAgICANCiAgICAgICAgICAgICAgICBEZWJ1ZygiRXRoZXJuZXQg
SVA6ICVzXG4iLGluZXRfbnRvYSgNCiAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAqKChzdHJ1Y3QgaW5fYWRkciopKGh3aW5mby0+bUhXSW5mb1tpXS52
YWx1ZSkpKSk7DQogICAgICAgICAgICAgICAgc3Jfc2V0X2V0aGVyX2lwKHNy
LCooKHVpbnQzMl90Kilod2luZm8tPm1IV0luZm9baV0udmFsdWUpKTsNCiAg
ICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgIGNhc2UgSFdFVEhF
UjoNCiAgICAgICAgICAgICAgICBEZWJ1ZygiSGFyZHdhcmUgQWRkcmVzczog
Iik7DQogICAgICAgICAgICAgICAgRGVidWdNQUMoaHdpbmZvLT5tSFdJbmZv
W2ldLnZhbHVlKTsNCiAgICAgICAgICAgICAgICBEZWJ1ZygiXG4iKTsNCiAg
ICAgICAgICAgICAgICBzcl9zZXRfZXRoZXJfYWRkcihzciwodW5zaWduZWQg
Y2hhciopaHdpbmZvLT5tSFdJbmZvW2ldLnZhbHVlKTsNCiAgICAgICAgICAg
ICAgICBicmVhazsNCiAgICAgICAgICAgIGRlZmF1bHQ6DQogICAgICAgICAg
ICAgICAgcHJpbnRmICgiICVkIFxuIixudG9obChod2luZm8tPm1IV0luZm9b
aV0ubUtleSkpOw0KICAgICAgICB9IC8qIC0tIHN3aXRjaCAtLSAqLw0KICAg
IH0gLyogLS0gZm9yIC0tICovDQoNCiAgICBzcl9wcmludF9pZl9saXN0KHNy
KTsNCg0KICAgIHJldHVybiBudW1fZW50cmllczsNCn0gLyogLS0gc3JfaGFu
ZGxlX2h3aW5mbyAtLSAqLw0KDQovKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tDQogKiBNZXRob2Q6IHNyX3JlYWRfZnJvbV9zZXJ2ZXIoLi4p
IA0KICogU2NvcGU6IGdsb2JhbCANCiAqDQogKiBIb3VzZXMgbWFpbiB3aGls
ZSBsb29wIGZvciBjb21tdW5pY2F0aW5nIHdpdGggdGhlIHZpcnR1YWwgcm91
dGVyIHNlcnZlci4NCiAqDQogKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLSovDQoNCmludCBzcl9yZWFkX2Zyb21fc2VydmVyKHN0cnVjdCBzcl9p
bnN0YW5jZSogc3IgLyogYm9ycm93ZWQgKi8pDQp7DQogICAgaW50IGNvbW1h
bmQsIGxlbjsNCiAgICB1bnNpZ25lZCBjaGFyICpidWYgPSAwOw0KICAgIGNf
cGFja2V0X2V0aGVybmV0X2hlYWRlciogc3JfcGt0ID0gMDsNCiAgICBpbnQg
cmV0ID0gMCwgYnl0ZXNfcmVhZCA9IDA7DQoNCiAgICAvKiBSRVFVSVJFUyAq
Lw0KICAgIGFzc2VydChzcik7DQoNCiAgICAvKi0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLQ0KICAgICAgUmVhZCBhIGNvbW1hbmQgZnJvbSB0aGUg
c2VydmVyIA0KICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSov
DQoNCiAgICBieXRlc19yZWFkID0gMDsNCg0KICAgIC8qIGF0dGVtcHQgdG8g
cmVhZCB0aGUgc2l6ZSBvZiB0aGUgaW5jb21pbmcgcGFja2V0ICovDQogICAg
d2hpbGUoIGJ5dGVzX3JlYWQgPCA0KQ0KICAgIHsNCiAgICAgICAgZG8NCiAg
ICAgICAgeyAvKiAtLSBqdXN0IGluIGNhc2UgU0lHQUxSTSBicmVha3MgcmVj
diAtLSAqLw0KICAgICAgICAgICAgZXJybm8gPSAwOyAvKiAtLSBoYWNreSBn
bGliYyB3b3JrYXJvdW5kIC0tICovDQogICAgICAgICAgICBpZigocmV0ID0g
cmVjdihzci0+c29ja2ZkLCgodWludDhfdCopJmxlbikgKyBieXRlc19yZWFk
LCANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA0IC0gYnl0ZXNfcmVh
ZCwgMCkpID09IC0xKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg
IGlmICggZXJybm8gPT0gRUlOVFIgKQ0KICAgICAgICAgICAgICAgIHsgY29u
dGludWU7IH0NCg0KICAgICAgICAgICAgICAgIHBlcnJvcigicmVjdiguLik6
c3JfY2xpZW50LmM6OnNyX3JlYWRfZnJvbV9zZXJ2ZXIiKTsNCiAgICAgICAg
ICAgICAgICByZXR1cm4gLTE7DQogICAgICAgICAgICB9DQogICAgICAgICAg
ICBieXRlc19yZWFkICs9IHJldDsNCiAgICAgICAgfSB3aGlsZSAoIGVycm5v
ID09IEVJTlRSKTsgLyogYmUgbWluZGZ1bCBvZiBzaWduYWxzICovDQoNCiAg
ICB9DQoNCiAgICBsZW4gPSBudG9obChsZW4pOw0KDQogICAgaWYgKCBsZW4g
PiAxMDAwMCB8fCBsZW4gPCAwICkNCiAgICB7DQogICAgICAgIGZwcmludGYo
c3RkZXJyLCJFcnJvcjogY29tbWFuZCBsZW5ndGggdG8gbGFyZ2UgJWRcbiIs
bGVuKTsNCiAgICAgICAgY2xvc2Uoc3ItPnNvY2tmZCk7IA0KICAgICAgICBy
ZXR1cm4gLTE7DQogICAgfQ0KDQogICAgaWYoKGJ1ZiA9IG1hbGxvYyhsZW4p
KSA9PSAwKQ0KICAgIHsNCiAgICAgICAgZnByaW50ZihzdGRlcnIsIkVycm9y
OiBvdXQgb2YgbWVtb3J5IChzcl9yZWFkX2Zyb21fc2VydmVyKVxuIik7DQog
ICAgICAgIHJldHVybiAtMTsNCiAgICB9DQoNCiAgICAvKiBzZXQgZmlyc3Qg
ZmllbGQgb2YgY29tbWFuZCBzaW5jZSB3ZSd2ZSBhbHJlYWR5IHJlYWQgaXQg
Ki8gDQogICAgKigoaW50ICopYnVmKSA9IGh0b25sKGxlbik7DQoNCiAgICBi
eXRlc19yZWFkID0gMDsNCg0KICAgIC8qIHJlYWQgdGhlIHJlc3Qgb2YgdGhl
IGNvbW1hbmQgKi8NCiAgICB3aGlsZSAoIGJ5dGVzX3JlYWQgPCBsZW4gLSA0
KQ0KICAgIHsNCiAgICAgICAgZG8NCiAgICAgICAgey8qIC0tIGp1c3QgaW4g
Y2FzZSBTSUdBTFJNIGJyZWFrcyByZWN2IC0tICovDQogICAgICAgICAgICBl
cnJubyA9IDA7IC8qIC0tIGhhY2t5IGdsaWJjIHdvcmthcm91bmQgLS0gKi8N
CiAgICAgICAgICAgIGlmICgocmV0ID0gcmVhZChzci0+c29ja2ZkLCBidWYr
NCtieXRlc19yZWFkLCBsZW4gLSA0IC0gYnl0ZXNfcmVhZCkpID09DQogICAg
ICAgICAgICAgICAgICAgIC0xKQ0KICAgICAgICAgICAgew0KICAgICAgICAg
ICAgICAgIGlmICggZXJybm8gPT0gRUlOVFIgKQ0KICAgICAgICAgICAgICAg
IHsgY29udGludWU7IH0NCiAgICAgICAgICAgICAgICBmcHJpbnRmKHN0ZGVy
ciwiRXJyb3I6IGZhaWxlZCByZWFkaW5nIGNvbW1hbmQgYm9keSAlZFxuIixy
ZXQpOw0KICAgICAgICAgICAgICAgIGNsb3NlKHNyLT5zb2NrZmQpOyANCiAg
ICAgICAgICAgICAgICByZXR1cm4gLTE7DQogICAgICAgICAgICB9DQogICAg
ICAgICAgICBieXRlc19yZWFkICs9IHJldDsNCiAgICAgICAgfSB3aGlsZSAo
ZXJybm8gPT0gRUlOVFIpOyAvKiBiZSBtaW5kZnVsIG9mIHNpZ25hbHMgKi8N
CiAgICB9IA0KDQogICAgLyogTXkgZW50cnkgZm9yIG1vc3QgdW5yZWFkYWJs
ZSBsaW5lIG9mIGNvZGUgLSBndWlkbyAqLw0KICAgIC8qIC4uLiB5b3Ugd2lu
IC0gbWMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8NCiAg
ICBjb21tYW5kID0gKigoKGludCAqKWJ1ZikrMSkgPSBudG9obCgqKCgoaW50
ICopYnVmKSsxKSk7DQoNCiAgICBzd2l0Y2ggKGNvbW1hbmQpDQogICAgew0K
ICAgICAgICAvKiAtLS0tLS0tLS0tLS0tICAgICAgICBWTlNQQUNLRVQgICAg
IC0tLS0tLS0tLS0tLS0tLS0tLS0tICovDQoNCiAgICAgICAgY2FzZSBWTlNQ
QUNLRVQ6DQogICAgICAgICAgICBzcl9wa3QgPSAoY19wYWNrZXRfZXRoZXJu
ZXRfaGVhZGVyICopYnVmOw0KDQogICAgICAgICAgICAvKiAtLSBjaGVjayBp
ZiBpdCBpcyBhbiBBUlAgdG8gYW5vdGhlciByb3V0ZXIgaWYgc28gZHJvcCAg
IC0tICovDQogICAgICAgICAgICBpZiAoIHNyX2FycF9yZXFfbm90X2Zvcl91
cyhzciwgDQogICAgICAgICAgICAgICAgICAgIChidWYrc2l6ZW9mKGNfcGFj
a2V0X2hlYWRlcikpLA0KICAgICAgICAgICAgICAgICAgICBsZW4gLSBzaXpl
b2YoY19wYWNrZXRfZXRoZXJuZXRfaGVhZGVyKSArDQogICAgICAgICAgICAg
ICAgICAgIHNpemVvZihzdHJ1Y3Qgc3JfZXRoZXJuZXRfaGRyKSwNCiAgICAg
ICAgICAgICAgICAgICAgYnVmICsgc2l6ZW9mKGNfYmFzZSkpICkNCiAgICAg
ICAgICAgIHsgYnJlYWs7IH0NCg0KICAgICAgICAgICAgLyogLS0gbG9nIHBh
Y2tldCAtLSAqLw0KICAgICAgICAgICAgc3JfbG9nX3BhY2tldChzciwgYnVm
ICsgc2l6ZW9mKGNfcGFja2V0X2hlYWRlciksDQogICAgICAgICAgICAgICAg
ICAgIG50b2hsKHNyX3BrdC0+bUxlbikgLSBzaXplb2YoY19wYWNrZXRfaGVh
ZGVyKSk7DQoNCiAgICAgICAgICAgIC8qIC0tIHBhc3MgdG8gcm91dGVyLCBz
dHVkZW50J3MgY29kZSBzaG91bGQgdGFrZSBvdmVyIGhlcmUgLS0gKi8NCiAg
ICAgICAgICAgIHNyX2hhbmRsZXBhY2tldChzciwNCiAgICAgICAgICAgICAg
ICAgICAgKGJ1ZitzaXplb2YoY19wYWNrZXRfaGVhZGVyKSksDQogICAgICAg
ICAgICAgICAgICAgIGxlbiAtIHNpemVvZihjX3BhY2tldF9ldGhlcm5ldF9o
ZWFkZXIpICsNCiAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHN0cnVjdCBz
cl9ldGhlcm5ldF9oZHIpLA0KICAgICAgICAgICAgICAgICAgICBidWYgKyBz
aXplb2YoY19iYXNlKSk7DQoNCiAgICAgICAgICAgIGJyZWFrOw0KDQogICAg
ICAgICAgICAvKiAtLS0tLS0tLS0tLS0tICAgICAgICBWTlNDTE9TRSAgICAg
IC0tLS0tLS0tLS0tLS0tLS0tLS0tICovDQoNCiAgICAgICAgY2FzZSBWTlND
TE9TRToNCiAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCJ2bnMgc2VydmVy
IGNsb3NlZCBzZXNzaW9uLlxuIik7DQogICAgICAgICAgICBmcHJpbnRmKHN0
ZGVyciwiUmVhc29uOiAlc1xuIiwoKGNfY2xvc2UqKWJ1ZiktPm1FcnJvck1l
c3NhZ2UpOw0KICAgICAgICAgICAgaWYoYnVmKQ0KICAgICAgICAgICAgeyBm
cmVlKGJ1Zik7IH0NCiAgICAgICAgICAgIHJldHVybiAwOyAgICAgIA0KICAg
ICAgICAgICAgYnJlYWs7DQoNCiAgICAgICAgICAgIC8qIC0tLS0tLS0tLS0t
LS0gICAgIFZOU0hXSU5GTyAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8N
Cg0KICAgICAgICBjYXNlIFZOU0hXSU5GTzoNCiAgICAgICAgICAgIHNyX2hh
bmRsZV9od2luZm8oc3IsKGNfaHdpbmZvKilidWYpOyANCiAgICAgICAgICAg
IGlmKHNyX3ZlcmlmeV9yb3V0aW5nX3RhYmxlKHNyKSAhPSAwKQ0KICAgICAg
ICAgICAgew0KICAgICAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCJSb3V0
aW5nIHRhYmxlIG5vdCBjb25zaXN0ZW50IHdpdGggaGFyZHdhcmVcbiIpOw0K
ICAgICAgICAgICAgICAgIHJldHVybiAtMTsNCiAgICAgICAgICAgIH0NCiAg
ICAgICAgICAgIGJyZWFrOw0KDQogICAgICAgIGRlZmF1bHQ6DQogICAgICAg
ICAgICBEZWJ1ZygidW5rbm93biBjb21tYW5kOiAlZFxuIiwgY29tbWFuZCk7
DQogICAgICAgICAgICBicmVhazsNCg0KICAgIH0vKiAtLSBzd2l0Y2ggLS0g
Ki8NCg0KICAgIGlmKGJ1ZikNCiAgICB7IGZyZWUoYnVmKTsgfQ0KICAgIHJl
dHVybiAxOw0KfS8qIC0tIHNyX3JlYWRfZnJvbV9zZXJ2ZXIgLS0gKi8NCg0K
LyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KICogTWV0aG9k
OiBzcl9ldGhlcl9hZGRyc19tYXRjaF9pbnRlcmZhY2UoLi4pDQogKiBTY29w
ZTogTG9jYWwNCiAqDQogKiBNYWtlIHN1cmUgZXRoZXJuZXQgYWRkcmVzc2Vz
IGFyZSBzYW5lIHNvIHdlIGRvbid0IG11Y2sgdW8gdGhlIHN5c3RlbS4NCiAq
DQogKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLw0KDQpzdGF0
aWMgDQppbnQgDQpzcl9ldGhlcl9hZGRyc19tYXRjaF9pbnRlcmZhY2UoIHN0
cnVjdCBzcl9pbnN0YW5jZSogc3IsIC8qIGJvcnJvd2VkICovDQogICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQ4X3QqIGJ1ZiwgLyogYm9y
cm93ZWQgKi8NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29u
c3QgY2hhciogbmFtZSAvKiBib3Jyb3dlZCAqLyApDQp7DQogICAgc3RydWN0
IHNyX2V0aGVybmV0X2hkciogZXRoZXJfaGRyID0gMDsNCiAgICBzdHJ1Y3Qg
c3JfaWYqIGlmYWNlID0gMDsNCg0KICAgIC8qIC0tIFJFUVVJUkVTIC0tICov
DQogICAgYXNzZXJ0KHNyKTsNCiAgICBhc3NlcnQoYnVmKTsNCiAgICBhc3Nl
cnQobmFtZSk7DQoNCiAgICBldGhlcl9oZHIgPSAoc3RydWN0IHNyX2V0aGVy
bmV0X2hkciopYnVmOw0KICAgIGlmYWNlID0gc3JfZ2V0X2ludGVyZmFjZShz
ciwgbmFtZSk7DQoNCiAgICBpZiAoIGlmYWNlID09IDAgKQ0KICAgIHsNCiAg
ICAgICAgZnByaW50Ziggc3RkZXJyLCAiKiogRXJyb3IsIGludGVyZmFjZSAl
cywgZG9lcyBub3QgZXhpc3RcbiIsIG5hbWUpOw0KICAgICAgICByZXR1cm4g
MDsNCiAgICB9DQoNCiAgICBpZiAoIG1lbWNtcCggZXRoZXJfaGRyLT5ldGhl
cl9zaG9zdCwgaWZhY2UtPmFkZHIsIEVUSEVSX0FERFJfTEVOKSAhPSAwICkN
CiAgICB7DQogICAgICAgIGZwcmludGYoIHN0ZGVyciwgIioqIEVycm9yLCBz
b3VyY2UgYWRkcmVzcyBkb2VzIG5vdCBtYXRjaCBpbnRlcmZhY2VcbiIpOw0K
ICAgICAgICByZXR1cm4gMDsNCiAgICB9DQoNCiAgICAvKiBUT0RPICovDQog
ICAgLyogQ2hlY2sgZGVzdGluYXRpb24sIGhhcmR3YXJlIGFkZHJlc3MuICBJ
ZiBpdCBpcyBwcml2YXRlIChpLmUuIGRlc3RpbmVkDQogICAgICogdG8gYSB2
aXJ0dWFsIGludGVyZmFjZSkgZW5zdXJlIGl0IGlzIGdvaW5nIHRvIHRoZSBj
b3JyZWN0IHRvcG9sb2d5DQogICAgICogTm90ZTogVGhpcyBjaGVjayBzaG91
bGQgcmVhbGx5IGJlIGRvbmUgc2VydmVyIHNpZGUgLi4uDQogICAgICovDQoN
CiAgICByZXR1cm4gMTsNCg0KfSAvKiAtLSBzcl9ldGhlcl9hZGRyc19tYXRj
aF9pbnRlcmZhY2UgLS0gKi8NCg0KLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLQ0KICogTWV0aG9kOiBzcl9zZW5kX3BhY2tldCguLikNCiAq
IFNjb3BlOiBHbG9iYWwNCiAqDQogKiBTZW5kIGEgcGFja2V0IChldGhlcm5l
dCBoZWFkZXIgaW5jbHVkZWQhKSBvZiBsZW5ndGggJ2xlbicgdG8gdGhlIHNl
cnZlcg0KICogdG8gYmUgaW5qZWN0ZWQgb250byB0aGUgd2lyZS4NCiAqDQog
Ki0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovDQoNCmludCBzcl9z
ZW5kX3BhY2tldChzdHJ1Y3Qgc3JfaW5zdGFuY2UqIHNyIC8qIGJvcnJvd2Vk
ICovLCANCiAgICAgICAgICAgICAgICAgICAgICAgICB1aW50OF90KiBidWYg
LyogYm9ycm93ZWQgKi8gLA0KICAgICAgICAgICAgICAgICAgICAgICAgIHVu
c2lnbmVkIGludCBsZW4sIA0KICAgICAgICAgICAgICAgICAgICAgICAgIGNv
bnN0IGNoYXIqIGlmYWNlIC8qIGJvcnJvd2VkICovKQ0Kew0KICAgIGNfcGFj
a2V0X2hlYWRlciAqc3JfcGt0Ow0KICAgIHVuc2lnbmVkIGludCB0b3RhbF9s
ZW4gPSAgbGVuICsgKHNpemVvZihjX3BhY2tldF9oZWFkZXIpKTsNCg0KICAg
IC8qIFJFUVVJUkVTICovDQogICAgYXNzZXJ0KHNyKTsNCiAgICBhc3NlcnQo
YnVmKTsNCiAgICBhc3NlcnQoaWZhY2UpOw0KDQogICAgLyogZG9uJ3Qgd2Fz
dGUgbXkgdGltZSAuLi4gKi8NCiAgICBpZiAoIGxlbiA8IHNpemVvZihzdHJ1
Y3Qgc3JfZXRoZXJuZXRfaGRyKSApDQogICAgew0KICAgICAgICBmcHJpbnRm
KHN0ZGVyciAsICIqKiBFcnJvcjogcGFja2V0IGlzIHdheXkgdG8gc2hvcnQg
XG4iKTsNCiAgICAgICAgcmV0dXJuIC0xOw0KICAgIH0NCg0KICAgIC8qIENy
ZWF0ZSBwYWNrZXQgKi8NCiAgICBzcl9wa3QgPSAoY19wYWNrZXRfaGVhZGVy
ICopbWFsbG9jKGxlbiArDQogICAgICAgICAgICBzaXplb2YoY19wYWNrZXRf
aGVhZGVyKSk7DQogICAgYXNzZXJ0KHNyX3BrdCk7DQogICAgc3JfcGt0LT5t
TGVuICA9IGh0b25sKHRvdGFsX2xlbik7DQogICAgc3JfcGt0LT5tVHlwZSA9
IGh0b25sKFZOU1BBQ0tFVCk7DQogICAgc3RybmNweShzcl9wa3QtPm1JbnRl
cmZhY2VOYW1lLGlmYWNlLDE2KTsNCiAgICBtZW1jcHkoKCh1aW50OF90Kilz
cl9wa3QpICsgc2l6ZW9mKGNfcGFja2V0X2hlYWRlciksDQogICAgICAgICAg
ICBidWYsbGVuKTsNCg0KICAgIC8qIC0tIGxvZyBwYWNrZXQgLS0gKi8NCiAg
ICBzcl9sb2dfcGFja2V0KHNyLGJ1ZixsZW4pOw0KDQogICAgaWYgKCAhIHNy
X2V0aGVyX2FkZHJzX21hdGNoX2ludGVyZmFjZSggc3IsIGJ1ZiwgaWZhY2Up
ICkNCiAgICB7DQogICAgICAgIGZwcmludGYoIHN0ZGVyciwgIioqKiBFcnJv
cjogcHJvYmxlbSB3aXRoIGV0aGVybmV0IGhlYWRlciwgY2hlY2sgbG9nXG4i
KTsNCiAgICAgICAgZnJlZSAoIHNyX3BrdCApOw0KICAgICAgICByZXR1cm4g
LTE7IA0KICAgIH0NCg0KICAgIGlmKCB3cml0ZShzci0+c29ja2ZkLCBzcl9w
a3QsIHRvdGFsX2xlbikgPCB0b3RhbF9sZW4gKSANCiAgICB7DQogICAgICAg
IGZwcmludGYoc3RkZXJyLCAiRXJyb3Igd3JpdGluZyBwYWNrZXRcbiIpOw0K
ICAgICAgICBmcmVlKHNyX3BrdCk7DQogICAgICAgIHJldHVybiAtMTsNCiAg
ICB9DQoNCiAgICBmcmVlKHNyX3BrdCk7DQoNCiAgICByZXR1cm4gMDsNCn0g
LyogLS0gc3Jfc2VuZF9wYWNrZXQgLS0gKi8NCg0KLyotLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLQ0KICogTWV0aG9kOiBzcl9sb2dfcGFja2V0
KCkNCiAqIFNjb3BlOiBMb2NhbCANCiAqDQogKi0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLSovDQoNCnZvaWQgc3JfbG9nX3BhY2tldChzdHJ1Y3Qg
c3JfaW5zdGFuY2UqIHNyLCB1aW50OF90KiBidWYsIGludCBsZW4gKQ0Kew0K
ICAgIHN0cnVjdCBwY2FwX3BrdGhkciBoOw0KICAgIGludCBzaXplOw0KDQog
ICAgLyogUkVRVUlSRVMgKi8NCiAgICBhc3NlcnQoc3IpOw0KDQogICAgaWYo
IXNyLT5sb2dmaWxlKQ0KICAgIHtyZXR1cm47IH0NCg0KICAgIHNpemUgPSBt
aW4oUEFDS0VUX0RVTVBfU0laRSwgbGVuKTsNCg0KICAgIGdldHRpbWVvZmRh
eSgmaC50cywgMCk7DQogICAgaC5jYXBsZW4gPSBzaXplOw0KICAgIGgubGVu
ID0gKHNpemUgPCBQQUNLRVRfRFVNUF9TSVpFKSA/IHNpemUgOiBQQUNLRVRf
RFVNUF9TSVpFOw0KDQogICAgc3JfZHVtcChzci0+bG9nZmlsZSwgJmgsIGJ1
Zik7DQogICAgZmZsdXNoKHNyLT5sb2dmaWxlKTsNCn0gLyogLS0gc3JfbG9n
X3BhY2tldCAtLSAqLw0KDQovKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tDQogKiBNZXRob2Q6IHNyX2FycF9yZXFfbm90X2Zvcl91cygpDQog
KiBTY29wZTogTG9jYWwgDQogKg0KICotLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0qLw0KDQppbnQgIHNyX2FycF9yZXFfbm90X2Zvcl91cyhzdHJ1
Y3Qgc3JfaW5zdGFuY2UqIHNyLCANCiAgICAgICAgICAgICAgICAgICAgICAg
ICAgIHVpbnQ4X3QgKiBwYWNrZXQgLyogbGVudCAqLywNCiAgICAgICAgICAg
ICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCBsZW4sDQogICAgICAgICAg
ICAgICAgICAgICAgICAgICBjaGFyKiBpbnRlcmZhY2UgIC8qIGxlbnQgKi8p
DQp7DQogICAgc3RydWN0IHNyX2lmKiBpZmFjZSA9IHNyX2dldF9pbnRlcmZh
Y2Uoc3IsIGludGVyZmFjZSk7DQogICAgc3RydWN0IHNyX2V0aGVybmV0X2hk
ciogZV9oZHIgPSAwOw0KICAgIHN0cnVjdCBzcl9hcnBoZHIqICAgICAgIGFf
aGRyID0gMDsNCg0KICAgIGlmIChsZW4gPCBzaXplb2Yoc3RydWN0IHNyX2V0
aGVybmV0X2hkcikgKyBzaXplb2Yoc3RydWN0IHNyX2FycGhkcikgKQ0KICAg
IHsgcmV0dXJuIDA7IH0NCg0KICAgIGFzc2VydChpZmFjZSk7DQoNCiAgICBl
X2hkciA9IChzdHJ1Y3Qgc3JfZXRoZXJuZXRfaGRyKilwYWNrZXQ7IA0KICAg
IGFfaGRyID0gKHN0cnVjdCBzcl9hcnBoZHIqKShwYWNrZXQgKyBzaXplb2Yo
c3RydWN0IHNyX2V0aGVybmV0X2hkcikpOw0KDQogICAgaWYgKCAoZV9oZHIt
PmV0aGVyX3R5cGUgPT0gaHRvbnMoRVRIRVJUWVBFX0FSUCkpICYmDQogICAg
ICAgICAgICAoYV9oZHItPmFyX29wICAgICAgPT0gaHRvbnMoQVJQX1JFUVVF
U1QpKSAgICYmDQogICAgICAgICAgICAoYV9oZHItPmFyX3RpcCAgICAgIT0g
aWZhY2UtPmlwICkgKQ0KICAgIHsgcmV0dXJuIDE7IH0NCg0KICAgIHJldHVy
biAwOw0KfSAvKiAtLSBzcl9hcnBfcmVxX25vdF9mb3JfdXMgLS0gKi8NCg==
--1085000002-185555476-1075585383=:13633--
.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: applications servers
Date: Sat, 31 Jan 2004 14:14:53 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.GSO.4.44.0401311412240.5908-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 1075587294 3014 171.64.15.42 (31 Jan 2004 22:14:54 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5728

what is present on the application servers?
I'm able to ping both of my servers (i.e. packets
get forwarded by my router in both directions).
However, when I tried ssh or ftp to either one,
packets are sent to the servers, servers even
reply to ARP requests but no data packets
comeback from either server.

Any ideas?

Thanks Boris.

.

Path: shelby.stanford.edu!not-for-mail
From: "Ryan" <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ARP Cache
Date: Sat, 31 Jan 2004 14:24:31 -0800
Lines: 6
Distribution: su
Message-ID: <bvh9v0$3hp$1@news.Stanford.EDU>
NNTP-Posting-Host: ryan05.stanford.edu
X-Trace: news.Stanford.EDU 1075587872 3641 128.12.21.88 (31 Jan 2004 22:24: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:5729

Is it acceptable for this assignment in terms of both functionality and
style to assume that protocol type is IP and hardware type is ethernet?  (We
can simply drop all others).  In so doing, am I correct in saying we can
ignore the information about the length of these two addresses?


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: applications servers
Date: Sat, 31 Jan 2004 14:26:50 -0800
Lines: 26
Distribution: su
Message-ID: <Pine.LNX.4.44.0401311425300.27285-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401311412240.5908-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 1075588011 3886 171.64.66.201 (31 Jan 2004 22:26:51 GMT)
X-Complaints-To: news@news.stanford.edu
To: Boris Senderzon <senderzo@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0401311412240.5908-100000@epic9.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5730


 HTTP and FTP.  You can verify this by FTPing to the application
 servers on the reference topology.

[casado@nity ~/tmp]$ ftp 192.168.129.225
Connected to 192.168.129.225 (192.168.129.225).
220 (vsFTPd 1.2.1)
Name (192.168.129.225:casado): [casado@nity ~/tmp]$
[casado@nity ~/tmp]$

 .m

> what is present on the application servers?
> I'm able to ping both of my servers (i.e. packets
> get forwarded by my router in both directions).
> However, when I tried ssh or ftp to either one,
> packets are sent to the servers, servers even
> reply to ARP requests but no data packets
> comeback from either server.
> 
> Any ideas?
> 
> Thanks Boris.
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "cs244a" <ayaz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: For those who want to use alarm(..)
Date: Sat, 31 Jan 2004 14:27:46 -0800
Lines: 20
Distribution: su
Message-ID: <bvha5c$3t5$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0401291830510.22211-100000@Xenon.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075588079 4005 127.0.0.1 (31 Jan 2004 22:27:59 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
Xref: shelby.stanford.edu su.class.cs244a:5731

Since we are not allowed to use global variables, how do we pass any
parameters to our SIGALRM signal handler?

Thanks
Ayaz


"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0401291830510.22211-100000@Xenon.Stanford.EDU...
>
>  I've taken Abhyudaya's patch and added it to the stub code so that
>  SIGALRM won't break the recv(..) in sr_vns_comm.c.  If anyone is thinking
>  of using alarm(..) to handle timeouts, email me and I'll send you the
>  patched code.  This hasn't been extensively tested so I want to keep
>  tabs on whose using it.
>
>  .m
>


.

Path: shelby.stanford.edu!elaine21.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: traceroute
Date: Sat, 31 Jan 2004 14:31:57 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.GSO.4.44.0401311427320.21031-100000@elaine21.Stanford.EDU>
References: <Pine.GSO.4.44.0401311412240.5908-100000@epic9.Stanford.EDU>
 <Pine.LNX.4.44.0401311425300.27285-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine21.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075588318 4252 171.64.15.86 (31 Jan 2004 22:31:58 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@CS.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0401311425300.27285-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5732

I'm able to traceroute to the application server but not quite sure
why it worked.  My router only get 3 packets from the firewall
with TTL of 1 to which I reply port unreachable.  I don't get any more
packets, yet traceroute is happy.  I thouht that after receiving
packets with TTL of 1, I'd get packets with TTL of 2 for which I would
decerement TTL field and send to the application server.  But this is not
happening. How come? the complete output from traceroute is below.

elaine21:~/classes/cs244a/p2/stub> traceroute 192.168.128.13
traceroute to ballagas-router-1.Stanford.EDU (192.168.128.13): 1-30 hops,
38 byte packets
 1  sweet-rtr.Stanford.EDU (171.64.15.65)  0.496 ms  0.334 ms  0.330 ms
 2  171.64.1.44 (171.64.1.44)  0.437 ms  0.782 ms  0.532 ms
 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.414 ms (ttl=62!)  0.383 ms
(ttl=62!)  0.371 ms (ttl=62!)
 4  ballagas-router-1.Stanford.EDU (192.168.128.13)  3.45 ms (ttl=61!) !A
2.23 ms (ttl=61!) !A  2.27 ms (ttl=61!) !A


.

Path: shelby.stanford.edu!elaine42.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Problem Set
Date: Sat, 31 Jan 2004 22:59:05 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <bvhbvp$625$1@news.Stanford.EDU>
References: <bvh3ps$ps0$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine42.stanford.edu
X-Trace: news.Stanford.EDU 1075589945 6213 171.64.15.117 (31 Jan 2004 22:59:05 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5733


>I noticed that on the course web site it says that the problem set is due
>February 6th. It also says that the problem set is due on February 6th on
>the problem set itself.  However, just recently I noticed it says that the
>problem set is due Wed., February 6th.  February 6th is actually a Friday.
>Am I correct in going by the date on the schedule page and assuming the
>problem set is due on Feb. 6th (and that Wed. is a typo)?

Yep, it's due on the 6th.  Sorry for the confusion.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: For those who want to use alarm(..)
Date: Sat, 31 Jan 2004 16:28:59 -0800
Lines: 33
Distribution: su
Message-ID: <Pine.LNX.4.44.0401311625110.31165-100000@Xenon.Stanford.EDU>
References: <Pine.LNX.4.44.0401291830510.22211-100000@Xenon.Stanford.EDU>
 <bvha5c$3t5$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 1075595341 12996 171.64.66.201 (1 Feb 2004 00:29:01 GMT)
X-Complaints-To: news@news.stanford.edu
To: cs244a <ayaz@stanford.edu>
In-Reply-To: <bvha5c$3t5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5734


(from Jason Ying Li)

struct sigaction can have a handler:

void (*sa_sigaction)(int, siginfo_t *, void *);

So you can pass sr in the 3rd param. 

..m

> Since we are not allowed to use global variables, how do we pass any
> parameters to our SIGALRM signal handler?
> 
> Thanks
> Ayaz
> 
> 
> "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> news:Pine.LNX.4.44.0401291830510.22211-100000@Xenon.Stanford.EDU...
> >
> >  I've taken Abhyudaya's patch and added it to the stub code so that
> >  SIGALRM won't break the recv(..) in sr_vns_comm.c.  If anyone is thinking
> >  of using alarm(..) to handle timeouts, email me and I'll send you the
> >  patched code.  This hasn't been extensively tested so I want to keep
> >  tabs on whose using it.
> >
> >  .m
> >
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ARP Cache
Date: Sat, 31 Jan 2004 16:30:08 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.LNX.4.44.0401311629190.31165-100000@Xenon.Stanford.EDU>
References: <bvh9v0$3hp$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 1075595409 13152 171.64.66.201 (1 Feb 2004 00:30:09 GMT)
X-Complaints-To: news@news.stanford.edu
To: Ryan <ryan05@stanford.edu>
In-Reply-To: <bvh9v0$3hp$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5735


> Is it acceptable for this assignment in terms of both functionality and
> style to assume that protocol type is IP and hardware type is ethernet?  (We
> can simply drop all others).  In so doing, am I correct in saying we can
> ignore the information about the length of these two addresses?

 Thats fine.

 .m

.

Path: shelby.stanford.edu!firebird2.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ICMP Port unreachable
Date: Sat, 31 Jan 2004 17:01:40 -0800
Lines: 4
Distribution: su
Message-ID: <Pine.LNX.4.44.0401311659100.32209-100000@firebird2.Stanford.EDU>
NNTP-Posting-Host: firebird2.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075597301 15795 171.64.15.15 (1 Feb 2004 01:01:41 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5736

I checked the network sourcery page on ICMP, but in the description of
type field, couldn't find the value for "port unreachable" which is one of
the ICMP message we need to generate. Please lend a pointer here. Thanks!

.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: bas64 decode
Date: Sun, 1 Feb 2004 01:14:35 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <bvhjtq$gn2$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1075598075 17122 171.64.15.67 (1 Feb 2004 01:14:35 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:5737

Stupid question here. How do I decode this base64 attached file? I'm using 
tin and it auto selects the MIME type. But I want to be able to save this 
post on disk then run a command line to decode.

Thanks
Jason
.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: base64 decode
Date: Sun, 1 Feb 2004 01:16:13 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <bvhk0s$gn2$2@news.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1075598173 17122 171.64.15.67 (1 Feb 2004 01:16: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:5738

Stupid question here. How do I decode this base64 attached file? I'm using 
tin and I need to save this file and run a command line to decode and save 
it.

Thanks
Jason
.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: base64 decode
Date: Sun, 1 Feb 2004 01:17:32 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <bvhk3c$gn2$3@news.Stanford.EDU>
References: <bvhk0s$gn2$2@news.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1075598252 17122 171.64.15.67 (1 Feb 2004 01:17:32 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:5739

This is in regards to the sr_vns_comm.c attached file

Jason Ying Li <jasonyli@stanford.edu> wrote:
> Stupid question here. How do I decode this base64 attached file? I'm using 
> tin and I need to save this file and run a command line to decode and save 
> it.

> Thanks
> Jason
.

Path: shelby.stanford.edu!not-for-mail
From: "Ryan" <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Variables global to a module
Date: Sat, 31 Jan 2004 18:03:52 -0800
Lines: 7
Distribution: su
Message-ID: <bvhmq9$kbr$1@news.Stanford.EDU>
NNTP-Posting-Host: ryan05.stanford.edu
X-Trace: news.Stanford.EDU 1075601033 20859 128.12.21.88 (1 Feb 2004 02:03: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:5740

  Are we allowed to have variables globule to a module?   (eg. statically
declared variables within a module).  It was discussed that we may modify
sr_instance but may we also add static variables? It seems like a reasonable
design decisino for a cache to have a module responsible for that cache and
one variable (global only to that module) that represents that cache.


.

Path: shelby.stanford.edu!not-for-mail
From: "Ayaz" <ayaz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: For those who want to use alarm(..)
Date: Sat, 31 Jan 2004 19:14:07 -0800
Lines: 56
Distribution: su
Message-ID: <bvhqu8$otp$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0401291830510.22211-100000@Xenon.Stanford.EDU> <bvha5c$3t5$1@news.Stanford.EDU> <Pine.LNX.4.44.0401311625110.31165-100000@Xenon.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075605258 25529 127.0.0.1 (1 Feb 2004 03:14:18 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
Xref: shelby.stanford.edu su.class.cs244a:5741

Still no luck in passing a context object :(

Has anyone got it to work? How do you pass "sr" as the 3rd param?

here is what i have:

void myalarm_handler(int sig, siginfo_t *sip, void *extra);

struct sigaction sa;
sa.sa_sigaction = myalarm_handler;
sigemptyset(&sa.sa_mask);
sigaddset(&sa.sa_mask, SIGALRM);
sa.sa_flags = SA_SIGINFO;

sigaction(SIGALRM, &sa, 0);



"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0401311625110.31165-100000@Xenon.Stanford.EDU...
>
> (from Jason Ying Li)
>
> struct sigaction can have a handler:
>
> void (*sa_sigaction)(int, siginfo_t *, void *);
>
> So you can pass sr in the 3rd param.
>
> .m
>
> > Since we are not allowed to use global variables, how do we pass any
> > parameters to our SIGALRM signal handler?
> >
> > Thanks
> > Ayaz
> >
> >
> > "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> > news:Pine.LNX.4.44.0401291830510.22211-100000@Xenon.Stanford.EDU...
> > >
> > >  I've taken Abhyudaya's patch and added it to the stub code so that
> > >  SIGALRM won't break the recv(..) in sr_vns_comm.c.  If anyone is
thinking
> > >  of using alarm(..) to handle timeouts, email me and I'll send you the
> > >  patched code.  This hasn't been extensively tested so I want to keep
> > >  tabs on whose using it.
> > >
> > >  .m
> > >
> >
> >
> >
>


.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: For those who want to use alarm(..)
Date: Sun, 1 Feb 2004 03:29:28 +0000 (UTC)
Lines: 64
Distribution: su
Message-ID: <bvhrqo$pju$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0401291830510.22211-100000@Xenon.Stanford.EDU> <bvha5c$3t5$1@news.Stanford.EDU> <Pine.LNX.4.44.0401311625110.31165-100000@Xenon.Stanford.EDU> <bvhqu8$otp$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine14.stanford.edu
X-Trace: news.Stanford.EDU 1075606168 26238 171.64.15.79 (1 Feb 2004 03:29:28 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:5742

I didn't use SIGALRM in the end and opted for pthreads instead. Yes I ran 
into the same problem as you did. The 3rd param of u_context is the stack 
data pointer of the caller I believe. So in this case, it would have been 
the kernel that called you, not sr_handlepacket.

BTW: it's actually very simple to use pthreads.

Ayaz <ayaz@stanford.edu> wrote:
> Still no luck in passing a context object :(

> Has anyone got it to work? How do you pass "sr" as the 3rd param?

> here is what i have:

> void myalarm_handler(int sig, siginfo_t *sip, void *extra);

> struct sigaction sa;
> sa.sa_sigaction = myalarm_handler;
> sigemptyset(&sa.sa_mask);
> sigaddset(&sa.sa_mask, SIGALRM);
> sa.sa_flags = SA_SIGINFO;

> sigaction(SIGALRM, &sa, 0);



> "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> news:Pine.LNX.4.44.0401311625110.31165-100000@Xenon.Stanford.EDU...
>>
>> (from Jason Ying Li)
>>
>> struct sigaction can have a handler:
>>
>> void (*sa_sigaction)(int, siginfo_t *, void *);
>>
>> So you can pass sr in the 3rd param.
>>
>> .m
>>
>> > Since we are not allowed to use global variables, how do we pass any
>> > parameters to our SIGALRM signal handler?
>> >
>> > Thanks
>> > Ayaz
>> >
>> >
>> > "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
>> > news:Pine.LNX.4.44.0401291830510.22211-100000@Xenon.Stanford.EDU...
>> > >
>> > >  I've taken Abhyudaya's patch and added it to the stub code so that
>> > >  SIGALRM won't break the recv(..) in sr_vns_comm.c.  If anyone is
> thinking
>> > >  of using alarm(..) to handle timeouts, email me and I'll send you the
>> > >  patched code.  This hasn't been extensively tested so I want to keep
>> > >  tabs on whose using it.
>> > >
>> > >  .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, 31 Jan 2004 20:41:46 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0401312040040.9836-100000@Xenon.Stanford.EDU>
References: <Pine.LNX.4.44.0401311659100.32209-100000@firebird2.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075610508 1068 171.64.66.201 (1 Feb 2004 04:41:48 GMT)
X-Complaints-To: news@news.stanford.edu
To: Yuhui Jin <yhjin@stanford.edu>
In-Reply-To: <Pine.LNX.4.44.0401311659100.32209-100000@firebird2.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5743


 Type is destination unreachable, code is port unreachable.

 .m

> I checked the network sourcery page on ICMP, but in the description of
> type field, couldn't find the value for "port unreachable" which is one of
> the ICMP message we need to generate. Please lend a pointer here. Thanks!
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Variables global to a module
Date: Sat, 31 Jan 2004 20:53:04 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0401312042020.9836-100000@Xenon.Stanford.EDU>
References: <bvhmq9$kbr$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 1075611187 1785 171.64.66.201 (1 Feb 2004 04:53:07 GMT)
X-Complaints-To: news@news.stanford.edu
To: Ryan <ryan05@stanford.edu>
In-Reply-To: <bvhmq9$kbr$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5744


>   Are we allowed to have variables globule to a module?   (eg. statically
> declared variables within a module).  It was discussed that we may modify
> sr_instance but may we also add static variables? It seems like a reasonable
> design decisino for a cache to have a module responsible for that cache and
> one variable (global only to that module) that represents that cache.

 This seems rather inconsistent to me.  You are passing around the router
 context to each method. A framework in which, if you choose, you could manage
 multiple routers. You have implicit locality per router for managing state for
 debugging and maintenance..  Why would you then choose to make part of router
 state a module global, static variable?  You will be marked off for using
 a global for the arp cache.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: For those who want to use alarm(..)
Date: Sat, 31 Jan 2004 20:55:55 -0800
Lines: 73
Distribution: su
Message-ID: <Pine.LNX.4.44.0401312053370.9836-100000@Xenon.Stanford.EDU>
References: <Pine.LNX.4.44.0401291830510.22211-100000@Xenon.Stanford.EDU>
 <bvha5c$3t5$1@news.Stanford.EDU> <Pine.LNX.4.44.0401311625110.31165-100000@Xenon.Stanford.EDU>
 <bvhqu8$otp$1@news.Stanford.EDU> <bvhrqo$pju$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 1075611356 1949 171.64.66.201 (1 Feb 2004 04:55:56 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jason Ying Li <jasonyli@Stanford.EDU>
In-Reply-To: <bvhrqo$pju$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5745


 I personally don't know the best way to handle this.  If you are intent on
 using SIGALRM you may save a reference to sr_instance in a method local static
 variable (unless someone knows a better solution??).

 .m

> I didn't use SIGALRM in the end and opted for pthreads instead. Yes I ran 
> into the same problem as you did. The 3rd param of u_context is the stack 
> data pointer of the caller I believe. So in this case, it would have been 
> the kernel that called you, not sr_handlepacket.
> 
> BTW: it's actually very simple to use pthreads.
> 
> Ayaz <ayaz@stanford.edu> wrote:
> > Still no luck in passing a context object :(
> 
> > Has anyone got it to work? How do you pass "sr" as the 3rd param?
> 
> > here is what i have:
> 
> > void myalarm_handler(int sig, siginfo_t *sip, void *extra);
> 
> > struct sigaction sa;
> > sa.sa_sigaction = myalarm_handler;
> > sigemptyset(&sa.sa_mask);
> > sigaddset(&sa.sa_mask, SIGALRM);
> > sa.sa_flags = SA_SIGINFO;
> 
> > sigaction(SIGALRM, &sa, 0);
> 
> 
> 
> > "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> > news:Pine.LNX.4.44.0401311625110.31165-100000@Xenon.Stanford.EDU...
> >>
> >> (from Jason Ying Li)
> >>
> >> struct sigaction can have a handler:
> >>
> >> void (*sa_sigaction)(int, siginfo_t *, void *);
> >>
> >> So you can pass sr in the 3rd param.
> >>
> >> .m
> >>
> >> > Since we are not allowed to use global variables, how do we pass any
> >> > parameters to our SIGALRM signal handler?
> >> >
> >> > Thanks
> >> > Ayaz
> >> >
> >> >
> >> > "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> >> > news:Pine.LNX.4.44.0401291830510.22211-100000@Xenon.Stanford.EDU...
> >> > >
> >> > >  I've taken Abhyudaya's patch and added it to the stub code so that
> >> > >  SIGALRM won't break the recv(..) in sr_vns_comm.c.  If anyone is
> > thinking
> >> > >  of using alarm(..) to handle timeouts, email me and I'll send you the
> >> > >  patched code.  This hasn't been extensively tested so I want to keep
> >> > >  tabs on whose using it.
> >> > >
> >> > >  .m
> >> > >
> >> >
> >> >
> >> >
> >>
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: arp queue
Date: Sat, 31 Jan 2004 21:01:19 -0800
Lines: 12
Distribution: su
Message-ID: <bvi0vt$1vh$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1075611453 2033 128.12.189.163 (1 Feb 2004 04:57: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:5746

Hi,
When i send an ARP request the first time, I find the interface & next hop
IP address for  the  ARP packet.For the next 4 times to send the ARP request
can I assume that the interface & the next hop ip address remains the same?
Also when my packet is actually sent from the queue,should I again check for
the interface from the routing table?
iedo I assume that the routing table does not change during that time from
which the packet is queued to when the packet is actually sent out ?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: arp queue
Date: Sat, 31 Jan 2004 21:57:41 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.LNX.4.44.0401312156340.31524-100000@Xenon.Stanford.EDU>
References: <bvi0vt$1vh$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 1075615063 5686 171.64.66.201 (1 Feb 2004 05:57:43 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bvi0vt$1vh$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5747


> Hi,
> When i send an ARP request the first time, I find the interface & next hop
> IP address for  the  ARP packet.For the next 4 times to send the ARP request
> can I assume that the interface & the next hop ip address remains the same?
 
  yes.

> Also when my packet is actually sent from the queue,should I again check for
> the interface from the routing table?
 
 nope

> iedo I assume that the routing table does not change during that time from
> which the packet is queued to when the packet is actually sent out ?

 correct!

 .m

.

Path: shelby.stanford.edu!firebird13.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: routing table collision domain & cache timeout enforcement
Date: Sat, 31 Jan 2004 22:16:22 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.LNX.4.44.0401312200490.20109-100000@firebird13.Stanford.EDU>
NNTP-Posting-Host: firebird13.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075616183 6717 171.64.12.142 (1 Feb 2004 06:16:23 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5748

I've got two questions:

1) in FAQ 23. It says two cases we need to support. I am not sure whether
i understand these.

If I am not wrong, I guess next hop has the same meaning as gateway.

The first case I think applies to the case when we have packets destined
to any of the app server. The next hop is in fact same as the ip of the
app server. Is that right?

The second case is beyond me. What does collision domain mean? Why the
example routing table shown in the assigment handout (with three rows
ending with eth1, eth2, eth0) does not contain "0.0.0.0" as its next-hop
address?  I guess I am missing something.

2) I have a thread for checking packet queue for ARP replies. Do we need
another thread to timeout ARP cache entries? Can I just delete the entry
and send a ARP request when I actually trying to use it for forwarding an
IP packet but find out it has expired?

Thank!!

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: routing table collision domain & cache timeout enforcement
Date: Sat, 31 Jan 2004 22:33:08 -0800
Lines: 36
Distribution: su
Message-ID: <Pine.LNX.4.44.0401312229210.9517-100000@Xenon.Stanford.EDU>
References: <Pine.LNX.4.44.0401312200490.20109-100000@firebird13.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075617191 7814 171.64.66.201 (1 Feb 2004 06:33:11 GMT)
X-Complaints-To: news@news.stanford.edu
To: Yuhui Jin <yhjin@stanford.edu>
In-Reply-To: <Pine.LNX.4.44.0401312200490.20109-100000@firebird13.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5749


> I've got two questions:
> 
> 1) in FAQ 23. It says two cases we need to support. I am not sure whether
> i understand these.
> 
> If I am not wrong, I guess next hop has the same meaning as gateway.

 correct.
 
> The first case I think applies to the case when we have packets destined
> to any of the app server. The next hop is in fact same as the ip of the
> app server. Is that right?

 correct.

> The second case is beyond me. What does collision domain mean? Why the
> example routing table shown in the assigment handout (with three rows
> ending with eth1, eth2, eth0) does not contain "0.0.0.0" as its next-hop
> address?  I guess I am missing something.

 The idea is that there may be mutiple hosts on the subnet off of the
 interface.  If any of these are addressed directly, there is no need
 to have an entry in the routing table for each of them.  Instead you
 use one routing entry of 0.0.0.0 as the gateway so the router knows
 that the next hop is the destination address of the packet.

> 2) I have a thread for checking packet queue for ARP replies. Do we need
> another thread to timeout ARP cache entries? Can I just delete the entry
> and send a ARP request when I actually trying to use it for forwarding an
> IP packet but find out it has expired?

 One thread is sufficient.

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: recv(..):sr_client.c::sr_read_from_server: Connection reset by peer
Date: Sat, 31 Jan 2004 22:44:57 -0800
Organization: Stanford University
Lines: 9
Distribution: su
Message-ID: <pan.2004.02.01.06.44.57.445197@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 1075617897 8215 128.12.69.27 (1 Feb 2004 06:44:57 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:5750

Right after I try to forward an IP packet to the vns server, i get:

recv(..):sr_client.c::sr_read_from_server: Connection reset by peer
sr_destroy_INSTANCE leaking memory

It looks like the vns server closed my connection.  What is the cause of
this?

--Chris
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: recv(..):sr_client.c::sr_read_from_server: Connection reset by
 peer
Date: Sat, 31 Jan 2004 22:52:57 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0401312251450.15137-100000@Xenon.Stanford.EDU>
References: <pan.2004.02.01.06.44.57.445197@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075618378 9030 171.64.66.201 (1 Feb 2004 06:52:58 GMT)
X-Complaints-To: news@news.stanford.edu
To: Chris Edstrom <cedstrom@stanford.edu>
In-Reply-To: <pan.2004.02.01.06.44.57.445197@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5751


 potentially you have a bogus length.  What topology are you using?

 .m

> Right after I try to forward an IP packet to the vns server, i get:
> 
> recv(..):sr_client.c::sr_read_from_server: Connection reset by peer
> sr_destroy_INSTANCE leaking memory
> 
> It looks like the vns server closed my connection.  What is the cause of
> this?
> 
> --Chris
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Ryan" <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: FIXME comment
Date: Sat, 31 Jan 2004 23:00:46 -0800
Lines: 12
Distribution: su
Message-ID: <bvi86u$9bu$1@news.Stanford.EDU>
NNTP-Posting-Host: ryan05.stanford.edu
X-Trace: news.Stanford.EDU 1075618846 9598 128.12.21.88 (1 Feb 2004 07:00: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:5752

I thought we were not suppoed to modify sr_protocol.h but there is a comment
that says:

/* FIXME
 * ohh how lame .. how very, very lame... how can I ever go out in public
 * again?! /mc
 */


Is this referring to a bug that we should fix?


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: FIXME comment
Date: Sat, 31 Jan 2004 23:09:48 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0401312307310.19632-100000@Xenon.Stanford.EDU>
References: <bvi86u$9bu$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 1075619399 10144 171.64.66.201 (1 Feb 2004 07:09:59 GMT)
X-Complaints-To: news@news.stanford.edu
To: Ryan <ryan05@stanford.edu>
In-Reply-To: <bvi86u$9bu$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5753


> I thought we were not suppoed to modify sr_protocol.h but there is a comment
> that says:
> 
> /* FIXME
>  * ohh how lame .. how very, very lame... how can I ever go out in public
>  * again?! /mc
>  */
> 
> 
> Is this referring to a bug that we should fix?

 Hehe, no. Thats just my admittance to some hackery to set endian 
 ordering based on OS.  

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: recv(..):sr_client.c::sr_read_from_server: Connection reset by peer
Date: Sat, 31 Jan 2004 23:33:12 -0800
Organization: Stanford University
Lines: 22
Distribution: su
Message-ID: <pan.2004.02.01.07.33.09.255198@stanford.edu>
References: <pan.2004.02.01.06.44.57.445197@stanford.edu> <Pine.LNX.4.44.0401312251450.15137-100000@Xenon.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 1075620792 11534 128.12.69.27 (1 Feb 2004 07:33:12 GMT)
X-Complaints-To: news@news.stanford.edu
To: casado@cs.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:5754

114; yeah, I think that's it.

--Chris

On Sat, 31 Jan 2004 22:52:57 -0800, Martin Casado wrote:

> 
>  potentially you have a bogus length.  What topology are you using?
> 
>  .m
> 
>> Right after I try to forward an IP packet to the vns server, i get:
>> 
>> recv(..):sr_client.c::sr_read_from_server: Connection reset by peer
>> sr_destroy_INSTANCE leaking memory
>> 
>> It looks like the vns server closed my connection.  What is the cause of
>> this?
>> 
>> --Chris
>>

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: recv(..):sr_client.c::sr_read_from_server: Connection reset by
 peer
Date: Sat, 31 Jan 2004 23:40:39 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.LNX.4.44.0401312340150.28923-100000@Xenon.Stanford.EDU>
References: <pan.2004.02.01.06.44.57.445197@stanford.edu>
 <Pine.LNX.4.44.0401312251450.15137-100000@Xenon.Stanford.EDU>
 <pan.2004.02.01.07.33.09.255198@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075621241 12127 171.64.66.201 (1 Feb 2004 07:40:41 GMT)
X-Complaints-To: news@news.stanford.edu
To: Chris Edstrom <cedstrom@stanford.edu>
In-Reply-To: <pan.2004.02.01.07.33.09.255198@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5755



 Works OK for me.  Let me know if you continue to have problems with it.

 .m

> 114; yeah, I think that's it.
> 
> --Chris
> 
> On Sat, 31 Jan 2004 22:52:57 -0800, Martin Casado wrote:
> 
> > 
> >  potentially you have a bogus length.  What topology are you using?
> > 
> >  .m
> > 
> >> Right after I try to forward an IP packet to the vns server, i get:
> >> 
> >> recv(..):sr_client.c::sr_read_from_server: Connection reset by peer
> >> sr_destroy_INSTANCE leaking memory
> >> 
> >> It looks like the vns server closed my connection.  What is the cause of
> >> this?
> >> 
> >> --Chris
> >>
> 
> 

.

Path: shelby.stanford.edu!firebird13.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sending arp request
Date: Sun, 1 Feb 2004 00:10:30 -0800
Lines: 22
Distribution: su
Message-ID: <Pine.LNX.4.44.0402010008180.20522-100000@firebird13.Stanford.EDU>
References: <4019BA3D.4020007@stanford.edu> <Pine.LNX.4.44.0401291813520.12226-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: firebird13.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075623037 14539 171.64.12.142 (1 Feb 2004 08:10:37 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0401291813520.12226-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5756


The FAQ 19. says ARP packet are 28 bytes, that needs 1 byte for the data
portion at the end. When I generate ARP request, do I generate 0x00 to
make up for this byte?

Thanks!


On Thu, 29 Jan 2004, Martin Casado wrote:

>
> > Hi,
> >
> > When we send arp requests, do we send it out every interface in our
> > router?
>
>  no.
>
>  .m
>
>

.

Path: shelby.stanford.edu!firebird13.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sending arp request
Date: Sun, 1 Feb 2004 00:12:05 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.LNX.4.44.0402010011240.20633-100000@firebird13.Stanford.EDU>
References: <4019BA3D.4020007@stanford.edu> <Pine.LNX.4.44.0401291813520.12226-100000@Xenon.Stanford.EDU>
 <Pine.LNX.4.44.0402010008180.20522-100000@firebird13.Stanford.EDU>
NNTP-Posting-Host: firebird13.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075623125 14602 171.64.12.142 (1 Feb 2004 08:12:05 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0402010008180.20522-100000@firebird13.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5757


Sorry. I mean there are 4 bytes in the data portion based on the
difference between FAQ 19 and ARP protocol.

On Sun, 1 Feb 2004, Yuhui Jin wrote:

>
> The FAQ 19. says ARP packet are 28 bytes, that needs 1 byte for the data
> portion at the end. When I generate ARP request, do I generate 0x00 to
> make up for this byte?
>
> Thanks!
>
>
> On Thu, 29 Jan 2004, Martin Casado wrote:
>
> >
> > > Hi,
> > >
> > > When we send arp requests, do we send it out every interface in our
> > > router?
> >
> >  no.
> >
> >  .m
> >
> >
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sending data back across vns-firewall
Date: Sun, 1 Feb 2004 00:12:21 -0800
Lines: 16
Distribution: su
Message-ID: <bvicdb$e9d$1@news.Stanford.EDU>
NNTP-Posting-Host: cerras1.stanford.edu
X-Trace: news.Stanford.EDU 1075623147 14637 128.12.196.135 (1 Feb 2004 08:12:27 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:5758

When i get data back from my servers, my router puts it in the queue and
sends out an arp request.  It correctly realizes it needs to go out to eth0,
but how is supposed to know not to send an arp request and that 172.24.74.17
is the next hop?


This is how I constructed my routing table file:

172.24.74.17         172.24.74.17         255.255.255.255  eth0
192.168.128.208   192.168.128.208   255.255.255.255  eth1
192.168.128.210   192.168.128.210   255.255.255.255  eth2
0.0.0.0                   172.24.74.17         0.0.0.0                  eth0

is this right?


.

Path: shelby.stanford.edu!firebird13.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sending data back across vns-firewall
Date: Sun, 1 Feb 2004 00:49:48 -0800
Lines: 27
Distribution: su
Message-ID: <Pine.LNX.4.44.0402010048150.20689-100000@firebird13.Stanford.EDU>
References: <bvicdb$e9d$1@news.Stanford.EDU>
NNTP-Posting-Host: firebird13.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075625389 17152 171.64.12.142 (1 Feb 2004 08:49:49 GMT)
X-Complaints-To: news@news.stanford.edu
To: Justin <justinfw@stanford.edu>
In-Reply-To: <bvicdb$e9d$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5759


I guess you may remove the first line. So the packet will match the last
default entry ( because the mask clears everything ) and gets sent the the
fire-wall.



On Sun, 1 Feb 2004, Justin wrote:

> When i get data back from my servers, my router puts it in the queue and
> sends out an arp request.  It correctly realizes it needs to go out to eth0,
> but how is supposed to know not to send an arp request and that 172.24.74.17
> is the next hop?
>
>
> This is how I constructed my routing table file:
>
> 172.24.74.17         172.24.74.17         255.255.255.255  eth0
> 192.168.128.208   192.168.128.208   255.255.255.255  eth1
> 192.168.128.210   192.168.128.210   255.255.255.255  eth2
> 0.0.0.0                   172.24.74.17         0.0.0.0                  eth0
>
> is this right?
>
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Ryan" <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sr_instance / sr_router.h
Date: Sun, 1 Feb 2004 02:25:24 -0800
Lines: 4
Distribution: su
Message-ID: <bvik6l$mln$1@news.Stanford.EDU>
NNTP-Posting-Host: ryan05.stanford.edu
X-Trace: news.Stanford.EDU 1075631125 23223 128.12.21.88 (1 Feb 2004 10:25: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:5760

Is the only element we are allowed a cache? or may we change this struct as
we see fit?


.

Path: shelby.stanford.edu!saga12.Stanford.EDU!mylesw
From: mylesw@Stanford.EDU (Myles Barrett Williams)
Newsgroups: su.class.cs244a
Subject: Re: ICMP through different interface
Date: Sun, 1 Feb 2004 11:25:21 +0000 (UTC)
Organization: Stanford University, CA 94305, USA
Lines: 12
Distribution: su
Message-ID: <bvinn1$prs$1@news.Stanford.EDU>
References: <bv92tl$6a0$1@news.Stanford.EDU> <Pine.LNX.4.44.0401281913300.25487-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0401281944100.21227-100000@fable5.Stanford.EDU> <Pine.LNX.4.44.0401290225400.12270-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: saga12.stanford.edu
X-Trace: news.Stanford.EDU 1075634721 26492 171.64.15.142 (1 Feb 2004 11:25:21 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5761

In article <Pine.LNX.4.44.0401290225400.12270-100000@Xenon.Stanford.EDU>,
Martin Casado  <casado@Xenon.Stanford.EDU> wrote:
>> To check if a packet is meant for the router, do I just iterate through
>> all interfaces and check if the dest of the packet matches one of them?
>
> yup.

In this case do ICMP errors go through the interface that the packet arrived
on, or the interface that it should have arrived on? If the former, what
source address should the message have?

Myles
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: sending arp request
Date: Sun, 1 Feb 2004 04:15:48 -0800
Lines: 38
Distribution: su
Message-ID: <Pine.LNX.4.44.0402010414410.375-100000@Xenon.Stanford.EDU>
References: <4019BA3D.4020007@stanford.edu> <Pine.LNX.4.44.0401291813520.12226-100000@Xenon.Stanford.EDU>
 <Pine.LNX.4.44.0402010008180.20522-100000@firebird13.Stanford.EDU>
 <Pine.LNX.4.44.0402010011240.20633-100000@firebird13.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075637751 1004 171.64.66.201 (1 Feb 2004 12:15:51 GMT)
X-Complaints-To: news@news.stanford.edu
To: Yuhui Jin <yhjin@stanford.edu>
In-Reply-To: <Pine.LNX.4.44.0402010011240.20633-100000@firebird13.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5762


 I don't understand where you are getting 4 bytes from .... you shouldn't
 have to do any padding for ARP however.

 .m

> 
> Sorry. I mean there are 4 bytes in the data portion based on the
> difference between FAQ 19 and ARP protocol.
> 
> On Sun, 1 Feb 2004, Yuhui Jin wrote:
> 
> >
> > The FAQ 19. says ARP packet are 28 bytes, that needs 1 byte for the data
> > portion at the end. When I generate ARP request, do I generate 0x00 to
> > make up for this byte?
> >
> > Thanks!
> >
> >
> > On Thu, 29 Jan 2004, Martin Casado wrote:
> >
> > >
> > > > Hi,
> > > >
> > > > When we send arp requests, do we send it out every interface in our
> > > > router?
> > >
> > >  no.
> > >
> > >  .m
> > >
> > >
> >
> >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: sending data back across vns-firewall
Date: Sun, 1 Feb 2004 04:19:05 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.LNX.4.44.0402010416120.375-100000@Xenon.Stanford.EDU>
References: <bvicdb$e9d$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 1075637948 1132 171.64.66.201 (1 Feb 2004 12:19:08 GMT)
X-Complaints-To: news@news.stanford.edu
To: Justin <justinfw@stanford.edu>
In-Reply-To: <bvicdb$e9d$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5763


> When i get data back from my servers, my router puts it in the queue and
> sends out an arp request.  It correctly realizes it needs to go out to eth0,
> but how is supposed to know not to send an arp request and that 172.24.74.17
> is the next hop?

 I don't understand your question ... your router should work as follows: 

 - You get a packet from the app server to somewhere on the internet
 - you look the next hop and find the default route (your routing table
   is broken btw)
 - you arp for the MAC addr of the gateway
 - on receipt of the request your forward your packet

 .m

> 
> This is how I constructed my routing table file:
> 
> 172.24.74.17         172.24.74.17         255.255.255.255  eth0
> 192.168.128.208   192.168.128.208   255.255.255.255  eth1
> 192.168.128.210   192.168.128.210   255.255.255.255  eth2
> 0.0.0.0                   172.24.74.17         0.0.0.0                  eth0
> 
> is this right?
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: sr_instance / sr_router.h
Date: Sun, 1 Feb 2004 04:20:02 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0402010419300.375-100000@Xenon.Stanford.EDU>
References: <bvik6l$mln$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 1075638003 1233 171.64.66.201 (1 Feb 2004 12:20:03 GMT)
X-Complaints-To: news@news.stanford.edu
To: Ryan <ryan05@stanford.edu>
In-Reply-To: <bvik6l$mln$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5764


 You may add what you like... just don't go to crazy with it :)

 .m

> Is the only element we are allowed a cache? or may we change this struct as
> we see fit?
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ICMP through different interface
Date: Sun, 1 Feb 2004 04:22:43 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.LNX.4.44.0402010420150.375-100000@Xenon.Stanford.EDU>
References: <bv92tl$6a0$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401281913300.25487-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401281944100.21227-100000@fable5.Stanford.EDU>
 <Pine.LNX.4.44.0401290225400.12270-100000@Xenon.Stanford.EDU>
 <bvinn1$prs$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 1075638165 1354 171.64.66.201 (1 Feb 2004 12:22:45 GMT)
X-Complaints-To: news@news.stanford.edu
To: Myles Barrett Williams <mylesw@Stanford.EDU>
In-Reply-To: <bvinn1$prs$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5765


> In article <Pine.LNX.4.44.0401290225400.12270-100000@Xenon.Stanford.EDU>,
> Martin Casado  <casado@Xenon.Stanford.EDU> wrote:
> >> To check if a packet is meant for the router, do I just iterate through
> >> all interfaces and check if the dest of the packet matches one of them?
> >
> > yup.
> 
> In this case do ICMP errors go through the interface that the packet arrived
> on, or the interface that it should have arrived on? 

 You can set the source address of generated packets (other than
 echo request) to the IP of the outgoing interface.  Recall that
 you have no idea which interface it should have arrived on, routes are
 not necessarily symetric.

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: sumeet shendrikar <sumeets@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Unable to connect to server
Date: Sun, 01 Feb 2004 07:25:11 -0800
Lines: 11
Distribution: su
Message-ID: <bvj5on$b13$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-60149.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075649111 11299 128.12.197.131 (1 Feb 2004 15:25:11 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5766

Umm... I get the following when I execute my program:

gethostbyname:sr_client.c::sr_connect_to_server(..): Resource 
temporarily unavailable.

This occurs no matter what topology or server (vns 1/2) I try to connect.

are the machines down?

sumeet

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: next-hop MTU on icmp messages
Date: Sun, 1 Feb 2004 09:57:28 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0402010956530.3843-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0401301522390.13781-100000@elaine25.Stanford.EDU>
 <Pine.LNX.4.44.0401301544490.26578-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 1075658249 19666 171.64.15.118 (1 Feb 2004 17:57:29 GMT)
X-Complaints-To: news@news.stanford.edu
Cc: Vishal Patel <vishalp@stanford.edu>
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0401301544490.26578-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5767

Which ICMP message contains the next hop MTU?  I could not find it.

On Fri, 30 Jan 2004, Martin Casado wrote:

>
>  Sure :)
>
>  .m
>
> >
> > We can just use 1500 for this field in the ICMP header, correct?
> >
> > --vishal
> >
> >
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: reusing memory
Date: Sun, 1 Feb 2004 10:05:23 -0800
Lines: 9
Distribution: su
Message-ID: <bvjf51$jn0$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1075658721 20192 128.12.61.97 (1 Feb 2004 18:05: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:5768

When processing an ARP request, I modify the data in the same memory space
as the received packet, and then send the memory back with the ARP reply (I
never malloc new memory).  This seems safe to me since both the request and
reply should have the same length, but would you consider it bad form?

Thanks,
Oded


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Unable to connect to server
Date: Sun, 1 Feb 2004 10:51:38 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0402011050050.13440-100000@Xenon.Stanford.EDU>
References: <bvj5on$b13$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 1075661500 23081 171.64.66.201 (1 Feb 2004 18:51:40 GMT)
X-Complaints-To: news@news.stanford.edu
To: sumeet shendrikar <sumeets@stanford.edu>
In-Reply-To: <bvj5on$b13$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5769




> Umm... I get the following when I execute my program:
> 
> gethostbyname:sr_client.c::sr_connect_to_server(..): Resource 
> temporarily unavailable.
> 
> This occurs no matter what topology or server (vns 1/2) I try to connect.
> 
> are the machines down?

 Nope, seems like a local problem if gethostbyname is failing.  You aren't
 getting name service for some reason.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: next-hop MTU on icmp messages
Date: Sun, 1 Feb 2004 10:53:59 -0800
Lines: 25
Distribution: su
Message-ID: <Pine.LNX.4.44.0402011052051.13440-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401301522390.13781-100000@elaine25.Stanford.EDU>
 <Pine.LNX.4.44.0401301544490.26578-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402010956530.3843-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 1075661640 23292 171.64.66.201 (1 Feb 2004 18:54:00 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402010956530.3843-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5770


 You don't have to worry about setting this.
 
 .m

> Which ICMP message contains the next hop MTU?  I could not find it.
> 
> On Fri, 30 Jan 2004, Martin Casado wrote:
> 
> >
> >  Sure :)
> >
> >  .m
> >
> > >
> > > We can just use 1500 for this field in the ICMP header, correct?
> > >
> > > --vishal
> > >
> > >
> >
> >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: reusing memory
Date: Sun, 1 Feb 2004 10:54:54 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0402011054040.13440-100000@Xenon.Stanford.EDU>
References: <bvjf51$jn0$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 1075661695 23311 171.64.66.201 (1 Feb 2004 18:54:55 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <bvjf51$jn0$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5771




> When processing an ARP request, I modify the data in the same memory space
> as the received packet, and then send the memory back with the ARP reply (I
> never malloc new memory).  This seems safe to me since both the request and
> reply should have the same length, but would you consider it bad form?

 That is OK as long as the packet is sent before handlepacket returns.

 .m

.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: recursive mutex
Date: Sun, 1 Feb 2004 11:56:43 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.GSO.4.44.0402011154140.15382-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 1075665404 27022 171.64.15.42 (1 Feb 2004 19:56:44 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5772

I wanted to use recursive option of the mutex.
That is if a thread already holds a lock and I call
a function that takes a lock as well, I don't want it
to block because of two mutex_lock calls.  According
to man pages, this should work but it does not.
I'm forced to put down lock, call function, then
reaquire the lock.

here is my call sequence:

    rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
    if (rc >= 0) rc = pthread_mutex_init(&sr->lock, &attr);

Is this wrong?

Thanks, Boris.

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: next-hop MTU on icmp messages
Date: Sun, 1 Feb 2004 12:25:59 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.GSO.4.44.0402011224360.2552-100000@elaine31.Stanford.EDU>
References: <Pine.GSO.4.44.0401301522390.13781-100000@elaine25.Stanford.EDU>
 <Pine.LNX.4.44.0401301544490.26578-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402010956530.3843-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075667161 28773 171.64.15.106 (1 Feb 2004 20:26:01 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402010956530.3843-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5773

its one of the error ones...ie...ICMP Host Unreachable, ICMP Port
Unreachable or ICMP timeout

if you go to www.networksorcery.com, they have pretty good docs
on this

--vishal


On Sun, 1 Feb 2004, Xiaohua Fang wrote:

> Which ICMP message contains the next hop MTU?  I could not find it.
>
> On Fri, 30 Jan 2004, Martin Casado wrote:
>
> >
> >  Sure :)
> >
> >  .m
> >
> > >
> > > We can just use 1500 for this field in the ICMP header, correct?
> > >
> > > --vishal
> > >
> > >
> >
> >
>

.

Path: shelby.stanford.edu!elaine33.Stanford.EDU!bahaa
From: Bahaa Eldin Yehia Fahim <bahaa@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: applications servers
Date: Sun, 1 Feb 2004 12:27:46 -0800
Lines: 44
Distribution: su
Message-ID: <Pine.GSO.4.44.0402011223440.12853-100000@elaine33.Stanford.EDU>
References: <Pine.GSO.4.44.0401311412240.5908-100000@epic9.Stanford.EDU>
 <Pine.LNX.4.44.0401311425300.27285-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075667269 28857 171.64.15.108 (1 Feb 2004 20:27:49 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0401311425300.27285-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5774


On my 2 application servers:

192.168.129.88 : I can FTP into, but not HTTP into.
192.168.129.90 : I can FTP and HTTP into.

Is it true that one of the app servers, I shouldn't be able to HTTP into,
or is there something that I'm doing wrong ?

Any help would be appreciated.

Thanks,
Bahaa

On Sat, 31 Jan 2004, Martin Casado wrote:

>
>  HTTP and FTP.  You can verify this by FTPing to the application
>  servers on the reference topology.
>
> [casado@nity ~/tmp]$ ftp 192.168.129.225
> Connected to 192.168.129.225 (192.168.129.225).
> 220 (vsFTPd 1.2.1)
> Name (192.168.129.225:casado): [casado@nity ~/tmp]$
> [casado@nity ~/tmp]$
>
>  .m
>
> > what is present on the application servers?
> > I'm able to ping both of my servers (i.e. packets
> > get forwarded by my router in both directions).
> > However, when I tried ssh or ftp to either one,
> > packets are sent to the servers, servers even
> > reply to ARP requests but no data packets
> > comeback from either server.
> >
> > Any ideas?
> >
> > Thanks Boris.
> >
> >
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Tony Hsieh" <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: icmp echo src addr
Date: Sun, 1 Feb 2004 12:39:48 -0800
Lines: 7
Distribution: su
Message-ID: <bvjo6q$sva$1@news.Stanford.EDU>
NNTP-Posting-Host: acc5d407.ipt.aol.com
X-Trace: news.Stanford.EDU 1075667999 29674 172.197.212.7 (1 Feb 2004 20:39: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:5775

according to the FYI you posted earlier, it seems that the reference router
contradicts this.  For example, when i ping one of the router's interfaces
(192.168.129.222), I receive replies from 192.168.129.221(which is the ip
for the departing interface) not 192.168.129.222 (the destination addr of
the echo request packet).  Is the FYI or the reference router correct?


.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: UMR in PURIFY
Date: Sun, 1 Feb 2004 12:54:08 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0402011253260.16378-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 1075668849 743 171.64.15.42 (1 Feb 2004 20:54:09 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5776

Does anyone seen UMR complaints
when using pthread_mutex_lock and unlock?

Do we need to worry about it?

Thanks.

.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: UMR in PURIFY
Date: Sun, 1 Feb 2004 12:56:44 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.GSO.4.44.0402011256110.16498-100000@epic9.Stanford.EDU>
References: <Pine.GSO.4.44.0402011253260.16378-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 1075669005 859 171.64.15.42 (1 Feb 2004 20:56:45 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402011253260.16378-100000@epic9.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5777

Never mind.  You have to do memset on a lock prior to call
to init.y

On Sun, 1 Feb 2004, Boris Senderzon wrote:

> Does anyone seen UMR complaints
> when using pthread_mutex_lock and unlock?
>
> Do we need to worry about it?
>
> Thanks.
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Tony Hsieh" <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: traceroute to a router interface
Date: Sun, 1 Feb 2004 12:58:12 -0800
Lines: 44
Distribution: su
Message-ID: <bvjp98$u8$1@news.Stanford.EDU>
NNTP-Posting-Host: acc5d407.ipt.aol.com
X-Trace: news.Stanford.EDU 1075669098 968 172.197.212.7 (1 Feb 2004 20:58: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:5778

When I traceroute to eth1 (192.168.129.222) or eth2 (192.168.129.224) of the
reference router, the last entry is a reply from 192.168.129.221.

epic13:~/cs244a/hw2> traceroute 192.168.129.222
traceroute to nickm-router-3.Stanford.EDU (192.168.129.222): 1-30 hops, 38
byte packets
 1  sweet-rtr.Stanford.EDU (171.64.15.1)  0.633 ms  0.325 ms  0.326 ms
 2  Gates-rtr.Stanford.EDU (171.64.1.178)  0.400 ms  0.419 ms  0.404 ms
 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.374 ms (ttl=62!)  0.360 ms
(ttl=62!)  0.356 ms (ttl=62!)
 4  ftp-zacharym.Stanford.EDU (192.168.129.221)  0.577 ms  0.511 ms  0.510
ms

I'm wondering if the last entry result should be from 192.168.129.222 or
192.168.129.221?  I ask b/c in my topology when I traceroute to
eth1(192.168.128.82), I get results from both eth0(192.168.128.81) and
eth1(192.168.128.82).

epic13:~/cs244a/hw2> traceroute 192.168.128.82
traceroute to tcondie-router-1.Stanford.EDU (192.168.128.82): 1-30 hops, 38
byte packets
 1  sweet-rtr.Stanford.EDU (171.64.15.1)  0.613 ms  0.327 ms  0.313 ms
 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.439 ms  0.369 ms  0.364 ms
 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.370 ms (ttl=62!)  0.354 ms
(ttl=62!)  0.346 ms (ttl=62!)
 4  ssho-router-1.Stanford.EDU (192.168.128.81)  7.11 ms (ttl=61!)  2.97 ms
(ttl=61!)  2.95 ms (ttl=61!)
 5  tcondie-router-1.Stanford.EDU (192.168.128.82)  2.98 ms (ttl=61!)  3.03
ms (ttl=61!)  3.10 ms (ttl=61!)

Traceroute works by sending a UDP packet with a TTL of 1 to my router which
I respond with a ICMP time exceeded msg.  In this IP msg, my ip source
address is the departing interface.  However, since the source ip is of the
departing interface and not the ip address of the final destination,
traceroute sends me a UDP packet with TTL 2, which I then respond with a
port unreachable ICMP message.  This causes the last entry in the traceroute
output.  It seems that traceroute doesn't stop unless it receives a ICMP msg
with the source ip being the UDP packet's destination ip?  Is this correct?
If I respond with the UDP packet's destination address as my ICMP msg's
source, my traceroute will show the last entry as eth1 and not eth0.  This
is a different output than the reference router's output.  What is the
correct way this should work?


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: granularity of 15 second arp cache timeout
Date: Sun, 1 Feb 2004 13:18:16 -0800
Lines: 23
Distribution: su
Message-ID: <bvjqem$25m$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401311329390.2710-100000@elaine31.Stanford.EDU> <Pine.LNX.4.44.0401311339230.13633-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1075670295 2230 128.12.61.97 (1 Feb 2004 21:18: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:5779

What if entries take anywhere from 15 to 30 seconds to clear?  Is that too
much?

Oded
>
>
>  Thats fine :)
>
>   .m
>
> >
> > What granularity should we enforce this timeout...
> >
> > in other words, some entries may take up to
> > 16 seconds to timeout (but no longer), is that ok
> >
> > --vishal
> >
> >
> >
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: recursive mutex
Date: Sun, 1 Feb 2004 13:20:49 -0800
Lines: 27
Distribution: su
Message-ID: <Pine.LNX.4.44.0402011315360.23340-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402011154140.15382-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 1075670451 2412 171.64.66.201 (1 Feb 2004 21:20:51 GMT)
X-Complaints-To: news@news.stanford.edu
To: Boris Senderzon <senderzo@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402011154140.15382-100000@epic9.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5780

 
 In should work in theory though I do know that recursive mutexes
 aren't supported in some pthreads implementations.  Since you
 aren't checking the return of the settype call correctly
 for error, you wouldn't know if this failed.

 .m

> I wanted to use recursive option of the mutex.
> That is if a thread already holds a lock and I call
> a function that takes a lock as well, I don't want it
> to block because of two mutex_lock calls.  According
> to man pages, this should work but it does not.
> I'm forced to put down lock, call function, then
> reaquire the lock.
> 
> here is my call sequence:
> 
>     rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
>     if (rc >= 0) rc = pthread_mutex_init(&sr->lock, &attr);
> 
> Is this wrong?
> 
> Thanks, Boris.
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: applications servers
Date: Sun, 1 Feb 2004 13:21:42 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0402011321040.23340-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401311412240.5908-100000@epic9.Stanford.EDU>
 <Pine.LNX.4.44.0401311425300.27285-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402011223440.12853-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 1075670504 2472 171.64.66.201 (1 Feb 2004 21:21:44 GMT)
X-Complaints-To: news@news.stanford.edu
To: Bahaa Eldin Yehia Fahim <bahaa@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402011223440.12853-100000@elaine33.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5781

On Sun, 1 Feb 2004, Bahaa Eldin Yehia Fahim wrote:

> 
> On my 2 application servers:
> 
> 192.168.129.88 : I can FTP into, but not HTTP into.
> 192.168.129.90 : I can FTP and HTTP into.
> 
> Is it true that one of the app servers, I shouldn't be able to HTTP into,
> or is there something that I'm doing wrong ?

 There is only 1 http server.  You aren't doing anything wrong.  Remember that
 there is a refernce router you can check against to see if your router is
 acting oddly.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: icmp echo src addr
Date: Sun, 1 Feb 2004 13:28:18 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0402011321580.23340-100000@Xenon.Stanford.EDU>
References: <bvjo6q$sva$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 1075670900 2844 171.64.66.201 (1 Feb 2004 21:28:20 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tony Hsieh <thsieh@stanford.edu>
In-Reply-To: <bvjo6q$sva$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5782


 I've been able to find routers which behave both ways so either will be
 accepted for grading.  Since the question had come up so much I thought
 I'd point to the rfc.  The reference router should probably be updated
 to support the rfc.
 
 .m

> according to the FYI you posted earlier, it seems that the reference router
> contradicts this.  For example, when i ping one of the router's interfaces
> (192.168.129.222), I receive replies from 192.168.129.221(which is the ip
> for the departing interface) not 192.168.129.222 (the destination addr of
> the echo request packet).  Is the FYI or the reference router correct?
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: traceroute to a router interface
Date: Sun, 1 Feb 2004 13:36:57 -0800
Lines: 54
Distribution: su
Message-ID: <Pine.LNX.4.44.0402011328560.23340-100000@Xenon.Stanford.EDU>
References: <bvjp98$u8$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 1075671418 3438 171.64.66.201 (1 Feb 2004 21:36:58 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tony Hsieh <thsieh@stanford.edu>
In-Reply-To: <bvjp98$u8$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5783


 
 Showing two hops when tracerouting to your router is incorrect.  Your
 method of handling the header is also incorrect, perhaps you should
 look at the FAQ or 4.2.2.9 of rfc 1812.

 .m

> When I traceroute to eth1 (192.168.129.222) or eth2 (192.168.129.224) of the
> reference router, the last entry is a reply from 192.168.129.221.
> 
> epic13:~/cs244a/hw2> traceroute 192.168.129.222
> traceroute to nickm-router-3.Stanford.EDU (192.168.129.222): 1-30 hops, 38
> byte packets
>  1  sweet-rtr.Stanford.EDU (171.64.15.1)  0.633 ms  0.325 ms  0.326 ms
>  2  Gates-rtr.Stanford.EDU (171.64.1.178)  0.400 ms  0.419 ms  0.404 ms
>  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.374 ms (ttl=62!)  0.360 ms
> (ttl=62!)  0.356 ms (ttl=62!)
>  4  ftp-zacharym.Stanford.EDU (192.168.129.221)  0.577 ms  0.511 ms  0.510
> ms
> 
> I'm wondering if the last entry result should be from 192.168.129.222 or
> 192.168.129.221?  I ask b/c in my topology when I traceroute to
> eth1(192.168.128.82), I get results from both eth0(192.168.128.81) and
> eth1(192.168.128.82).
> 
> epic13:~/cs244a/hw2> traceroute 192.168.128.82
> traceroute to tcondie-router-1.Stanford.EDU (192.168.128.82): 1-30 hops, 38
> byte packets
>  1  sweet-rtr.Stanford.EDU (171.64.15.1)  0.613 ms  0.327 ms  0.313 ms
>  2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.439 ms  0.369 ms  0.364 ms
>  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.370 ms (ttl=62!)  0.354 ms
> (ttl=62!)  0.346 ms (ttl=62!)
>  4  ssho-router-1.Stanford.EDU (192.168.128.81)  7.11 ms (ttl=61!)  2.97 ms
> (ttl=61!)  2.95 ms (ttl=61!)
>  5  tcondie-router-1.Stanford.EDU (192.168.128.82)  2.98 ms (ttl=61!)  3.03
> ms (ttl=61!)  3.10 ms (ttl=61!)
> 
> Traceroute works by sending a UDP packet with a TTL of 1 to my router which
> I respond with a ICMP time exceeded msg.  In this IP msg, my ip source
> address is the departing interface.  However, since the source ip is of the
> departing interface and not the ip address of the final destination,
> traceroute sends me a UDP packet with TTL 2, which I then respond with a
> port unreachable ICMP message.  This causes the last entry in the traceroute
> output.  It seems that traceroute doesn't stop unless it receives a ICMP msg
> with the source ip being the UDP packet's destination ip?  Is this correct?
> If I respond with the UDP packet's destination address as my ICMP msg's
> source, my traceroute will show the last entry as eth1 and not eth0.  This
> is a different output than the reference router's output.  What is the
> correct way this should work?
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: granularity of 15 second arp cache timeout
Date: Sun, 1 Feb 2004 13:39:02 -0800
Lines: 33
Distribution: su
Message-ID: <Pine.LNX.4.44.0402011337180.30836-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401311329390.2710-100000@elaine31.Stanford.EDU>
 <Pine.LNX.4.44.0401311339230.13633-100000@Xenon.Stanford.EDU>
 <bvjqem$25m$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 1075671544 3571 171.64.66.201 (1 Feb 2004 21:39:04 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <bvjqem$25m$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5784


 It doesn't matter when you actually clear the ARP entries.  Since you
 only need to use the ARP cache when you get a packet you don't
 have to enforce stong timeouts.  Just as long as you don't use
 a cache entry after it has expired.

 .m

> What if entries take anywhere from 15 to 30 seconds to clear?  Is that too
> much?
> 
> Oded
> >
> >
> >  Thats fine :)
> >
> >   .m
> >
> > >
> > > What granularity should we enforce this timeout...
> > >
> > > in other words, some entries may take up to
> > > 16 seconds to timeout (but no longer), is that ok
> > >
> > > --vishal
> > >
> > >
> > >
> >
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS2 Q6
Date: Sun, 1 Feb 2004 22:01:11 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <bvjsv7$4l3$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
X-Trace: news.Stanford.EDU 1075672871 4771 171.64.15.100 (1 Feb 2004 22:01: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:5785

Part b: Does "ten packets per query" refer to the -q option?

Part c: Do we use www.cam.ac.uk for Cambridge University?  And is the distance to Cambridge calculated by comparing the number 
of hops to those in part a (to UCLA) or b (to Wilson Sonsini)?

Tyrone

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Routing Table
Date: Sun, 01 Feb 2004 14:09:37 -0800
Lines: 14
Distribution: su
Message-ID: <401D7921.7B55ED6F@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075673378 5498 128.12.21.88 (1 Feb 2004 22:09:38 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:5786

Am I correct in saying:

The following lines:

172.24.74.213 172.24.74.213 255.255.255.255  eth1

means to get to 172.24.74.213 the next hop is 172.24.74.213 on eth1


and the following line:
172.24.74.213 0.0.0.0 255.255.255.255 eth1
says 172.24.74.213 lies on eth so send directly to IP   (and in case of
1st entry being 172.24.74 this would have more significance)

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: granularity of 15 second arp cache timeout
Date: Sun, 1 Feb 2004 14:58:03 -0800
Lines: 44
Distribution: su
Message-ID: <bvk09p$8n5$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0401311329390.2710-100000@elaine31.Stanford.EDU> <Pine.LNX.4.44.0401311339230.13633-100000@Xenon.Stanford.EDU> <bvjqem$25m$1@news.Stanford.EDU> <Pine.LNX.4.44.0402011337180.30836-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1075676281 8933 128.12.61.97 (1 Feb 2004 22:58: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:5787

I guess what I'm asking is can it expire between 15 and 30 seconds, or does
it HAVE to expire in 15, so if a packet comes in at second 16 it's stale?

My thought is to have a thread wake up every 15 seconds and delete ARP cache
entries that it saw the last time it was awake.

Thanks,
Oded
>
>  It doesn't matter when you actually clear the ARP entries.  Since you
>  only need to use the ARP cache when you get a packet you don't
>  have to enforce stong timeouts.  Just as long as you don't use
>  a cache entry after it has expired.
>
>  .m
>
> > What if entries take anywhere from 15 to 30 seconds to clear?  Is that
too
> > much?
> >
> > Oded
> > >
> > >
> > >  Thats fine :)
> > >
> > >   .m
> > >
> > > >
> > > > What granularity should we enforce this timeout...
> > > >
> > > > in other words, some entries may take up to
> > > > 16 seconds to timeout (but no longer), is that ok
> > > >
> > > > --vishal
> > > >
> > > >
> > > >
> > >
> >
> >
> >
>


.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ICMP port unreach dump
Date: Sun, 1 Feb 2004 15:24:41 -0800
Lines: 35
Distribution: su
Message-ID: <Pine.GSO.4.44.0402011519170.4977-100000@elaine7.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075677888 10684 171.64.15.72 (1 Feb 2004 23:24:48 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5788

I've generated the following ICMP port unreachable:

15:12:09.936500 70:0:0:73:0:1 0:e0:81:4:26:d9 ip 90:
sidj-router-1.Stanford.EDU > elaine7.Stanford.EDU: icmp:
sidj-router-1.Stanford.EDU tcp port telnet unreachable for
elaine7.Stanford.EDU.37708 > sidj-router-1.Stanford.EDU.telnet: . [bad tcp
cksum af7a!] 100907902:100907930(28) win 0 (DF) [tos 0x10]  (ttl 61, id
56217, len 48, bad cksum 0!) (ttl 63, id 0, len 76)
                         4500 004c 0000 0000 3f01 8034 c0a8 804c
                         ab40 0f48 0303 0eb9 0000 0000 4510 0030
                         db99 4000 3d06 0000 ab40 0f48 c0a8 804c
                         934c 0017 0603 bb7e 0000 0000 0000 0000
                         0000 0000 0000 0000 0000 0000

First question: It is important to include the original IP checksum in the
data portion of the ICMP?

Next, why does tcpdump complain about the tcp checksum?  It is safe to
ignore this?

Here is the original IP packet for reference:

15:12:09.932938 0:e0:81:4:26:d9 70:0:0:73:0:1 ip 86:
elaine7.Stanford.EDU.37708 > sidj-router-1.Stanford.EDU.telnet: S [tcp sum
ok] 100907902:100907902(0) win 24820 <nop,nop,sackOK,mss 1460> (DF) [tos
0x10]  (ttl 61, id 56217, len 48)
                         4510 0030 db99 4000 3d06 66a1 ab40 0f48
                         c0a8 804c 934c 0017 0603 bb7e 0000 0000
                         7002 60f4 d1c8 0000 0101 0402 0204 05b4
                         0073 0000 0238 0000 0000 0002 ce58 0000
                         0000 0000 0000 0000

Thanks,
Barrett

.

Path: shelby.stanford.edu!firebird13.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ICMP checksum vs IP checksum
Date: Sun, 1 Feb 2004 15:49:33 -0800
Lines: 4
Distribution: su
Message-ID: <Pine.LNX.4.44.0402011547040.30441-100000@firebird13.Stanford.EDU>
NNTP-Posting-Host: firebird13.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075679374 12131 171.64.12.142 (1 Feb 2004 23:49:34 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5789

Just to verify that they are computed using the same checksum algorithm.

Thanks!

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: arp replies
Date: Sun, 1 Feb 2004 16:14:06 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.GSO.4.44.0402011612140.16396-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 1075680847 13677 171.64.15.100 (2 Feb 2004 00:14:07 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5790


for arp replies, can we just send it out on the same interface
the request came from, or do we have to look up next hop in routing table
and go from there?

--vishal

PS. sorry if someone already asked this question, i couldn't find it
though

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: network byte order checksum
Date: Sun, 1 Feb 2004 16:21:35 -0800
Lines: 5
Distribution: su
Message-ID: <bvk56i$dre$1@news.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1075681299 14190 128.12.90.43 (2 Feb 2004 00:21: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:5791

Just to confirm: if we use the algorithm given in the Peterson/Davie book to
calculate the checksum, the integer that we compute will already be in
network byte order?


.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: arp req & replies
Date: Sun, 1 Feb 2004 16:38:46 -0800
Lines: 17
Distribution: su
Message-ID: <bvk66p$eq3$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1075682329 15171 128.12.189.163 (2 Feb 2004 00:38: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:5792

Hi,
My program has 2 threads, one to invalidate the cache & the other which
periodically checks the arp queue.
My processing when i receive an arp reply is a part of my main program.
So what happens is that as soon as I receive an arp reply it is entered into
the cache.
But only when my thread wakes up periodically , it realises that now this
entry is present  in the cache and so sends the packet out.
this actally causes a little delay for the queued packet.As my thread wakes
up every second, the first time when I traceroute to my application servers,
the time returned  is almost 1 second while from the next time, since the
adddress is in the cache the time is of the order of a few milliseconds.
Is this delay fine?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!firebird13.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ICMP header and checksum
Date: Sun, 1 Feb 2004 16:41:46 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.LNX.4.44.0402011630200.30441-100000@firebird13.Stanford.EDU>
NNTP-Posting-Host: firebird13.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075682507 15417 171.64.12.142 (2 Feb 2004 00:41:47 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5793


Here what confuses me about the ICMP header and data seperation. I
thought the header only contains "type", "code" and "checksum". Whichever
type of ICMP message we compute checksum for, we compute simply over these
three fields with the checksum set to 0.

However, the packet formats (listed in networksourcery) for different
ICMP messages may contain different extra fields in the packet besides
the above three fields. For example, the packet format for ICMP reply has
two extra fields "identifier" and "sequence number", followed by "data".
So do I compute the checksum over five fields including these two?

If we look at other ICMP message such as Time exceeded or Port
unreachable, the packet formats are different and don't even denote any
"data" portion. So are we supposed to compute checksum over all the fields
here?

Thanks!

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ICMP echo request comes in a different interface
Date: Sun, 1 Feb 2004 16:43:08 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.GSO.4.44.0402011640360.10657-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 1075682590 15495 171.64.15.118 (2 Feb 2004 00:43:10 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5794


The topology is as following;

eth0: 192.168.128.241
eth1: 192.168.128.242
eth2: 192.168.128.244

If a ICMP echo request for 192.168.128.242 comes in from eth0 through the
firewall, what should I do with the message, drop it?

I think it was answered before.  I just could not seem to find the answer
any more.

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP port unreach dump
Date: Sun, 1 Feb 2004 16:58:41 -0800
Lines: 45
Distribution: su
Message-ID: <Pine.GSO.4.44.0402011656310.5683-100000@elaine3.Stanford.EDU>
References: <Pine.GSO.4.44.0402011519170.4977-100000@elaine7.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075683523 16509 171.64.15.68 (2 Feb 2004 00:58:43 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402011519170.4977-100000@elaine7.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5795

Answering yes to first question yielded no more complaining about the
second.  Apparently tcpdump likes to compute checksums on the embedded IP
header as well.

-Barrett

On Sun, 1 Feb 2004, Barrett Trask wrote:

> I've generated the following ICMP port unreachable:
>
> 15:12:09.936500 70:0:0:73:0:1 0:e0:81:4:26:d9 ip 90:
> sidj-router-1.Stanford.EDU > elaine7.Stanford.EDU: icmp:
> sidj-router-1.Stanford.EDU tcp port telnet unreachable for
> elaine7.Stanford.EDU.37708 > sidj-router-1.Stanford.EDU.telnet: . [bad tcp
> cksum af7a!] 100907902:100907930(28) win 0 (DF) [tos 0x10]  (ttl 61, id
> 56217, len 48, bad cksum 0!) (ttl 63, id 0, len 76)
>                          4500 004c 0000 0000 3f01 8034 c0a8 804c
>                          ab40 0f48 0303 0eb9 0000 0000 4510 0030
>                          db99 4000 3d06 0000 ab40 0f48 c0a8 804c
>                          934c 0017 0603 bb7e 0000 0000 0000 0000
>                          0000 0000 0000 0000 0000 0000
>
> First question: It is important to include the original IP checksum in the
> data portion of the ICMP?
>
> Next, why does tcpdump complain about the tcp checksum?  It is safe to
> ignore this?
>
> Here is the original IP packet for reference:
>
> 15:12:09.932938 0:e0:81:4:26:d9 70:0:0:73:0:1 ip 86:
> elaine7.Stanford.EDU.37708 > sidj-router-1.Stanford.EDU.telnet: S [tcp sum
> ok] 100907902:100907902(0) win 24820 <nop,nop,sackOK,mss 1460> (DF) [tos
> 0x10]  (ttl 61, id 56217, len 48)
>                          4510 0030 db99 4000 3d06 66a1 ab40 0f48
>                          c0a8 804c 934c 0017 0603 bb7e 0000 0000
>                          7002 60f4 d1c8 0000 0101 0402 0204 05b4
>                          0073 0000 0238 0000 0000 0002 ce58 0000
>                          0000 0000 0000 0000
>
> Thanks,
> Barrett
>
>

.

Path: shelby.stanford.edu!firebird13.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: fixed IP header size for ICMP packet
Date: Sun, 1 Feb 2004 18:12:57 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.LNX.4.44.0402011808250.31104-100000@firebird13.Stanford.EDU>
NNTP-Posting-Host: firebird13.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075687977 21331 171.64.12.142 (2 Feb 2004 02:12:57 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5796

Is is fine (or shall I get points off ) if I define IP header size as 20
bytes and use it to define the structs for generating ICMP messages which
need to embed IP headers?  Or shall I allocate more memory to a new ICMP
packet to commodate a possibly larger IP header? If so, how to decide the
right amount?

Thanks!

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: icmp echo src addr
Date: Mon, 02 Feb 2004 10:38:53 +0800
Lines: 36
Distribution: su
Message-ID: <401DB83D.BD10989B@leland.stanford.edu>
References: <bvjo6q$sva$1@news.Stanford.EDU> <Pine.LNX.4.44.0402011321580.23340-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075689568 23066 128.12.196.85 (2 Feb 2004 02:39:28 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:5797

Then how about traceroutes?

elaine25:~/cs244a> traceroute 192.168.129.222
traceroute to nickm-router-3.Stanford.EDU (192.168.129.222): 1-30 hops, 38 byte
packets
 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.825 ms  0.643 ms  0.400 ms
 2  171.64.1.44 (171.64.1.44)  0.507 ms  0.645 ms  0.446 ms
 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.464 ms (ttl=62!)  0.440 ms (ttl=
62!)  0.426 ms (ttl=62!)
 4  ftp-zacharym.Stanford.EDU (192.168.129.221)  0.653 ms  0.659 ms  0.910 ms

The reply comes from 192.168.129.221 as well. So are we correct to set the source
address of ICMP messages to address of the interface that the packet comes in (as
this seems to be what the reference router is doing).

Thanks,
Jimmy

Martin Casado wrote:

>  I've been able to find routers which behave both ways so either will be
>  accepted for grading.  Since the question had come up so much I thought
>  I'd point to the rfc.  The reference router should probably be updated
>  to support the rfc.
>
>  .m
>
> > according to the FYI you posted earlier, it seems that the reference router
> > contradicts this.  For example, when i ping one of the router's interfaces
> > (192.168.129.222), I receive replies from 192.168.129.221(which is the ip
> > for the departing interface) not 192.168.129.222 (the destination addr of
> > the echo request packet).  Is the FYI or the reference router correct?
> >
> >
> >

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Routing Table
Date: Sun, 1 Feb 2004 21:15:04 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0402012111370.3373-100000@Xenon.Stanford.EDU>
References: <401D7921.7B55ED6F@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075698906 4097 171.64.66.201 (2 Feb 2004 05:15:06 GMT)
X-Complaints-To: news@news.stanford.edu
To: Ryan <ryan05@stanford.edu>
In-Reply-To: <401D7921.7B55ED6F@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5798


> Am I correct in saying:
> 
> The following lines:
> 
> 172.24.74.213 172.24.74.213 255.255.255.255  eth1
> 
> means to get to 172.24.74.213 the next hop is 172.24.74.213 on eth1

 yup
 
> 
> and the following line:
> 172.24.74.213 0.0.0.0 255.255.255.255 eth1
> says 172.24.74.213 lies on eth so send directly to IP   (and in case of
> 1st entry being 172.24.74 this would have more significance)

 Yes, they are functionally equivalent in this case.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: granularity of 15 second arp cache timeout
Date: Sun, 1 Feb 2004 21:16:07 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0402012115080.3373-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0401311329390.2710-100000@elaine31.Stanford.EDU>
 <Pine.LNX.4.44.0401311339230.13633-100000@Xenon.Stanford.EDU>
 <bvjqem$25m$1@news.Stanford.EDU> <Pine.LNX.4.44.0402011337180.30836-100000@Xenon.Stanford.EDU>
 <bvk09p$8n5$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 1075698969 4164 171.64.66.201 (2 Feb 2004 05:16:09 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <bvk09p$8n5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5799


> I guess what I'm asking is can it expire between 15 and 30 seconds, or does
> it HAVE to expire in 15, so if a packet comes in at second 16 it's stale?
> 
> My thought is to have a thread wake up every 15 seconds and delete ARP cache
> entries that it saw the last time it was awake.

  Why not just timestamp every entry and not use entries that have expired?
  This will gaurontee you don't use stale entries and it doesn't require a
  thread.

  .m

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: fixed IP header size for ICMP packet
Date: Sun, 1 Feb 2004 21:18:00 -0800
Lines: 18
Distribution: su
Message-ID: <bvkmic$454$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0402011808250.31104-100000@firebird13.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1075699084 4260 128.12.90.43 (2 Feb 2004 05:18: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:5800

Since you're the one who is creating the packet, I don't think you need to
add any of the IP options or anything that would make the IP header larger
than 20 bytes.

-Eddy

"Yuhui Jin" <yhjin@stanford.edu> wrote in message
news:Pine.LNX.4.44.0402011808250.31104-100000@firebird13.Stanford.EDU...
> Is is fine (or shall I get points off ) if I define IP header size as 20
> bytes and use it to define the structs for generating ICMP messages which
> need to embed IP headers?  Or shall I allocate more memory to a new ICMP
> packet to commodate a possibly larger IP header? If so, how to decide the
> right amount?
>
> Thanks!
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ICMP port unreach dump
Date: Sun, 1 Feb 2004 21:19:01 -0800
Lines: 44
Distribution: su
Message-ID: <Pine.LNX.4.44.0402012116160.3373-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402011519170.4977-100000@elaine7.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075699143 4316 171.64.66.201 (2 Feb 2004 05:19:03 GMT)
X-Complaints-To: news@news.stanford.edu
To: Barrett Trask <btrask@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402011519170.4977-100000@elaine7.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5801


> I've generated the following ICMP port unreachable:
> 
> 15:12:09.936500 70:0:0:73:0:1 0:e0:81:4:26:d9 ip 90:
> sidj-router-1.Stanford.EDU > elaine7.Stanford.EDU: icmp:
> sidj-router-1.Stanford.EDU tcp port telnet unreachable for
> elaine7.Stanford.EDU.37708 > sidj-router-1.Stanford.EDU.telnet: . [bad tcp
> cksum af7a!] 100907902:100907930(28) win 0 (DF) [tos 0x10]  (ttl 61, id
> 56217, len 48, bad cksum 0!) (ttl 63, id 0, len 76)
>                          4500 004c 0000 0000 3f01 8034 c0a8 804c
>                          ab40 0f48 0303 0eb9 0000 0000 4510 0030
>                          db99 4000 3d06 0000 ab40 0f48 c0a8 804c
>                          934c 0017 0603 bb7e 0000 0000 0000 0000
>                          0000 0000 0000 0000 0000 0000
> 
> First question: It is important to include the original IP checksum in the
> data portion of the ICMP?

 Yes, why wouldn't you?

> Next, why does tcpdump complain about the tcp checksum?  It is safe to
> ignore this?

 I wouldn't think [tcp sum ok] is a complaint.

 .m

> Here is the original IP packet for reference:
> 
> 15:12:09.932938 0:e0:81:4:26:d9 70:0:0:73:0:1 ip 86:
> elaine7.Stanford.EDU.37708 > sidj-router-1.Stanford.EDU.telnet: S [tcp sum
> ok] 100907902:100907902(0) win 24820 <nop,nop,sackOK,mss 1460> (DF) [tos
> 0x10]  (ttl 61, id 56217, len 48)
>                          4510 0030 db99 4000 3d06 66a1 ab40 0f48
>                          c0a8 804c 934c 0017 0603 bb7e 0000 0000
>                          7002 60f4 d1c8 0000 0101 0402 0204 05b4
>                          0073 0000 0238 0000 0000 0002 ce58 0000
>                          0000 0000 0000 0000
> 
> Thanks,
> Barrett
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ICMP checksum vs IP checksum
Date: Sun, 1 Feb 2004 21:20:04 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0402012119360.3373-100000@Xenon.Stanford.EDU>
References: <Pine.LNX.4.44.0402011547040.30441-100000@firebird13.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075699206 4431 171.64.66.201 (2 Feb 2004 05:20:06 GMT)
X-Complaints-To: news@news.stanford.edu
To: Yuhui Jin <yhjin@stanford.edu>
In-Reply-To: <Pine.LNX.4.44.0402011547040.30441-100000@firebird13.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5802


 This is clearly stated both on network sorcery and the rfcs

 .m

> Just to verify that they are computed using the same checksum algorithm.
> 
> Thanks!
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: arp replies
Date: Sun, 1 Feb 2004 21:25:55 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0402012120100.3373-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402011612140.16396-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 1075699557 4796 171.64.66.201 (2 Feb 2004 05:25:57 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402011612140.16396-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5803


 The answer to this is self evident, consider the nature of routing vs. arp.

 .m


> for arp replies, can we just send it out on the same interface
> the request came from, or do we have to look up next hop in routing table
> and go from there?
> 
> --vishal
> 
> PS. sorry if someone already asked this question, i couldn't find it
> though
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: network byte order checksum
Date: Sun, 1 Feb 2004 21:27:22 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0402012126040.3373-100000@Xenon.Stanford.EDU>
References: <bvk56i$dre$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 1075699644 4907 171.64.66.201 (2 Feb 2004 05:27:24 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <bvk56i$dre$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5804


  Not necessarily, the algorithm is independant of byte ordering.

  .m

> Just to confirm: if we use the algorithm given in the Peterson/Davie book to
> calculate the checksum, the integer that we compute will already be in
> network byte order?
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: arp req & replies
Date: Sun, 1 Feb 2004 21:30:58 -0800
Lines: 22
Distribution: su
Message-ID: <Pine.LNX.4.44.0402012127290.3373-100000@Xenon.Stanford.EDU>
References: <bvk66p$eq3$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 1075699860 5149 171.64.66.201 (2 Feb 2004 05:31:00 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bvk66p$eq3$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5805


> Hi,
> My program has 2 threads, one to invalidate the cache & the other which
> periodically checks the arp queue.
> My processing when i receive an arp reply is a part of my main program.
> So what happens is that as soon as I receive an arp reply it is entered into
> the cache.
> But only when my thread wakes up periodically , it realises that now this
> entry is present  in the cache and so sends the packet out.
> this actally causes a little delay for the queued packet.As my thread wakes
> up every second, the first time when I traceroute to my application servers,
> the time returned  is almost 1 second while from the next time, since the
> adddress is in the cache the time is of the order of a few milliseconds.
> Is this delay fine?

 It seems a bit unnecessary.  There is not reason to have a thread handle
 the ARP cache since the only time a cache entry is significant is when
 you are going to use it.  Why not service the arp queue whenever an
 arp reply comes in?

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: network byte order checksum
Date: Sun, 1 Feb 2004 21:31:05 -0800
Lines: 22
Distribution: su
Message-ID: <bvknat$516$1@news.Stanford.EDU>
References: <bvk56i$dre$1@news.Stanford.EDU> <Pine.LNX.4.44.0402012126040.3373-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1075699870 5158 128.12.90.43 (2 Feb 2004 05:31: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:5806

But if we compute it over a header that is in network byte order, the sum
will be in network byte order?

-Eddy

"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0402012126040.3373-100000@Xenon.Stanford.EDU...
>
>   Not necessarily, the algorithm is independant of byte ordering.
>
>   .m
>
> > Just to confirm: if we use the algorithm given in the Peterson/Davie
book to
> > calculate the checksum, the integer that we compute will already be in
> > network byte order?
> >
> >
> >
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ICMP header and checksum
Date: Sun, 1 Feb 2004 21:31:51 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.LNX.4.44.0402012131060.3373-100000@Xenon.Stanford.EDU>
References: <Pine.LNX.4.44.0402011630200.30441-100000@firebird13.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075699913 5230 171.64.66.201 (2 Feb 2004 05:31:53 GMT)
X-Complaints-To: news@news.stanford.edu
To: Yuhui Jin <yhjin@stanford.edu>
In-Reply-To: <Pine.LNX.4.44.0402011630200.30441-100000@firebird13.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5807


> 
> Here what confuses me about the ICMP header and data seperation. I
> thought the header only contains "type", "code" and "checksum". Whichever
> type of ICMP message we compute checksum for, we compute simply over these
> three fields with the checksum set to 0.
> 
> However, the packet formats (listed in networksourcery) for different
> ICMP messages may contain different extra fields in the packet besides
> the above three fields. For example, the packet format for ICMP reply has
> two extra fields "identifier" and "sequence number", followed by "data".
> So do I compute the checksum over five fields including these two?
> 
> If we look at other ICMP message such as Time exceeded or Port
> unreachable, the packet formats are different and don't even denote any
> "data" portion. So are we supposed to compute checksum over all the fields
> here?

 You compute the checksum over the full icmp header (which depends on the icmp
 type)

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ICMP echo request comes in a different interface
Date: Sun, 1 Feb 2004 21:32:16 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.LNX.4.44.0402012132040.3373-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402011640360.10657-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 1075699938 5241 171.64.66.201 (2 Feb 2004 05:32:18 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402011640360.10657-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5808


> 
> The topology is as following;
> 
> eth0: 192.168.128.241
> eth1: 192.168.128.242
> eth2: 192.168.128.244
> 
> If a ICMP echo request for 192.168.128.242 comes in from eth0 through the
> firewall, what should I do with the message, drop it?
 
 no.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: fixed IP header size for ICMP packet
Date: Sun, 1 Feb 2004 21:33:40 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0402012133020.3373-100000@Xenon.Stanford.EDU>
References: <Pine.LNX.4.44.0402011808250.31104-100000@firebird13.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075700024 5332 171.64.66.201 (2 Feb 2004 05:33:44 GMT)
X-Complaints-To: news@news.stanford.edu
To: Yuhui Jin <yhjin@stanford.edu>
In-Reply-To: <Pine.LNX.4.44.0402011808250.31104-100000@firebird13.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5809



 As long as you don't crash on a large IP header size.. it is OK.  How
 you handle it is your choice.

 .m

> Is is fine (or shall I get points off ) if I define IP header size as 20
> bytes and use it to define the structs for generating ICMP messages which
> need to embed IP headers?  Or shall I allocate more memory to a new ICMP
> packet to commodate a possibly larger IP header? If so, how to decide the
> right amount?
> 
> Thanks!
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: icmp echo src addr
Date: Sun, 1 Feb 2004 21:34:34 -0800
Lines: 43
Distribution: su
Message-ID: <Pine.LNX.4.44.0402012133590.3373-100000@Xenon.Stanford.EDU>
References: <bvjo6q$sva$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0402011321580.23340-100000@Xenon.Stanford.EDU>
 <401DB83D.BD10989B@leland.stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075700074 5400 171.64.66.201 (2 Feb 2004 05:34:34 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jimmy Pang <hcpang@leland.stanford.edu>
In-Reply-To: <401DB83D.BD10989B@leland.stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5810


 In this case it should be the ip of the outgoing interface.

 .m

> Then how about traceroutes?
> 
> elaine25:~/cs244a> traceroute 192.168.129.222
> traceroute to nickm-router-3.Stanford.EDU (192.168.129.222): 1-30 hops, 38 byte
> packets
>  1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.825 ms  0.643 ms  0.400 ms
>  2  171.64.1.44 (171.64.1.44)  0.507 ms  0.645 ms  0.446 ms
>  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.464 ms (ttl=62!)  0.440 ms (ttl=
> 62!)  0.426 ms (ttl=62!)
>  4  ftp-zacharym.Stanford.EDU (192.168.129.221)  0.653 ms  0.659 ms  0.910 ms
> 
> The reply comes from 192.168.129.221 as well. So are we correct to set the source
> address of ICMP messages to address of the interface that the packet comes in (as
> this seems to be what the reference router is doing).
> 
> Thanks,
> Jimmy
> 
> Martin Casado wrote:
> 
> >  I've been able to find routers which behave both ways so either will be
> >  accepted for grading.  Since the question had come up so much I thought
> >  I'd point to the rfc.  The reference router should probably be updated
> >  to support the rfc.
> >
> >  .m
> >
> > > according to the FYI you posted earlier, it seems that the reference router
> > > contradicts this.  For example, when i ping one of the router's interfaces
> > > (192.168.129.222), I receive replies from 192.168.129.221(which is the ip
> > > for the departing interface) not 192.168.129.222 (the destination addr of
> > > the echo request packet).  Is the FYI or the reference router correct?
> > >
> > >
> > >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS2 Q6
Date: Sun, 1 Feb 2004 21:38:22 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.LNX.4.44.0402012135460.3373-100000@Xenon.Stanford.EDU>
References: <bvjsv7$4l3$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 1075700303 5668 171.64.66.201 (2 Feb 2004 05:38:23 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <bvjsv7$4l3$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5811


> Part b: Does "ten packets per query" refer to the -q option?

 yes
 
> Part c: Do we use www.cam.ac.uk for Cambridge University? 

 sure

And is the distance to Cambridge calculated by comparing the number 
> of hops to those in part a (to UCLA) or b (to Wilson Sonsini)?

 no, try and use latency as a first order approcimation of distance.

 .m
 
 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: network byte order checksum
Date: Sun, 1 Feb 2004 21:39:22 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.LNX.4.44.0402012139040.13031-100000@Xenon.Stanford.EDU>
References: <bvk56i$dre$1@news.Stanford.EDU> <Pine.LNX.4.44.0402012126040.3373-100000@Xenon.Stanford.EDU>
 <bvknat$516$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 1075700364 5715 171.64.66.201 (2 Feb 2004 05:39:24 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <bvknat$516$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5812


 yes :)
 .m

> But if we compute it over a header that is in network byte order, the sum
> will be in network byte order?
> 
> -Eddy
> 
> "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> news:Pine.LNX.4.44.0402012126040.3373-100000@Xenon.Stanford.EDU...
> >
> >   Not necessarily, the algorithm is independant of byte ordering.
> >
> >   .m
> >
> > > Just to confirm: if we use the algorithm given in the Peterson/Davie
> book to
> > > calculate the checksum, the integer that we compute will already be in
> > > network byte order?
> > >
> > >
> > >
> >
> 
> 
> 

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: UMR and ABR in stub code
Date: Sun, 1 Feb 2004 22:48:37 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0402012244180.20953-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 1075704519 10463 171.64.15.118 (2 Feb 2004 06:48:39 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5813


When I ran sr.purify, I saw
(1) UMR  in sr_log_packet(), the memory is allocated in sr_read_from_server
(2) ABR in sf_write_header.

Since these are the origianl stub code, am I responsbile for that?


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: UMR and ABR in stub code
Date: Sun, 1 Feb 2004 23:06:18 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0402012305010.5589-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402012244180.20953-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 1075705580 11563 171.64.66.201 (2 Feb 2004 07:06:20 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402012244180.20953-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5814


 sr_dumper had some problems.  William submitted a patch which I posted.

 You certainly are not responsible for those.

 .m

> 
> When I ran sr.purify, I saw
> (1) UMR  in sr_log_packet(), the memory is allocated in sr_read_from_server
> (2) ABR in sf_write_header.
> 
> Since these are the origianl stub code, am I responsbile for that?
> 
> 
> 

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: router disappeared in the traceroute
Date: Sun, 1 Feb 2004 23:08:30 -0800
Lines: 34
Distribution: su
Message-ID: <Pine.GSO.4.44.0402012304430.21443-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 1075705712 11684 171.64.15.118 (2 Feb 2004 07:08:32 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5815


In my topology, application server (192.168.128.243" is hangin go off
"eth1" interface (192.168.128.242),

When I traceroute "192.168.128.24", I can see my router:

====
traceroute 192.168.128.244
traceroute to www-shepard8.Stanford.EDU (192.168.128.244): 1-30 hops, 38
byte packets
 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.651 ms  0.381 ms  0.362 ms
 2  Gates-rtr.Stanford.EDU (171.64.1.178)  0.493 ms  0.418 ms  0.419 ms
 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.451 ms (ttl=62!)  0.411 ms
(ttl=62!)  0.388 ms (ttl=62!)
 4  www-shepard8.Stanford.EDU (192.168.128.244)  10.7 ms (ttl=61!)  5.25
ms (ttl=61!)  5.25 ms (ttl=61!)
====

When I traceroute "192.168.128.243", my router disappears.

====
> traceroute 192.168.128.243
traceroute to shepard8-router-2.Stanford.EDU (192.168.128.243): 1-30 hops,
38 byte packets
 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.656 ms  0.386 ms  0.376 ms
 2  Gates-rtr.Stanford.EDU (171.64.1.178)  0.553 ms  0.457 ms  0.455 ms
 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.451 ms (ttl=62!)  0.422 ms
(ttl=62!)  0.424 ms (ttl=62!)
 4  shepard8-router-2.Stanford.EDU (192.168.128.243)  88.9 ms (ttl=61!) !A
4.12 ms (ttl=61!) !A  4.35 ms (ttl=61!) !A

====
Is this expected behavior?

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: router disappeared in the traceroute
Date: Sun, 1 Feb 2004 23:11:56 -0800
Lines: 42
Distribution: su
Message-ID: <Pine.LNX.4.44.0402012311220.9878-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402012304430.21443-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 1075705918 11976 171.64.66.201 (2 Feb 2004 07:11:58 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402012304430.21443-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5816



> 
> In my topology, application server (192.168.128.243" is hangin go off
> "eth1" interface (192.168.128.242),
> 
> When I traceroute "192.168.128.24", I can see my router:
> 
> ====
> traceroute 192.168.128.244
> traceroute to www-shepard8.Stanford.EDU (192.168.128.244): 1-30 hops, 38
> byte packets
>  1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.651 ms  0.381 ms  0.362 ms
>  2  Gates-rtr.Stanford.EDU (171.64.1.178)  0.493 ms  0.418 ms  0.419 ms
>  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.451 ms (ttl=62!)  0.411 ms
> (ttl=62!)  0.388 ms (ttl=62!)
>  4  www-shepard8.Stanford.EDU (192.168.128.244)  10.7 ms (ttl=61!)  5.25
> ms (ttl=61!)  5.25 ms (ttl=61!)
> ====
> 
> When I traceroute "192.168.128.243", my router disappears.

 No this is not the correct behavior.

 .m
 
> ====
> > traceroute 192.168.128.243
> traceroute to shepard8-router-2.Stanford.EDU (192.168.128.243): 1-30 hops,
> 38 byte packets
>  1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.656 ms  0.386 ms  0.376 ms
>  2  Gates-rtr.Stanford.EDU (171.64.1.178)  0.553 ms  0.457 ms  0.455 ms
>  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.451 ms (ttl=62!)  0.422 ms
> (ttl=62!)  0.424 ms (ttl=62!)
>  4  shepard8-router-2.Stanford.EDU (192.168.128.243)  88.9 ms (ttl=61!) !A
> 4.12 ms (ttl=61!) !A  4.35 ms (ttl=61!) !A
> 
> ====
> Is this expected behavior?
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: IP Header Checksum
Date: Sun, 01 Feb 2004 23:31:04 -0800
Lines: 5
Distribution: su
Message-ID: <401DFCB8.180E7DDB@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075707065 12983 128.12.21.88 (2 Feb 2004 07:31:05 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:5817

If the IP header checksum fails, that ip header is invalid (error
occured). So we would want to send a host unreachable message, but the
header is invalid and so the source address may be invalid.  Do we drop
the packet or do nothing?  Try to send an error message?

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Reference route problem
Date: Mon, 2 Feb 2004 00:01:15 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.GSO.4.44.0402012359190.21470-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 1075708877 15568 171.64.15.118 (2 Feb 2004 08:01:17 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5818


Problem with the reference route:

When I tried "traceout traceroute 192.168.129.222", the last line does not
show 192.168.129.222.  Is this correct?

elaine43:~/cs244/hw2> traceroute 192.168.129.222
traceroute to nickm-router-3.Stanford.EDU (192.168.129.222): 1-30 hops, 38
byte packets
 1  sweet-rtr.Stanford.EDU (171.64.15.97)  1.12 ms  0.504 ms  0.457 ms
 2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.587 ms  0.720 ms  0.476 ms
 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.536 ms (ttl=62!)  0.551 ms
(ttl=62!)  0.502 ms (ttl=62!)
 4  ftp-zacharym.Stanford.EDU (192.168.129.221)  0.909 ms  0.609 ms  0.604
ms


.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: FTP problem: any hint?
Date: Mon, 2 Feb 2004 00:24:08 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.GSO.4.44.0402020017560.23035-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 1075710250 17648 171.64.15.118 (2 Feb 2004 08:24:10 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5819


I tried to ftp files from 192.168.128.243 and 192.168.128.245.  For the
files in 192.168.128.245/pub, they were downloaded properly.

For 192.168.128.243/pub, "congrat.jpg" was downloaded properly. However,
with file "sbnatan.mp3", I had some trouble.  The ftp program tells me
that:

===
ftp> get sbnatan.mp3
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for sbnatan.mp3 (1342903 bytes).
226 File send OK.
local: sbnatan.mp3 remote: sbnatan.mp3
1342903 bytes received in 27 seconds (49.44 Kbytes/s)
====

However, when I check the downloaded file size, it is only 1342870 bytes,
which is 33-byte shorter than ftp claimed to transfer.

Any hint on what could be wrong?

-Laura

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Route Table: Collision Domain
Date: Mon, 2 Feb 2004 00:55:44 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.GSO.4.44.0402020052240.22052-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 1075712146 19566 171.64.15.118 (2 Feb 2004 08:55:46 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5820


As specified in the FAQ;

" Routes where the next hop is '0.0.0.0' which denotes that all matches to
this route lie in the collision domain of the interface associated with
the route. In this case, the next hop is the destination address of the IP
packet.".

I assume the entry in the route table is:

192.168.128.0 0.0.0.0 255.255.255.0 eth??

In this case, what should be the outgoing interface then?


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: IP Header Checksum
Date: Mon, 2 Feb 2004 08:28:56 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0402020826530.23130-100000@Xenon.Stanford.EDU>
References: <401DFCB8.180E7DDB@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075739338 18646 171.64.66.201 (2 Feb 2004 16:28:58 GMT)
X-Complaints-To: news@news.stanford.edu
To: Ryan <ryan05@stanford.edu>
In-Reply-To: <401DFCB8.180E7DDB@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5821


 You don't send a response to packets with bad headers, you shouldn't
 forward them either.

 .m

> If the IP header checksum fails, that ip header is invalid (error
> occured). So we would want to send a host unreachable message, but the
> header is invalid and so the source address may be invalid.  Do we drop
> the packet or do nothing?  Try to send an error message?
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Reference route problem
Date: Mon, 2 Feb 2004 08:29:24 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.LNX.4.44.0402020829070.23130-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402012359190.21470-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 1075739367 18669 171.64.66.201 (2 Feb 2004 16:29:27 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402012359190.21470-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5822


> 
> Problem with the reference route:
> 
> When I tried "traceout traceroute 192.168.129.222", the last line does not
> show 192.168.129.222.  Is this correct?

 yes

 .m
 
> elaine43:~/cs244/hw2> traceroute 192.168.129.222
> traceroute to nickm-router-3.Stanford.EDU (192.168.129.222): 1-30 hops, 38
> byte packets
>  1  sweet-rtr.Stanford.EDU (171.64.15.97)  1.12 ms  0.504 ms  0.457 ms
>  2  Gates-rtr.Stanford.EDU (171.64.1.44)  0.587 ms  0.720 ms  0.476 ms
>  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.536 ms (ttl=62!)  0.551 ms
> (ttl=62!)  0.502 ms (ttl=62!)
>  4  ftp-zacharym.Stanford.EDU (192.168.129.221)  0.909 ms  0.609 ms  0.604
> ms
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Route Table: Collision Domain
Date: Mon, 2 Feb 2004 08:30:40 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.LNX.4.44.0402020830310.23130-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402020052240.22052-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 1075739441 18820 171.64.66.201 (2 Feb 2004 16:30:41 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402020052240.22052-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5823

On Mon, 2 Feb 2004, Xiaohua Fang wrote:

> 
> As specified in the FAQ;
> 
> " Routes where the next hop is '0.0.0.0' which denotes that all matches to
> this route lie in the collision domain of the interface associated with
> the route. In this case, the next hop is the destination address of the IP
> packet.".
> 
> I assume the entry in the route table is:
> 
> 192.168.128.0 0.0.0.0 255.255.255.0 eth??
> 
> In this case, what should be the outgoing interface then?

 eth??

  .m

.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: recursive mutex
Date: Mon, 2 Feb 2004 08:46:52 -0800
Lines: 31
Distribution: su
Message-ID: <Pine.GSO.4.44.0402020844380.13926-100000@epic6.Stanford.EDU>
References: <Pine.GSO.4.44.0402011154140.15382-100000@epic9.Stanford.EDU>
NNTP-Posting-Host: epic6.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075740414 20275 171.64.15.39 (2 Feb 2004 16:46:54 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402011154140.15382-100000@epic9.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5824

For those interested in using recursive mutex,
the problem with the code below is a lack of
one more function.  Here's the full init sequence...

rc = pthread_mutexattr_init(&attr); /* THIS CALL IS BADLY NEEDED */
if (rc == 0) rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
if (rc == 0) rc = pthread_mutex_init(&sr->lock, &attr);

Boris.

On Sun, 1 Feb 2004, Boris Senderzon wrote:

> I wanted to use recursive option of the mutex.
> That is if a thread already holds a lock and I call
> a function that takes a lock as well, I don't want it
> to block because of two mutex_lock calls.  According
> to man pages, this should work but it does not.
> I'm forced to put down lock, call function, then
> reaquire the lock.
>
> here is my call sequence:
>
>     rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
>     if (rc >= 0) rc = pthread_mutex_init(&sr->lock, &attr);
>
> Is this wrong?
>
> Thanks, Boris.
>
>

.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Router print outs
Date: Mon, 2 Feb 2004 08:50:08 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0402020846550.13926-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 1075740609 20509 171.64.15.39 (2 Feb 2004 16:50:09 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5825

Am I correct to assume that no explicit print outs from our
router are required.  You'll be able to determine its functinality
using tcmpdump or something similar.  That includes cache invalidation
(new ARP request from our router will commence) and failure to receive
ARP reply (request sent again or ICMP host unreachable is generated).

Thanks.

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: IP Header Checksum
Date: Mon, 02 Feb 2004 08:49:26 -0800
Lines: 9
Distribution: su
Message-ID: <bvlv88$b44$1@news.Stanford.EDU>
References: <401DFCB8.180E7DDB@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075740744 11396 127.0.0.1 (2 Feb 2004 16:52:24 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4
X-Accept-Language: en-us, en
In-Reply-To: <401DFCB8.180E7DDB@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5826

I think the router rfc 1812 says, on ip version != 4, too short header 
len, or checksum failure, to just drop the packet.

Ryan wrote:
> If the IP header checksum fails, that ip header is invalid (error
> occured). So we would want to send a host unreachable message, but the
> header is invalid and so the source address may be invalid.  Do we drop
> the packet or do nothing?  Try to send an error message?
> 
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Router print outs
Date: Mon, 2 Feb 2004 09:27:40 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0402020925180.14662-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402020846550.13926-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 1075742862 23406 171.64.66.201 (2 Feb 2004 17:27:42 GMT)
X-Complaints-To: news@news.stanford.edu
To: Boris Senderzon <senderzo@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402020846550.13926-100000@epic6.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5827


> Am I correct to assume that no explicit print outs from our
> router are required.  You'll be able to determine its functinality
> using tcmpdump or something similar.  That includes cache invalidation
> (new ARP request from our router will commence) and failure to receive
> ARP reply (request sent again or ICMP host unreachable is generated).

 Exactly right.  

 .m

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: FAQ Hw2 - #17
Date: Mon, 2 Feb 2004 10:23:55 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.GSO.4.44.0402021018390.8619-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 1075746238 27544 171.64.15.100 (2 Feb 2004 18:23:58 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5828


it says discard packets w/ negative size...but the parameter
coming into sr_handlepacket is an unsigned int, so this will never
be the case.

Also, drop packets  if len > MTU..which for this assignment, we
have put a value of 1500, however, when I do ftp some "large" files,
I receive packets of size 1514, so I'm guessing the actual statement
should be len > MTU + 14 /* size of ethernet header */

--vishal


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: FAQ Hw2 - #17
Date: Mon, 2 Feb 2004 11:14:06 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.LNX.4.44.0402021106080.23502-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402021018390.8619-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 1075749247 1840 171.64.66.201 (2 Feb 2004 19:14:07 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402021018390.8619-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5829


> 
> it says discard packets w/ negative size...but the parameter
> coming into sr_handlepacket is an unsigned int, so this will never
> be the case.
 
  Yeah, that is silly and doesn't make sense. Thanks for pointing that
  out.

> Also, drop packets  if len > MTU..which for this assignment, we
> have put a value of 1500, however, when I do ftp some "large" files,
> I receive packets of size 1514, so I'm guessing the actual statement
> should be len > MTU + 14 /* size of ethernet header */

 This is referring to the IP length.  I agree that it is poorly worded.

 Thanks again.

 .m

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Route Table: Collision Domain
Date: Mon, 2 Feb 2004 12:39:31 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.GSO.4.44.0402021238440.2600-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0402020052240.22052-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0402020830310.23130-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 1075754372 8253 171.64.15.118 (2 Feb 2004 20:39:32 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0402020830310.23130-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5830


My question is really which ethernet interface should be put at the end of
entry.

On Mon, 2 Feb 2004, Martin Casado wrote:

> On Mon, 2 Feb 2004, Xiaohua Fang wrote:
>
> >
> > As specified in the FAQ;
> >
> > " Routes where the next hop is '0.0.0.0' which denotes that all matches to
> > this route lie in the collision domain of the interface associated with
> > the route. In this case, the next hop is the destination address of the IP
> > packet.".
> >
> > I assume the entry in the route table is:
> >
> > 192.168.128.0 0.0.0.0 255.255.255.0 eth??
> >
> > In this case, what should be the outgoing interface then?
>
>  eth??
>
>   .m
>
>

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Route Table: Collision Domain
Date: Mon, 2 Feb 2004 12:52:14 -0800
Lines: 37
Distribution: su
Message-ID: <Pine.LNX.4.44.0402021251080.2514-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402020052240.22052-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0402020830310.23130-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402021238440.2600-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 1075755136 9202 171.64.66.201 (2 Feb 2004 20:52:16 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402021238440.2600-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5831



 This depends on the topology.  Whichever interface is on the 192.168.128.0
 subnet.  

 .m

> 
> My question is really which ethernet interface should be put at the end of
> entry.
> 
> On Mon, 2 Feb 2004, Martin Casado wrote:
> 
> > On Mon, 2 Feb 2004, Xiaohua Fang wrote:
> >
> > >
> > > As specified in the FAQ;
> > >
> > > " Routes where the next hop is '0.0.0.0' which denotes that all matches to
> > > this route lie in the collision domain of the interface associated with
> > > the route. In this case, the next hop is the destination address of the IP
> > > packet.".
> > >
> > > I assume the entry in the route table is:
> > >
> > > 192.168.128.0 0.0.0.0 255.255.255.0 eth??
> > >
> > > In this case, what should be the outgoing interface then?
> >
> >  eth??
> >
> >   .m
> >
> >
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Kirk Shimano <kshimano@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ICMP echo to eth1 and eth2
Date: Mon, 02 Feb 2004 13:07:14 -0800
Lines: 14
Distribution: su
Message-ID: <bvme63$a3i$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 1075756035 10354 128.12.41.60 (2 Feb 2004 21:07:15 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:5832

In a previous post, it was mentioned that it is an error to service an 
ARP from an interface other than the one it came in on. Does the same 
apply for ICMP requests?

For instance, if I try to ping the eth1 address, my router will receive 
an ICMP echo request whose destination is the IP address of eth1. 
However, this ICMP will arrive on the eth0 interface. Is it correct for 
me to send an ICMP echo reply back out of eth0? Otherwise, it doesn't 
seem like I'll be able to respond to ping requests on all interfaces...

Thanks!

-Kirk

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ICMP echo to eth1 and eth2
Date: Mon, 2 Feb 2004 14:11:57 -0800
Lines: 22
Distribution: su
Message-ID: <Pine.LNX.4.44.0402021401460.1832-100000@Xenon.Stanford.EDU>
References: <bvme63$a3i$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 1075759918 15661 171.64.66.201 (2 Feb 2004 22:11:58 GMT)
X-Complaints-To: news@news.stanford.edu
To: Kirk Shimano <kshimano@stanford.edu>
In-Reply-To: <bvme63$a3i$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5833


> In a previous post, it was mentioned that it is an error to service an 
> ARP from an interface other than the one it came in on. Does the same 
> apply for ICMP requests?

 Nope.  It seems people are having a hard time understanding the fundamental
 differences between ARP and IP packets.  ARP packets are not routed, they are
 simply a mechanism for pairing an IP with a MAC address on a shared collision
 domain.  ARP uses hardware addressing, that is one interface talking to
 another, this connectivity is governed (normally) by hardware.  There is no
 notion of a 'next hop' for ARP packets (this gets blurred in the case of
 proxy arp but that aside..).

 IP packets on the other hand are routed across a virtual topology governed
 by the routing table.  Therefore, all IP packets should consult the routing
 table before exiting the router.

 Remember, you can always check the reference router's behaviour with regards
 to these questions.

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: "Ayaz" <ayaz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: arp negotiation not fast enough?
Date: Mon, 2 Feb 2004 14:54:56 -0800
Lines: 24
Distribution: su
Message-ID: <bvmkg6$ic6$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075762504 18822 127.0.0.1 (2 Feb 2004 22:55:04 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
Xref: shelby.stanford.edu su.class.cs244a:5834

When I ping one of the application servers for the first time, my router has
to ARP the app server for its mac address. Then it can forward the ICMP
request to the app server. However, by the time this arp negotiation is done
and the ICMP request is forwarded to server, its too late. One second has
passed and ping outputs "no reply" as seen below. The same happens when the
ARP entry times out and I have to send another ARP Request to update my arp
cache. Are others seeing this too?

>ping 192.168.128.140
PING www-eogren.Stanford.EDU (192.168.128.140): 56 data bytes
no reply from www-eogren.Stanford.EDU within 1 sec
64 bytes from www-eogren.Stanford.EDU (192.168.128.140): seq=1 ttl=61
time=5.38 ms.
64 bytes from www-eogren.Stanford.EDU (192.168.128.140): seq=2 ttl=61
time=5.29 ms.
64 bytes from www-eogren.Stanford.EDU (192.168.128.140): seq=3 ttl=61
time=5.26 ms.
64 bytes from www-eogren.Stanford.EDU (192.168.128.140): seq=4 ttl=61
time=5.27 ms.
64 bytes from www-eogren.Stanford.EDU (192.168.128.140): seq=5 ttl=61
time=5.22 ms.



.

Path: shelby.stanford.edu!epic15.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: purify and signals
Date: Mon, 2 Feb 2004 15:14:05 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.GSO.4.44.0402021510260.3441-100000@epic15.Stanford.EDU>
NNTP-Posting-Host: epic15.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075763666 20440 171.64.15.48 (2 Feb 2004 23:14:26 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5835

When I run the purify'd sr, I have to ^C to exit the router.  This causes
purify to catch the SIGINT and halt analysis.  How can we get a full
report (with memory leak analysis as well...)?

This is the end of my purify.output:

****  Purify instrumented sr.purify (pid 3388)  ****
SIG: Signal handled:
  * This is occurring while in:
        *unknown func* [pc=0x889f4]
        sr_read_from_server [sr_vns_comm.c:210]
        main           [sr_main.c:146]
        _start         [crt1.o]
  * Received signal 2 (SIGINT - Interrupt)
  * Signal mask: (SIGINT)
  * Pending signals:

Thanks,
Barrett

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: purify and signals
Date: Mon, 2 Feb 2004 15:28:32 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.LNX.4.44.0402021526470.3113-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402021510260.3441-100000@epic15.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075764514 21540 171.64.66.201 (2 Feb 2004 23:28:34 GMT)
X-Complaints-To: news@news.stanford.edu
To: Barrett Trask <btrask@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402021510260.3441-100000@epic15.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5836


 Easiest way I've found is to register a signal handler for SIGHUP that
 exits then kill -s HUP <pid>.

 There may be an easier way I don't know about however.

 .m

> When I run the purify'd sr, I have to ^C to exit the router.  This causes
> purify to catch the SIGINT and halt analysis.  How can we get a full
> report (with memory leak analysis as well...)?
> 
> This is the end of my purify.output:
> 
> ****  Purify instrumented sr.purify (pid 3388)  ****
> SIG: Signal handled:
>   * This is occurring while in:
>         *unknown func* [pc=0x889f4]
>         sr_read_from_server [sr_vns_comm.c:210]
>         main           [sr_main.c:146]
>         _start         [crt1.o]
>   * Received signal 2 (SIGINT - Interrupt)
>   * Signal mask: (SIGINT)
>   * Pending signals:
> 
> Thanks,
> Barrett
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP through different interface
Date: Mon, 2 Feb 2004 15:47:06 -0800
Lines: 19
Distribution: su
Message-ID: <bvmnhh$mcv$1@news.Stanford.EDU>
References: <bv92tl$6a0$1@news.Stanford.EDU> <Pine.LNX.4.44.0401281308490.31625-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0401281612270.24565-100000@elaine31.Stanford.EDU> <Pine.LNX.4.44.0401281735120.25439-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0401281804300.29076-100000@elaine31.Stanford.EDU> <Pine.LNX.4.44.0401281913300.25487-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0401281944100.21227-100000@fable5.Stanford.EDU> <Pine.LNX.4.44.0401290225400.12270-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1075765617 22943 128.12.61.97 (2 Feb 2004 23:46: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:5837

I'm confused as to what the final verdict here was.
If I receive over eth0 (192.168.129.131) an ICMP packet destined for
192.168.129.132 (eth1), do I need to forward it to eth1, or just service it
immediately.

Sounds like you are saying the interface isn't important, so just service it
immediately.  Is that right?

Oded

> > To check if a packet is meant for the router, do I just iterate through
> > all interfaces and check if the dest of the packet matches one of them?
>
>  yup.
>
>  .m
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Cynthia Lau" <cindabin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: arp request timeouts?
Date: Mon, 2 Feb 2004 16:54:23 -0800
Lines: 9
Distribution: su
Message-ID: <bvmrg0$rf9$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-36725.stanford.edu
X-Trace: news.Stanford.EDU 1075769664 28137 128.12.196.60 (3 Feb 2004 00:54: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:5838

Hi,

I'm still unclear as to how long we should wait after sending an ARP request
before resending.  Someone posted a while back, saying it was 200 - 500
milliseconds--where did these numbers come from?

-Cynthia


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ICMP through different interface
Date: Mon, 2 Feb 2004 17:05:52 -0800
Lines: 35
Distribution: su
Message-ID: <Pine.LNX.4.44.0402021703090.18131-100000@Xenon.Stanford.EDU>
References: <bv92tl$6a0$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0401281308490.31625-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401281612270.24565-100000@elaine31.Stanford.EDU>
 <Pine.LNX.4.44.0401281735120.25439-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401281804300.29076-100000@elaine31.Stanford.EDU>
 <Pine.LNX.4.44.0401281913300.25487-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0401281944100.21227-100000@fable5.Stanford.EDU>
 <Pine.LNX.4.44.0401290225400.12270-100000@Xenon.Stanford.EDU>
 <bvmnhh$mcv$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 1075770353 29012 171.64.66.201 (3 Feb 2004 01:05:53 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <bvmnhh$mcv$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5839


  I still don't understand what "forward it to eth1" really means.  

  - you receive a packet with the name of the interface it came in on
  - you decide it's for you
  - you process it accordingly

  Just so I understand what you are asking, how does the above sequence
  differ whether you "forward it to ethX" or not?

  .m



> I'm confused as to what the final verdict here was.
> If I receive over eth0 (192.168.129.131) an ICMP packet destined for
> 192.168.129.132 (eth1), do I need to forward it to eth1, or just service it
> immediately.
> 
> Sounds like you are saying the interface isn't important, so just service it
> immediately.  Is that right?
> 
> Oded
> 
> > > To check if a packet is meant for the router, do I just iterate through
> > > all interfaces and check if the dest of the packet matches one of them?
> >
> >  yup.
> >
> >  .m
> >
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: arp request timeouts?
Date: Mon, 2 Feb 2004 17:06:56 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0402021706010.18131-100000@Xenon.Stanford.EDU>
References: <bvmrg0$rf9$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 1075770418 29070 171.64.66.201 (3 Feb 2004 01:06:58 GMT)
X-Complaints-To: news@news.stanford.edu
To: Cynthia Lau <cindabin@stanford.edu>
In-Reply-To: <bvmrg0$rf9$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5840


 There is no required value, pick one you find reasonable.

 .m


> Hi,
> 
> I'm still unclear as to how long we should wait after sending an ARP request
> before resending.  Someone posted a while back, saying it was 200 - 500
> milliseconds--where did these numbers come from?
> 
> -Cynthia
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: multiple ARP requests
Date: Mon, 2 Feb 2004 19:20:57 -0800
Lines: 23
Distribution: su
Message-ID: <bvn42d$92k$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1075778445 9300 128.12.61.97 (3 Feb 2004 03:20: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:5841

Is it acceptable to send a new ARP request for every IP packet going to a
hop for which I don't have an ARP cache entry?

So if I have two packets, both with the SAME next hop:
-I receive the first packet
-I don't find an ARP entry, so I send out an ARP request
-I receive the second packet
-I don't find an ARP entry, so I send out an ARP request
-I receive the first ARP reply
-I receive the second ARP reply

Is this redundancy acceptable?

One caveat is that if I get a reply for the first ARP request but none for
the second, I could theoretically send an ICMP host unreachable to the
second of the second packet, even though I have a (technically) valid ARP
cache entry now... but if it doesn't respond to the second one, it may have
presumably gone down at that moment...

Thanks,
Oded


.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Byte Order
Date: Mon, 02 Feb 2004 19:36:38 -0800
Lines: 3
Distribution: su
Message-ID: <401F1746.611F6657@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075779398 10328 128.12.21.88 (3 Feb 2004 03:36:38 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:5842

The infromation such as addr in sr_if as well as the constants such as
ETHERTYPE_ARP.  Are these stored in network or host byte order?

.

Path: shelby.stanford.edu!not-for-mail
From: sumeet shendrikar <sumeets@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: purify and signals
Date: Mon, 02 Feb 2004 20:28:01 -0800
Lines: 44
Distribution: su
Message-ID: <bvn80i$dp0$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402021510260.3441-100000@epic15.Stanford.EDU> <Pine.LNX.4.44.0402021526470.3113-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-60149.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075782482 14112 128.12.197.131 (3 Feb 2004 04:28:02 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:5843

i found setting a hard limit on the number of packets received by the 
router works well for purify.

i.e.  if a global counter has exceeded some value (like 2000 or so) then 
just do an exit(1).

again.. works well for debugging only.

Martin Casado wrote:
>  Easiest way I've found is to register a signal handler for SIGHUP that
>  exits then kill -s HUP <pid>.
> 
>  There may be an easier way I don't know about however.
> 
>  .m




> 
>>When I run the purify'd sr, I have to ^C to exit the router.  This causes
>>purify to catch the SIGINT and halt analysis.  How can we get a full
>>report (with memory leak analysis as well...)?
>>
>>This is the end of my purify.output:
>>
>>****  Purify instrumented sr.purify (pid 3388)  ****
>>SIG: Signal handled:
>>  * This is occurring while in:
>>        *unknown func* [pc=0x889f4]
>>        sr_read_from_server [sr_vns_comm.c:210]
>>        main           [sr_main.c:146]
>>        _start         [crt1.o]
>>  * Received signal 2 (SIGINT - Interrupt)
>>  * Signal mask: (SIGINT)
>>  * Pending signals:
>>
>>Thanks,
>>Barrett
>>
>>
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Eddy Wu" <ewu@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Router print outs
Date: Mon, 2 Feb 2004 20:42:32 -0800
Lines: 20
Distribution: su
Message-ID: <bvn8s7$f0u$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402020846550.13926-100000@epic6.Stanford.EDU> <Pine.LNX.4.44.0402020925180.14662-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: glacion.stanford.edu
X-Trace: news.Stanford.EDU 1075783368 15390 128.12.90.43 (3 Feb 2004 04:42: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:5844

Should we remove any debugging printouts (like when we have to drop packets)
from our code before submission?

-Eddy

"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0402020925180.14662-100000@Xenon.Stanford.EDU...
>
> > Am I correct to assume that no explicit print outs from our
> > router are required.  You'll be able to determine its functinality
> > using tcmpdump or something similar.  That includes cache invalidation
> > (new ARP request from our router will commence) and failure to receive
> > ARP reply (request sent again or ICMP host unreachable is generated).
>
>  Exactly right.
>
>  .m
>


.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: submission script
Date: Mon, 2 Feb 2004 21:00:50 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.GSO.4.44.0402022058440.2825-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 1075784451 16626 171.64.15.42 (3 Feb 2004 05:00:51 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5845

Submission script for hw2 does not seem to pick up
purify.output files.  Are they needed?

Thanks.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: multiple ARP requests
Date: Mon, 2 Feb 2004 21:06:34 -0800
Lines: 32
Distribution: su
Message-ID: <Pine.LNX.4.44.0402022100530.7704-100000@Xenon.Stanford.EDU>
References: <bvn42d$92k$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 1075784795 17005 171.64.66.201 (3 Feb 2004 05:06:35 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <bvn42d$92k$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5846


 Yes this is perfectly acceptable.  You are not required to 
 keep state for each arp request.

 .m 


> Is it acceptable to send a new ARP request for every IP packet going to a
> hop for which I don't have an ARP cache entry?
> 
> So if I have two packets, both with the SAME next hop:
> -I receive the first packet
> -I don't find an ARP entry, so I send out an ARP request
> -I receive the second packet
> -I don't find an ARP entry, so I send out an ARP request
> -I receive the first ARP reply
> -I receive the second ARP reply
> 
> Is this redundancy acceptable?
> 
> One caveat is that if I get a reply for the first ARP request but none for
> the second, I could theoretically send an ICMP host unreachable to the
> second of the second packet, even though I have a (technically) valid ARP
> cache entry now... but if it doesn't respond to the second one, it may have
> presumably gone down at that moment...
> 
> Thanks,
> Oded
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Byte Order
Date: Mon, 2 Feb 2004 21:27:17 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0402022126200.16337-100000@Xenon.Stanford.EDU>
References: <401F1746.611F6657@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075786039 18465 171.64.66.201 (3 Feb 2004 05:27:19 GMT)
X-Complaints-To: news@news.stanford.edu
To: Ryan <ryan05@stanford.edu>
In-Reply-To: <401F1746.611F6657@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5847


 The ip in sr_if are stored in network byte order.  You should
 be able to (easily) determine the byte ordering for the
 constants.

 .m

> The infromation such as addr in sr_if as well as the constants such as
> ETHERTYPE_ARP.  Are these stored in network or host byte order?
> 
> 

.

Path: shelby.stanford.edu!elaine35.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: submission script
Date: Tue, 3 Feb 2004 05:27:58 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <bvnbgu$i2e$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402022058440.2825-100000@epic9.Stanford.EDU>
NNTP-Posting-Host: elaine35.stanford.edu
X-Trace: news.Stanford.EDU 1075786078 18510 171.64.15.110 (3 Feb 2004 05:27:58 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5848


>Submission script for hw2 does not seem to pick up
>purify.output files.  Are they needed?

Nope.
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Router print outs
Date: Mon, 2 Feb 2004 21:28:47 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.LNX.4.44.0402022127350.16337-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402020846550.13926-100000@epic6.Stanford.EDU>
 <Pine.LNX.4.44.0402020925180.14662-100000@Xenon.Stanford.EDU>
 <bvn8s7$f0u$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 1075786129 18541 171.64.66.201 (3 Feb 2004 05:28:49 GMT)
X-Complaints-To: news@news.stanford.edu
To: Eddy Wu <ewu@stanford.edu>
In-Reply-To: <bvn8s7$f0u$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5849


 It doesn't partularly matter for this assignment, however it is nice to
 have a compile flag to turn off debugging output.

 .m

> Should we remove any debugging printouts (like when we have to drop packets)
> from our code before submission?
> 
> -Eddy
> 
> "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> news:Pine.LNX.4.44.0402020925180.14662-100000@Xenon.Stanford.EDU...
> >
> > > Am I correct to assume that no explicit print outs from our
> > > router are required.  You'll be able to determine its functinality
> > > using tcmpdump or something similar.  That includes cache invalidation
> > > (new ARP request from our router will commence) and failure to receive
> > > ARP reply (request sent again or ICMP host unreachable is generated).
> >
> >  Exactly right.
> >
> >  .m
> >
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: submission script
Date: Mon, 2 Feb 2004 21:29:01 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0402022128530.16337-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402022058440.2825-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 1075786143 18553 171.64.66.201 (3 Feb 2004 05:29:03 GMT)
X-Complaints-To: news@news.stanford.edu
To: Boris Senderzon <senderzo@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402022058440.2825-100000@epic9.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5850


 Nope :)
 .m

> Submission script for hw2 does not seem to pick up
> purify.output files.  Are they needed?
> 
> Thanks.
> 
> 

.

Path: shelby.stanford.edu!elaine35.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Router print outs
Date: Tue, 3 Feb 2004 05:31:54 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <bvnboa$ia4$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402020846550.13926-100000@epic6.Stanford.EDU> <Pine.LNX.4.44.0402020925180.14662-100000@Xenon.Stanford.EDU> <bvn8s7$f0u$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine35.stanford.edu
X-Trace: news.Stanford.EDU 1075786314 18756 171.64.15.110 (3 Feb 2004 05:31:54 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5851


>Should we remove any debugging printouts (like when we have to drop packets)
>from our code before submission?

As Martin indicated, we won't be looking at the output when grading.
Presumably your debugging printouts are enabled by an #ifdef or some
similar unobtrusive mechanism that you can just turn off...

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS2 #6c
Date: Mon, 2 Feb 2004 22:11:29 -0800
Lines: 37
Distribution: su
Message-ID: <Pine.GSO.4.44.0402022207070.859-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 1075788691 21572 171.64.15.100 (3 Feb 2004 06:11:31 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5852


when i do a traceroute to www.wsgr.com from elaine25, i get:

traceroute to www.wsgr.com (67.112.196.67): 1-30 hops, 38 byte packets
 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.431/0.480/0.775 (0.098) ms
10/10 pkts (0% loss)
 2  bbr2-rtr.Stanford.EDU (171.64.1.161)  0.445/0.460/0.493 (0.014) ms
10/10 pkts (0% loss)
 3  border-rtr.Stanford.EDU (171.64.1.145)  1.59/2.24/3.83 (0.669) ms
10/10 pkts (0% loss)
 4  g1.ba21.b003123-1.sfo01.atlas.cogentco.com (66.250.7.137)
2.00/3.04/6.53 (1.23) ms  10/10 pkts (0% loss)
 5  g1-1.core02.sfo01.atlas.cogentco.com (66.28.6.13)  2.71/3.91/10.8
(2.31) ms  10/10 pkts (0% loss)
 6  p6-0.pr01.sjc04.atlas.psi.net (154.54.1.254)  3.40/4.49/6.66 (1.02) ms
10/10 pkts (0% loss)
 7  ex1-p5-3.pxpaca.sbcglobal.net (151.164.89.153)  3.56/5.34/9.17 (1.58)
ms  10/10 pkts (0% loss)
 8  ex2-p11-0.pxpaca.sbcglobal.net (151.164.191.82)  3.66/4.97/9.81 (1.76)
ms  10/10 pkts (0% loss)
 9  bb1-p14-3.sntc01.pbi.net (151.164.191.77)  4.33/4.87/5.78 (0.426) ms
10/10 pkts (0% loss)
10  ded3-ge-2-0.sntc01.pbi.net (63.203.51.9)  3.54/5.28/8.06 (1.10) ms
10/10 pkts (0% loss)
11  VIP-Wilson-Sonsini-Goodrich-Rosati-1055538.cust-rtr.pacbell.net
(64.174.55.22)  4.83/5.87/7.44 (0.791) ms  10/10 pkts (0% loss)
12  *  *  *  *  *  0/5 pkts (100% loss)
13  *  *  *  *  *  0/5 pkts (100% loss)
14  *  *  *  *  *  0/5 pkts (100% loss)

and so on...

Are we supposed to figure out the answer to this part w/out a succesful
completion of traceroute?

--vishal

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: pthread_cond_timedwait compiler warning
Date: Tue, 3 Feb 2004 07:37:13 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <bvnj39$puk$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine14.stanford.edu
X-Trace: news.Stanford.EDU 1075793833 26580 171.64.15.79 (3 Feb 2004 07:37: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:5853

There was a post earlier about a compiler warning issued on pthread_cond_timedwait for no apparent reason.

It appears this is due to the pthreads header files on Solaris not being conformant to C90.  If I compile without
the -ansi flag, there is no warning. 

I tried a bare-bones version containing just that line and the necessary declarations; it compiled fine in the
default dialect (gnu89) but wouldn't compile at all with -ansi.

Can we omit the -ansi flag?  Or should we just live with the warning?
.

Path: shelby.stanford.edu!not-for-mail
From: "Cynthia Lau" <cindabin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: updating ARP cache on requests
Date: Mon, 2 Feb 2004 23:55:30 -0800
Lines: 20
Distribution: su
Message-ID: <bvnk5k$rks$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-36725.stanford.edu
X-Trace: news.Stanford.EDU 1075794932 28316 128.12.196.60 (3 Feb 2004 07:55: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:5854

Hi,

In an old post Martin said:

>  Perhaps I should clarify, you do not add arbitrary ARP requests to
>  the ARP cache.  Since ARP requests are sent to broadcast you may receive
>  them from anyone.  If however the incoming interface has the correct IP
>  you should cache the request.  If the ARP request isn't for you, but you
>  have the triplet in your cache, you should update it.
>
>  .m
>

The final sentence implies that we are supposed to update our ARP cache even
for ARP requests that aren't meant for us.  But because of the function
sr_arp_req_not_for_us, this case should never really come up in the code
we're allowed to modify.  So, should we just completely ignore ARP requests
not meant for the right interface?


.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: HW#2 Questions
Date: Tue, 3 Feb 2004 08:21:20 +0000 (UTC)
Lines: 17
Distribution: su
Message-ID: <bvnlm0$11o$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine16.stanford.edu
X-Trace: news.Stanford.EDU 1075796480 1080 171.64.15.81 (3 Feb 2004 08:21: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:5855

Do we need to answer in the README file the questions raised in the HW#2 
handout? Questions like the following are already answered by the code 
(the fact that the code is working proves it.)

 + What will the destination hardware address be for the packet sent back
   by the client?

 + What if the client doesn't know the hardware address for www-nickm?

 + To test if the router is actually receiving packets try pinging or
   running traceroute to the IP address of eth0 (which is connected to the
   firewall in the assignment topology). The sr should print out that it
   received a packet. What type of packet do you think this is?

 + What should your router do on receipt of an ARP request packet?

Jason
.

Path: shelby.stanford.edu!firebird5.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Ping no-reply response
Date: Tue, 3 Feb 2004 00:23:04 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.LNX.4.44.0402030019330.30363-100000@firebird5.Stanford.EDU>
NNTP-Posting-Host: firebird5.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075796586 1375 171.64.15.18 (3 Feb 2004 08:23:06 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5856

Is that ture there should never be no-reply reponse when pinging any of
the interfaces in the topology?  Is it possible because of the time-out
value for cache and queuing, there could be no-reply with 1 sec for the
first message?

Thanks!

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: bus error
Date: Tue, 3 Feb 2004 00:32:35 -0800
Lines: 10
Distribution: su
Message-ID: <bvnmbs$24s$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1075797180 2204 128.12.189.163 (3 Feb 2004 08:33:00 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:5857

Hi,
My code seems to works fine most of the time but suddenly once in a while I
get a "bus error"
and my program exits.
Is it something I should worry about?
Can someone please tell me why that error is caused?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!not-for-mail
From: "Jaideep Ravela" <jaideep_ravela@hotmail.com>
Newsgroups: su.class.cs244a
Subject: ARP Refresh
Date: Tue, 3 Feb 2004 00:39:54 -0800
Lines: 10
Distribution: su
Message-ID: <bvnmsk$2rn$1@news.Stanford.EDU>
NNTP-Posting-Host: rains-02-28a.stanford.edu
X-Trace: news.Stanford.EDU 1075797716 2935 128.12.185.88 (3 Feb 2004 08: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:5858

Could somebody tell me when to refresh the time stamp for the hardware
address of an IP in our arp cache. I am currently doing it when the entry is
more than 15s old (and an ARP request is sent out) or when an ARP request
comes in from that IP. Do we have to refresh the time stamp for every packet
being sent/received from that IP?

Thank you,
Jaideep


.

Path: shelby.stanford.edu!not-for-mail
From: "Lei Zhang" <lei.zhang@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: sr Exit
Date: Tue, 3 Feb 2004 01:18:10 -0800
Lines: 8
Distribution: su
Message-ID: <bvnp0r$5d9$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075799901 5545 127.0.0.1 (3 Feb 2004 09:18: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:5859

Do we need to exit the program gracefully (and how), or Ctrl-C is fine?
Purify does not seem to be able to catch all memory leaks if not exiting
properly.

Thanks,
Lei


.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: bus error
Date: Tue, 03 Feb 2004 02:10:01 -0800
Organization: Stanford University
Lines: 27
Distribution: su
Message-ID: <pan.2004.02.03.10.09.58.378833@stanford.edu>
References: <bvnmbs$24s$1@news.Stanford.EDU>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1075803001 9173 128.12.69.27 (3 Feb 2004 10:10:01 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:5860

Yeah, I'm seeing the same thing; my code works fine on linux but SIGBUSes
on Solaris with out any warning.  Purify doesn't even report an access
error, only the SIGBUS.  It happens when I try to access the s_addr field
of an in_addr struct.  The solaris compiler at build time doesn't complain
about it, but if I look at gdb:

ip_dst = {S_un = {S_un_b = {s_b1 = 192 '�',
        s_b2 = 168 '', s_b3 = 128 '\200', s_b4 = 73 'I'}, S_un_w = {
        s_w1 = 49320, s_w2 = 32841}, S_addr = 3232268361}}}

no such field (s_addr) exists; the closest that exists is S_addr (notice
the capital). However, the data within this struct is totally fine.  It's
extraordinarily weird.

--Chris

On Tue, 03 Feb 2004 00:32:35 -0800, Haripriya Rajagopal wrote:

> Hi,
> My code seems to works fine most of the time but suddenly once in a while I
> get a "bus error"
> and my program exits.
> Is it something I should worry about?
> Can someone please tell me why that error is caused?
> Thanks,
> Haripriya

.

Path: shelby.stanford.edu!not-for-mail
From: "Tim Grow" <grow@stanford.edu>
Newsgroups: su.class.cs244a
Subject: "struct in_addr" vs "uint32_t"
Date: Tue, 3 Feb 2004 02:18:21 -0800
Lines: 11
Distribution: su
Message-ID: <bvnshb$9bp$1@news.Stanford.EDU>
NNTP-Posting-Host: grow.stanford.edu
X-Trace: news.Stanford.EDU 1075803499 9593 128.12.191.36 (3 Feb 2004 10:18: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:5861

Hi-

Is there any reason why sr_protocol.h/struct_ip uses "struct in_addr"
whereas sr_protocol.h/struct_sr_arphdr uses "uint32_t" for IP addresses?
This is a non-issue, but I'm just curious.  I'd think the stronger type
checking associated with "struct in_addr" would be nice, and "struct
in_addr" is marginally more portable.

Tim


.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: bus error
Date: Tue, 03 Feb 2004 02:36:57 -0800
Organization: Stanford University
Lines: 17
Distribution: su
Message-ID: <pan.2004.02.03.10.36.54.68764@stanford.edu>
References: <bvnmbs$24s$1@news.Stanford.EDU>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1075804617 10564 128.12.69.27 (3 Feb 2004 10:36:57 GMT)
X-Complaints-To: news@news.stanford.edu
To: hpriya@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:5862

So I have started to figure mine out.  For some reason, sr_handle_packet
is giving me unaligned addresses and this causes the SIGBUS.  Turn on core
dumps on your machine and see if you have the same problem.

--Chris

On Tue, 03 Feb 2004 00:32:35 -0800, Haripriya Rajagopal wrote:

> Hi,
> My code seems to works fine most of the time but suddenly once in a while I
> get a "bus error"
> and my program exits.
> Is it something I should worry about?
> Can someone please tell me why that error is caused?
> Thanks,
> Haripriya

.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: bus error
Date: Tue, 03 Feb 2004 02:51:05 -0800
Organization: Stanford University
Lines: 34
Distribution: su
Message-ID: <pan.2004.02.03.10.51.02.263119@stanford.edu>
References: <bvnmbs$24s$1@news.Stanford.EDU> <pan.2004.02.03.10.36.54.68764@stanford.edu>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1075805465 11242 128.12.69.27 (3 Feb 2004 10:51:05 GMT)
X-Complaints-To: news@news.stanford.edu
To: hpriya@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:5863

TA's: please let me know if my thinking is correct!

Ok, so I think I've got mine figured.  So the difference between SIGSEGV
and SIGBUS is where the error was detected.  SIGSEGV means software
caught it, SIGBUS means hardware caught it.  Now, x86 (i.e. my linux box)
does not have hardware checking, hence, if you access and unaligned
address, nothing will happen.  SPARC, on the other hand, does.  So what's
happening to me is that I am storing away a packet to send later while
waiting for an arp request.  Now, I don't care about the ethernet header,
so I am just throwing that away.  That removes 14 bytes, so now I am off 4
byte alignment.  So, when I try to access my data again, I get a SIGBUS
because the hardware detects an unaligned access.

--Chris

On Tue, 03 Feb 2004 02:36:57 -0800, Chris Edstrom wrote:

> So I have started to figure mine out.  For some reason, sr_handle_packet
> is giving me unaligned addresses and this causes the SIGBUS.  Turn on core
> dumps on your machine and see if you have the same problem.
> 
> --Chris
> 
> On Tue, 03 Feb 2004 00:32:35 -0800, Haripriya Rajagopal wrote:
> 
>> Hi,
>> My code seems to works fine most of the time but suddenly once in a while I
>> get a "bus error"
>> and my program exits.
>> Is it something I should worry about?
>> Can someone please tell me why that error is caused?
>> Thanks,
>> Haripriya

.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: bus error
Date: Tue, 03 Feb 2004 03:22:55 -0800
Organization: Stanford University
Lines: 54
Distribution: su
Message-ID: <pan.2004.02.03.11.22.51.482342@stanford.edu>
References: <bvnmbs$24s$1@news.Stanford.EDU> <pan.2004.02.03.10.36.54.68764@stanford.edu> <pan.2004.02.03.10.51.02.263119@stanford.edu>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1075807375 13382 128.12.69.27 (3 Feb 2004 11:22:55 GMT)
X-Complaints-To: news@news.stanford.edu
To: hpriya@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:5864

Yes, my intuition was right.  Instead of loading the address by doing:

(addr is a uint32_t, data is an ip packet)
addr = *(packet + 16);

I just did:

addr = ((struct ip*)packet)->ip_dst.s_addr;

That works cause byte alignment only applies to "freestanding" ints, not
ones inside structs.  I guess the unaligned load is actually emulated by
the OS, from what I gather.

--Chris

P.S. Prof. McKeown: Thank you so much for making CS140 a prereq for this
class; I probably would have _NEVER_ found that error without it! :)

On Tue, 03 Feb 2004 02:51:05 -0800, Chris Edstrom wrote:

> TA's: please let me know if my thinking is correct!
> 
> Ok, so I think I've got mine figured.  So the difference between SIGSEGV
> and SIGBUS is where the error was detected.  SIGSEGV means software
> caught it, SIGBUS means hardware caught it.  Now, x86 (i.e. my linux box)
> does not have hardware checking, hence, if you access and unaligned
> address, nothing will happen.  SPARC, on the other hand, does.  So what's
> happening to me is that I am storing away a packet to send later while
> waiting for an arp request.  Now, I don't care about the ethernet header,
> so I am just throwing that away.  That removes 14 bytes, so now I am off 4
> byte alignment.  So, when I try to access my data again, I get a SIGBUS
> because the hardware detects an unaligned access.
> 
> --Chris
> 
> On Tue, 03 Feb 2004 02:36:57 -0800, Chris Edstrom wrote:
> 
>> So I have started to figure mine out.  For some reason, sr_handle_packet
>> is giving me unaligned addresses and this causes the SIGBUS.  Turn on core
>> dumps on your machine and see if you have the same problem.
>> 
>> --Chris
>> 
>> On Tue, 03 Feb 2004 00:32:35 -0800, Haripriya Rajagopal wrote:
>> 
>>> Hi,
>>> My code seems to works fine most of the time but suddenly once in a while I
>>> get a "bus error"
>>> and my program exits.
>>> Is it something I should worry about?
>>> Can someone please tell me why that error is caused?
>>> Thanks,
>>> Haripriya

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: purify and signals
Date: Tue, 3 Feb 2004 03:35:18 -0800
Lines: 37
Distribution: su
Message-ID: <Pine.GSO.4.44.0402030334300.11582-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0402021510260.3441-100000@epic15.Stanford.EDU>
 <Pine.LNX.4.44.0402021526470.3113-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 1075808121 14052 171.64.15.118 (3 Feb 2004 11:35:21 GMT)
X-Complaints-To: news@news.stanford.edu
Cc: Barrett Trask <btrask@stanford.edu>
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0402021526470.3113-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5865

Is this signal handler required for the project, or just nice to have?

-Laura
On Mon, 2 Feb 2004, Martin Casado wrote:

>
>  Easiest way I've found is to register a signal handler for SIGHUP that
>  exits then kill -s HUP <pid>.
>
>  There may be an easier way I don't know about however.
>
>  .m
>
> > When I run the purify'd sr, I have to ^C to exit the router.  This causes
> > purify to catch the SIGINT and halt analysis.  How can we get a full
> > report (with memory leak analysis as well...)?
> >
> > This is the end of my purify.output:
> >
> > ****  Purify instrumented sr.purify (pid 3388)  ****
> > SIG: Signal handled:
> >   * This is occurring while in:
> >         *unknown func* [pc=0x889f4]
> >         sr_read_from_server [sr_vns_comm.c:210]
> >         main           [sr_main.c:146]
> >         _start         [crt1.o]
> >   * Received signal 2 (SIGINT - Interrupt)
> >   * Signal mask: (SIGINT)
> >   * Pending signals:
> >
> > Thanks,
> > Barrett
> >
> >
>
>

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: pthread_cond_timedwait compiler warning
Date: Tue, 3 Feb 2004 08:51:45 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.LNX.4.44.0402030851250.20785-100000@Xenon.Stanford.EDU>
References: <bvnj39$puk$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 1075827106 5164 171.64.66.201 (3 Feb 2004 16:51:46 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <bvnj39$puk$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5866

> 
> Can we omit the -ansi flag?  Or should we just live with the warning?
> 

 Live with the warning.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: updating ARP cache on requests
Date: Tue, 3 Feb 2004 08:56:12 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.LNX.4.44.0402030851520.20785-100000@Xenon.Stanford.EDU>
References: <bvnk5k$rks$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 1075827373 5486 171.64.66.201 (3 Feb 2004 16:56:13 GMT)
X-Complaints-To: news@news.stanford.edu
To: Cynthia Lau <cindabin@stanford.edu>
In-Reply-To: <bvnk5k$rks$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5867


> Hi,
> 
> In an old post Martin said:
> 
> >  Perhaps I should clarify, you do not add arbitrary ARP requests to
> >  the ARP cache.  Since ARP requests are sent to broadcast you may receive
> >  them from anyone.  If however the incoming interface has the correct IP
> >  you should cache the request.  If the ARP request isn't for you, but you
> >  have the triplet in your cache, you should update it.
> >
> >  .m
> >
> 
> The final sentence implies that we are supposed to update our ARP cache even
> for ARP requests that aren't meant for us.  But because of the function
> sr_arp_req_not_for_us, this case should never really come up in the code
> we're allowed to modify.  So, should we just completely ignore ARP requests
> not meant for the right interface?

 The functionality I described is the correct method of handling ARP with
 regards to the rfc.  Give students access to all ARP traffic has proven
 dangerous in the past so we filter them out.  Your implementation should
 be complete with regards to the rfc but you don't have to provide redundant
 functionality.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: HW#2 Questions
Date: Tue, 3 Feb 2004 08:57:06 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.LNX.4.44.0402030856200.20785-100000@Xenon.Stanford.EDU>
References: <bvnlm0$11o$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 1075827427 5592 171.64.66.201 (3 Feb 2004 16:57:07 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jason Ying Li <jasonyli@Stanford.EDU>
In-Reply-To: <bvnlm0$11o$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5868


 No you don't.  Those are just meant to bring up points for consideration.

 .m

> Do we need to answer in the README file the questions raised in the HW#2 
> handout? Questions like the following are already answered by the code 
> (the fact that the code is working proves it.)
> 
>  + What will the destination hardware address be for the packet sent back
>    by the client?
> 
>  + What if the client doesn't know the hardware address for www-nickm?
> 
>  + To test if the router is actually receiving packets try pinging or
>    running traceroute to the IP address of eth0 (which is connected to the
>    firewall in the assignment topology). The sr should print out that it
>    received a packet. What type of packet do you think this is?
> 
>  + What should your router do on receipt of an ARP request packet?
> 
> Jason
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Jeremy Slade <jeremy@jkslade.net>
Newsgroups: su.class.cs244a
Subject: Re: purify and signals
Date: 03 Feb 2004 10:01:05 -0700
Lines: 32
Sender: jeremy@dad.jkslade.net
Distribution: su
Message-ID: <m3ektcnlm6.fsf@dad.jkslade.net>
References: <Pine.GSO.4.44.0402021510260.3441-100000@epic15.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1075827430 4370 171.64.15.111 (3 Feb 2004 16:57:10 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)
Xref: shelby.stanford.edu su.class.cs244a:5869

You can also get a memory-leak report essentially any time while the
process is running -- in the purify winow, click on the faucet icon
across the top.  It will report any new leaks since the last report.

Jeremy

Barrett Trask <btrask@stanford.edu> writes:

> When I run the purify'd sr, I have to ^C to exit the router.  This causes
> purify to catch the SIGINT and halt analysis.  How can we get a full
> report (with memory leak analysis as well...)?
> 
> This is the end of my purify.output:
> 
> ****  Purify instrumented sr.purify (pid 3388)  ****
> SIG: Signal handled:
>   * This is occurring while in:
>         *unknown func* [pc=0x889f4]
>         sr_read_from_server [sr_vns_comm.c:210]
>         main           [sr_main.c:146]
>         _start         [crt1.o]
>   * Received signal 2 (SIGINT - Interrupt)
>   * Signal mask: (SIGINT)
>   * Pending signals:
> 
> Thanks,
> Barrett
> 

-- 
Jeremy Slade
jeremy@jkslade.net
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Ping no-reply response
Date: Tue, 3 Feb 2004 08:58:47 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0402030857190.20785-100000@Xenon.Stanford.EDU>
References: <Pine.LNX.4.44.0402030019330.30363-100000@firebird5.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075827528 5681 171.64.66.201 (3 Feb 2004 16:58:48 GMT)
X-Complaints-To: news@news.stanford.edu
To: Yuhui Jin <yhjin@stanford.edu>
In-Reply-To: <Pine.LNX.4.44.0402030019330.30363-100000@firebird5.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5870


 Most of the students implementations, as well as my own, do not time-out
 on any of the ping prodes.  If yours is doing this you may want to look
 at the cause of the delay.

 .m

> Is that ture there should never be no-reply reponse when pinging any of
> the interfaces in the topology?  Is it possible because of the time-out
> value for cache and queuing, there could be no-reply with 1 sec for the
> first message?
> 
> Thanks!
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: bus error
Date: Tue, 3 Feb 2004 09:00:04 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0402030858520.20785-100000@Xenon.Stanford.EDU>
References: <bvnmbs$24s$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 1075827606 5812 171.64.66.201 (3 Feb 2004 17:00:06 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bvnmbs$24s$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5871


> Hi,
> My code seems to works fine most of the time but suddenly once in a while I
> get a "bus error"
> and my program exits.
> Is it something I should worry about?

 yes!

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ARP Refresh
Date: Tue, 3 Feb 2004 09:01:04 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0402030900090.20785-100000@Xenon.Stanford.EDU>
References: <bvnmsk$2rn$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 1075827666 5938 171.64.66.201 (3 Feb 2004 17:01:06 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jaideep Ravela <jaideep_ravela@hotmail.com>
In-Reply-To: <bvnmsk$2rn$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5872


> Could somebody tell me when to refresh the time stamp for the hardware
> address of an IP in our arp cache. I am currently doing it when the entry is
> more than 15s old (and an ARP request is sent out) or when an ARP request
> comes in from that IP. Do we have to refresh the time stamp for every packet
> being sent/received from that IP?

 You only refesh the ARP cache timestamp when you receive an ARP reply for
 that IP.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: sr Exit
Date: Tue, 3 Feb 2004 09:03:12 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0402030901091.20785-100000@Xenon.Stanford.EDU>
References: <bvnp0r$5d9$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 1075827794 6116 171.64.66.201 (3 Feb 2004 17:03:14 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lei Zhang <lei.zhang@cs.stanford.edu>
In-Reply-To: <bvnp0r$5d9$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5873


 You don't have to worry about exiting gracefully.  With regards
 to memory, just be sure you aren't loosing references to malloc()'d
 memory during execution time.

 .m

> Do we need to exit the program gracefully (and how), or Ctrl-C is fine?
> Purify does not seem to be able to catch all memory leaks if not exiting
> properly.
> 
> Thanks,
> Lei
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: bus error
Date: Tue, 3 Feb 2004 09:04:50 -0800
Lines: 36
Distribution: su
Message-ID: <Pine.LNX.4.44.0402030903340.20785-100000@Xenon.Stanford.EDU>
References: <bvnmbs$24s$1@news.Stanford.EDU> <pan.2004.02.03.10.09.58.378833@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT
X-Trace: news.Stanford.EDU 1075827892 6179 171.64.66.201 (3 Feb 2004 17:04:52 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <pan.2004.02.03.10.09.58.378833@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5874



 bus errors on solaris are normally caused by memory alignment errors.  Do
 you have an overrun anywhere?

 .m

> Yeah, I'm seeing the same thing; my code works fine on linux but SIGBUSes
> on Solaris with out any warning.  Purify doesn't even report an access
> error, only the SIGBUS.  It happens when I try to access the s_addr field
> of an in_addr struct.  The solaris compiler at build time doesn't complain
> about it, but if I look at gdb:
> 
> ip_dst = {S_un = {S_un_b = {s_b1 = 192 '�',
>         s_b2 = 168 '', s_b3 = 128 '\200', s_b4 = 73 'I'}, S_un_w = {
>         s_w1 = 49320, s_w2 = 32841}, S_addr = 3232268361}}}
> 
> no such field (s_addr) exists; the closest that exists is S_addr (notice
> the capital). However, the data within this struct is totally fine.  It's
> extraordinarily weird.
> 
> --Chris
> 
> On Tue, 03 Feb 2004 00:32:35 -0800, Haripriya Rajagopal wrote:
> 
> > Hi,
> > My code seems to works fine most of the time but suddenly once in a while I
> > get a "bus error"
> > and my program exits.
> > Is it something I should worry about?
> > Can someone please tell me why that error is caused?
> > Thanks,
> > Haripriya
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: "struct in_addr" vs "uint32_t"
Date: Tue, 3 Feb 2004 09:10:19 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.LNX.4.44.0402030905010.20785-100000@Xenon.Stanford.EDU>
References: <bvnshb$9bp$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 1075828220 6587 171.64.66.201 (3 Feb 2004 17:10:20 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tim Grow <grow@stanford.edu>
In-Reply-To: <bvnshb$9bp$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5875


 The arphdr is simply incorrect.  You shouldn't make assumptions
 as to the size of the protocol address (though I've never seen
 ARP for anything but IP).  You are right that in_addr would be
 preferrable to providing a 32 bit primitive (I don't know
 about the portability claim however, unitX_t is ansi (c99))
 
 I think, in the future, sr_protocol will be removed altogether.

 .m

> Hi-
> 
> Is there any reason why sr_protocol.h/struct_ip uses "struct in_addr"
> whereas sr_protocol.h/struct_sr_arphdr uses "uint32_t" for IP addresses?
> This is a non-issue, but I'm just curious.  I'd think the stronger type
> checking associated with "struct in_addr" would be nice, and "struct
> in_addr" is marginally more portable.
> 
> Tim
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: bus error
Date: Tue, 3 Feb 2004 09:22:22 -0800
Lines: 51
Distribution: su
Message-ID: <Pine.LNX.4.44.0402030912020.20785-100000@Xenon.Stanford.EDU>
References: <bvnmbs$24s$1@news.Stanford.EDU> <pan.2004.02.03.10.36.54.68764@stanford.edu>
 <pan.2004.02.03.10.51.02.263119@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075828944 7773 171.64.66.201 (3 Feb 2004 17:22:24 GMT)
X-Complaints-To: news@news.stanford.edu
Cc: hpriya@stanford.edu
To: Chris Edstrom <cedstrom@stanford.edu>
In-Reply-To: <pan.2004.02.03.10.51.02.263119@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5876



 SIGSEV is a segmentation violation, this is different than SIGBUS.  SIBGUS is
 due to misaligned data access in a multi-byte word, and is thrown by the
 processor.  x86 won't raise a signal on this error (misaligned data memory
 accesses are just slower because they require two reads).

 Are you using your own protocol header structs?

 .m





> TA's: please let me know if my thinking is correct!
> 
> Ok, so I think I've got mine figured.  So the difference between SIGSEGV
> and SIGBUS is where the error was detected.  SIGSEGV means software
> caught it, SIGBUS means hardware caught it.  Now, x86 (i.e. my linux box)
> does not have hardware checking, hence, if you access and unaligned
> address, nothing will happen.  SPARC, on the other hand, does.  So what's
> happening to me is that I am storing away a packet to send later while
> waiting for an arp request.  Now, I don't care about the ethernet header,
> so I am just throwing that away.  That removes 14 bytes, so now I am off 4
> byte alignment.  So, when I try to access my data again, I get a SIGBUS
> because the hardware detects an unaligned access.
> 
> --Chris
> 
> On Tue, 03 Feb 2004 02:36:57 -0800, Chris Edstrom wrote:
> 
> > So I have started to figure mine out.  For some reason, sr_handle_packet
> > is giving me unaligned addresses and this causes the SIGBUS.  Turn on core
> > dumps on your machine and see if you have the same problem.
> > 
> > --Chris
> > 
> > On Tue, 03 Feb 2004 00:32:35 -0800, Haripriya Rajagopal wrote:
> > 
> >> Hi,
> >> My code seems to works fine most of the time but suddenly once in a while I
> >> get a "bus error"
> >> and my program exits.
> >> Is it something I should worry about?
> >> Can someone please tell me why that error is caused?
> >> Thanks,
> >> Haripriya
> 
> 

.

Path: shelby.stanford.edu!elaine40.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS2 #6c
Date: Tue, 3 Feb 2004 17:22:27 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <bvolcj$7j4$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402022207070.859-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine40.stanford.edu
X-Trace: news.Stanford.EDU 1075828947 7780 171.64.15.115 (3 Feb 2004 17:22:27 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5877


>Are we supposed to figure out the answer to this part w/out a succesful
>completion of traceroute?

I get the same thing--just assume for this question that there
are several additional hops after
VIP-Wilson-Sonsini-Goodrich-Rosati-1055538.cust-rtr.pacbell.net
until www.wsgr.com.  They likely have a firewall in place that causes
the behaviour we see.
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: purify and signals
Date: Tue, 3 Feb 2004 09:23:40 -0800
Lines: 44
Distribution: su
Message-ID: <Pine.LNX.4.44.0402030923330.20785-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402021510260.3441-100000@epic15.Stanford.EDU>
 <Pine.LNX.4.44.0402021526470.3113-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402030334300.11582-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 1075829023 7866 171.64.66.201 (3 Feb 2004 17:23:43 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402030334300.11582-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5878


 Just nice to have.

  .m

> Is this signal handler required for the project, or just nice to have?
> 
> -Laura
> On Mon, 2 Feb 2004, Martin Casado wrote:
> 
> >
> >  Easiest way I've found is to register a signal handler for SIGHUP that
> >  exits then kill -s HUP <pid>.
> >
> >  There may be an easier way I don't know about however.
> >
> >  .m
> >
> > > When I run the purify'd sr, I have to ^C to exit the router.  This causes
> > > purify to catch the SIGINT and halt analysis.  How can we get a full
> > > report (with memory leak analysis as well...)?
> > >
> > > This is the end of my purify.output:
> > >
> > > ****  Purify instrumented sr.purify (pid 3388)  ****
> > > SIG: Signal handled:
> > >   * This is occurring while in:
> > >         *unknown func* [pc=0x889f4]
> > >         sr_read_from_server [sr_vns_comm.c:210]
> > >         main           [sr_main.c:146]
> > >         _start         [crt1.o]
> > >   * Received signal 2 (SIGINT - Interrupt)
> > >   * Signal mask: (SIGINT)
> > >   * Pending signals:
> > >
> > > Thanks,
> > > Barrett
> > >
> > >
> >
> >
> 
> 

.

Path: shelby.stanford.edu!elaine40.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: bus error
Date: Tue, 3 Feb 2004 17:26:15 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <bvoljn$7t9$1@news.Stanford.EDU>
References: <bvnmbs$24s$1@news.Stanford.EDU> <pan.2004.02.03.10.36.54.68764@stanford.edu>  <pan.2004.02.03.10.51.02.263119@stanford.edu> <Pine.LNX.4.44.0402030912020.20785-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine40.stanford.edu
X-Trace: news.Stanford.EDU 1075829175 8105 171.64.15.115 (3 Feb 2004 17:26:15 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5879


> SIGSEV is a segmentation violation, this is different than SIGBUS.  SIBGUS is
> due to misaligned data access in a multi-byte word, and is thrown by the
> processor.  x86 won't raise a signal on this error (misaligned data memory
> accesses are just slower because they require two reads).

Just to add to Martin's point (although this has nothing to do with your
problem)--
a segmentation violation comes from attempting to access an invalid memory
address (i.e. memory that wasn't allocated to your process).  it has nothing
to do with alignment issues.

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: loading the router
Date: Tue, 3 Feb 2004 09:31:51 -0800
Lines: 12
Distribution: su
Message-ID: <bvolu8$88t$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1075829512 8477 128.12.189.163 (3 Feb 2004 17:31: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:5880

Hi,
When I simulateneously try to traceroute, ping to the router from 4-5
machines simulatenously & traceroute like that too, one of my pings
sometimes cannot seem to reply that fast.This especially happens when all
the addresses are new & need to be addded to the cache.Since processing is
slow the reply gets delayed for ping.this happens only about once every 300
packets or so,
is it acceptable?
Thanks,
haripriya


.

Path: shelby.stanford.edu!elaine40.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: arp negotiation not fast enough?
Date: Tue, 3 Feb 2004 17:33:09 +0000 (UTC)
Lines: 19
Distribution: su
Message-ID: <bvom0l$8b4$1@news.Stanford.EDU>
References: <bvmkg6$ic6$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine40.stanford.edu
X-Trace: news.Stanford.EDU 1075829589 8548 171.64.15.115 (3 Feb 2004 17:33:09 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5881


>When I ping one of the application servers for the first time, my router has
>to ARP the app server for its mac address. Then it can forward the ICMP
>request to the app server. However, by the time this arp negotiation is done
>and the ICMP request is forwarded to server, its too late. One second has
>passed and ping outputs "no reply" as seen below. The same happens when the
>ARP entry times out and I have to send another ARP Request to update my arp
>cache. Are others seeing this too?

There's probably something strange about your ARP handling--I would check
this if I were you...

% ping 192.168.129.223
PING ftp-nickm.Stanford.EDU (192.168.129.223): 56 data bytes
64 bytes from ftp-nickm.Stanford.EDU (192.168.129.223): seq=0 ttl=60 time=1.30 ms.
64 bytes from ftp-nickm.Stanford.EDU (192.168.129.223): seq=1 ttl=60 time=0.960 ms.
64 bytes from ftp-nickm.Stanford.EDU (192.168.129.223): seq=2 ttl=60 time=0.858 ms.
^C

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: loading the router
Date: Tue, 3 Feb 2004 09:34:57 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.LNX.4.44.0402030933570.2691-100000@Xenon.Stanford.EDU>
References: <bvolu8$88t$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 1075829700 8681 171.64.66.201 (3 Feb 2004 17:35:00 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bvolu8$88t$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5882


 This sounds reasonable. 

  .m

> Hi,
> When I simulateneously try to traceroute, ping to the router from 4-5
> machines simulatenously & traceroute like that too, one of my pings
> sometimes cannot seem to reply that fast.This especially happens when all
> the addresses are new & need to be addded to the cache.Since processing is
> slow the reply gets delayed for ping.this happens only about once every 300
> packets or so,
> is it acceptable?
> Thanks,
> haripriya
> 
> 
> 

.

Path: shelby.stanford.edu!elaine40.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: loading the router
Date: Tue, 3 Feb 2004 17:42:21 +0000 (UTC)
Lines: 22
Distribution: su
Message-ID: <bvomht$8v9$1@news.Stanford.EDU>
References: <bvolu8$88t$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine40.stanford.edu
X-Trace: news.Stanford.EDU 1075830141 9193 171.64.15.115 (3 Feb 2004 17:42:21 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5883


>When I simulateneously try to traceroute, ping to the router from 4-5
>machines simulatenously & traceroute like that too, one of my pings
>sometimes cannot seem to reply that fast.This especially happens when all
>the addresses are new & need to be addded to the cache.Since processing is
>slow the reply gets delayed for ping.this happens only about once every 300
>packets or so,
>is it acceptable?

I'll quote from the general project guidelines document, which you can find
on the FAQ page:
"At times there will be ambiguities in the assignment specifications, or
multiple ways an assignment can be implemented. As CS244a is an engineering
class, we expect you to make reasonable design decisions in these cases.
Base your decisions on what you know of the assignment as a whole."

So given this, please pause a minute to think about what you've just asked--
You know your code.  You thus know (hopefully) whether you took any
shortcuts, or if there are places where there are obvious inefficiencies.
Assuming there aren't, then a delayed reply for ping 0.3% of the time (!)
certainly seems like it's probably reasonable, doesn't it?

.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: reference router for "bad" routes
Date: Tue, 3 Feb 2004 10:05:05 -0800
Lines: 39
Distribution: su
Message-ID: <bvonsq$aqk$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075831516 11092 127.0.0.1 (3 Feb 2004 18:05: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:5884

I know this is a bit late, but is there any way to set up the refence router
so that we can test either a missing ARP reply from the app server or an
rtable with no route to the app server (maybe the reference router could
provide two more IP addresses that get routed from the vns-server to your
vns-client)?    I'm getting funky traceroute's although I'm not sure what  I
should be expecting.  Is the below output correct?

Here's what I get when I try to traceroute to my app server when I ignore
ARP replies coming back from the app server.


traceroute -q  1 192.168.129.93
traceroute to ftp-garry.Stanford.EDU (192.168.129.93): 1-30 hops, 38 byte
packets
 1  sweet-rtr.Stanford.EDU (171.64.15.1)  0.649 ms
 2  Gates-rtr.Stanford.EDU (171.64.1.178)  0.547 ms
 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.433 ms (ttl=62!)
 4  ftp-fzb.Stanford.EDU (192.168.129.91)  29.5 ms (ttl=61!)
 5  *
 6  ftp-fzb.Stanford.EDU (192.168.129.91)  878 ms (ttl=61!)
 7  *
 8  ftp-fzb.Stanford.EDU (192.168.129.91)  979 ms (ttl=61!)
 9  *
10  ftp-fzb.Stanford.EDU (192.168.129.91)  750 ms (ttl=61!)
11  *
12^C


Here's what I get when I remove the app server from my routing table:

epic13:~> traceroute -q 1 192.168.129.93
traceroute to ftp-garry.Stanford.EDU (192.168.129.93): 1-30 hops, 38 byte
packets
 1  sweet-rtr.Stanford.EDU (171.64.15.1)  0.648 ms
 2  Gates-rtr.Stanford.EDU (171.64.1.178)  0.429 ms
 3  vns-firewall.Stanford.EDU (172.24.74.11)  0.424 ms (ttl=62!)
 4  vns-firewall.Stanford.EDU (172.24.74.11)  2994 ms (ttl=62!) !H


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: reference router for "bad" routes
Date: Tue, 3 Feb 2004 10:47:36 -0800
Lines: 52
Distribution: su
Message-ID: <Pine.LNX.4.44.0402031043570.1035-100000@Xenon.Stanford.EDU>
References: <bvonsq$aqk$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 1075834058 14622 171.64.66.201 (3 Feb 2004 18:47:38 GMT)
X-Complaints-To: news@news.stanford.edu
To: Joshua Silver <jmsilver@stanford.edu>
In-Reply-To: <bvonsq$aqk$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5885


 That is a good idea Josh, unfortunately setting it up would
 take some time.  What you might want to do instead is not turn
 on your router and try tracerouting to it.  The linux box acting
 as the firewall should act properly when it doesn't receive ARP
 replies.

 Are you sure your pastes aren't mixed?

 .m

> I know this is a bit late, but is there any way to set up the refence router
> so that we can test either a missing ARP reply from the app server or an
> rtable with no route to the app server (maybe the reference router could
> provide two more IP addresses that get routed from the vns-server to your
> vns-client)?    I'm getting funky traceroute's although I'm not sure what  I
> should be expecting.  Is the below output correct?
> 
> Here's what I get when I try to traceroute to my app server when I ignore
> ARP replies coming back from the app server.
> 
> 
> traceroute -q  1 192.168.129.93
> traceroute to ftp-garry.Stanford.EDU (192.168.129.93): 1-30 hops, 38 byte
> packets
>  1  sweet-rtr.Stanford.EDU (171.64.15.1)  0.649 ms
>  2  Gates-rtr.Stanford.EDU (171.64.1.178)  0.547 ms
>  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.433 ms (ttl=62!)
>  4  ftp-fzb.Stanford.EDU (192.168.129.91)  29.5 ms (ttl=61!)
>  5  *
>  6  ftp-fzb.Stanford.EDU (192.168.129.91)  878 ms (ttl=61!)
>  7  *
>  8  ftp-fzb.Stanford.EDU (192.168.129.91)  979 ms (ttl=61!)
>  9  *
> 10  ftp-fzb.Stanford.EDU (192.168.129.91)  750 ms (ttl=61!)
> 11  *
> 12^C
> 
> 
> Here's what I get when I remove the app server from my routing table:
> 
> epic13:~> traceroute -q 1 192.168.129.93
> traceroute to ftp-garry.Stanford.EDU (192.168.129.93): 1-30 hops, 38 byte
> packets
>  1  sweet-rtr.Stanford.EDU (171.64.15.1)  0.648 ms
>  2  Gates-rtr.Stanford.EDU (171.64.1.178)  0.429 ms
>  3  vns-firewall.Stanford.EDU (172.24.74.11)  0.424 ms (ttl=62!)
>  4  vns-firewall.Stanford.EDU (172.24.74.11)  2994 ms (ttl=62!) !H
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ICMP header and checksum
Date: Tue, 3 Feb 2004 13:30:07 -0800
Lines: 46
Distribution: su
Message-ID: <bvp3t3$r9e$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0402011630200.30441-100000@firebird13.Stanford.EDU> <Pine.LNX.4.44.0402012131060.3373-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1075843811 27950 128.12.44.20 (3 Feb 2004 21:30: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:5886

Er, hold on. Is the ICMP checksum computed over just the header, or the
entire ICMP message? Networksorcery would seem to indicate the latter:

ICMP Header Checksum. 16 bits.
Checksum that covers the ICMP message. This is the 16-bit one's complement
of the one's complement sum of the ICMP message starting with the Type
field. The checksum field should be set to zero before generating the
checksum.

We would just then compute a checksum from the start of the ICMP header to
the end of the packet, regardless of what type of ICMP it is, right?

- Sean

"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0402012131060.3373-100000@Xenon.Stanford.EDU...
>
> >
> > Here what confuses me about the ICMP header and data seperation. I
> > thought the header only contains "type", "code" and "checksum".
Whichever
> > type of ICMP message we compute checksum for, we compute simply over
these
> > three fields with the checksum set to 0.
> >
> > However, the packet formats (listed in networksourcery) for different
> > ICMP messages may contain different extra fields in the packet besides
> > the above three fields. For example, the packet format for ICMP reply
has
> > two extra fields "identifier" and "sequence number", followed by "data".
> > So do I compute the checksum over five fields including these two?
> >
> > If we look at other ICMP message such as Time exceeded or Port
> > unreachable, the packet formats are different and don't even denote any
> > "data" portion. So are we supposed to compute checksum over all the
fields
> > here?
>
>  You compute the checksum over the full icmp header (which depends on the
icmp
>  type)
>
>  .m
>


.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Byte Order Translation (1 byte numbers)
Date: Tue, 03 Feb 2004 13:32:10 -0800
Lines: 5
Distribution: su
Message-ID: <4020135A.B4A51325@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075843932 28072 128.12.21.88 (3 Feb 2004 21:32:12 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:5887

htons is for converting the byte order of 16 bit values and htonl is
converting the byte order of 32 bit values.  Is there a standard
function we can use to convert the byte order of 8 bit values
(variables declared as uint8_t).

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Byte Order Translation (1 byte numbers)
Date: Tue, 03 Feb 2004 13:34:53 -0800
Lines: 9
Distribution: su
Message-ID: <bvp47k$o7u$1@news.Stanford.EDU>
References: <4020135A.B4A51325@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075844148 24830 127.0.0.1 (3 Feb 2004 21:35:48 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4
X-Accept-Language: en-us, en
In-Reply-To: <4020135A.B4A51325@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5888

How do you order one byte?  One byte is ordered the same forward and 
backward.  You need no such function.

Ryan wrote:
> htons is for converting the byte order of 16 bit values and htonl is
> converting the byte order of 32 bit values.  Is there a standard
> function we can use to convert the byte order of 8 bit values
> (variables declared as uint8_t).
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Byte Order Translation (1 byte numbers)
Date: Tue, 3 Feb 2004 13:36:52 -0800
Lines: 15
Distribution: su
Message-ID: <bvp49o$s55$1@news.Stanford.EDU>
References: <4020135A.B4A51325@stanford.edu>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1075844216 28837 128.12.44.20 (3 Feb 2004 21:36: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:5889

The whole point of byte order conversions is to rearrange bytes. With just
one byte, there's no byte order to change, implying that you don't need to
convert 1 byte variables.

- Sean

"Ryan" <ryan05@stanford.edu> wrote in message
news:4020135A.B4A51325@stanford.edu...
> htons is for converting the byte order of 16 bit values and htonl is
> converting the byte order of 32 bit values.  Is there a standard
> function we can use to convert the byte order of 8 bit values
> (variables declared as uint8_t).
>


.

Path: shelby.stanford.edu!elaine40.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Byte Order Translation (1 byte numbers)
Date: Tue, 3 Feb 2004 21:37:16 +0000 (UTC)
Lines: 25
Distribution: su
Message-ID: <bvp4ac$s5n$1@news.Stanford.EDU>
References: <4020135A.B4A51325@stanford.edu>
NNTP-Posting-Host: elaine40.stanford.edu
X-Trace: news.Stanford.EDU 1075844236 28855 171.64.15.115 (3 Feb 2004 21:37:16 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5890


>htons is for converting the byte order of 16 bit values and htonl is
>converting the byte order of 32 bit values.  Is there a standard
>function we can use to convert the byte order of 8 bit values
>(variables declared as uint8_t).

A 32-bit integer is comprised of 4 bytes:

 | 0 | 1 | 2 | 3 |

which are laid out internally either likely that, or as | 3 | 2 | 1 | 0 |,
depending on the architecture.  Likewise for a 16-bit integer, which
is laid out as either | 0 | 1 | or | 1 | 0 |.  You can see the
difference by compiling a union such as the following on both Solaris
and Linux/x86:

union {
	int d;
	char c[4];
} u;

u.d = 1 will produce a different c[0] on a Sun and on an x86.

There's only one possible byte ordering of a one-byte value...

.

Path: shelby.stanford.edu!elaine40.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ICMP header and checksum
Date: Tue, 3 Feb 2004 21:41:59 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <bvp4j7$sg6$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0402011630200.30441-100000@firebird13.Stanford.EDU> <Pine.LNX.4.44.0402012131060.3373-100000@Xenon.Stanford.EDU> <bvp3t3$r9e$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine40.stanford.edu
X-Trace: news.Stanford.EDU 1075844519 29190 171.64.15.115 (3 Feb 2004 21:41:59 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5891

>Er, hold on. Is the ICMP checksum computed over just the header, or the
>entire ICMP message? Networksorcery would seem to indicate the latter:

There are two checksums--the IP header checksum, computed over the IP
header, and the ICMP checksum, computed over the whole message.

>We would just then compute a checksum from the start of the ICMP header to
>the end of the packet, regardless of what type of ICMP it is, right?

Yep.

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Byte Order Translation (1 byte numbers)
Date: Tue, 03 Feb 2004 13:47:30 -0800
Lines: 2
Distribution: su
Message-ID: <402016F2.C94E392A@stanford.edu>
References: <4020135A.B4A51325@stanford.edu> <bvp4ac$s5n$1@news.Stanford.EDU>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075844852 29540 128.12.21.88 (3 Feb 2004 21:47:32 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:5892

Oh ya! Oops, sorry for the silly question guys

.

Path: shelby.stanford.edu!not-for-mail
From: Adar Dembo <adar@stanford.edu>
Newsgroups: su.class.cs244a
Subject: No entry in routing table (alternate scenario)
Date: Tue, 03 Feb 2004 14:04:51 -0800
Lines: 33
Distribution: su
Message-ID: <bvp5u5$mo$1@news.Stanford.EDU>
NNTP-Posting-Host: adar.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075845893 728 128.12.72.21 (3 Feb 2004 22:04:53 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:5893

Suppose you've got a generalized IP packet sending function that tacks 
on an ethernet header, handles the ARP stuff, queries the routing table, 
fills in all necessary fields, and calls sr_send_packet.

Now suppose you call this function on an ICMP packet. Furthermore, 
suppose that you do not get a NextHop from the routing table. Do you 
drop the packet? Or do you construct an ICMP Host Unreachable packet, 
and attempt to send that to the source IP indicated in the first IP packet?

The reason I ask is as follows: If I receive an ICMP Echo intended for 
one of my interfaces, I want to construct an ICMP Echo Reply and send it 
back to the host who sent it. Obviously, if I can't find the host in my 
routing table, I'd get into an infinite loop if I likewise generated a 
new ICMP Host Unreachable and tried to send that.

However, in another situation where I'm FORWARDING an ICMP packet (not 
GENERATING), it does make sense to construct this. Example, I receive an 
Echo intended for one of my app servers. I can't route to it, and as 
such, I'm going to generate an ICMP Host Unreachable and send it back to 
the source.

The way I'm thinking of handling this is, as I said, making a 
dinstinction between GENERATING and FORWARDING packets. In the case 
packet generation, do not generate another ICMP packet. In the case of 
packet forwarding, do.

Another student suggested that perhaps if the packet being sent is ICMP, 
do not generate an ICMP for it. That is, do not generate an ICMP for an 
ICMP, only generate for an IP. Given the examples I provided, I don't 
think that would be the right way, though. I can't find the answer in 
the RFC's either. Any thoughts?

-Adar
.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: No entry in routing table (alternate scenario)
Date: Tue, 03 Feb 2004 14:27:54 -0800
Lines: 49
Distribution: su
Message-ID: <bvp7b1$o7u$2@news.Stanford.EDU>
References: <bvp5u5$mo$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075847330 24830 127.0.0.1 (3 Feb 2004 22:28:50 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4
X-Accept-Language: en-us, en
In-Reply-To: <bvp5u5$mo$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5894

Adar Dembo wrote:
> Suppose you've got a generalized IP packet sending function that tacks 
> on an ethernet header, handles the ARP stuff, queries the routing table, 
> fills in all necessary fields, and calls sr_send_packet.
> 
> Now suppose you call this function on an ICMP packet. Furthermore, 
> suppose that you do not get a NextHop from the routing table. Do you 
> drop the packet? Or do you construct an ICMP Host Unreachable packet, 
> and attempt to send that to the source IP indicated in the first IP packet?

If I recall correctly, in this case the correct message is Network 
Unreachable.  I could be wrong.

> 
> The reason I ask is as follows: If I receive an ICMP Echo intended for 
> one of my interfaces, I want to construct an ICMP Echo Reply and send it 
> back to the host who sent it. Obviously, if I can't find the host in my 
> routing table, I'd get into an infinite loop if I likewise generated a 
> new ICMP Host Unreachable and tried to send that.

Where's the infinite loop?  You construct the ICMP echo reply.  Its 
source ip is your router.  You have a failure in sending it (in this 
case a Network Unreachable).  You don't need to send a message to the 
source since your router is the source.  Just drop it.

> 
> However, in another situation where I'm FORWARDING an ICMP packet (not 
> GENERATING), it does make sense to construct this. Example, I receive an 
> Echo intended for one of my app servers. I can't route to it, and as 
> such, I'm going to generate an ICMP Host Unreachable and send it back to 
> the source.
> 
> The way I'm thinking of handling this is, as I said, making a 
> dinstinction between GENERATING and FORWARDING packets. In the case 
> packet generation, do not generate another ICMP packet. In the case of 
> packet forwarding, do.
> 
> Another student suggested that perhaps if the packet being sent is ICMP, 
> do not generate an ICMP for it. That is, do not generate an ICMP for an 
> ICMP, only generate for an IP. Given the examples I provided, I don't 
> think that would be the right way, though. I can't find the answer in 
> the RFC's either. Any thoughts?
> 
> -Adar

Just examine the source ip.  If it's yourself, there's no point in 
sending an ICMP error message to yourself.

--Will
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: No entry in routing table (alternate scenario)
Date: Tue, 3 Feb 2004 14:38:02 -0800
Lines: 56
Distribution: su
Message-ID: <Pine.LNX.4.44.0402031437400.6593-100000@Xenon.Stanford.EDU>
References: <bvp5u5$mo$1@news.Stanford.EDU> <bvp7b1$o7u$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 1075847884 3340 171.64.66.201 (3 Feb 2004 22:38:04 GMT)
X-Complaints-To: news@news.stanford.edu
To: William Chan <chanman@stanford.edu>
In-Reply-To: <bvp7b1$o7u$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5895


 Will is correct (thanks).

 .m

> Adar Dembo wrote:
> > Suppose you've got a generalized IP packet sending function that tacks 
> > on an ethernet header, handles the ARP stuff, queries the routing table, 
> > fills in all necessary fields, and calls sr_send_packet.
> > 
> > Now suppose you call this function on an ICMP packet. Furthermore, 
> > suppose that you do not get a NextHop from the routing table. Do you 
> > drop the packet? Or do you construct an ICMP Host Unreachable packet, 
> > and attempt to send that to the source IP indicated in the first IP packet?
> 
> If I recall correctly, in this case the correct message is Network 
> Unreachable.  I could be wrong.
> 
> > 
> > The reason I ask is as follows: If I receive an ICMP Echo intended for 
> > one of my interfaces, I want to construct an ICMP Echo Reply and send it 
> > back to the host who sent it. Obviously, if I can't find the host in my 
> > routing table, I'd get into an infinite loop if I likewise generated a 
> > new ICMP Host Unreachable and tried to send that.
> 
> Where's the infinite loop?  You construct the ICMP echo reply.  Its 
> source ip is your router.  You have a failure in sending it (in this 
> case a Network Unreachable).  You don't need to send a message to the 
> source since your router is the source.  Just drop it.
> 
> > 
> > However, in another situation where I'm FORWARDING an ICMP packet (not 
> > GENERATING), it does make sense to construct this. Example, I receive an 
> > Echo intended for one of my app servers. I can't route to it, and as 
> > such, I'm going to generate an ICMP Host Unreachable and send it back to 
> > the source.
> > 
> > The way I'm thinking of handling this is, as I said, making a 
> > dinstinction between GENERATING and FORWARDING packets. In the case 
> > packet generation, do not generate another ICMP packet. In the case of 
> > packet forwarding, do.
> > 
> > Another student suggested that perhaps if the packet being sent is ICMP, 
> > do not generate an ICMP for it. That is, do not generate an ICMP for an 
> > ICMP, only generate for an IP. Given the examples I provided, I don't 
> > think that would be the right way, though. I can't find the answer in 
> > the RFC's either. Any thoughts?
> > 
> > -Adar
> 
> Just examine the source ip.  If it's yourself, there's no point in 
> sending an ICMP error message to yourself.
> 
> --Will
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Ursula Chen" <urse@stanford.edu>
Newsgroups: su.class.cs244a
Subject: can't connect to VNS server
Date: Tue, 3 Feb 2004 15:11:44 -0800
Lines: 13
Distribution: su
Message-ID: <bvp9ri$5k2$1@news.Stanford.EDU>
NNTP-Posting-Host: urse.stanford.edu
X-Trace: news.Stanford.EDU 1075849906 5762 128.12.185.104 (3 Feb 2004 23:11: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:5896

When I try to run my router, I get the following message:

Sending c_open (type=1 len=108)
vns server closed session.
Reason: reservehost failed
sr_destroy_INSTANCE leaking memory

And then the program exits.  What's going on?

Thanks,
Ursula


.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: No entry in routing table (alternate scenario)
Date: Tue, 3 Feb 2004 15:32:02 -0800
Lines: 73
Distribution: su
Message-ID: <Pine.GSO.4.44.0402031528060.18958-100000@elaine31.Stanford.EDU>
References: <bvp5u5$mo$1@news.Stanford.EDU> <bvp7b1$o7u$2@news.Stanford.EDU>
 <Pine.LNX.4.44.0402031437400.6593-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 1075851124 7393 171.64.15.106 (3 Feb 2004 23:32:04 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0402031437400.6593-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5897


> > If I recall correctly, in this case the correct message is Network
> > Unreachable.  I could be wrong.

In the faq, it says: "what type of ICMP messages do I have to generate"
and the answer has no mention of "Network Unreachable"...I've already
submitted an assignment that just sends back a "Host Unreachable", as
suggested by the FAQ

Do I have to change this and re-submit my assignment? I hope not... :)

--vishal



On Tue, 3 Feb 2004, Martin Casado wrote:

>
>  Will is correct (thanks).
>
>  .m
>
> > Adar Dembo wrote:
> > > Suppose you've got a generalized IP packet sending function that tacks
> > > on an ethernet header, handles the ARP stuff, queries the routing table,
> > > fills in all necessary fields, and calls sr_send_packet.
> > >
> > > Now suppose you call this function on an ICMP packet. Furthermore,
> > > suppose that you do not get a NextHop from the routing table. Do you
> > > drop the packet? Or do you construct an ICMP Host Unreachable packet,
> > > and attempt to send that to the source IP indicated in the first IP packet?
> >
> >
> > >
> > > The reason I ask is as follows: If I receive an ICMP Echo intended for
> > > one of my interfaces, I want to construct an ICMP Echo Reply and send it
> > > back to the host who sent it. Obviously, if I can't find the host in my
> > > routing table, I'd get into an infinite loop if I likewise generated a
> > > new ICMP Host Unreachable and tried to send that.
> >
> > Where's the infinite loop?  You construct the ICMP echo reply.  Its
> > source ip is your router.  You have a failure in sending it (in this
> > case a Network Unreachable).  You don't need to send a message to the
> > source since your router is the source.  Just drop it.
> >
> > >
> > > However, in another situation where I'm FORWARDING an ICMP packet (not
> > > GENERATING), it does make sense to construct this. Example, I receive an
> > > Echo intended for one of my app servers. I can't route to it, and as
> > > such, I'm going to generate an ICMP Host Unreachable and send it back to
> > > the source.
> > >
> > > The way I'm thinking of handling this is, as I said, making a
> > > dinstinction between GENERATING and FORWARDING packets. In the case
> > > packet generation, do not generate another ICMP packet. In the case of
> > > packet forwarding, do.
> > >
> > > Another student suggested that perhaps if the packet being sent is ICMP,
> > > do not generate an ICMP for it. That is, do not generate an ICMP for an
> > > ICMP, only generate for an IP. Given the examples I provided, I don't
> > > think that would be the right way, though. I can't find the answer in
> > > the RFC's either. Any thoughts?
> > >
> > > -Adar
> >
> > Just examine the source ip.  If it's yourself, there's no point in
> > sending an ICMP error message to yourself.
> >
> > --Will
> >
>
>

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS2 #6c
Date: Tue, 3 Feb 2004 16:18:07 -0800
Lines: 27
Distribution: su
Message-ID: <Pine.GSO.4.44.0402031612280.29144-100000@elaine25.Stanford.EDU>
References: <Pine.GSO.4.44.0402022207070.859-100000@elaine25.Stanford.EDU>
 <bvolcj$7j4$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075853889 10956 171.64.15.100 (4 Feb 2004 00:18:09 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bvolcj$7j4$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5898

Hmm, well, its a little hard to answer the question then, because the
average RTT to get to the
VIP-Wilson-Sonsini-Goodrich-Rosati-1055538.cust-rtr.pacbell.net
is smaller than the average RTT to www.ucla.edu...which contradicts
the "seeming further" part of the question...

so do we just assume that the last several hops will take a sufficiently
long time to make this question valid? .... I guess I'm a little confused
w/ the question...

--vishal


On Tue, 3 Feb 2004, Matthew Jonathan Holliman wrote:

>
> >Are we supposed to figure out the answer to this part w/out a succesful
> >completion of traceroute?
>
> I get the same thing--just assume for this question that there
> are several additional hops after
> VIP-Wilson-Sonsini-Goodrich-Rosati-1055538.cust-rtr.pacbell.net
> until www.wsgr.com.  They likely have a firewall in place that causes
> the behaviour we see.
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Extra office hours?
Date: Tue, 3 Feb 2004 16:23:40 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.LNX.4.44.0402031622330.19415-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 1075854224 11327 171.64.66.201 (4 Feb 2004 00:23:44 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5899


 Let us know if extra office hours tonight (7-9) would help.

 .martin

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: can't connect to VNS server
Date: Tue, 3 Feb 2004 16:56:56 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.LNX.4.44.0402031656400.787-100000@Xenon.Stanford.EDU>
References: <bvp9ri$5k2$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 1075856219 13973 171.64.66.201 (4 Feb 2004 00:56:59 GMT)
X-Complaints-To: news@news.stanford.edu
To: Ursula Chen <urse@stanford.edu>
In-Reply-To: <bvp9ri$5k2$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5900


 Which topology are you trying to connect to?

  .m

> When I try to run my router, I get the following message:
> 
> Sending c_open (type=1 len=108)
> vns server closed session.
> Reason: reservehost failed
> sr_destroy_INSTANCE leaking memory
> 
> And then the program exits.  What's going on?
> 
> Thanks,
> Ursula
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: No entry in routing table (alternate scenario)
Date: Tue, 3 Feb 2004 16:57:23 -0800
Lines: 80
Distribution: su
Message-ID: <Pine.LNX.4.44.0402031657100.787-100000@Xenon.Stanford.EDU>
References: <bvp5u5$mo$1@news.Stanford.EDU> <bvp7b1$o7u$2@news.Stanford.EDU>
 <Pine.LNX.4.44.0402031437400.6593-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402031528060.18958-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 1075856245 13994 171.64.66.201 (4 Feb 2004 00:57:25 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402031528060.18958-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5901


 Either is fine.

 .m

> 
> > > If I recall correctly, in this case the correct message is Network
> > > Unreachable.  I could be wrong.
> 
> In the faq, it says: "what type of ICMP messages do I have to generate"
> and the answer has no mention of "Network Unreachable"...I've already
> submitted an assignment that just sends back a "Host Unreachable", as
> suggested by the FAQ
> 
> Do I have to change this and re-submit my assignment? I hope not... :)
> 
> --vishal
> 
> 
> 
> On Tue, 3 Feb 2004, Martin Casado wrote:
> 
> >
> >  Will is correct (thanks).
> >
> >  .m
> >
> > > Adar Dembo wrote:
> > > > Suppose you've got a generalized IP packet sending function that tacks
> > > > on an ethernet header, handles the ARP stuff, queries the routing table,
> > > > fills in all necessary fields, and calls sr_send_packet.
> > > >
> > > > Now suppose you call this function on an ICMP packet. Furthermore,
> > > > suppose that you do not get a NextHop from the routing table. Do you
> > > > drop the packet? Or do you construct an ICMP Host Unreachable packet,
> > > > and attempt to send that to the source IP indicated in the first IP packet?
> > >
> > >
> > > >
> > > > The reason I ask is as follows: If I receive an ICMP Echo intended for
> > > > one of my interfaces, I want to construct an ICMP Echo Reply and send it
> > > > back to the host who sent it. Obviously, if I can't find the host in my
> > > > routing table, I'd get into an infinite loop if I likewise generated a
> > > > new ICMP Host Unreachable and tried to send that.
> > >
> > > Where's the infinite loop?  You construct the ICMP echo reply.  Its
> > > source ip is your router.  You have a failure in sending it (in this
> > > case a Network Unreachable).  You don't need to send a message to the
> > > source since your router is the source.  Just drop it.
> > >
> > > >
> > > > However, in another situation where I'm FORWARDING an ICMP packet (not
> > > > GENERATING), it does make sense to construct this. Example, I receive an
> > > > Echo intended for one of my app servers. I can't route to it, and as
> > > > such, I'm going to generate an ICMP Host Unreachable and send it back to
> > > > the source.
> > > >
> > > > The way I'm thinking of handling this is, as I said, making a
> > > > dinstinction between GENERATING and FORWARDING packets. In the case
> > > > packet generation, do not generate another ICMP packet. In the case of
> > > > packet forwarding, do.
> > > >
> > > > Another student suggested that perhaps if the packet being sent is ICMP,
> > > > do not generate an ICMP for it. That is, do not generate an ICMP for an
> > > > ICMP, only generate for an IP. Given the examples I provided, I don't
> > > > think that would be the right way, though. I can't find the answer in
> > > > the RFC's either. Any thoughts?
> > > >
> > > > -Adar
> > >
> > > Just examine the source ip.  If it's yourself, there's no point in
> > > sending an ICMP error message to yourself.
> > >
> > > --Will
> > >
> >
> >
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Ursula Chen" <urse@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: can't connect to VNS server
Date: Tue, 3 Feb 2004 16:57:59 -0800
Lines: 29
Distribution: su
Message-ID: <bvpg2o$dnu$1@news.Stanford.EDU>
References: <bvp9ri$5k2$1@news.Stanford.EDU> <Pine.LNX.4.44.0402031656400.787-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: urse.stanford.edu
X-Trace: news.Stanford.EDU 1075856280 14078 128.12.185.104 (4 Feb 2004 00:58:00 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:5902

I am trying to connect to topology 186.

Thanks,
-Ursula

"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0402031656400.787-100000@Xenon.Stanford.EDU...
>
>  Which topology are you trying to connect to?
>
>   .m
>
> > When I try to run my router, I get the following message:
> >
> > Sending c_open (type=1 len=108)
> > vns server closed session.
> > Reason: reservehost failed
> > sr_destroy_INSTANCE leaking memory
> >
> > And then the program exits.  What's going on?
> >
> > Thanks,
> > Ursula
> >
> >
> >
>


.

Path: shelby.stanford.edu!elaine37.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS2 #6c
Date: Wed, 4 Feb 2004 01:58:49 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <bvpjkp$ic0$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402022207070.859-100000@elaine25.Stanford.EDU>  <bvolcj$7j4$1@news.Stanford.EDU> <Pine.GSO.4.44.0402031612280.29144-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine37.stanford.edu
X-Trace: news.Stanford.EDU 1075859929 18816 171.64.15.112 (4 Feb 2004 01:58:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5903


>Hmm, well, its a little hard to answer the question then, because the
>average RTT to get to the
>VIP-Wilson-Sonsini-Goodrich-Rosati-1055538.cust-rtr.pacbell.net
>is smaller than the average RTT to www.ucla.edu...which contradicts
>the "seeming further" part of the question...

The "further" was a reference to the number of hops--i.e. for the purpose
of this problem, assume that there is another hop or two after the
firewall before you reach the WWW server.  There's no reference to RTT
in the question...

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: multiple ARP requests
Date: Tue, 3 Feb 2004 18:25:55 -0800
Lines: 49
Distribution: su
Message-ID: <bvpl8g$kl2$1@news.Stanford.EDU>
References: <bvn42d$92k$1@news.Stanford.EDU> <Pine.LNX.4.44.0402022100530.7704-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1075861583 21154 128.12.61.97 (4 Feb 2004 02:26: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:5904

If I choose to send out a new ARP request for every packet that doesn't have
an ARP cache entry, is it acceptable to send out the 5 retry requests for
each packet? So if I have 10 packets all going to A.B.C.D, and it's
unreachable, I'll have potentially 50 or 60 ARP requests going for that
IP... is this still acceptable? I plan on checking the packet queue whenever
an ARP reply is received, so even with 60 requests out, all it will take is
one reply to send out all the packets currently waiting for that IP's MAC
address...

Thanks,
Oded

>  Yes this is perfectly acceptable.  You are not required to
>  keep state for each arp request.
>
>  .m
>
>
> > Is it acceptable to send a new ARP request for every IP packet going to
a
> > hop for which I don't have an ARP cache entry?
> >
> > So if I have two packets, both with the SAME next hop:
> > -I receive the first packet
> > -I don't find an ARP entry, so I send out an ARP request
> > -I receive the second packet
> > -I don't find an ARP entry, so I send out an ARP request
> > -I receive the first ARP reply
> > -I receive the second ARP reply
> >
> > Is this redundancy acceptable?
> >
> > One caveat is that if I get a reply for the first ARP request but none
for
> > the second, I could theoretically send an ICMP host unreachable to the
> > second of the second packet, even though I have a (technically) valid
ARP
> > cache entry now... but if it doesn't respond to the second one, it may
have
> > presumably gone down at that moment...
> >
> > Thanks,
> > Oded
> >
> >
> >
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: icmp messsages
Date: Tue, 3 Feb 2004 18:34:07 -0800
Lines: 14
Distribution: su
Message-ID: <bvpln6$l8h$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1075862054 21777 128.12.189.163 (4 Feb 2004 02:34: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:5905

Hi,
There was a long post in the newsgroup abt the icmp messages.
The RFC says you should not send an icmp message about an icmp message.
So if i do not find the next hop ip for any icmp packet(addressed to me or
any one else)
I just drop it.
it it correct, or should i first check if the icmp packets are addressed to
only me & then drop such packets?
I have already submitted my assignement with the former.Please let meknow if
I need to change it to the latter.
Thanks,
haripriya


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: multiple ARP requests
Date: Tue, 3 Feb 2004 18:47:23 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0402031833001.4087-100000@Xenon.Stanford.EDU>
References: <bvn42d$92k$1@news.Stanford.EDU> <Pine.LNX.4.44.0402022100530.7704-100000@Xenon.Stanford.EDU>
 <bvpl8g$kl2$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 1075862845 22712 171.64.66.201 (4 Feb 2004 02:47:25 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <bvpl8g$kl2$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5906


> If I choose to send out a new ARP request for every packet that doesn't have
> an ARP cache entry, is it acceptable to send out the 5 retry requests for
> each packet? So if I have 10 packets all going to A.B.C.D, and it's
> unreachable, I'll have potentially 50 or 60 ARP requests going for that
> IP... is this still acceptable? I plan on checking the packet queue whenever
> an ARP reply is received, so even with 60 requests out, all it will take is
> one reply to send out all the packets currently waiting for that IP's MAC
> address...

 This is OK since you are not required to keep state for each sent ARP reply
 (though there are obviously better solutions such as marking in the ARP
 cache that you are waiting for a reply).
  
  .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: icmp messsages
Date: Tue, 3 Feb 2004 18:52:25 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0402031849330.8653-100000@Xenon.Stanford.EDU>
References: <bvpln6$l8h$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 1075863147 23139 171.64.66.201 (4 Feb 2004 02:52:27 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <bvpln6$l8h$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5907


> Hi,
> There was a long post in the newsgroup abt the icmp messages.
> The RFC says you should not send an icmp message about an icmp message.
> So if i do not find the next hop ip for any icmp packet(addressed to me or
> any one else)
> I just drop it.
 
 Thats just fine :)

  .m

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Overflow Policy?
Date: Tue, 03 Feb 2004 19:13:06 -0800
Lines: 4
Distribution: su
Message-ID: <40206342.B1E7458@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075864387 24634 128.12.21.88 (4 Feb 2004 03:13:07 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:5908

Is it acceptable to drop anything past 100 packets we get destined for
the same host (for which at the time we do not know ethernet address and
so cannot send)?

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Overflow Policy?
Date: Tue, 3 Feb 2004 19:35:12 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.LNX.4.44.0402031934530.26365-100000@Xenon.Stanford.EDU>
References: <40206342.B1E7458@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075865714 26373 171.64.66.201 (4 Feb 2004 03:35:14 GMT)
X-Complaints-To: news@news.stanford.edu
To: Ryan <ryan05@stanford.edu>
In-Reply-To: <40206342.B1E7458@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5909


> Is it acceptable to drop anything past 100 packets we get destined for
> the same host (for which at the time we do not know ethernet address and
> so cannot send)?

 Sure :) 

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: "Ayaz" <ayaz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: arp request for host unreachable
Date: Tue, 3 Feb 2004 19:49:35 -0800
Lines: 18
Distribution: su
Message-ID: <bvpq4q$qgq$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075866589 27162 127.0.0.1 (4 Feb 2004 03:49:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
Xref: shelby.stanford.edu su.class.cs244a:5910

Lets say we get a ftp/udp packet that we need to forward. We send multiple
ARP requests and no ARP replies come back.

So now we need to send an ICMP host unreachable message. We check the
routing table to find next hop. But if in the arp cache we don't have entry
for that next hop, do we have to queue the ICMP host unreachable message and
go through 5 to 6 ARP requests again for that ICMP?

[the reason i ask...the handler for sending that ICMP message is servicing
my queue of "blocked" packets but then i need get access to my queue to
place this ICMP message in it for later transmit....im running into deadlock
on mutex]

Thanks
Ayaz



.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: arp request for host unreachable
Date: Tue, 3 Feb 2004 21:25:07 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.LNX.4.44.0402032121030.5814-100000@Xenon.Stanford.EDU>
References: <bvpq4q$qgq$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 1075872309 5786 171.64.66.201 (4 Feb 2004 05:25:09 GMT)
X-Complaints-To: news@news.stanford.edu
To: Ayaz <ayaz@stanford.edu>
In-Reply-To: <bvpq4q$qgq$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5911


> Lets say we get a ftp/udp packet that we need to forward. We send multiple
> ARP requests and no ARP replies come back.
> 
> So now we need to send an ICMP host unreachable message. We check the
> routing table to find next hop. But if in the arp cache we don't have entry
> for that next hop, do we have to queue the ICMP host unreachable message and
> go through 5 to 6 ARP requests again for that ICMP?

 
  Yes you must queue the packet and ARP for the MAC, dropping the
  packet is incorrect.

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: modifying sr_main.c
Date: Wed, 4 Feb 2004 06:05:09 +0000 (UTC)
Lines: 3
Distribution: su
Message-ID: <bvq22l$91i$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1075874709 9266 171.64.15.68 (4 Feb 2004 06:05:09 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:5912

If we have added fields to the sr_instance struct, can we add code to 
initialize them in the sr_init_instance function?  That seems to me the 
logical place to put it...
.

Path: shelby.stanford.edu!firebird3.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: outgoing interface for traceroute
Date: Tue, 3 Feb 2004 22:14:24 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.LNX.4.44.0402032212080.12786-100000@firebird3.Stanford.EDU>
NNTP-Posting-Host: firebird3.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075875265 10052 171.64.15.16 (4 Feb 2004 06:14:25 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5913


Suppose we traceroute to an interface in the router other than eth0,
e.g. eth1. Should the last entry in the result be the IP of eth0 or eth1?
I thought it should always be the outgoing interface at the router
i.e., eth0. I might be wrong.

Thanks!!

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: icmp messsages
Date: Tue, 3 Feb 2004 22:30:24 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.GSO.4.44.0402032227470.6238-100000@elaine43.Stanford.EDU>
References: <bvpln6$l8h$1@news.Stanford.EDU> <Pine.LNX.4.44.0402031849330.8653-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 1075876226 11362 171.64.15.118 (4 Feb 2004 06:30:26 GMT)
X-Complaints-To: news@news.stanford.edu
Cc: Haripriya Rajagopal <hpriya@stanford.edu>
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0402031849330.8653-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5914

Is this correct to say that:
===
you should not send an icmp message about an icmp message.
===

What if the original ICMP message is the ECHO message?  I thought it is
quite important to send ICMP (host unreachable) back to the sender if ARP
retries timeout.

-Laura


On Tue, 3 Feb 2004, Martin Casado wrote:

>
> > Hi,
> > There was a long post in the newsgroup abt the icmp messages.
> > The RFC says you should not send an icmp message about an icmp message.
> > So if i do not find the next hop ip for any icmp packet(addressed to me or
> > any one else)
> > I just drop it.
>
>  Thats just fine :)
>
>   .m
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: modifying sr_main.c
Date: Tue, 3 Feb 2004 23:09:03 -0800
Lines: 12
Distribution: su
Message-ID: <bvq5qh$drb$1@news.Stanford.EDU>
References: <bvq22l$91i$1@news.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1075878545 14187 128.12.44.20 (4 Feb 2004 07:09: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:5915

void sr_init(struct sr_instance *), in sr_router.c, would be a more
appopriate place.

- Sean

"Tyrone Nicholas" <tyronen@Stanford.EDU> wrote in message
news:bvq22l$91i$1@news.Stanford.EDU...
> If we have added fields to the sr_instance struct, can we add code to
> initialize them in the sr_init_instance function?  That seems to me the
> logical place to put it...


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: modifying sr_main.c
Date: Wed, 4 Feb 2004 00:20:47 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0402040020290.313-100000@Xenon.Stanford.EDU>
References: <bvq22l$91i$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 1075882849 19413 171.64.66.201 (4 Feb 2004 08:20:49 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <bvq22l$91i$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5916



 That is what sr_init(..) is for in sr_router.c.

 .m

> If we have added fields to the sr_instance struct, can we add code to 
> initialize them in the sr_init_instance function?  That seems to me the 
> logical place to put it...
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: outgoing interface for traceroute
Date: Wed, 4 Feb 2004 00:21:28 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0402040020550.313-100000@Xenon.Stanford.EDU>
References: <Pine.LNX.4.44.0402032212080.12786-100000@firebird3.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075882890 19449 171.64.66.201 (4 Feb 2004 08:21:30 GMT)
X-Complaints-To: news@news.stanford.edu
To: Yuhui Jin <yhjin@stanford.edu>
In-Reply-To: <Pine.LNX.4.44.0402032212080.12786-100000@firebird3.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5917


 You can test your theory on the reference router or any of the other
 routers on campus.

 .m

> 
> Suppose we traceroute to an interface in the router other than eth0,
> e.g. eth1. Should the last entry in the result be the IP of eth0 or eth1?
> I thought it should always be the outgoing interface at the router
> i.e., eth0. I might be wrong.
> 
> Thanks!!
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: purify and signals
Date: Wed, 04 Feb 2004 00:25:02 -0800
Lines: 13
Distribution: su
Message-ID: <4020AC5E.B526BCAE@stanford.edu>
References: <Pine.GSO.4.44.0402021510260.3441-100000@epic15.Stanford.EDU> <Pine.LNX.4.44.0402021526470.3113-100000@Xenon.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075883104 19595 127.0.0.1 (4 Feb 2004 08:25:04 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:5918

Martin Casado wrote:
> 
>  Easiest way I've found is to register a signal handler for SIGHUP that
>  exits then kill -s HUP <pid>.

Is there a way to pass an argument to the signal handler
if we're not allowed to use global variables?

If we use signal(SIGINT, signal_handler) then signal_handler
gets only the signal number so it cannot do any cleanup.

-- 
Seungbeom Kim
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: icmp messsages
Date: Wed, 4 Feb 2004 00:25:50 -0800
Lines: 41
Distribution: su
Message-ID: <Pine.LNX.4.44.0402040021330.313-100000@Xenon.Stanford.EDU>
References: <bvpln6$l8h$1@news.Stanford.EDU> <Pine.LNX.4.44.0402031849330.8653-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402032227470.6238-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 1075883152 19640 171.64.66.201 (4 Feb 2004 08:25:52 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402032227470.6238-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5919


 It isn't correct, traceroute (the microsoft variety) and ping rely on
 responses to ICMP messages.  However, if you do not find a next hop for a
 generated ICMP, you should drop it.  Sending a host unreachable for an ICMP
 can be a security problem (forge a packet from one unreachable address to
 another will create an infinate ping of unreachable packets) so not responding
 is OK.  Either approach is fine with regards to the assignment.

 .m


> Is this correct to say that:
> ===
> you should not send an icmp message about an icmp message.
> ===
> 
> What if the original ICMP message is the ECHO message?  I thought it is
> quite important to send ICMP (host unreachable) back to the sender if ARP
> retries timeout.
> 
> -Laura
> 
> 
> On Tue, 3 Feb 2004, Martin Casado wrote:
> 
> >
> > > Hi,
> > > There was a long post in the newsgroup abt the icmp messages.
> > > The RFC says you should not send an icmp message about an icmp message.
> > > So if i do not find the next hop ip for any icmp packet(addressed to me or
> > > any one else)
> > > I just drop it.
> >
> >  Thats just fine :)
> >
> >   .m
> >
> >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: purify and signals
Date: Wed, 4 Feb 2004 00:41:32 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.LNX.4.44.0402040031180.2836-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402021510260.3441-100000@epic15.Stanford.EDU>
 <Pine.LNX.4.44.0402021526470.3113-100000@Xenon.Stanford.EDU>
 <4020AC5E.B526BCAE@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075884094 20471 171.64.66.201 (4 Feb 2004 08:41:34 GMT)
X-Complaints-To: news@news.stanford.edu
To: Seungbeom Kim <sbkim@stanford.edu>
In-Reply-To: <4020AC5E.B526BCAE@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5920


 This has become a sticky issue.  We are not conncerned about memory
 that still is referenced in the code, it is lost memory we are looking
 for when grading, and purify will provide this information regardless
 of a fully clean exit.

 however ...

 You can always provide an get_global_instance(..) method that maintains a
 local static reference to your router.  While this is kinda' hackish, it is
 preferrable to a file global or even a file local variable (you can monitor
 references, maintain multiple instances served by thread_id (this is commonly
 used in ip stacks) etc.)

 .m 

> Martin Casado wrote:
> > 
> >  Easiest way I've found is to register a signal handler for SIGHUP that
> >  exits then kill -s HUP <pid>.
> 
> Is there a way to pass an argument to the signal handler
> if we're not allowed to use global variables?
> 
> If we use signal(SIGINT, signal_handler) then signal_handler
> gets only the signal number so it cannot do any cleanup.
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: network byte order checksum
Date: Wed, 4 Feb 2004 01:11:33 -0800
Lines: 48
Distribution: su
Message-ID: <bvqd0v$m3d$1@news.Stanford.EDU>
References: <bvk56i$dre$1@news.Stanford.EDU> <Pine.LNX.4.44.0402012126040.3373-100000@Xenon.Stanford.EDU> <bvknat$516$1@news.Stanford.EDU> <Pine.LNX.4.44.0402012139040.13031-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1075885919 22637 128.12.61.97 (4 Feb 2004 09:11: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:5921

I'm a little confused on this issue.
Let's say my header is entirely of one byte fields (I know this is
hypothetical).
My checksum is the same regardless of whether I compute it directly on the
header or convert the fields to host byte order first (which does nothing on
1 byte fields)... but my checksum being a short calculated on my host,
couldn't it be potentially written in the wrong order if I don't do a htons
on it when writing it into the packet?

I guess my question is: I understand we want to do a checksum on the bytes
in network byte order... but when writing the checksum into the header
field, do we still need to call htons on it?

Thanks,
Oded

>
>  yes :)
>  .m
>
> > But if we compute it over a header that is in network byte order, the
sum
> > will be in network byte order?
> >
> > -Eddy
> >
> > "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> > news:Pine.LNX.4.44.0402012126040.3373-100000@Xenon.Stanford.EDU...
> > >
> > >   Not necessarily, the algorithm is independant of byte ordering.
> > >
> > >   .m
> > >
> > > > Just to confirm: if we use the algorithm given in the Peterson/Davie
> > book to
> > > > calculate the checksum, the integer that we compute will already be
in
> > > > network byte order?
> > > >
> > > >
> > > >
> > >
> >
> >
> >
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: network byte order checksum
Date: Wed, 4 Feb 2004 01:19:59 -0800
Lines: 65
Distribution: su
Message-ID: <bvqdgp$mhk$1@news.Stanford.EDU>
References: <bvk56i$dre$1@news.Stanford.EDU> <Pine.LNX.4.44.0402012126040.3373-100000@Xenon.Stanford.EDU> <bvknat$516$1@news.Stanford.EDU> <Pine.LNX.4.44.0402012139040.13031-100000@Xenon.Stanford.EDU> <bvqd0v$m3d$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1075886425 23092 128.12.61.97 (4 Feb 2004 09:20: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:5922

Okay... I think I figured this out.
Doing a check sum on a host ordered header would give an incorrect
checksum... since it's a bitwise operation all we care about is the bits in
the 16-bit checksum field, which will come out correct regardless of whether
my host is big or little endian.
So no htons when writing the checksum.

Oded

"Oded Wurman" <owurman@stanford.edu> wrote in message
news:bvqd0v$m3d$1@news.Stanford.EDU...
> I'm a little confused on this issue.
> Let's say my header is entirely of one byte fields (I know this is
> hypothetical).
> My checksum is the same regardless of whether I compute it directly on the
> header or convert the fields to host byte order first (which does nothing
on
> 1 byte fields)... but my checksum being a short calculated on my host,
> couldn't it be potentially written in the wrong order if I don't do a
htons
> on it when writing it into the packet?
>
> I guess my question is: I understand we want to do a checksum on the bytes
> in network byte order... but when writing the checksum into the header
> field, do we still need to call htons on it?
>
> Thanks,
> Oded
>
> >
> >  yes :)
> >  .m
> >
> > > But if we compute it over a header that is in network byte order, the
> sum
> > > will be in network byte order?
> > >
> > > -Eddy
> > >
> > > "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> > > news:Pine.LNX.4.44.0402012126040.3373-100000@Xenon.Stanford.EDU...
> > > >
> > > >   Not necessarily, the algorithm is independant of byte ordering.
> > > >
> > > >   .m
> > > >
> > > > > Just to confirm: if we use the algorithm given in the
Peterson/Davie
> > > book to
> > > > > calculate the checksum, the integer that we compute will already
be
> in
> > > > > network byte order?
> > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> >
>
>


.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftp file size incorrect
Date: Wed, 4 Feb 2004 03:39:56 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.GSO.4.44.0402040336130.6640-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 1075894799 855 171.64.15.70 (4 Feb 2004 11:39:59 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5923


My router seems to be working fine for all cases. However, I just found
out for large files such as the mp3 files on the ftp server, the
downloaded
file has a number of bytes missing. It works fine with the small image
file though. I don't see why this will happen, any help or suggestions
will be highly appreciated!!



.

Path: shelby.stanford.edu!elaine12.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ftp file size incorrect
Date: Wed, 4 Feb 2004 16:12:05 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <bvr5kl$gjc$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402040336130.6640-100000@elaine5.Stanford.EDU>
NNTP-Posting-Host: elaine12.stanford.edu
X-Trace: news.Stanford.EDU 1075911125 17004 171.64.15.77 (4 Feb 2004 16:12:05 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5924

Yuhui Jin <yhjin@stanford.edu> writes:


>My router seems to be working fine for all cases. However, I just found
>out for large files such as the mp3 files on the ftp server, the
>downloaded
>file has a number of bytes missing. It works fine with the small image
>file though. I don't see why this will happen, any help or suggestions
>will be highly appreciated!!


Do you see anything interesting when you look at your packet trace
with tcpdump/ethereal?  This would be the first step in trying to debug
your problem.

.

Path: shelby.stanford.edu!elaine12.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: submission TA
Date: Wed, 4 Feb 2004 16:22:31 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <bvr687$h99$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine12.stanford.edu
X-Trace: news.Stanford.EDU 1075911751 17705 171.64.15.77 (4 Feb 2004 16:22:31 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5925

I thought I'd clarify since I received question about this--
You may recall that Nick mentioned on the first day of class that we
rotate TAs when grading programming assignments.  So someone asked
to whom they should submit this time (and for future PAs, too).

You should still submit to your original TA, i.e. whomever you were assigned
at the beginning of the quarter.  (We just rotate grading internally).

Thanks.
.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: 192.168.129.3
Date: Wed, 4 Feb 2004 11:27:53 -0800
Lines: 18
Distribution: su
Message-ID: <bvrh4g$8b$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1075922896 267 128.12.61.97 (4 Feb 2004 19:28: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:5926

Hey,

I'm getting a strange ARP cache entry for the IP 192.168.129.3.  I checked
tcpdump, and sure enough:

arp 84: arp who-has kunnatur-router-3.Stanford.EDU tell 192.168.129.3

The only strange thing about it (aside from it not being anywhere on my
topology) is that the MAC address it's giving me is the MAC address for
192.168.129.133.
It doesn't really hurt me as long as I don't try sending anything to
192.168.129.3, but it doesn't seem like it should be there.  Yet it's coming
from someone else, so can it be my bug?

Thanks,
Oded


.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp file size incorrect
Date: Wed, 04 Feb 2004 11:41:20 -0800
Lines: 26
Distribution: su
Message-ID: <bvrht1$19s$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402040336130.6640-100000@elaine5.Stanford.EDU> <bvr5kl$gjc$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 1075923681 1340 128.12.194.74 (4 Feb 2004 19:41: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: <bvr5kl$gjc$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5927

Matthew Jonathan Holliman wrote:
> Yuhui Jin <yhjin@stanford.edu> writes:
> 
> 
> 
>>My router seems to be working fine for all cases. However, I just found
>>out for large files such as the mp3 files on the ftp server, the
>>downloaded
>>file has a number of bytes missing. It works fine with the small image
>>file though. I don't see why this will happen, any help or suggestions
>>will be highly appreciated!!
> 

I don't know if this will help, but if you're limiting your packet size 
to an MTU of 1500, try bumping it up to 1515.  I noticed that if I don't 
set a limit, a good part of the files come in 1514 sized packets. :)

Paul E.

> 
> 
> Do you see anything interesting when you look at your packet trace
> with tcpdump/ethereal?  This would be the first step in trying to debug
> your problem.
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: 192.168.129.3
Date: Wed, 4 Feb 2004 12:07:48 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.LNX.4.44.0402041203350.837-100000@Xenon.Stanford.EDU>
References: <bvrh4g$8b$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 1075925272 3320 171.64.66.201 (4 Feb 2004 20:07:52 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <bvrh4g$8b$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5928



 I'm confused, you are getting an ARP request with a destination MAC
 address of 192.168.129.133, from 192.168.129.132 requesting
 192.168.129.3? This doesn't seem possible

 can you repost using -n -x -vvv for the arp line?

 .m

> Hey,
> 
> I'm getting a strange ARP cache entry for the IP 192.168.129.3.  I checked
> tcpdump, and sure enough:
> 
> arp 84: arp who-has kunnatur-router-3.Stanford.EDU tell 192.168.129.3
> 
> The only strange thing about it (aside from it not being anywhere on my
> topology) is that the MAC address it's giving me is the MAC address for
> 192.168.129.133.
> It doesn't really hurt me as long as I don't try sending anything to
> 192.168.129.3, but it doesn't seem like it should be there.  Yet it's coming
> from someone else, so can it be my bug?
> 
> Thanks,
> Oded
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp file size incorrect
Date: Wed, 4 Feb 2004 12:18:52 -0800
Lines: 36
Distribution: su
Message-ID: <bvrk4k$431$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402040336130.6640-100000@elaine5.Stanford.EDU> <bvr5kl$gjc$1@news.Stanford.EDU> <bvrht1$19s$1@news.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1075925972 4193 128.12.44.20 (4 Feb 2004 20:19: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:5929

@Paul:
It's because the 1500 MTU is for the IP part of the packet, and doesn't
include the extra 14 bytes of the ethernet header.

- Sean

"Paul E." <ignatius@stanford.edu> wrote in message
news:bvrht1$19s$1@news.Stanford.EDU...
> Matthew Jonathan Holliman wrote:
> > Yuhui Jin <yhjin@stanford.edu> writes:
> >
> >
> >
> >>My router seems to be working fine for all cases. However, I just found
> >>out for large files such as the mp3 files on the ftp server, the
> >>downloaded
> >>file has a number of bytes missing. It works fine with the small image
> >>file though. I don't see why this will happen, any help or suggestions
> >>will be highly appreciated!!
> >
>
> I don't know if this will help, but if you're limiting your packet size
> to an MTU of 1500, try bumping it up to 1515.  I noticed that if I don't
> set a limit, a good part of the files come in 1514 sized packets. :)
>
> Paul E.
>
> >
> >
> > Do you see anything interesting when you look at your packet trace
> > with tcpdump/ethereal?  This would be the first step in trying to debug
> > your problem.
> >
>


.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!spathak
From: Sumedh Pathak <spathak@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ICMP host unreachable
Date: Wed, 4 Feb 2004 12:55:36 -0800
Lines: 31
Distribution: su
Message-ID: <Pine.GSO.4.44.0402041249200.4914-100000@elaine28.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075928139 6638 171.64.15.69 (4 Feb 2004 20:55:39 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5930


Hi,

Im having some problems with getting ICMP host unreachable working. I send
arp requests 5 times, and I send out an ICMP msg with host unreachable.
However, it never seems to get back to the application (eg. ping, ftp).

I looked at the packet in ethereal, and everything seems fine:

12:47:38.249672 70:0:0:ab:0:1 0:e0:81:4:26:d9 ip 78:
jamfan-router-3.Stanford.EDU > ratfish.Stanford.EDU: icmp:
host ftp-jamfan.Stanford.EDU unreachable for ratfish.Stanford.EDU >
ftp-jamfan.Stanford.EDU: icmp: ech
o request (ttl 59, id 36084, len 84) (ttl 64, id 36084, len 64)
                         4500 0040 8cf4 0000 4001 a912 c0a8 8166
                         ab41 5766 0301 e225 0000 05dc 4500 0054
                         8cf4 0000 3b01 adfd ab41 5766 c0a8 8167
                         0800 5d29 1a49 0000 4021 5a64 0004 fb00


where my machine is trying to ping the ftp server.
Ignore the packet size, cos I was trying out some other stuff.

However, if I just change the code to ICMP Port Unreachable, then ftp
quits with 'connection refused' error.

Im not sure what the problem is here. All checksums are reported as
correct in ethereal.

Sumedh

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Acceptable Technique to Reply
Date: Wed, 04 Feb 2004 12:56:22 -0800
Lines: 7
Distribution: su
Message-ID: <40215C76.79C983DC@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075928183 6680 128.12.21.88 (4 Feb 2004 20:56:23 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:5931

   For ICMP pings as well as port unreachables is it acceptable to
switch dest/source fields rather than do a lookup for next hop.  In
these cases, it seems we can safely send back to where it came from so I
assumed it would be ok but I want to be sure.



.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ICMP host unreachable
Date: Wed, 4 Feb 2004 13:15:05 -0800
Lines: 48
Distribution: su
Message-ID: <Pine.LNX.4.44.0402041310260.27558-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402041249200.4914-100000@elaine28.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075929308 8046 171.64.66.201 (4 Feb 2004 21:15:08 GMT)
X-Complaints-To: news@news.stanford.edu
To: Sumedh Pathak <spathak@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402041249200.4914-100000@elaine28.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5932

> 

 ftp won't necessarily time out if it gets a host unreachable.  Ping should
 respond something like:

 packet seq=3 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host unreachable
 packet seq=4 bounced at vns-firewall.Stanford.EDU (172.24.74.11): Host unreachable

 (though the source will not be vns-firewall)

 you can verify that this works by trying to ping your router when it isn't
 connected.

 .m


> Hi,
> 
> Im having some problems with getting ICMP host unreachable working. I send
> arp requests 5 times, and I send out an ICMP msg with host unreachable.
> However, it never seems to get back to the application (eg. ping, ftp).
> 
> I looked at the packet in ethereal, and everything seems fine:
> 
> 12:47:38.249672 70:0:0:ab:0:1 0:e0:81:4:26:d9 ip 78:
> jamfan-router-3.Stanford.EDU > ratfish.Stanford.EDU: icmp:
> host ftp-jamfan.Stanford.EDU unreachable for ratfish.Stanford.EDU >
> ftp-jamfan.Stanford.EDU: icmp: ech
> o request (ttl 59, id 36084, len 84) (ttl 64, id 36084, len 64)
>                          4500 0040 8cf4 0000 4001 a912 c0a8 8166
>                          ab41 5766 0301 e225 0000 05dc 4500 0054
>                          8cf4 0000 3b01 adfd ab41 5766 c0a8 8167
>                          0800 5d29 1a49 0000 4021 5a64 0004 fb00
> 
> 
> where my machine is trying to ping the ftp server.
> Ignore the packet size, cos I was trying out some other stuff.
> 
> However, if I just change the code to ICMP Port Unreachable, then ftp
> quits with 'connection refused' error.
> 
> Im not sure what the problem is here. All checksums are reported as
> correct in ethereal.
> 
> Sumedh
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Acceptable Technique to Reply
Date: Wed, 4 Feb 2004 13:16:09 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0402041315150.27558-100000@Xenon.Stanford.EDU>
References: <40215C76.79C983DC@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075929371 8267 171.64.66.201 (4 Feb 2004 21:16:11 GMT)
X-Complaints-To: news@news.stanford.edu
To: Ryan <ryan05@stanford.edu>
In-Reply-To: <40215C76.79C983DC@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5933


>    For ICMP pings as well as port unreachables is it acceptable to
> switch dest/source fields rather than do a lookup for next hop.  In
> these cases, it seems we can safely send back to where it came from so I
> assumed it would be ok but I want to be sure.

 No, even if you choose to switch the source/dest you must consult the
 routing table for the correct interface to send it out of.

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: Joey Liaw <jliaw@@@stanford.....nospam.edu>
Newsgroups: su.class.cs244a
Subject: application feedback of host unreachable
Date: Wed, 4 Feb 2004 21:16:12 +0000 (UTC)
Organization: Stanford University
Lines: 21
Distribution: su
Message-ID: <Xns9485871DDA19Ajliawstanfordnospam@171.64.14.103>
NNTP-Posting-Host: myeah.stanford.edu
X-Trace: news.Stanford.EDU 1075929372 29490 128.12.102.21 (4 Feb 2004 21:16:12 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Xnews/5.04.25
Xref: shelby.stanford.edu su.class.cs244a:5934

So I mangle rtable to test out ICMP host unreachable.
I try to ftp to my now unreachable host.

The router appears to properly send arp requests every second, waits 
patiently for five requests to get ignored, then responds with ICMP host 
unreachable.

However, the ftp application then decides to send another packet instead of 
telling me 'host unreachable.'  Is this the correct behavior or am I 
somehow sending invalid host unreachable packets?  It looks good to me:

12:55:16.765625 arp who-has 4.4.4.4 (ff:ff:ff:ff:ff:ff) tell 
192.168.129.124
                         0001 0800 0604 0001 7000 00af 0006 c0a8
                         817c ffff ffff ffff 0404 0404
12:55:16.765625 192.168.129.121 > 171.64.15.102: icmp: host 192.168.129.125 
unreachable
                         4500 0038 0000 0000 4001 7dfd c0a8 8179
                         ab40 0f66 0301 4f13 0000 05dc 4500 0030
                         776b 4000 3c06 ca90 ab40 0f66 c0a8 817d
                         f6b2 0015 8c16 2531
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: application feedback of host unreachable
Date: Wed, 4 Feb 2004 13:25:11 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.LNX.4.44.0402041324390.1857-100000@Xenon.Stanford.EDU>
References: <Xns9485871DDA19Ajliawstanfordnospam@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 1075929913 8888 171.64.66.201 (4 Feb 2004 21:25:13 GMT)
X-Complaints-To: news@news.stanford.edu
To: Joey Liaw <jliaw@stanford.edu>
In-Reply-To: <Xns9485871DDA19Ajliawstanfordnospam@171.64.14.103>
Xref: shelby.stanford.edu su.class.cs244a:5935


 Check out my recent answer to Sumedh in the newsgroup.

 .m

> So I mangle rtable to test out ICMP host unreachable.
> I try to ftp to my now unreachable host.
> 
> The router appears to properly send arp requests every second, waits 
> patiently for five requests to get ignored, then responds with ICMP host 
> unreachable.
> 
> However, the ftp application then decides to send another packet instead of 
> telling me 'host unreachable.'  Is this the correct behavior or am I 
> somehow sending invalid host unreachable packets?  It looks good to me:
> 
> 12:55:16.765625 arp who-has 4.4.4.4 (ff:ff:ff:ff:ff:ff) tell 
> 192.168.129.124
>                          0001 0800 0604 0001 7000 00af 0006 c0a8
>                          817c ffff ffff ffff 0404 0404
> 12:55:16.765625 192.168.129.121 > 171.64.15.102: icmp: host 192.168.129.125 
> unreachable
>                          4500 0038 0000 0000 4001 7dfd c0a8 8179
>                          ab40 0f66 0301 4f13 0000 05dc 4500 0030
>                          776b 4000 3c06 ca90 ab40 0f66 c0a8 817d
>                          f6b2 0015 8c16 2531
> 

.

Path: shelby.stanford.edu!firebird6.Stanford.EDU!yhjin
From: Yuhui Jin <yhjin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftp file size incorrect
Date: Wed, 4 Feb 2004 13:28:08 -0800
Lines: 49
Distribution: su
Message-ID: <Pine.LNX.4.44.0402041325060.27032-100000@firebird6.Stanford.EDU>
References: <Pine.GSO.4.44.0402040336130.6640-100000@elaine5.Stanford.EDU>
 <bvr5kl$gjc$1@news.Stanford.EDU> <bvrht1$19s$1@news.Stanford.EDU>
 <bvrk4k$431$1@news.Stanford.EDU>
NNTP-Posting-Host: firebird6.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075930090 9084 171.64.15.19 (4 Feb 2004 21:28:10 GMT)
X-Complaints-To: news@news.stanford.edu
To: "Sean M." <seanm514@stanford.edu>
In-Reply-To: <bvrk4k$431$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5936


Thanks! The problem has been solved by explicitly setting to the binary
mode before I do the get file. I think the ftp server is by default in
ASC II mode. I hope there's nothing we need to fix in our router.

Anyway, all files seem to bear the same size now.



On Wed, 4 Feb 2004, Sean M. wrote:

> @Paul:
> It's because the 1500 MTU is for the IP part of the packet, and doesn't
> include the extra 14 bytes of the ethernet header.
>
> - Sean
>
> "Paul E." <ignatius@stanford.edu> wrote in message
> news:bvrht1$19s$1@news.Stanford.EDU...
> > Matthew Jonathan Holliman wrote:
> > > Yuhui Jin <yhjin@stanford.edu> writes:
> > >
> > >
> > >
> > >>My router seems to be working fine for all cases. However, I just found
> > >>out for large files such as the mp3 files on the ftp server, the
> > >>downloaded
> > >>file has a number of bytes missing. It works fine with the small image
> > >>file though. I don't see why this will happen, any help or suggestions
> > >>will be highly appreciated!!
> > >
> >
> > I don't know if this will help, but if you're limiting your packet size
> > to an MTU of 1500, try bumping it up to 1515.  I noticed that if I don't
> > set a limit, a good part of the files come in 1514 sized packets. :)
> >
> > Paul E.
> >
> > >
> > >
> > > Do you see anything interesting when you look at your packet trace
> > > with tcpdump/ethereal?  This would be the first step in trying to debug
> > > your problem.
> > >
> >
>
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: testing IP options
Date: Wed, 4 Feb 2004 14:04:02 -0800
Lines: 10
Distribution: su
Message-ID: <bvrq98$av9$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1075932264 11241 128.12.61.97 (4 Feb 2004 22:04: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:5937

Is there a way to set IP options in ping or traceroute, thus making the IP
header larger than 20 bytes?  I wasn't able to find such an option in the
man page.

Is there perhaps another way to test IP headers with options?

Thanks,
Oded


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: can't connect to VNS server
Date: Wed, 4 Feb 2004 14:08:53 -0800
Lines: 36
Distribution: su
Message-ID: <bvrqic$bb1$1@news.Stanford.EDU>
References: <bvp9ri$5k2$1@news.Stanford.EDU> <Pine.LNX.4.44.0402031656400.787-100000@Xenon.Stanford.EDU> <bvpg2o$dnu$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1075932556 11617 128.12.61.97 (4 Feb 2004 22:09: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:5938

I got the same error when I was running the router in two windows.
Might that have been it?

Oded

> I am trying to connect to topology 186.
>
> Thanks,
> -Ursula
>
> "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> news:Pine.LNX.4.44.0402031656400.787-100000@Xenon.Stanford.EDU...
> >
> >  Which topology are you trying to connect to?
> >
> >   .m
> >
> > > When I try to run my router, I get the following message:
> > >
> > > Sending c_open (type=1 len=108)
> > > vns server closed session.
> > > Reason: reservehost failed
> > > sr_destroy_INSTANCE leaking memory
> > >
> > > And then the program exits.  What's going on?
> > >
> > > Thanks,
> > > Ursula
> > >
> > >
> > >
> >
>
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: testing IP options
Date: Wed, 4 Feb 2004 15:36:10 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0402041535580.28271-100000@Xenon.Stanford.EDU>
References: <bvrq98$av9$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 1075937772 17891 171.64.66.201 (4 Feb 2004 23:36:12 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <bvrq98$av9$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5939


 you can use hping.

 .m

> Is there a way to set IP options in ping or traceroute, thus making the IP
> header larger than 20 bytes?  I wasn't able to find such an option in the
> man page.
> 
> Is there perhaps another way to test IP headers with options?
> 
> Thanks,
> Oded
> 
> 
> 

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: icmp messsages
Date: Wed, 4 Feb 2004 15:53:18 -0800
Lines: 59
Distribution: su
Message-ID: <Pine.GSO.4.44.0402041545540.6307-100000@elaine43.Stanford.EDU>
References: <bvpln6$l8h$1@news.Stanford.EDU> <Pine.LNX.4.44.0402031849330.8653-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402032227470.6238-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0402040021330.313-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 1075938803 19289 171.64.15.118 (4 Feb 2004 23:53:23 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0402040021330.313-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5940

Is a good idea to drop all queued-up messages that have a source address
that belongs to one of the router's interface?

The reason behind this:
(1) ICMP message is the only kind of message that the router sends out
(with its interface ip address as the source address).  By dropping the queued ICMP message generated by
the router, we pervent the router generates even more ICMP messages.

For ICMP (Echo Reply) messages sent by the router, if the router can not
find out the next hop, it is anyway meaningless to send the ICMP(Host
unreachable) back to router.

Does this sound reasonable?

On Wed, 4 Feb 2004, Martin Casado wrote:

>
>  It isn't correct, traceroute (the microsoft variety) and ping rely on
>  responses to ICMP messages.  However, if you do not find a next hop for a
>  generated ICMP, you should drop it.  Sending a host unreachable for an ICMP
>  can be a security problem (forge a packet from one unreachable address to
>  another will create an infinate ping of unreachable packets) so not responding
>  is OK.  Either approach is fine with regards to the assignment.
>
>  .m
>
>
> > Is this correct to say that:
> > ===
> > you should not send an icmp message about an icmp message.
> > ===
> >
> > What if the original ICMP message is the ECHO message?  I thought it is
> > quite important to send ICMP (host unreachable) back to the sender if ARP
> > retries timeout.
> >
> > -Laura
> >
> >
> > On Tue, 3 Feb 2004, Martin Casado wrote:
> >
> > >
> > > > Hi,
> > > > There was a long post in the newsgroup abt the icmp messages.
> > > > The RFC says you should not send an icmp message about an icmp message.
> > > > So if i do not find the next hop ip for any icmp packet(addressed to me or
> > > > any one else)
> > > > I just drop it.
> > >
> > >  Thats just fine :)
> > >
> > >   .m
> > >
> > >
> >
> >
>
>

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: icmp messsages
Date: Wed, 4 Feb 2004 15:58:12 -0800
Lines: 70
Distribution: su
Message-ID: <Pine.LNX.4.44.0402041555370.4792-100000@Xenon.Stanford.EDU>
References: <bvpln6$l8h$1@news.Stanford.EDU> <Pine.LNX.4.44.0402031849330.8653-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402032227470.6238-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0402040021330.313-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402041545540.6307-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 1075939094 19690 171.64.66.201 (4 Feb 2004 23:58:14 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402041545540.6307-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5941


 Not really, dropping an ICMP echo reply because you don't have
 the next hop MAC in your cache is not correct.  Now if you 
 time out all your arp requests then you may drop any packet
 sourced from you.

 .m


> Is a good idea to drop all queued-up messages that have a source address
> that belongs to one of the router's interface?
> 
> The reason behind this:
> (1) ICMP message is the only kind of message that the router sends out
> (with its interface ip address as the source address).  By dropping the queued ICMP message generated by
> the router, we pervent the router generates even more ICMP messages.
> 
> For ICMP (Echo Reply) messages sent by the router, if the router can not
> find out the next hop, it is anyway meaningless to send the ICMP(Host
> unreachable) back to router.
> 
> Does this sound reasonable?
> 
> On Wed, 4 Feb 2004, Martin Casado wrote:
> 
> >
> >  It isn't correct, traceroute (the microsoft variety) and ping rely on
> >  responses to ICMP messages.  However, if you do not find a next hop for a
> >  generated ICMP, you should drop it.  Sending a host unreachable for an ICMP
> >  can be a security problem (forge a packet from one unreachable address to
> >  another will create an infinate ping of unreachable packets) so not responding
> >  is OK.  Either approach is fine with regards to the assignment.
> >
> >  .m
> >
> >
> > > Is this correct to say that:
> > > ===
> > > you should not send an icmp message about an icmp message.
> > > ===
> > >
> > > What if the original ICMP message is the ECHO message?  I thought it is
> > > quite important to send ICMP (host unreachable) back to the sender if ARP
> > > retries timeout.
> > >
> > > -Laura
> > >
> > >
> > > On Tue, 3 Feb 2004, Martin Casado wrote:
> > >
> > > >
> > > > > Hi,
> > > > > There was a long post in the newsgroup abt the icmp messages.
> > > > > The RFC says you should not send an icmp message about an icmp message.
> > > > > So if i do not find the next hop ip for any icmp packet(addressed to me or
> > > > > any one else)
> > > > > I just drop it.
> > > >
> > > >  Thats just fine :)
> > > >
> > > >   .m
> > > >
> > > >
> > >
> > >
> >
> >
> 
> 

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: icmp messsages
Date: Wed, 4 Feb 2004 16:03:20 -0800
Lines: 78
Distribution: su
Message-ID: <Pine.GSO.4.44.0402041600410.6850-100000@elaine43.Stanford.EDU>
References: <bvpln6$l8h$1@news.Stanford.EDU> <Pine.LNX.4.44.0402031849330.8653-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402032227470.6238-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0402040021330.313-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402041545540.6307-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0402041555370.4792-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 1075939402 20209 171.64.15.118 (5 Feb 2004 00:03:22 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@CS.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0402041555370.4792-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5942


Actually, what I wanted IS to drop any packet sourced from the router
after the ARP requests are timeout (the queued-up messages are the ones
that are waiting for the ARP_REPLY).  So, it matches what you stated, right?

On Wed, 4 Feb 2004, Martin Casado wrote:

>
>  Not really, dropping an ICMP echo reply because you don't have
>  the next hop MAC in your cache is not correct.  Now if you
>  time out all your arp requests then you may drop any packet
>  sourced from you.
>
>  .m
>
>
> > Is a good idea to drop all queued-up messages that have a source address
> > that belongs to one of the router's interface?
> >
> > The reason behind this:
> > (1) ICMP message is the only kind of message that the router sends out
> > (with its interface ip address as the source address).  By dropping the queued ICMP message generated by
> > the router, we pervent the router generates even more ICMP messages.
> >
> > For ICMP (Echo Reply) messages sent by the router, if the router can not
> > find out the next hop, it is anyway meaningless to send the ICMP(Host
> > unreachable) back to router.
> >
> > Does this sound reasonable?
> >
> > On Wed, 4 Feb 2004, Martin Casado wrote:
> >
> > >
> > >  It isn't correct, traceroute (the microsoft variety) and ping rely on
> > >  responses to ICMP messages.  However, if you do not find a next hop for a
> > >  generated ICMP, you should drop it.  Sending a host unreachable for an ICMP
> > >  can be a security problem (forge a packet from one unreachable address to
> > >  another will create an infinate ping of unreachable packets) so not responding
> > >  is OK.  Either approach is fine with regards to the assignment.
> > >
> > >  .m
> > >
> > >
> > > > Is this correct to say that:
> > > > ===
> > > > you should not send an icmp message about an icmp message.
> > > > ===
> > > >
> > > > What if the original ICMP message is the ECHO message?  I thought it is
> > > > quite important to send ICMP (host unreachable) back to the sender if ARP
> > > > retries timeout.
> > > >
> > > > -Laura
> > > >
> > > >
> > > > On Tue, 3 Feb 2004, Martin Casado wrote:
> > > >
> > > > >
> > > > > > Hi,
> > > > > > There was a long post in the newsgroup abt the icmp messages.
> > > > > > The RFC says you should not send an icmp message about an icmp message.
> > > > > > So if i do not find the next hop ip for any icmp packet(addressed to me or
> > > > > > any one else)
> > > > > > I just drop it.
> > > > >
> > > > >  Thats just fine :)
> > > > >
> > > > >   .m
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>

.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: How to test ICMP host unreachable
Date: Wed, 04 Feb 2004 16:03:36 -0800
Lines: 6
Distribution: su
Message-ID: <40218858.66B86789@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1075939418 20219 127.0.0.1 (5 Feb 2004 00:03:38 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:5943

The router is required to send back an "ICMP host unreachable" message
if it doesn't get ARP replies. How can I test that functionality,
since all the hosts whose addresses I'm given respond to ARP requests?

-- 
Seungbeom Kim
.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: inet_ntoa leaky?
Date: Wed, 4 Feb 2004 16:05:13 -0800
Lines: 20
Distribution: su
Message-ID: <bvs1cf$jt9$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1075939535 20393 128.12.61.97 (5 Feb 2004 00:05: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:5944

Hey,

I only have one memory leak in my program, and it's in a call to inet_ntoa.
Earlier when I tried free'ing the return value, I got other errors, and
eventually concluded that inet_ntoa does something strange, but doesn't
quite malloc new memory.  So I'm confused... do I have to free the pointer
returns by a call to inet_ntoa, or don't I?

Either way I get purify errors...

without freeing I get a MLK error.
with freeing I get a bunch of FMWs...

I'm tending towards not free'ing it, since it's a much smaller error in
purify.

Thanks,
Oded


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: How to test ICMP host unreachable
Date: Wed, 4 Feb 2004 16:06:48 -0800
Lines: 12
Distribution: su
Message-ID: <bvs1fe$k0k$1@news.Stanford.EDU>
References: <40218858.66B86789@stanford.edu>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1075939630 20500 128.12.61.97 (5 Feb 2004 00:07: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:5945

I hardcoded my program not to pay any attention to ARP_REPLY.

"Seungbeom Kim" <sbkim@stanford.edu> wrote in message
news:40218858.66B86789@stanford.edu...
> The router is required to send back an "ICMP host unreachable" message
> if it doesn't get ARP replies. How can I test that functionality,
> since all the hosts whose addresses I'm given respond to ARP requests?
>
> -- 
> Seungbeom Kim


.

Path: shelby.stanford.edu!not-for-mail
From: Joey Liaw <jliaw@@@stanford.....nospam.edu>
Newsgroups: su.class.cs244a
Subject: broadcast galore
Date: Thu, 5 Feb 2004 00:10:48 +0000 (UTC)
Organization: Stanford University
Lines: 2
Distribution: su
Message-ID: <Xns9485A4976FFAjliawstanfordnospam@171.64.14.103>
NNTP-Posting-Host: myeah.stanford.edu
X-Trace: news.Stanford.EDU 1075939848 29490 128.12.102.21 (5 Feb 2004 00:10:48 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Xnews/5.04.25
Xref: shelby.stanford.edu su.class.cs244a:5946

Just curious, why is the ARP cache stale time only 15 seconds?  On large 
networks wouldn't this result in a lot of broadcast packets?
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: How to test ICMP host unreachable
Date: Wed, 4 Feb 2004 16:38:45 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0402041637350.20521-100000@Xenon.Stanford.EDU>
References: <40218858.66B86789@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075941527 23223 171.64.66.201 (5 Feb 2004 00:38:47 GMT)
X-Complaints-To: news@news.stanford.edu
To: Seungbeom Kim <sbkim@stanford.edu>
In-Reply-To: <40218858.66B86789@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:5947


 There are a number of ways to do this, e.g.
 drop all arp reply packets on a particular interface.

 .m

> The router is required to send back an "ICMP host unreachable" message
> if it doesn't get ARP replies. How can I test that functionality,
> since all the hosts whose addresses I'm given respond to ARP requests?
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: inet_ntoa leaky?
Date: Wed, 4 Feb 2004 16:41:57 -0800
Lines: 33
Distribution: su
Message-ID: <Pine.LNX.4.44.0402041638590.20521-100000@Xenon.Stanford.EDU>
References: <bvs1cf$jt9$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 1075941719 23648 171.64.66.201 (5 Feb 2004 00:41:59 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <bvs1cf$jt9$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5948


> Hey,

 hey yourself ..

 No you shouldn't free it, inet_ntoa(..) uses a static, method local
 variable.  We won't take off points if inet_ntoa(..) is causing 
 a purify error, however you shouldn't need it for anything but
 debugging ...

 .m

> 
> I only have one memory leak in my program, and it's in a call to inet_ntoa.
> Earlier when I tried free'ing the return value, I got other errors, and
> eventually concluded that inet_ntoa does something strange, but doesn't
> quite malloc new memory.  So I'm confused... do I have to free the pointer
> returns by a call to inet_ntoa, or don't I?
> 
> Either way I get purify errors...
> 
> without freeing I get a MLK error.
> with freeing I get a bunch of FMWs...
> 
> I'm tending towards not free'ing it, since it's a much smaller error in
> purify.
> 
> Thanks,
> Oded
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: broadcast galore
Date: Wed, 4 Feb 2004 16:44:04 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.LNX.4.44.0402041642160.20521-100000@Xenon.Stanford.EDU>
References: <Xns9485A4976FFAjliawstanfordnospam@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 1075941846 23807 171.64.66.201 (5 Feb 2004 00:44:06 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Xns9485A4976FFAjliawstanfordnospam@171.64.14.103>
Xref: shelby.stanford.edu su.class.cs244a:5949


 Arbitrary. Default for linux is even less I believe, the amount of extra
 traffic is really at the noise level.

 .m

> Just curious, why is the ARP cache stale time only 15 seconds?  On large 
> networks wouldn't this result in a lot of broadcast packets?
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Lei Zhang" <lei.zhang@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS2 Q2
Date: Wed, 4 Feb 2004 20:57:19 -0800
Lines: 11
Distribution: su
Message-ID: <bvsifo$dhm$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1075957051 13878 127.0.0.1 (5 Feb 2004 04:57: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:5950

1. Is 119.12.73/25 equivalent to 119.12.73.0/25 ? Otherwise what will be the
last bit (25th) of the network address?
2. Does 119.12.73/25 collide into 119.12.64/18 ? I understand that the
router at ISP can route the packets based on longest prefix. But how does
this work administratively, i.e. how will company Y know there is a hole in
the address space allocated to itself?

Thanks,
Lei


.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Plotting traceroute results
Date: Wed, 4 Feb 2004 21:16:21 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.GSO.4.44.0402042108030.5363-100000@elaine26.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1075958184 15893 171.64.15.101 (5 Feb 2004 05:16:24 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5951

If the result of 3 trace route probes to a host is 9.73 * 9.72
how do you plot * ? Can we just note that some values were not obtained by
traceroute?

I tried setting wait time to a larger value thinking that the return delay
might be very slow due to congestion, but it sure looks like the router
just has to drop some requests as the longer wait time didn't seem to make
a difference.

Thanks,

Edward G. Chron

.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Plotting traceroute results
Date: Thu, 5 Feb 2004 18:37:35 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <bvu2hf$4oh$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402042108030.5363-100000@elaine26.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1076006255 4881 171.64.15.103 (5 Feb 2004 18:37:35 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5953


>If the result of 3 trace route probes to a host is 9.73 * 9.72
>how do you plot * ? Can we just note that some values were not obtained by
>traceroute?

I assume you're referring to PS2 Q7--the *s shouldn't matter much for
that question (assuming they're rare), so you can just ignore them.

.

Path: shelby.stanford.edu!epic1.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS2 Q7bii
Date: Thu, 5 Feb 2004 13:21:10 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0402051306570.14132-100000@epic1.Stanford.EDU>
NNTP-Posting-Host: epic1.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1076016072 17546 171.64.15.34 (5 Feb 2004 21:21:12 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5954


I'm a little confused about what this question is asking.  I don't believe
any value of T at the source can guarantee that the two packets arrive
back to back at the destination.

Let's say we choose a sufficiently small T such that the packets arrive
back to back after link R2 (the slowest link).  This router must have a
faster outgoing link, by definition.  After P1 arrives, it sends it out
the outgoing link, R3, faster than it takes P2 to arrive.  Therefore,
there will be space between the packets (possibly, depending on the rest
of the link speeds) at the destination (assuming R2 is not the last hop).

Further decreasing T cannot change this behavior on the second router.  Am
I missing something about this question?

Thanks,
Barrett

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: traceroute -n
Date: Thu, 5 Feb 2004 14:02:58 -0800
Lines: 10
Distribution: su
Message-ID: <bvuejo$jqb$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1076018616 20299 128.12.189.163 (5 Feb 2004 22:03:36 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:5955

Hi,
When traceroute sends packets, the first time it does a dns lookup.But
suppose I send 10 packets, then does it again do the dns lookup each time or
does it do it just for the first packet?
I ask this coz, when we consider the diference in times, do we need to
consider the average time or the time of the first packet?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS2 Q7bii
Date: Thu, 5 Feb 2004 16:22:25 -0800
Lines: 27
Distribution: su
Message-ID: <Pine.LNX.4.44.0402051619170.20306-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402051306570.14132-100000@epic1.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1076026947 1914 171.64.66.201 (6 Feb 2004 00:22:27 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402051306570.14132-100000@epic1.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5956

On Thu, 5 Feb 2004, Barrett Trask wrote:

> 
> I'm a little confused about what this question is asking.  I don't believe
> any value of T at the source can guarantee that the two packets arrive
> back to back at the destination.
> 
> Let's say we choose a sufficiently small T such that the packets arrive
> back to back after link R2 (the slowest link).  This router must have a
> faster outgoing link, by definition.  After P1 arrives, it sends it out
> the outgoing link, R3, faster than it takes P2 to arrive.  Therefore,
> there will be space between the packets (possibly, depending on the rest
> of the link speeds) at the destination 

> (assuming R2 is not the last hop).

Assume that R2 is the last hop for answering this part

Shankar

> Further decreasing T cannot change this behavior on the second router.  Am
> I missing something about this question?
> 
> Thanks,
> Barrett
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Cynthia Lau" <cindabin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: traceroute -n
Date: Thu, 5 Feb 2004 19:33:52 -0800
Lines: 32
Distribution: su
Message-ID: <bvv1v1$f9q$1@news.Stanford.EDU>
References: <bvuejo$jqb$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-36725.stanford.edu
X-Trace: news.Stanford.EDU 1076038433 15674 128.12.196.60 (6 Feb 2004 03:33: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:5959

I'm not sure I understand how we're supposed to tell the difference in
running time in the first place.  The reverse DNS lookup time doesn't seem
to be a part of the query time; for instance, for any given hop, even when
queries take a while to complete, the domain name is already printed to
output first.  This means that the lookup time is independent of the query
times for at least all but the first query packet per hop.

But even if the lookup time is included in the time reported for the first
query packet, that time varies so much every time traceroute is run that
it's impossible to tell.

Is there supposed to be some other way for us to measure the time taken by
traceroute with and without the -n option?  If not, then I'm at a loss.  Can
someone please point me in the right direction?

-Cynthia

"Haripriya Rajagopal" <hpriya@stanford.edu> wrote in message
news:bvuejo$jqb$1@news.Stanford.EDU...
> Hi,
> When traceroute sends packets, the first time it does a dns lookup.But
> suppose I send 10 packets, then does it again do the dns lookup each time
or
> does it do it just for the first packet?
> I ask this coz, when we consider the diference in times, do we need to
> consider the average time or the time of the first packet?
> Thanks,
> Haripriya
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS2 Q1
Date: Fri, 6 Feb 2004 04:56:35 +0000 (UTC)
Lines: 4
Distribution: su
Message-ID: <bvv6q3$m2g$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
X-Trace: news.Stanford.EDU 1076043395 22608 171.64.15.100 (6 Feb 2004 04:56:35 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:5961

Does the IP address listed in traceroute correspond to the interface on which a packet entered the router, or exited, 
or neither?  I also don't see a host or traceroute option to determine the other, or the netmask.  


.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!rameshk
From: Ramesh Kumar <rameshk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Problem Numbers in Second Edition for 3,4
Date: Thu, 5 Feb 2004 21:08:10 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0402052106140.1031-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 1076044092 23526 171.64.15.100 (6 Feb 2004 05:08:12 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5962


Could someone confirm if problems 3, 4 in ps2 are question 19 and question
17 in Peterson and Davie, Second Edition.

Thanks,
Ramesh.


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: 24 hour extension
Date: Thu, 5 Feb 2004 22:47:14 -0800
Lines: 5
Distribution: su
Message-ID: <bvvd9u$gq$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1076050046 538 128.12.61.97 (6 Feb 2004 06:47: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:5963

Is the free late day good for problem sets too?

Oded


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: traceroute -n
Date: Thu, 5 Feb 2004 23:57:43 -0800
Lines: 33
Distribution: su
Message-ID: <Pine.LNX.4.44.0402052354380.29902-100000@Xenon.Stanford.EDU>
References: <bvuejo$jqb$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 1076054265 5306 171.64.66.201 (6 Feb 2004 07:57:45 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bvuejo$jqb$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5964


On Thu, 5 Feb 2004, Haripriya Rajagopal wrote:

> Hi,
> When traceroute sends packets, the first time it does a dns lookup.But
> suppose I send 10 packets, then does it again do the dns lookup each time or
> does it do it just for the first packet?

It wouldn't do a dns lookup for every probe. I have, however, noticed 
that you may not be able to determine the dns lookup time in a 
statistically meaningful way. So stay tuned for a further post on this 
question ..

Shankar

> I ask this coz, when we consider the diference in times, do we need to
> consider the average time or the time of the first packet?
> Thanks,
> Haripriya
> 
> 
> 

-- 

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: traceroute -n
Date: Fri, 6 Feb 2004 00:02:00 -0800
Lines: 58
Distribution: su
Message-ID: <Pine.LNX.4.44.0402052358210.17640-100000@Xenon.Stanford.EDU>
References: <bvuejo$jqb$1@news.Stanford.EDU> <bvv1v1$f9q$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 1076054521 5715 171.64.66.201 (6 Feb 2004 08:02:01 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bvv1v1$f9q$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5965

On Thu, 5 Feb 2004, Cynthia Lau wrote:

> I'm not sure I understand how we're supposed to tell the difference in
> running time in the first place.  The reverse DNS lookup time doesn't seem
> to be a part of the query time; for instance, for any given hop, even when
> queries take a while to complete, the domain name is already printed to
> output first.  This means that the lookup time is independent of the query
> times for at least all but the first query packet per hop.
> 
> But even if the lookup time is included in the time reported for the first
> query packet, that time varies so much every time traceroute is run that
> it's impossible to tell.
> 
> Is there supposed to be some other way for us to measure the time taken by
> traceroute with and without the -n option?  If not, then I'm at a loss.  Can
> someone please point me in the right direction?

There is a slightly different way that avoids the first problem you 
mention, but it still has the second problem.

So stay tuned for a further post on this question. 

(As an aside, note that you can answer such questions easily if you had 
access to tcpdump.) 

Shankar


> 
> -Cynthia
> 
> "Haripriya Rajagopal" <hpriya@stanford.edu> wrote in message
> news:bvuejo$jqb$1@news.Stanford.EDU...
> > Hi,
> > When traceroute sends packets, the first time it does a dns lookup.But
> > suppose I send 10 packets, then does it again do the dns lookup each time
> or
> > does it do it just for the first packet?
> > I ask this coz, when we consider the diference in times, do we need to
> > consider the average time or the time of the first packet?
> > Thanks,
> > Haripriya
> >
> >
> 
> 
> 

-- 

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: PS2 Q1
Date: Fri, 6 Feb 2004 00:06:40 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.LNX.4.44.0402060002100.17640-100000@Xenon.Stanford.EDU>
References: <bvv6q3$m2g$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 1076054801 6017 171.64.66.201 (6 Feb 2004 08:06:41 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bvv6q3$m2g$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5966


On Fri, 6 Feb 2004, Tyrone Nicholas wrote:

> Does the IP address listed in traceroute correspond to the interface on which a packet entered the router, or exited, 
> or neither?  
> I also don't see a host or traceroute option to determine the other, or 
> the netmask.  

The second programming assignment should give you a clue to answer your 
first question. Also, read the man pages carefully -- there is an option 
you have missed that allows you to determine the other interface. 
Finally, note that the question says "where possible, find the subnet mask"

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: 24 hour extension
Date: Fri, 6 Feb 2004 00:07:04 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.LNX.4.44.0402060006560.17640-100000@Xenon.Stanford.EDU>
References: <bvvd9u$gq$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 1076054826 6032 171.64.66.201 (6 Feb 2004 08:07:06 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <bvvd9u$gq$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5967


On Thu, 5 Feb 2004, Oded Wurman wrote:

> Is the free late day good for problem sets too?
> 

yes

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Problem Numbers in Second Edition for 3,4
Date: Fri, 6 Feb 2004 00:11:01 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.LNX.4.44.0402060008540.22014-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402052106140.1031-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 1076055063 6559 171.64.66.201 (6 Feb 2004 08:11:03 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402052106140.1031-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5968



On Thu, 5 Feb 2004, Ramesh Kumar wrote:

> 
> Could someone confirm if problems 3, 4 in ps2 are question 19 and question
> 17 in Peterson and Davie, Second Edition.
> 
I don't think the question numbers are the same in the 2nd and 3rd 
editions, but I can't be sure because I don't have the 3rd edition with 
me. Will answer this tommorow. 

Shankar


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS2 6(g)
Date: Fri, 6 Feb 2004 00:22:34 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0402060012380.22946-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 1076055755 7525 171.64.66.201 (6 Feb 2004 08:22:35 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5969


OK. Here it goes.. Briefly indicate what experiment you did, and if your 
measurements don't provide a meaningful value for dns lookup time, simply 
indicate this in your answer. 

(As an aside, note that this is not an isolated problem. Often, when doing 
system performance measurements, one may come up with an expt that should 
theoretically measure a certain  value, but in practice it may or may not 
give meaningful results unless a number of other details are taken into 
account.)

Shankar

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS2 Q1
Date: Fri, 6 Feb 2004 01:15:27 -0800
Lines: 21
Distribution: su
Message-ID: <bvvlvs$aas$1@news.Stanford.EDU>
References: <bvv6q3$m2g$1@news.Stanford.EDU> <Pine.LNX.4.44.0402060002100.17640-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1076058940 10588 128.12.61.97 (6 Feb 2004 09:15:40 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:5970

Can we assume that the same interface is used to receive and send... that
is, if I'm sending a packet from sweet-rtr to bbr2-rtr on a traceroute to
www.mit.edu, and someone at my target traceroutes back to
elaine25.stanford.edu, will the ingress IP he sees on sweet-rtr be the same
as the egress interface for the packets leaving sweet-rtr for bbr2-rtr?
My intuition says no, that it's not necessarily symmetric, but I see no
traceroute options that will help if this isn't the case.

Oded

>
> The second programming assignment should give you a clue to answer your
> first question. Also, read the man pages carefully -- there is an option
> you have missed that allows you to determine the other interface.
> Finally, note that the question says "where possible, find the subnet
mask"
>
> Shankar
>


.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS2: Q2
Date: Fri, 6 Feb 2004 01:28:41 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0402060124060.7945-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 1076059736 11172 171.64.15.100 (6 Feb 2004 09:28:56 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5971


In the forwarding table, there need to be a next hop IP address.  I can
not figure out what the next-hop address is.  Can we assume that all
Company X's computers are on a subnet that is directly connected with the
3-port router, port 1?



.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS2, Q6(b) Missing packet at the last hop
Date: Fri, 6 Feb 2004 02:34:43 -0800
Lines: 37
Distribution: su
Message-ID: <Pine.GSO.4.44.0402060233001.9458-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 1076063685 14919 171.64.15.100 (6 Feb 2004 10:34:45 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5972


I noticed that there is always one missing packet (the "*" at the last
line) for the last hop.  Why?

====
>traceroute -q 10  www.ucla.edu
traceroute to www.ucla.edu (169.232.55.135): 1-30 hops, 38 byte packets
 1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.565 ms  0.343 ms  0.329 ms
0.322 ms  0.321 ms  0.323 ms  0.319 ms  0.321 ms  0.319 ms  0.318 ms
 2  bbr2-rtr.Stanford.EDU (171.64.1.161)  0.379 ms  0.362 ms  0.345 ms
0.354 ms  0.346 ms  0.347 ms  0.352 ms  0.337 ms  0.341 ms  0.338 ms
 3  dc1-rtr.Stanford.EDU (171.64.1.132)  0.881 ms  0.624 ms  1.06 ms
0.765 ms  0.790 ms  0.959 ms  0.738 ms  0.875 ms  0.596 ms  0.735 ms
 4  dc-svl-dc1--stan-ge.cenic.net (137.164.23.37)  1.26 ms  1.50 ms  1.19
ms  1.51 ms  1.13 ms  1.45 ms  0.971 ms  1.04 ms  1.32 ms  1.15 ms
 5  dc-oak-dc1--svl-dc1-10ge.cenic.net (137.164.22.31)  2.35 ms  2.37 ms
2.71 ms  2.38 ms  2.54 ms  2.30 ms  2.13 ms  2.04 ms  2.40 ms  2.19 ms
 6  dc-oak-dc2--oak-dc1-ge.cenic.net (137.164.22.125)  2.42 ms  2.53 ms
2.40 ms  2.64 ms  2.74 ms  2.24 ms  2.72 ms  2.59 ms  2.39 ms  2.27 ms
 7  dc-csac-dc1--oak-dc2-ge.cenic.net (137.164.22.111)  4.70 ms  4.52 ms
4.62 ms  4.80 ms  4.37 ms  4.72 ms  4.65 ms  4.49 ms  4.44 ms  4.30 ms
 8  dc-lax-dc1--sac-dc1-pos.cenic.net (137.164.22.126)  13.9 ms  13.9 ms
13.8 ms  13.9 ms  14.0 ms  13.8 ms  14.1 ms  13.9 ms  13.6 ms  13.9 ms
 9  ucla-ge-lax-dc1.cenic.net (137.164.24.18)  14.6 ms  14.2 ms  14.3 ms
14.7 ms  14.7 ms  14.6 ms  14.1 ms  14.5 ms  14.6 ms  14.2 ms
10  border--core.backbone.ucla.net (169.232.6.201)  15.2 ms (ttl=244!)
15.0 ms (ttl=244!)  15.1 ms (ttl=244!)  14.8 ms (ttl=244!)  15.5 ms
(ttl=244!)  15.3 ms (ttl=244!)  15.4 ms (ttl=244!)  14.9 ms (ttl=244!)
15.3 ms (ttl=244!)  15.3 ms (ttl=244!)
11  core--anderson.backbone.ucla.net (169.232.51.22)  15.2 ms (ttl=243!)
14.9 ms (ttl=243!)  14.9 ms (ttl=243!)  14.9 ms (ttl=243!)  15.4 ms
(ttl=243!)  15.2 ms (ttl=243!)  15.0 ms (ttl=243!)  15.1 ms (ttl=243!)
15.4 ms (ttl=243!)  14.8 ms (ttl=243!)
12  www.ucla.edu (169.232.55.135)  15.1 ms (ttl=51!)  15.0 ms (ttl=51!)
15.0 ms (ttl=51!)  15.3 ms (ttl=51!)  15.2 ms (ttl=51!)  14.7 ms (ttl=51!)
*  15.3 ms (ttl=51!)  15.3 ms (ttl=51!)  15.5 ms (ttl=51!)

.

Path: shelby.stanford.edu!not-for-mail
From: "Cynthia Lau" <cindabin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem Numbers in Second Edition for 3,4
Date: Fri, 6 Feb 2004 03:05:56 -0800
Lines: 20
Distribution: su
Message-ID: <bvvsem$g49$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402052106140.1031-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-36725.stanford.edu
X-Trace: news.Stanford.EDU 1076065558 16521 128.12.196.60 (6 Feb 2004 11:05: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:5973

I use the 2nd edition too; problem 3 is not exactly identical to any
question in the 2nd edition (different charts are used), but is similar to
#14.

problem 4 is the same as #13 in the 2nd edition.

-Cynthia

"Ramesh Kumar" <rameshk@stanford.edu> wrote in message
news:Pine.GSO.4.44.0402052106140.1031-100000@elaine25.Stanford.EDU...
>
> Could someone confirm if problems 3, 4 in ps2 are question 19 and question
> 17 in Peterson and Davie, Second Edition.
>
> Thanks,
> Ramesh.
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: Adar Dembo <adar@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS2: Q6(c)
Date: Fri, 06 Feb 2004 05:16:57 -0800
Lines: 19
Distribution: su
Message-ID: <c00449$nkp$1@news.Stanford.EDU>
NNTP-Posting-Host: adar.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1076073417 24217 128.12.72.21 (6 Feb 2004 13:16:57 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:5974

This may sound silly, but I don't know if this question is valid anymore 
(perhaps it was in the past).

I ran a traceroute on both www.ucla.edu and www.wsgr.com. WSGR timed out 
after the 12th hop (firewall dropping UDP packets perhaps?) UCLA traced 
at 12 hops. On a Linux computer, however, traceroute -I uses ICMP echo 
packets instead of UDP (an option that Solaris does not seem to 
provide). With traceroute -I, www.wsgr.com also traced at 12 hops.

Through both ping and traceroute, www.wsgr.com averaged around 5 ms, 
while www.ucla.edu averaged around 15 ms.

Granted, the routes to either one are different (seen by following the 
router trail with traceroute), and www.wsgr.com the website loads a BIT 
slower than www.ucla.edu (I am guessing because of their use of ASP), 
but I don't think that counts for this question, and in all other 
respects, www.ucla.edu seems "further" than www.wsgr.com. What gives?

-Adar
.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: traceroute result interpretation
Date: Fri, 06 Feb 2004 05:23:45 -0800
Lines: 12
Distribution: su
Message-ID: <40239561.8C15CA40@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1076073826 24574 127.0.0.1 (6 Feb 2004 13:23:46 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:5975

When traceroute is given the option -S, it prints a per-hop min/avg/max
RTT statistics summary (according to the manual page).
The actual output looks like "4.13/5.22/7.54 (0.927) ms"; I understand
that 4.13/5.22/7.54 correspond to min/avg/max, but what does 0.927 mean?

And I sometimes see that a earlier hop router has a larger RTT than
a later one, e.g. 4.57 ms in hop 9 followed by 3.90 ms in hop 10.
Is this just due to the variance of the network, or does it have
any other meaning?

-- 
Seungbeom Kim
.

Path: shelby.stanford.edu!not-for-mail
From: Adar Dembo <adar@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS2: Q6(c)
Date: Fri, 06 Feb 2004 05:37:27 -0800
Lines: 33
Distribution: su
Message-ID: <c005an$ob6$1@news.Stanford.EDU>
References: <c00449$nkp$1@news.Stanford.EDU>
NNTP-Posting-Host: adar.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1076074647 24934 128.12.72.21 (6 Feb 2004 13:37:27 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: <c00449$nkp$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5976

Adar Dembo wrote:

> This may sound silly, but I don't know if this question is valid anymore 
> (perhaps it was in the past).
> 
> I ran a traceroute on both www.ucla.edu and www.wsgr.com. WSGR timed out 
> after the 12th hop (firewall dropping UDP packets perhaps?) UCLA traced 
> at 12 hops. On a Linux computer, however, traceroute -I uses ICMP echo 
> packets instead of UDP (an option that Solaris does not seem to 
> provide). With traceroute -I, www.wsgr.com also traced at 12 hops.
> 
> Through both ping and traceroute, www.wsgr.com averaged around 5 ms, 
> while www.ucla.edu averaged around 15 ms.
> 
> Granted, the routes to either one are different (seen by following the 
> router trail with traceroute), and www.wsgr.com the website loads a BIT 
> slower than www.ucla.edu (I am guessing because of their use of ASP), 
> but I don't think that counts for this question, and in all other 
> respects, www.ucla.edu seems "further" than www.wsgr.com. What gives?
> 
> -Adar

I'd like to add that I just read the previous post about this question, 
posted on 2/3/2004 by Vishal Patel. He describes the router dropping the 
UDP packets, and Matthew told him to assume that there were  possibly 
multiple routers behind it.

Unfortunately, given that with traceroute -I (on the appropriate 
machine) the next hop (hop 12 from elaine25) is www.wsgr.com, and this 
is equal to www.ucla.edu in hop count, I am still confused as to how to 
answer this question.

-Adar
.

Path: shelby.stanford.edu!saga9.Stanford.EDU!rameshk
From: Ramesh Kumar <rameshk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem Numbers in Second Edition for 3,4
Date: Fri, 6 Feb 2004 07:30:22 -0800
Lines: 33
Distribution: su
Message-ID: <Pine.GSO.4.44.0402060728001.15794-100000@saga9.Stanford.EDU>
References: <Pine.GSO.4.44.0402052106140.1031-100000@elaine25.Stanford.EDU>
 <bvvsem$g49$1@news.Stanford.EDU>
NNTP-Posting-Host: saga9.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1076081424 2113 171.64.15.139 (6 Feb 2004 15:30:24 GMT)
X-Complaints-To: news@news.stanford.edu
To: Cynthia Lau <cindabin@stanford.edu>
In-Reply-To: <bvvsem$g49$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5977

Thanks. Can somebody post the table for problem 3 (in ps2) in the textbook
from Peterson and Davie, third edition.

Thanks,
Ramesh.


On Fri, 6 Feb 2004, Cynthia Lau wrote:

> I use the 2nd edition too; problem 3 is not exactly identical to any
> question in the 2nd edition (different charts are used), but is similar to
> #14.
>
> problem 4 is the same as #13 in the 2nd edition.
>
> -Cynthia
>
> "Ramesh Kumar" <rameshk@stanford.edu> wrote in message
> news:Pine.GSO.4.44.0402052106140.1031-100000@elaine25.Stanford.EDU...
> >
> > Could someone confirm if problems 3, 4 in ps2 are question 19 and question
> > 17 in Peterson and Davie, Second Edition.
> >
> > Thanks,
> > Ramesh.
> >
> >
>
>
>



.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Problem Numbers in Second Edition for 3,4
Date: Fri, 6 Feb 2004 08:11:20 -0800
Lines: 62
Distribution: su
Message-ID: <c00ebc$4p6$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402052106140.1031-100000@elaine25.Stanford.EDU> <bvvsem$g49$1@news.Stanford.EDU> <Pine.GSO.4.44.0402060728001.15794-100000@saga9.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1076083884 4902 128.12.44.20 (6 Feb 2004 16:11: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:5978

19) Suppose we have the forwarding tables shown below for nodes A and F, in
a netowkr where all links have cost 1. Give a diagram of the smallest
network consistent with these tables.

Node A [Node, Cost, NextHop]:
[B, 1, B]
[C, 1, C]
[D, 2, B]
[E, 3, C]
[F, 2, C]

Node F:
[A, 2, C]
[B, 3, C]
[C, 1, C]
[D, 2, C]
[E, 1, E]

Apologies for breaking copyrights and all. :P

- Sean


"Ramesh Kumar" <rameshk@stanford.edu> wrote in message
news:Pine.GSO.4.44.0402060728001.15794-100000@saga9.Stanford.EDU...
> Thanks. Can somebody post the table for problem 3 (in ps2) in the textbook
> from Peterson and Davie, third edition.
>
> Thanks,
> Ramesh.
>
>
> On Fri, 6 Feb 2004, Cynthia Lau wrote:
>
> > I use the 2nd edition too; problem 3 is not exactly identical to any
> > question in the 2nd edition (different charts are used), but is similar
to
> > #14.
> >
> > problem 4 is the same as #13 in the 2nd edition.
> >
> > -Cynthia
> >
> > "Ramesh Kumar" <rameshk@stanford.edu> wrote in message
> > news:Pine.GSO.4.44.0402052106140.1031-100000@elaine25.Stanford.EDU...
> > >
> > > Could someone confirm if problems 3, 4 in ps2 are question 19 and
question
> > > 17 in Peterson and Davie, Second Edition.
> > >
> > > Thanks,
> > > Ramesh.
> > >
> > >
> >
> >
> >
>
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine29.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS2: Q2
Date: 06 Feb 2004 10:59:40 -0800
Organization: Stanford University, CA, USA
Lines: 13
Distribution: su
Message-ID: <snn65ek3ug3.fsf@elaine29.Stanford.EDU>
References: <Pine.GSO.4.44.0402060124060.7945-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine29.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1076093980 15199 171.64.15.104 (6 Feb 2004 18:59:40 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:5980

The problem says to draw the contents of the forwarding table as best as
you can.  Since we don't give you any specific next hop addresses, it's
fine to leave that column empty.   There's still a lot of routing
information you can determine.

Susan

Xiaohua Fang <xxf5@stanford.edu> writes:

> In the forwarding table, there need to be a next hop IP address.  I can
> not figure out what the next-hop address is.  Can we assume that all
> Company X's computers are on a subnet that is directly connected with the
> 3-port router, port 1?
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine29.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS2 Q7bii
Date: 06 Feb 2004 11:19:11 -0800
Organization: Stanford University, CA, USA
Lines: 26
Distribution: su
Message-ID: <snn1xp83tjk.fsf@elaine29.Stanford.EDU>
References: <Pine.GSO.4.44.0402051306570.14132-100000@epic1.Stanford.EDU>
NNTP-Posting-Host: elaine29.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1076095151 15687 171.64.15.104 (6 Feb 2004 19:19:11 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:5981

Yes, you can't guarantee that a gap never gets introduced after R2,
however, there is still a sense of a max T...beyond this max T, there will
*always* be a gap between the packets.  Think of finding this T.  ie. find
the max T such that if the routers after R2 cooperate, the packets can
arrive back-to-back.

Susan

Barrett Trask <btrask@stanford.edu> writes:

> I'm a little confused about what this question is asking.  I don't believe
> any value of T at the source can guarantee that the two packets arrive
> back to back at the destination.
> 
> Let's say we choose a sufficiently small T such that the packets arrive
> back to back after link R2 (the slowest link).  This router must have a
> faster outgoing link, by definition.  After P1 arrives, it sends it out
> the outgoing link, R3, faster than it takes P2 to arrive.  Therefore,
> there will be space between the packets (possibly, depending on the rest
> of the link speeds) at the destination (assuming R2 is not the last hop).
> 
> Further decreasing T cannot change this behavior on the second router.  Am
> I missing something about this question?
> 
> Thanks,
> Barrett
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine29.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS2 Q1
Date: 06 Feb 2004 11:25:41 -0800
Organization: Stanford University, CA, USA
Lines: 28
Distribution: su
Message-ID: <snnwu702eoa.fsf@elaine29.Stanford.EDU>
References: <bvv6q3$m2g$1@news.Stanford.EDU> <Pine.LNX.4.44.0402060002100.17640-100000@Xenon.Stanford.EDU> <bvvlvs$aas$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine29.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1076095541 15687 171.64.15.104 (6 Feb 2004 19:25:41 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:5982

No you shouldn't assume they are necessarily the same.  You can figure out
a lot by looking at the results of the traceroute, knowing your starting
ip and netmask, and looking at potential netmasks for the interfaces on
each router.

Susan

"Oded Wurman" <owurman@stanford.edu> writes:

> Can we assume that the same interface is used to receive and send... that
> is, if I'm sending a packet from sweet-rtr to bbr2-rtr on a traceroute to
> www.mit.edu, and someone at my target traceroutes back to
> elaine25.stanford.edu, will the ingress IP he sees on sweet-rtr be the same
> as the egress interface for the packets leaving sweet-rtr for bbr2-rtr?
> My intuition says no, that it's not necessarily symmetric, but I see no
> traceroute options that will help if this isn't the case.
> 
> Oded
> 
> >
> > The second programming assignment should give you a clue to answer your
> > first question. Also, read the man pages carefully -- there is an option
> > you have missed that allows you to determine the other interface.
> > Finally, note that the question says "where possible, find the subnet
> mask"
> >
> > Shankar
> >
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine29.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS2, Q6(b) Missing packet at the last hop
Date: 06 Feb 2004 11:35:39 -0800
Organization: Stanford University, CA, USA
Lines: 41
Distribution: su
Message-ID: <snnsmho2e7o.fsf@elaine29.Stanford.EDU>
References: <Pine.GSO.4.44.0402060233001.9458-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine29.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1076096139 17766 171.64.15.104 (6 Feb 2004 19:35:39 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:5983

Certainly one possibility is that the machine dropped the packet, right?

Susan

Xiaohua Fang <xxf5@stanford.edu> writes:

> I noticed that there is always one missing packet (the "*" at the last
> line) for the last hop.  Why?
> 
> ====
> >traceroute -q 10  www.ucla.edu
> traceroute to www.ucla.edu (169.232.55.135): 1-30 hops, 38 byte packets
>  1  sweet-rtr.Stanford.EDU (171.64.15.97)  0.565 ms  0.343 ms  0.329 ms
> 0.322 ms  0.321 ms  0.323 ms  0.319 ms  0.321 ms  0.319 ms  0.318 ms
>  2  bbr2-rtr.Stanford.EDU (171.64.1.161)  0.379 ms  0.362 ms  0.345 ms
> 0.354 ms  0.346 ms  0.347 ms  0.352 ms  0.337 ms  0.341 ms  0.338 ms
>  3  dc1-rtr.Stanford.EDU (171.64.1.132)  0.881 ms  0.624 ms  1.06 ms
> 0.765 ms  0.790 ms  0.959 ms  0.738 ms  0.875 ms  0.596 ms  0.735 ms
>  4  dc-svl-dc1--stan-ge.cenic.net (137.164.23.37)  1.26 ms  1.50 ms  1.19
> ms  1.51 ms  1.13 ms  1.45 ms  0.971 ms  1.04 ms  1.32 ms  1.15 ms
>  5  dc-oak-dc1--svl-dc1-10ge.cenic.net (137.164.22.31)  2.35 ms  2.37 ms
> 2.71 ms  2.38 ms  2.54 ms  2.30 ms  2.13 ms  2.04 ms  2.40 ms  2.19 ms
>  6  dc-oak-dc2--oak-dc1-ge.cenic.net (137.164.22.125)  2.42 ms  2.53 ms
> 2.40 ms  2.64 ms  2.74 ms  2.24 ms  2.72 ms  2.59 ms  2.39 ms  2.27 ms
>  7  dc-csac-dc1--oak-dc2-ge.cenic.net (137.164.22.111)  4.70 ms  4.52 ms
> 4.62 ms  4.80 ms  4.37 ms  4.72 ms  4.65 ms  4.49 ms  4.44 ms  4.30 ms
>  8  dc-lax-dc1--sac-dc1-pos.cenic.net (137.164.22.126)  13.9 ms  13.9 ms
> 13.8 ms  13.9 ms  14.0 ms  13.8 ms  14.1 ms  13.9 ms  13.6 ms  13.9 ms
>  9  ucla-ge-lax-dc1.cenic.net (137.164.24.18)  14.6 ms  14.2 ms  14.3 ms
> 14.7 ms  14.7 ms  14.6 ms  14.1 ms  14.5 ms  14.6 ms  14.2 ms
> 10  border--core.backbone.ucla.net (169.232.6.201)  15.2 ms (ttl=244!)
> 15.0 ms (ttl=244!)  15.1 ms (ttl=244!)  14.8 ms (ttl=244!)  15.5 ms
> (ttl=244!)  15.3 ms (ttl=244!)  15.4 ms (ttl=244!)  14.9 ms (ttl=244!)
> 15.3 ms (ttl=244!)  15.3 ms (ttl=244!)
> 11  core--anderson.backbone.ucla.net (169.232.51.22)  15.2 ms (ttl=243!)
> 14.9 ms (ttl=243!)  14.9 ms (ttl=243!)  14.9 ms (ttl=243!)  15.4 ms
> (ttl=243!)  15.2 ms (ttl=243!)  15.0 ms (ttl=243!)  15.1 ms (ttl=243!)
> 15.4 ms (ttl=243!)  14.8 ms (ttl=243!)
> 12  www.ucla.edu (169.232.55.135)  15.1 ms (ttl=51!)  15.0 ms (ttl=51!)
> 15.0 ms (ttl=51!)  15.3 ms (ttl=51!)  15.2 ms (ttl=51!)  14.7 ms (ttl=51!)
> *  15.3 ms (ttl=51!)  15.3 ms (ttl=51!)  15.5 ms (ttl=51!)
.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS2: Q6(c)
Date: Fri, 6 Feb 2004 19:39:37 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c00qhp$i09$1@news.Stanford.EDU>
References: <c00449$nkp$1@news.Stanford.EDU> <c005an$ob6$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1076096377 18441 171.64.15.116 (6 Feb 2004 19:39:37 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5984


>Unfortunately, given that with traceroute -I (on the appropriate 
>machine) the next hop (hop 12 from elaine25) is www.wsgr.com, and this 
>is equal to www.ucla.edu in hop count, I am still confused as to how to 
>answer this question.

Hmm, their network must have changed since the question was originally
set (not a surprise--the route a packet takes to a host can obviously
change wildly over time).

If you find that the question doesn't seem to make any sense, an
explanation of *why* it doesn't make sense to you is fine too.

.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine29.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS2: Q6(c)
Date: 06 Feb 2004 11:45:00 -0800
Organization: Stanford University, CA, USA
Lines: 44
Distribution: su
Message-ID: <snnoesc2ds3.fsf@elaine29.Stanford.EDU>
References: <c00449$nkp$1@news.Stanford.EDU> <c005an$ob6$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine29.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1076096700 17766 171.64.15.104 (6 Feb 2004 19:45:00 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:5985

If it helps, you can think of the question this way:
WSGR is located physically on Page Mill Drive, just
past El Camino, literally just a couple miles away.  UCLA is something
like 500 miles away.  Both are "12 hops" away...WSGR might even be "15
hops" away.   Since WSGR is only a couple miles away, shouldn't they be
just a couple hops away as well while UCLA, being further, be more hops?
Explain why WSGR is so many hops away while still being so physically
close to us...and why UCLA is only 12 hops away despite the great physical
distance.


Susan

Adar Dembo <adar@stanford.edu> writes:

> Adar Dembo wrote:
> 
> > This may sound silly, but I don't know if this question is valid anymore
> > (perhaps it was in the past).
> > I ran a traceroute on both www.ucla.edu and www.wsgr.com. WSGR timed out
> > after the 12th hop (firewall dropping UDP packets perhaps?) UCLA traced
> > at 12 hops. On a Linux computer, however, traceroute -I uses ICMP echo
> > packets instead of UDP (an option that Solaris does not seem to
> > provide). With traceroute -I, www.wsgr.com also traced at 12 hops.
> > Through both ping and traceroute, www.wsgr.com averaged around 5 ms,
> > while www.ucla.edu averaged around 15 ms.
> > Granted, the routes to either one are different (seen by following the
> > router trail with traceroute), and www.wsgr.com the website loads a BIT
> > slower than www.ucla.edu (I am guessing because of their use of ASP),
> > but I don't think that counts for this question, and in all other
> > respects, www.ucla.edu seems "further" than www.wsgr.com. What gives?
> > -Adar
> 
> I'd like to add that I just read the previous post about this question,
> posted on 2/3/2004 by Vishal Patel. He describes the router dropping the
> UDP packets, and Matthew told him to assume that there were  possibly
> multiple routers behind it.
> 
> Unfortunately, given that with traceroute -I (on the appropriate machine)
> the next hop (hop 12 from elaine25) is www.wsgr.com, and this is equal to
> www.ucla.edu in hop count, I am still confused as to how to answer this
> question.
> 
> -Adar
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine29.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: traceroute result interpretation
Date: 06 Feb 2004 11:52:16 -0800
Organization: Stanford University, CA, USA
Lines: 26
Distribution: su
Message-ID: <snnk7302dfz.fsf@elaine29.Stanford.EDU>
References: <40239561.8C15CA40@stanford.edu>
NNTP-Posting-Host: elaine29.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1076097136 17766 171.64.15.104 (6 Feb 2004 19:52: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:5986

Seungbeom Kim <sbkim@stanford.edu> writes:

> When traceroute is given the option -S, it prints a per-hop min/avg/max
> RTT statistics summary (according to the manual page).
> The actual output looks like "4.13/5.22/7.54 (0.927) ms"; I understand
> that 4.13/5.22/7.54 correspond to min/avg/max, but what does 0.927 mean?

It doesn't say, but it looks like probably standard deviation or
variance.  You'll notice it's larger when the difference between min and
max results is larger and smaller when min and max are very close.

> 
> And I sometimes see that a earlier hop router has a larger RTT than
> a later one, e.g. 4.57 ms in hop 9 followed by 3.90 ms in hop 10.
> Is this just due to the variance of the network, or does it have
> any other meaning?

One possible explanation is that some routers may put a low priority on
sending ICMP timeout messages and therefore seem further away than they
actually are.

Susan

> 
> -- 
> Seungbeom Kim
.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Understanding TCP Packet Processing
Date: Fri, 6 Feb 2004 20:02:05 -0800
Lines: 39
Distribution: su
Message-ID: <Pine.GSO.4.44.0402061819180.24337-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 1076126527 24229 171.64.15.100 (7 Feb 2004 04:02:07 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5987

I was tracing some network activity on my Linux system and I noticed
something that seemed a bit odd and wondered if this was something that is
system specific or something that is generic to TCP. Maybe someone can
provide some insight.

A source sends TCP packets to a receiver and seems to start with a very
small window size. It looks like the window size effectively doubles
every rtt, which I think is what is expected with slow start.

At some point the sender no longer doubles it's window size but increases
the window size very gradually if at all. The data rate is well below what
the data rate that a window of that size would allow (less than 1/3 of the
available rate of the adapter) and is growing very gradually. I thought
this meant that congestion avoidance had kicked in. Yet my trace shows no
packet loss what so ever. Seems like the system has reached the slow start
threshold. But I thought initally the slow start threshold would be
essentially inifinity and would be limited only when a packet loss occured.

Additionally, the receiver seems to be acking every packet when the client
is doubling it's windows size / rtt. But when the sender slows it's rate
of the window growth down, now the receiver seems to be acking every two
packets received (two packets acked for each ack recevied by the sender).
I can't tell from the trace exactly which of these events occurs first
or even if they are related but they happen very close together which
makes me believe they are related.

It may just be the implementation on Linux.
I looked at some of the Linux net code, but it is not at all easy to read,
though obviously it works quite well. :-)

I'm not sure who cares about this but I think understanding this could
provide some valuable insight. If any one could provide some insight into
this behavior, I think it would be useful to know for those of us who
are interested.

Thanks,

Edward G. Chron

.

Path: shelby.stanford.edu!elaine12.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Understanding TCP Packet Processing
Date: Sat, 7 Feb 2004 04:38:11 +0000 (UTC)
Lines: 45
Distribution: su
Message-ID: <c01q3j$pe1$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402061819180.24337-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine12.stanford.edu
X-Trace: news.Stanford.EDU 1076128691 26049 171.64.15.77 (7 Feb 2004 04:38:11 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5988


>A source sends TCP packets to a receiver and seems to start with a very
>small window size. It looks like the window size effectively doubles
>every rtt, which I think is what is expected with slow start.

Yep.

>At some point the sender no longer doubles it's window size but increases
>the window size very gradually if at all. The data rate is well below what
>the data rate that a window of that size would allow (less than 1/3 of the
>available rate of the adapter) and is growing very gradually. I thought
>this meant that congestion avoidance had kicked in. Yet my trace shows no
>packet loss what so ever. Seems like the system has reached the slow start
>threshold. But I thought initally the slow start threshold would be
>essentially inifinity and would be limited only when a packet loss occured.

I don't completely understand some of your comments (data rate should equal
window size / RTT -- how could it be less than what the window "allows"?)
But perhaps this may be related...

In the Internet today, the throughput of many TCP implementations is
actually limited by receiver window size rather than the congestion window.
For example, many implementations use a receiver window on the order
of 32KB, sometimes less (Windows is particularly poor in this regard).
If you consider a typical RTT for a connection, you can see that the
expected throughput of an individual connection can often be much less than
what you'd expect to achieve with your network adapter.

There is a TCP option to support window scaling, to permit receiver windows
larger than 64KB (the maximum allowed in the original definition of TCP),
but this doesn't seem to be widely used.

A setsockopt() with SO_SNDBUF may have the effect of increasing the
receiver window from whatever default your O/S assumes.

>Additionally, the receiver seems to be acking every packet when the client
>is doubling it's windows size / rtt. But when the sender slows it's rate
>of the window growth down, now the receiver seems to be acking every two
>packets received (two packets acked for each ack recevied by the sender).

Most TCP stacks will implement "delayed ACKs," where one ACK is sent for
every 2 MSS-sized segments.  (If the second such segment doesn't arrive
within a timeout, an ACK for the first segment is sent as usual--the
maximum time is specified in one of the RFCs).

.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Understanding TCP Packet Processing
Date: Fri, 6 Feb 2004 23:08:24 -0800
Lines: 92
Distribution: su
Message-ID: <Pine.GSO.4.44.0402062233420.4406-100000@elaine26.Stanford.EDU>
References: <Pine.GSO.4.44.0402061819180.24337-100000@elaine25.Stanford.EDU>
 <c01q3j$pe1$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1076137706 4381 171.64.15.101 (7 Feb 2004 07:08:26 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c01q3j$pe1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5989

Thanks for the information.

The data rate for the Linux system was considerably lower than what the
window size would allow, i.e. the window size was ~12 MB but the
source system only put ~3 MB on the wire. The sender on linux specified
8 MB for the desired window size. Linux, however, doubled this and took
2/3rds of that (why I'm not exactly sure) and so the sender ended up with
about 12 MB for the window size. I could see this in the trace.

The sender could have put more data on the wire, and very gradually it was
adding additional packets per rtt, but at a much lower rate than I
would have guessed. This was not being throttled back by the receiver, the receiver
can handle data rates well in excess of 100 MB/s (this is with GigE and
9000 Byte Jumbo frames). In fact by switching ipperf from TCP to UDP
I measured rates well in excess of 100 MB/s on the same systems through
the same Extreme Networks Router.

It seemed that the longer the latency in the network (i.e. I ran a couple
of tests, one with a 100 msec latency, one with a 50 msec latency and with
a 25 msec latency in each direction, I verified these with pings that
gave me times of ~ 50msec, 100msec and 200msec respectively) the slower
the sender TCP ramped up.

I thought the longer the latency the more data the sender TCP needed to
pump on to the wire, to fill the wire up (so to speak). The longer latency
meant the ACKs came back later (since the rtt was longer) but I didn't
think that mattered, except that the sender would need to buffer more
since it could send more data before getting ACKs back.

I was just trying to see if I could understand how TCP functioned in a
real, reasonably high performance environment (though I guess 10 GigE
ethernet routers are starting to be used commerically available).
I still have a lot to learn.

Thanks

 On Sat, 7 Feb 2004, Matthew Jonathan Holliman wrote:

> Date: Sat, 7 Feb 2004 04:38:11 +0000 (UTC)
> From: Matthew Jonathan Holliman <holliman@Stanford.EDU>
> Newsgroups: su.class.cs244a
> Subject: Re: Understanding TCP Packet Processing
>
>
> >A source sends TCP packets to a receiver and seems to start with a very
> >small window size. It looks like the window size effectively doubles
> >every rtt, which I think is what is expected with slow start.
>
> Yep.
>
> >At some point the sender no longer doubles it's window size but increases
> >the window size very gradually if at all. The data rate is well below what
> >the data rate that a window of that size would allow (less than 1/3 of the
> >available rate of the adapter) and is growing very gradually. I thought
> >this meant that congestion avoidance had kicked in. Yet my trace shows no
> >packet loss what so ever. Seems like the system has reached the slow start
> >threshold. But I thought initally the slow start threshold would be
> >essentially inifinity and would be limited only when a packet loss occured.
>
> I don't completely understand some of your comments (data rate should equal
> window size / RTT -- how could it be less than what the window "allows"?)
> But perhaps this may be related...
>
> In the Internet today, the throughput of many TCP implementations is
> actually limited by receiver window size rather than the congestion window.
> For example, many implementations use a receiver window on the order
> of 32KB, sometimes less (Windows is particularly poor in this regard).
> If you consider a typical RTT for a connection, you can see that the
> expected throughput of an individual connection can often be much less than
> what you'd expect to achieve with your network adapter.
>
> There is a TCP option to support window scaling, to permit receiver windows
> larger than 64KB (the maximum allowed in the original definition of TCP),
> but this doesn't seem to be widely used.
>
> A setsockopt() with SO_SNDBUF may have the effect of increasing the
> receiver window from whatever default your O/S assumes.
>
> >Additionally, the receiver seems to be acking every packet when the client
> >is doubling it's windows size / rtt. But when the sender slows it's rate
> >of the window growth down, now the receiver seems to be acking every two
> >packets received (two packets acked for each ack recevied by the sender).
>
> Most TCP stacks will implement "delayed ACKs," where one ACK is sent for
> every 2 MSS-sized segments.  (If the second such segment doesn't arrive
> within a timeout, an ACK for the first segment is sent as usual--the
> maximum time is specified in one of the RFCs).
>
>

Edward G. Chron

.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Understanding TCP Packet Processing
Date: Fri, 6 Feb 2004 23:17:15 -0800
Lines: 76
Distribution: su
Message-ID: <Pine.GSO.4.44.0402062309150.4406-100000@elaine26.Stanford.EDU>
References: <Pine.GSO.4.44.0402061819180.24337-100000@elaine25.Stanford.EDU>
 <c01q3j$pe1$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1076138237 4978 171.64.15.101 (7 Feb 2004 07:17:17 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c01q3j$pe1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5990

On Sat, 7 Feb 2004, Matthew Jonathan Holliman wrote:

> Most TCP stacks will implement "delayed ACKs," where one ACK is sent for
> every 2 MSS-sized segments.  (If the second such segment doesn't arrive
> within a timeout, an ACK for the first segment is sent as usual--the
> maximum time is specified in one of the RFCs).

Thanks for the explanation. One further question. Why would the receiver
ACK just one request and then later switch to ACKing two requests at once?
Is this based on leaving the ACK in the queue and then after some fixed
time shoving the response on the wire back to the sender?
Except for very early on in slow start, the sender is always shoving some
number of packets out fairly quickly then it goes idle until the next ACK.
I would have thought the receiver would have piggy backed the ACKs earlier
as well but it take a while for this to happen.

One thing the trace shows and that jibes with what we've learned in
lecture, especially during slow start as the sender ramps up, TCP is quite
bursty.

Thanks

> Date: Sat, 7 Feb 2004 04:38:11 +0000 (UTC)
> From: Matthew Jonathan Holliman <holliman@Stanford.EDU>
> Newsgroups: su.class.cs244a
> Subject: Re: Understanding TCP Packet Processing
>
>
> >A source sends TCP packets to a receiver and seems to start with a very
> >small window size. It looks like the window size effectively doubles
> >every rtt, which I think is what is expected with slow start.
>
> Yep.
>
> >At some point the sender no longer doubles it's window size but increases
> >the window size very gradually if at all. The data rate is well below what
> >the data rate that a window of that size would allow (less than 1/3 of the
> >available rate of the adapter) and is growing very gradually. I thought
> >this meant that congestion avoidance had kicked in. Yet my trace shows no
> >packet loss what so ever. Seems like the system has reached the slow start
> >threshold. But I thought initally the slow start threshold would be
> >essentially inifinity and would be limited only when a packet loss occured.
>
> I don't completely understand some of your comments (data rate should equal
> window size / RTT -- how could it be less than what the window "allows"?)
> But perhaps this may be related...
>
> In the Internet today, the throughput of many TCP implementations is
> actually limited by receiver window size rather than the congestion window.
> For example, many implementations use a receiver window on the order
> of 32KB, sometimes less (Windows is particularly poor in this regard).
> If you consider a typical RTT for a connection, you can see that the
> expected throughput of an individual connection can often be much less than
> what you'd expect to achieve with your network adapter.
>
> There is a TCP option to support window scaling, to permit receiver windows
> larger than 64KB (the maximum allowed in the original definition of TCP),
> but this doesn't seem to be widely used.
>
> A setsockopt() with SO_SNDBUF may have the effect of increasing the
> receiver window from whatever default your O/S assumes.
>
> >Additionally, the receiver seems to be acking every packet when the client
> >is doubling it's windows size / rtt. But when the sender slows it's rate
> >of the window growth down, now the receiver seems to be acking every two
> >packets received (two packets acked for each ack recevied by the sender).
>
> Most TCP stacks will implement "delayed ACKs," where one ACK is sent for
> every 2 MSS-sized segments.  (If the second such segment doesn't arrive
> within a timeout, an ACK for the first segment is sent as usual--the
> maximum time is specified in one of the RFCs).
>
>

Edward G. Chron

.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Understanding TCP Packet Processing
Date: Sat, 7 Feb 2004 08:01:22 -0800
Lines: 90
Distribution: su
Message-ID: <Pine.GSO.4.44.0402070759370.6609-100000@elaine26.Stanford.EDU>
References: <Pine.GSO.4.44.0402061819180.24337-100000@elaine25.Stanford.EDU>
 <c01q3j$pe1$1@news.Stanford.EDU> <Pine.GSO.4.44.0402062309150.4406-100000@elaine26.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1076169685 2101 171.64.15.101 (7 Feb 2004 16:01:25 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402062309150.4406-100000@elaine26.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5991

I found the reference in the RFC and looking at the trace and comparing
the times when the packets come and when in the ACK goes out, now it makes
sense to me. Thanks for explanation.
On Fri, 6 Feb 2004, Edward Chron wrote:

> Date: Fri, 6 Feb 2004 23:17:15 -0800
> From: Edward Chron <echron@stanford.edu>
> Newsgroups: su.class.cs244a
> Subject: Re: Understanding TCP Packet Processing
>
> On Sat, 7 Feb 2004, Matthew Jonathan Holliman wrote:
>
> > Most TCP stacks will implement "delayed ACKs," where one ACK is sent for
> > every 2 MSS-sized segments.  (If the second such segment doesn't arrive
> > within a timeout, an ACK for the first segment is sent as usual--the
> > maximum time is specified in one of the RFCs).
>
> Thanks for the explanation. One further question. Why would the receiver
> ACK just one request and then later switch to ACKing two requests at once?
> Is this based on leaving the ACK in the queue and then after some fixed
> time shoving the response on the wire back to the sender?
> Except for very early on in slow start, the sender is always shoving some
> number of packets out fairly quickly then it goes idle until the next ACK.
> I would have thought the receiver would have piggy backed the ACKs earlier
> as well but it take a while for this to happen.
>
> One thing the trace shows and that jibes with what we've learned in
> lecture, especially during slow start as the sender ramps up, TCP is quite
> bursty.
>
> Thanks
>
> > Date: Sat, 7 Feb 2004 04:38:11 +0000 (UTC)
> > From: Matthew Jonathan Holliman <holliman@Stanford.EDU>
> > Newsgroups: su.class.cs244a
> > Subject: Re: Understanding TCP Packet Processing
> >
> >
> > >A source sends TCP packets to a receiver and seems to start with a very
> > >small window size. It looks like the window size effectively doubles
> > >every rtt, which I think is what is expected with slow start.
> >
> > Yep.
> >
> > >At some point the sender no longer doubles it's window size but increases
> > >the window size very gradually if at all. The data rate is well below what
> > >the data rate that a window of that size would allow (less than 1/3 of the
> > >available rate of the adapter) and is growing very gradually. I thought
> > >this meant that congestion avoidance had kicked in. Yet my trace shows no
> > >packet loss what so ever. Seems like the system has reached the slow start
> > >threshold. But I thought initally the slow start threshold would be
> > >essentially inifinity and would be limited only when a packet loss occured.
> >
> > I don't completely understand some of your comments (data rate should equal
> > window size / RTT -- how could it be less than what the window "allows"?)
> > But perhaps this may be related...
> >
> > In the Internet today, the throughput of many TCP implementations is
> > actually limited by receiver window size rather than the congestion window.
> > For example, many implementations use a receiver window on the order
> > of 32KB, sometimes less (Windows is particularly poor in this regard).
> > If you consider a typical RTT for a connection, you can see that the
> > expected throughput of an individual connection can often be much less than
> > what you'd expect to achieve with your network adapter.
> >
> > There is a TCP option to support window scaling, to permit receiver windows
> > larger than 64KB (the maximum allowed in the original definition of TCP),
> > but this doesn't seem to be widely used.
> >
> > A setsockopt() with SO_SNDBUF may have the effect of increasing the
> > receiver window from whatever default your O/S assumes.
> >
> > >Additionally, the receiver seems to be acking every packet when the client
> > >is doubling it's windows size / rtt. But when the sender slows it's rate
> > >of the window growth down, now the receiver seems to be acking every two
> > >packets received (two packets acked for each ack recevied by the sender).
> >
> > Most TCP stacks will implement "delayed ACKs," where one ACK is sent for
> > every 2 MSS-sized segments.  (If the second such segment doesn't arrive
> > within a timeout, an ACK for the first segment is sent as usual--the
> > maximum time is specified in one of the RFCs).
> >
> >
>
> Edward G. Chron
>
>

Edward G. Chron

.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Understanding TCP packet processing
Date: Sat, 7 Feb 2004 08:49:20 -0800
Lines: 78
Distribution: su
Message-ID: <Pine.GSO.4.44.0402070803510.6609-100000@elaine26.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1076172561 4417 171.64.15.101 (7 Feb 2004 16:49:21 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5992

Matthew Jonathan Holliman wrote:

> I don't completely understand some of your comments (data rate should
> equal window size / RTT -- how could it be less than what the window "allows"?)
> But perhaps this may be related...

> In the Internet today, the throughput of many TCP implementations is
> actually limited by receiver window size rather than the congestion
> window.
> For example, many implementations use a receiver window on the order
> of 32KB, sometimes less (Windows is particularly poor in this regard).
> If you consider a typical RTT for a connection, you can see that the
> expected throughput of an individual connection can often be much less
> than what you'd expect to achieve with your network adapter.

> There is a TCP option to support window scaling, to permit receiver
> windows larger than 64KB (the maximum allowed in the original definition of TCP),
> but this doesn't seem to be widely used.

> A setsockopt() with SO_SNDBUF may have the effect of increasing the
> receiver window from whatever default your O/S assumes.

I think I'm using the wrong terminology for one thing, in particular the
term window size. Maybe you can help me to use the terminology correctly.

First there is the window size that the receiver advertises to the
sender. What is the proper term for this, the advertised window size?

In the experiment I ran, the receiver (not the sender as I
incorrectly stated) set it's receive buffer size to 8MB using a socket
option. For some reason Linux mucked with this and what got sent back to
the sender as the advertised size was larger, around 12 MB.

The sender seems to use that window size but then calculates it's own send
window size (I don't know what to call it). This send window size appears
to be the advertised window size from the receiver minus the amount of data it
has sent out, but here is where I am a bit confused and maybe I'm
misreading the trace data.

Suppose the MTU is 1500 and the advertised window size is 15000.
If the sender sends 10 1500 byte packets, it must now wait for an ACK.
In this case, the send window size has reached the advertised window size
limit.

At some point the receiver receives the first packet and ACKs it.
I would assume when the receiver ACKs it, sends an advertised window size
of 15000 back to the sender. After all, it's buffers are empty.

The sender received the ACK but cannot send the advertised size, it can
send only 1500 bytes or less data. If the receiver can't handle all the
sender's data in a timely fashion, packets get dropped and the sender
should throttle back (cutting the send window size in half).

That is the kind of behavior I expected to see. But what I'm seeing in the
trace is that the sender is taking a long time to ramp up to the advertised
window size. I realize that because of the way slow start works, it can't ramp up to
the advertised window size instantanously, it doubles every rtt.

But what I expected was the sender to increase it's send window size (the
amount of data it is now sending plus any data it currently has in
transit) doubling every rtt until it reaches the advertised window size
or until a packet gets dropped. Does that make sense?

What I'm seeing is that the sender doubles it's send window size each
rtt until the send window size reaches ~3.3MB, where the advertised window
size is around 12MB, and then the sender increases the window sender size
using additive increases (the slope of the rate of increase is quite
noticibly less).

Maybe the slower rate of increase is due to some setting I need to make
on Linux, I'm not sure. Maybe their stack is tuned for 10 Mbit or 10/100
Mbit and 1Gbit requires tuneables changes or other adjustments.

It isn't a problem for UDP packets, they ramp up very quickly and achieve
numbers close to the expected limit on the wire.

Edward G. Chron

.

Path: shelby.stanford.edu!elaine21.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Understanding TCP packet processing
Date: Mon, 9 Feb 2004 19:17:58 +0000 (UTC)
Lines: 113
Distribution: su
Message-ID: <c08md6$sg2$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402070803510.6609-100000@elaine26.Stanford.EDU>
NNTP-Posting-Host: elaine21.stanford.edu
X-Trace: news.Stanford.EDU 1076354278 29186 171.64.15.86 (9 Feb 2004 19:17:58 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5993

I've coalesced my responses...

>The data rate for the Linux system was considerably lower than what the
>window size would allow, i.e. the window size was ~12 MB but the
>source system only put ~3 MB on the wire. The sender on linux specified
>8 MB for the desired window size. Linux, however, doubled this and took
>2/3rds of that (why I'm not exactly sure) and so the sender ended up with
>about 12 MB for the window size. I could see this in the trace.

Okay, I understand your terminology now.  Is there any application-level
throttling that would explain this, or is it just doing a write()/read()
loop on the sender/receiver, resp.?  What is the CPU utilisation?
Frequently with Gig-E, this is a bottleneck that limits the throughput
you can achieve.  (Although if you achieve 100+ MB/s, i.e. 800 Mb/s, you're
doing exceptionally well--and judging from the behaviour you see, it
doesn't sound like this is the case on your system).

I'm not sure why Linux would handle the window setsockopt() in that way--
perhaps there's a comment in the kernel source somewhere that would
elucidate... with no other information to go on, it 'feels' like a hack.

>It seemed that the longer the latency in the network (i.e. I ran a couple
>of tests, one with a 100 msec latency, one with a 50 msec latency and with
>a 25 msec latency in each direction, I verified these with pings that
>gave me times of ~ 50msec, 100msec and 200msec respectively) the slower
>the sender TCP ramped up.

This makes sense--TCP can only increase its window every RTT.  So if the
RTT is longer, it takes longer to ramp up.  This is why a large window
is needed to use a link efficiently with a high delay-bandwidth product.

>Thanks for the explanation. One further question. Why would the receiver
>ACK just one request and then later switch to ACKing two requests at once?

This doesn't make sense to me--from an implementation point of view, it
would make sense to have a fixed way of handling ACKs (i.e. a timer is
scheduled for each ACK, and if a second packet arrives before that fires,
an ACK is sent).  I can't think of a good reason why the receiver
would behave differently when the sender is in slow start.  Do I understand
from your subsequent posting that there wasn't an inconsistency in the way
the receiver sent out its ACKs after all?

>Is this based on leaving the ACK in the queue and then after some fixed
>time shoving the response on the wire back to the sender?

Yep.

>One thing the trace shows and that jibes with what we've learned in
>lecture, especially during slow start as the sender ramps up, TCP is quite
>bursty.

True during slow start, but in steady state it should be sending out
roughly ~1 packet/ACK, i.e. sending roughly at constant rate (over some
slight time average).  Do you see different behaviour than this?

> A setsockopt() with SO_SNDBUF may have the effect of increasing the
> receiver window from whatever default your O/S assumes.

I wrote the wrong thing here--SO_SNDBUF sets the sender buffer size.
SO_RCVBUF is the receiver buffer size.  Quite how the O/S interprets
these varies a bit (they aren't just window sizes).  N.B. if you do
getsockopt(), does that confirm that the buffer was set to the value
that was passed in to setsockopt()?  e.g. Solaris documentations
suggests a 1 MB maximum on TCP sender buffer size.  (BTW, you
can do man -s 7P tcp on the elaines for Solaris documentation about
TCP, and man ndd to see how to retrieve some of the Solaris kernel's
parameters).

>First there is the window size that the receiver advertises to the
>sender. What is the proper term for this, the advertised window size?

Yep.

>The sender seems to use that window size but then calculates it's own send
>window size (I don't know what to call it). This send window size appears
>to be the advertised window size from the receiver minus the amount of
>data it
>has sent out, but here is where I am a bit confused and maybe I'm
>misreading the trace data.

This is the sender window--but do you mean 'minus the amount of unACKed data
it has sent out'?  This would make more sense to me.

>At some point the receiver receives the first packet and ACKs it.
>I would assume when the receiver ACKs it, sends an advertised window size
>of 15000 back to the sender. After all, it's buffers are empty.

I would think it depends if the application read the data or not.

>The sender received the ACK but cannot send the advertised size, it can
>send only 1500 bytes or less data. If the receiver can't handle all the
>sender's data in a timely fashion, packets get dropped and the sender
>should throttle back (cutting the send window size in half).

Nope--there are two different windows that the sender must conform to,
the advertised receiver window, and the congestion window.  Flow
control (making sure the sender doesn't overrun the receiver) is
quite distinct from congestion control (making sure the sender doesn't
overburden the network).

>But what I expected was the sender to increase it's send window size (the
>amount of data it is now sending plus any data it currently has in
>transit) doubling every rtt until it reaches the advertised window size
>or until a packet gets dropped. Does that make sense?

Yep.  I found a page that seems to explain the symptoms you
describe:  http://www.csm.ornl.gov/~dunigan/netperf/auto.html

BTW, are you using tcptrace or similar software for these experiments?
(http://jarok.cs.ohiou.edu/software/tcptrace/tcptrace.html)
I haven't used this personally, but it's been described as
pretty useful by others I know.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: More Tips/Tricks from the Grading Gurus
Date: Mon, 9 Feb 2004 14:21:14 -0800
Lines: 31
Distribution: su
Message-ID: <Pine.LNX.4.44.0402091126100.14562-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 1076365276 12408 171.64.66.201 (9 Feb 2004 22:21:16 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5994


 Hi All,

   After going through another round of grading your programming assignments,
   we've amassed another set of suggestions you should consider before handing
   in your projects: 

   - Try and avoid using tabs in your source code.  In vim you can turn off
     tabs by adding "set et" to your .vimrc.  There must be an equivalent for
     other editors (yo no hablo emacs).  Tabbing environments vary greatly
     between developers and your code can be simply unreadable if you developed
     your code with a tabbed spacing different than that of the reader.  (for
     formatting you might want to learn how to use indent, and run it over your
     source code before submission)

   - Don't have blocks of commented out code in your final submission.  This
     does little more than obstruct the reader.

   - Please use carriage returns in your READMEs!  A number of students have
     submitted READMEs with paragraphs that double or triple the max
     displayable line length in vi.  

   - Be careful with your comments.  We spend a lot of time reading through
     your code and old, ambiguous or wrong comment can be terribly misleading.
     An incorrect comment is much more confusing to us than non at all.

   - Turn off all debugging output in your final submission.  Retaining the
     code to do the printing is fine, however a default compile, when run
     should not print out anything that isn't strictly required by the
     assignment.

.

Path: shelby.stanford.edu!saga19.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Understanding TCP packet processing
Date: Mon, 9 Feb 2004 17:27:52 -0800
Lines: 168
Distribution: su
Message-ID: <Pine.GSO.4.44.0402091704390.13449-100000@saga19.Stanford.EDU>
References: <Pine.GSO.4.44.0402070803510.6609-100000@elaine26.Stanford.EDU>
 <c08md6$sg2$1@news.Stanford.EDU>
NNTP-Posting-Host: saga19.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1076376475 27775 171.64.15.149 (10 Feb 2004 01:27:55 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c08md6$sg2$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:5995

Matthew, Thanks for all the information. Very informative and helpful.

Turns out it was a problem with the transmit queue length size for the
adapter card. Increasing this allowed slow start to continue ramping up
to the advertised receiver window size, quickly ramping up to over 100
MB/s.

> True during slow start, but in steady state it should be sending out
> roughly ~1 packet/ACK, i.e. sending roughly at constant rate (over some
> slight time average).  Do you see different behaviour than this?

Precisely.

> This is the sender window--but do you mean 'minus the amount of unACKed
> data it has sent out'?  This would make more sense to me.

Yes, it is minus the amount of UnACKed data.

> I would think it depends if the application read the data or not.

Good point, the receiver is basically reading and discarding the data
since the focus is on measuring the speed of the network and stack.

> Nope--there are two different windows that the sender must conform to,
> the advertised receiver window, and the congestion window.  Flow
> control (making sure the sender doesn't overrun the receiver) is
> quite distinct from congestion control (making sure the sender doesn't
> overburden the network).

Great point.

> BTW, are you using tcptrace or similar software for these experiments?
> (http://jarok.cs.ohiou.edu/software/tcptrace/tcptrace.html)
> I haven't used this personally, but it's been described as
> pretty useful by others I know.

tcptrace, ipperf and network emulation tool to adjust the delay/bandwidth
path. All interesting tools to use.

The time spent might have been better utilized else where but it was
interesting none the less.

Thanks.

 On Mon, 9 Feb 2004, Matthew Jonathan Holliman wrote:

> Date: Mon, 9 Feb 2004 19:17:58 +0000 (UTC)
> From: Matthew Jonathan Holliman <holliman@Stanford.EDU>
> Newsgroups: su.class.cs244a
> Subject: Re: Understanding TCP packet processing
>
> I've coalesced my responses...
>
> >The data rate for the Linux system was considerably lower than what the
> >window size would allow, i.e. the window size was ~12 MB but the
> >source system only put ~3 MB on the wire. The sender on linux specified
> >8 MB for the desired window size. Linux, however, doubled this and took
> >2/3rds of that (why I'm not exactly sure) and so the sender ended up with
> >about 12 MB for the window size. I could see this in the trace.
>
> Okay, I understand your terminology now.  Is there any application-level
> throttling that would explain this, or is it just doing a write()/read()
> loop on the sender/receiver, resp.?  What is the CPU utilisation?
> Frequently with Gig-E, this is a bottleneck that limits the throughput
> you can achieve.  (Although if you achieve 100+ MB/s, i.e. 800 Mb/s, you're
> doing exceptionally well--and judging from the behaviour you see, it
> doesn't sound like this is the case on your system).
>
> I'm not sure why Linux would handle the window setsockopt() in that way--
> perhaps there's a comment in the kernel source somewhere that would
> elucidate... with no other information to go on, it 'feels' like a hack.
>
> >It seemed that the longer the latency in the network (i.e. I ran a couple
> >of tests, one with a 100 msec latency, one with a 50 msec latency and with
> >a 25 msec latency in each direction, I verified these with pings that
> >gave me times of ~ 50msec, 100msec and 200msec respectively) the slower
> >the sender TCP ramped up.
>
> This makes sense--TCP can only increase its window every RTT.  So if the
> RTT is longer, it takes longer to ramp up.  This is why a large window
> is needed to use a link efficiently with a high delay-bandwidth product.
>
> >Thanks for the explanation. One further question. Why would the receiver
> >ACK just one request and then later switch to ACKing two requests at once?
>
> This doesn't make sense to me--from an implementation point of view, it
> would make sense to have a fixed way of handling ACKs (i.e. a timer is
> scheduled for each ACK, and if a second packet arrives before that fires,
> an ACK is sent).  I can't think of a good reason why the receiver
> would behave differently when the sender is in slow start.  Do I understand
> from your subsequent posting that there wasn't an inconsistency in the way
> the receiver sent out its ACKs after all?
>
> >Is this based on leaving the ACK in the queue and then after some fixed
> >time shoving the response on the wire back to the sender?
>
> Yep.
>
> >One thing the trace shows and that jibes with what we've learned in
> >lecture, especially during slow start as the sender ramps up, TCP is quite
> >bursty.
>
> True during slow start, but in steady state it should be sending out
> roughly ~1 packet/ACK, i.e. sending roughly at constant rate (over some
> slight time average).  Do you see different behaviour than this?
>
> > A setsockopt() with SO_SNDBUF may have the effect of increasing the
> > receiver window from whatever default your O/S assumes.
>
> I wrote the wrong thing here--SO_SNDBUF sets the sender buffer size.
> SO_RCVBUF is the receiver buffer size.  Quite how the O/S interprets
> these varies a bit (they aren't just window sizes).  N.B. if you do
> getsockopt(), does that confirm that the buffer was set to the value
> that was passed in to setsockopt()?  e.g. Solaris documentations
> suggests a 1 MB maximum on TCP sender buffer size.  (BTW, you
> can do man -s 7P tcp on the elaines for Solaris documentation about
> TCP, and man ndd to see how to retrieve some of the Solaris kernel's
> parameters).
>
> >First there is the window size that the receiver advertises to the
> >sender. What is the proper term for this, the advertised window size?
>
> Yep.
>
> >The sender seems to use that window size but then calculates it's own send
> >window size (I don't know what to call it). This send window size appears
> >to be the advertised window size from the receiver minus the amount of
> >data it
> >has sent out, but here is where I am a bit confused and maybe I'm
> >misreading the trace data.
>
> This is the sender window--but do you mean 'minus the amount of unACKed data
> it has sent out'?  This would make more sense to me.
>
> >At some point the receiver receives the first packet and ACKs it.
> >I would assume when the receiver ACKs it, sends an advertised window size
> >of 15000 back to the sender. After all, it's buffers are empty.
>
> I would think it depends if the application read the data or not.
>
> >The sender received the ACK but cannot send the advertised size, it can
> >send only 1500 bytes or less data. If the receiver can't handle all the
> >sender's data in a timely fashion, packets get dropped and the sender
> >should throttle back (cutting the send window size in half).
>
> Nope--there are two different windows that the sender must conform to,
> the advertised receiver window, and the congestion window.  Flow
> control (making sure the sender doesn't overrun the receiver) is
> quite distinct from congestion control (making sure the sender doesn't
> overburden the network).
>
> >But what I expected was the sender to increase it's send window size (the
> >amount of data it is now sending plus any data it currently has in
> >transit) doubling every rtt until it reaches the advertised window size
> >or until a packet gets dropped. Does that make sense?
>
> Yep.  I found a page that seems to explain the symptoms you
> describe:  http://www.csm.ornl.gov/~dunigan/netperf/auto.html
>
> BTW, are you using tcptrace or similar software for these experiments?
> (http://jarok.cs.ohiou.edu/software/tcptrace/tcptrace.html)
> I haven't used this personally, but it's been described as
> pretty useful by others I know.
>
>

Edward G. Chron

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Links to the sample midterm is not valid
Date: Mon, 9 Feb 2004 17:32:41 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0402091730500.23909-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 1076376762 28153 171.64.15.100 (10 Feb 2004 01:32:42 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5996


I just tried to download the sample midterm from the course website.  The
link does not seem to be right.

file:///C:/work/cs244a/old_exams/midterm_win2002.pdf
file:///C:/work/cs244a/old_exams/midterm_win2003.pdf
file:///C:/work/cs244a/old_exams/midterm_win2002_soln.pdf
file:///C:/work/cs244a/old_exams/midterm_win2003_soln.pdf

-Laura

.

Path: shelby.stanford.edu!elaine17.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Links to the sample midterm is not valid
Date: Tue, 10 Feb 2004 02:08:43 +0000 (UTC)
Lines: 2
Distribution: su
Message-ID: <c09efb$s3$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402091730500.23909-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine17.stanford.edu
X-Trace: news.Stanford.EDU 1076378923 899 171.64.15.82 (10 Feb 2004 02:08:43 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:5997

Sorry--fixed it.

.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine40.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: More Tips/Tricks from the Grading Gurus
Date: 10 Feb 2004 14:12:27 -0800
Organization: Stanford University, CA, USA
Lines: 55
Distribution: su
Message-ID: <snnvfmer3ck.fsf@elaine40.Stanford.EDU>
References: <Pine.LNX.4.44.0402091126100.14562-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine40.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1076451147 16108 171.64.15.115 (10 Feb 2004 22:12: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:5998

>    - Try and avoid using tabs in your source code.  In vim you can turn off
>      tabs by adding "set et" to your .vimrc.  There must be an equivalent for
>      other editors (yo no hablo emacs).  Tabbing environments vary greatly
>      between developers and your code can be simply unreadable if you developed
>      your code with a tabbed spacing different than that of the reader.  (for
>      formatting you might want to learn how to use indent, and run it over your
>      source code before submission)

In emacs (this *should* work for xemacs as well), in your .emacs file add:


;; If you never want to use tabs in any mode set
;; these.  Setting tab-width will determine how many
;; spaces are indented

;; set tab width to 4 by default
(setq-default tab-width 10)

;; spaces instead of tabs by default...
(setq-default indent-tabs-mode nil)

----------------------------------------------------------
;; If you only want to prevent tabs in c/c++ modes
;; set these instead:

;Basic unit of spaces for each indentation level.  You can change
; the 4 if you need larger or smaller indents.

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


; Use only spaces for indentation (default is tabs mixed with spaces)
; so that our files will always look the same regardless of the viewing
; software.

(add-hook 'c++-mode-hook '(lambda ()
    (setq indent-tabs-mode nil)))
(add-hook 'c-mode-hook '(lambda ()
    (setq indent-tabs-mode nil)))

----------------------------------------------
;; here's a bonus emacs setting that makes indenting easier
;; and more automatic:

; Make Emacs use "newline-and-indent" when you hit the Enter key so
; that you don't need to keep using TAB to align yourself when coding.
; This is akin to setting autoindent in vi.

(global-set-key "\C-m" 'newline-and-indent)


Susan
.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: STCP Psuedo Header, Options, STCP States
Date: Tue, 10 Feb 2004 22:10:28 -0800
Lines: 39
Distribution: su
Message-ID: <Pine.GSO.4.44.0402102120330.10309-100000@elaine26.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1076479831 18494 171.64.15.101 (11 Feb 2004 06:10:31 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:5999

I just wanted to make sure I understand the assignment and FAQ correctly:

We don't need to do the whole TCP/UDP psuedo header (headache) with STCP,
correct?

STCP doesn't generate packets with Options but STCP can handle options
when sent:
* The max packet size is 536 bytes and the world knows this.
  So we don't need any options like MSS, correct?
* We also don't need any Window Scale (max windows either side is 3072)
  other options like timestamps, SACK or anything like that, correct?
* Any STCP packets we receive with options supplied we process but promptly
  can ignore those options.

The STCP checksum is not our problem (either for packets we are sending or
receiving), nor is filling in the ports in the STCP header.

What about padding the packet so checksum has 16 bit boundries, do we need
to worrk about that?

We don't need a 2*MSL timeout (TIME_WAIT), correct?

The passive end should combine SYN/ACK in response to an active open.

What about the receiver of the first FIN (active close?).
We can't combine the ACK/FIN in the response. We need a four way
handshake (handout) and Peterson/Davie shows seperate states.

What is the rational that prevents an implementation from combining the
FIN/ACK?

Do we have to handle the case where some implementation would
send us FIN/ACK? Is that valid or an error? If it is an error, do we
ignore it or what do we do?

Thanks,

Edward G. Chron

.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: small problem in transport.c stub
Date: Wed, 11 Feb 2004 07:48:08 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c0cmno$nt5$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1076485688 24485 171.64.15.98 (11 Feb 2004 07:48:08 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6000

Someone pointed out a small conflict between the definition of
our_dprintf() in transport.c, and the declaration in transport.h.
If you've already copied the HW3 stub code, please change our_dprintf()
in transport.c to agree with the declaration in transport.h
(takes a const char *fmt).  (if you haven't copied the code yet,
nothing to do... the current stub code's been fixed).

.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: STCP Psuedo Header, Options, STCP States
Date: Wed, 11 Feb 2004 07:56:52 +0000 (UTC)
Lines: 79
Distribution: su
Message-ID: <c0cn84$oos$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402102120330.10309-100000@elaine26.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1076486212 25372 171.64.15.98 (11 Feb 2004 07:56:52 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6001


>We don't need to do the whole TCP/UDP psuedo header (headache) with STCP,
>correct?

right, we take care of the checksum.

>STCP doesn't generate packets with Options but STCP can handle options
>when sent:
>* The max packet size is 536 bytes and the world knows this.
>  So we don't need any options like MSS, correct?

correct.  if the MSS option isn't specified, TCP assumes 536.

>* We also don't need any Window Scale (max windows either side is 3072)

no need for window scale (if you don't specify such an option, the
other side can't use it).  the max window on the other side is only
3072 if you're talking to another STCP implementation--it will almost
certainly be different when you talk to real TCP eventually.

>  other options like timestamps, SACK or anything like that, correct?

yep.

>* Any STCP packets we receive with options supplied we process but promptly
>  can ignore those options.

yep.

>The STCP checksum is not our problem (either for packets we are sending or
>receiving), nor is filling in the ports in the STCP header.

yep.

>What about padding the packet so checksum has 16 bit boundries, do we need
>to worrk about that?

nope, the stub code should take care of that.

>We don't need a 2*MSL timeout (TIME_WAIT), correct?

correct.

>The passive end should combine SYN/ACK in response to an active open.

correct.

>What about the receiver of the first FIN (active close?).
>We can't combine the ACK/FIN in the response. We need a four way
>handshake (handout) and Peterson/Davie shows seperate states.
>
>What is the rational that prevents an implementation from combining the
>FIN/ACK?

I don't quite understand where this is coming from--can you point
out what prompted this?  You need to implement a four-way handshake,
just like regular TCP.

When one side of the connection has finished sending data, it sends a FIN.
The ACK field may be set (in fact, it should be set--more on that below),
just indicating that th_ack is valid.  The other side ACKs the FIN as usual.
When both sides have sent FINs and had them ACKed (or had them timeout
after several retransmisions), the connection is terminated.

>Do we have to handle the case where some implementation would
>send us FIN/ACK? Is that valid or an error? If it is an error, do we
>ignore it or what do we do?

Yes.  In fact, regular TCP will always set the ACK field whenever it
can, even in a FIN segment.

This is a bit of an aside:
Many firewalls will drop FIN segments that don't have the ACK field set.
The reason is that an old stealthy port scan technique used to send a
SYN, receive a SYN-ACK, and then send a FIN (no ACK set)--this would
prevent a connection from being established, often avoiding it being
logged.  So FINs without ACK set are "suspicious," and regularly dropped by
firewalls.

.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!kayvonf
From: Kayvon Fatahalian <kayvonf@elaine5.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: retransmitted packets
Date: Wed, 11 Feb 2004 01:00:11 -0800
Lines: 27
Distribution: su
Message-ID: <Pine.GSO.4.44.0402110051270.13138-100000@elaine5.Stanford.EDU>
References: <Pine.GSO.4.44.0402102120330.10309-100000@elaine26.Stanford.EDU>
 <c0cn84$oos$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 1076490018 29515 171.64.15.70 (11 Feb 2004 09:00:18 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c0cn84$oos$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6002


Will retransmitted packets always be retransmitted with the same payload
as the original packet?


As an example, could the following occur when trying to send 150 bytes?

SENDER sends packet1: seq num 0 len 100
SENDER sends packet2: seq num 100 len 50

No acks recieved from peer.

SENDER decides, to resend packets, but for some reason decides to use
different packet sizes this time.

SENDER sends packet3: seq num 0 len 80
SENDER sends packet4: seq num 80 len 40
SENDER sends packet5: seq num 120 len 30


Such behavior makes is more difficult for the receiver to do his
bookkeeping, however the assignment spec in the "sliding Windows" section
makes is seem like such cases should be supported.  Clarificdation?

Thanks,
Kayvon

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: assignment 3: buffer/window implementation
Date: Wed, 11 Feb 2004 09:52:14 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.GSO.4.44.0402110940020.21264-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 1076521936 27890 171.64.15.106 (11 Feb 2004 17:52:16 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6003


Taking the send window as an example...

the send window buffer looks something like this

0                                            3071
|-----------------------|--------------------|
unacked_data_start      unsent_data_start

(unacked_data_start marks start of outstanding data)
(unsent_data_start marks start of data in buffer that can be sent)

When we get an ack for seq# starting at unacked_data_start for N bytes,

we would increment the unacked_data_start by N...but that leaves N bytes
at the beginning of the buffer unused.  At this point, can we just slide
everything in the buffer down by N  bytes.

This operation is inefficient because it involves a lot of copying, but
makes the coding slightly easier (i think)...Would we get points taken
off for using this "short cut" ;)

--vishal

.

Path: shelby.stanford.edu!elaine35.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: retransmitted packets
Date: Wed, 11 Feb 2004 18:27:10 +0000 (UTC)
Lines: 25
Distribution: su
Message-ID: <c0ds5u$113$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402102120330.10309-100000@elaine26.Stanford.EDU>  <c0cn84$oos$1@news.Stanford.EDU> <Pine.GSO.4.44.0402110051270.13138-100000@elaine5.Stanford.EDU>
NNTP-Posting-Host: elaine35.stanford.edu
X-Trace: news.Stanford.EDU 1076524030 1059 171.64.15.110 (11 Feb 2004 18:27:10 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6004


>Will retransmitted packets always be retransmitted with the same payload
>as the original packet?

In the real world, they should be, but you can't count on it.  Some of
the test cases specifically break this assumption, and assume that the
receiver buffers data (keeping the first copy of any data received).

>As an example, could the following occur when trying to send 150 bytes?

>SENDER sends packet1: seq num 0 len 100
>SENDER sends packet2: seq num 100 len 50

>No acks recieved from peer.

>SENDER decides, to resend packets, but for some reason decides to use
>different packet sizes this time.

>SENDER sends packet3: seq num 0 len 80
>SENDER sends packet4: seq num 80 len 40
>SENDER sends packet5: seq num 120 len 30

Yes, this is perfectly valid, and you must handle such cases.
(And you'll likely encounter broken TCP stacks in HW4 that send overlapping
packets).
.

Path: shelby.stanford.edu!elaine35.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: assignment 3: buffer/window implementation
Date: Wed, 11 Feb 2004 18:29:45 +0000 (UTC)
Lines: 28
Distribution: su
Message-ID: <c0dsap$15o$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402110940020.21264-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine35.stanford.edu
X-Trace: news.Stanford.EDU 1076524185 1208 171.64.15.110 (11 Feb 2004 18:29:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6005



>0                                            3071
>|-----------------------|--------------------|
>unacked_data_start      unsent_data_start

>(unacked_data_start marks start of outstanding data)
>(unsent_data_start marks start of data in buffer that can be sent)

>When we get an ack for seq# starting at unacked_data_start for N bytes,

>we would increment the unacked_data_start by N...but that leaves N bytes
>at the beginning of the buffer unused.  At this point, can we just slide
>everything in the buffer down by N  bytes.

>This operation is inefficient because it involves a lot of copying, but
>makes the coding slightly easier (i think)...Would we get points taken
>off for using this "short cut" ;)

the question shouldn't be about whether you'll have points taken off,
but rather about whether it's the right design philosophy.  the points
are a means of encouraging you to think about programming the right
way. :-)

this should strike you as a hack (as I suppose it must, given that you
acknowledge its inefficiency)... you can implement such a scheme very easily
without a brute-force copy.

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: initial_sequence_num
Date: Wed, 11 Feb 2004 14:07:17 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.GSO.4.44.0402111404480.25073-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 1076537238 19246 171.64.15.100 (11 Feb 2004 22:07:18 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6006


this is declared as type 'int' in the given code...shouldn't
it be of type 'tcp_seq'...The only reason I ask is because i get all
these 'unsigned to signed int comparrison warning'

Also, the assignment says not to worry about the sequeence number
wrapping, but we are supposed to implement some "random" sequence number
generation correct.  What if that number ends up being close to
2^32-1, it will surely wrap...should we still not worry about this?

--vishal


.

Path: shelby.stanford.edu!elaine8.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: initial_sequence_num
Date: Wed, 11 Feb 2004 23:22:54 +0000 (UTC)
Lines: 20
Distribution: su
Message-ID: <c0edge$nq5$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402111404480.25073-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine8.stanford.edu
X-Trace: news.Stanford.EDU 1076541774 24389 171.64.15.73 (11 Feb 2004 23:22:54 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6007


>this is declared as type 'int' in the given code...shouldn't
>it be of type 'tcp_seq'...The only reason I ask is because i get all
>these 'unsigned to signed int comparrison warning'

Yes, that would be more appropriate; I've changed this now.  But you can
change this as you like anyway--there's no requirement that you keep this
as is.  The only real requirement is that you use ISN=1 when FIXED_INITNUM
is defined.

>Also, the assignment says not to worry about the sequeence number
>wrapping, but we are supposed to implement some "random" sequence number
>generation correct.  What if that number ends up being close to
>2^32-1, it will surely wrap...should we still not worry about this?

You generate a random sequence number in the range 0..255, per the
section entitled "Sequence Numbers."

I promise that we won't be testing your transport layer with 4GB of data...

.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Retrans failure
Date: Wed, 11 Feb 2004 20:34:36 -0800
Lines: 39
Distribution: su
Message-ID: <Pine.GSO.4.44.0402112008500.25672-100000@elaine26.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1076560480 14545 171.64.15.101 (12 Feb 2004 04:34:40 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6008

Just to clarify, the HW3 handout says for Retransmissions, third bullet:

"If the timeout for a segment is reached, teh segment is examined. If it
has been sent a total of 6 times (once from the original sned plus 5
retansmissions), then the network is assumed to have failed and the
network terminated. Otherwise the segment is retansmitted and the timeout
is reset again."

I'm trying to make sure I interpret this statement correctly.

I assume what this means is that after 5 retransmissions after the
original send of the packet the packet remains unacknowledged, the
connection is terminated.

So given we have recognized a "network failure" for this connection,
we could:

Follow the standard protocol and send a FIN to let the other side know we
are closing the connection? This would cause a FIN to be sent and up to 5
retransmissions of the FIN before we totally give up.

Or we could (because we tried 6 times and there was no answer) transition
to the closed state and the heck with the other side.

The Network Termination steps on the next page of the assignment says that
"the usual rules for retransmission and sequence numbers apply for the
FIN segment" but from the above case it is not clear that we should send
the FIN at all.

Considering how conserative TCP often is, it seems that the latter is
needed but maybe we can avoid a special case here and frankly anything to
make this simpler sounds good to me.

Please advise.

Thank-you,

Edward G. Chron

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Retrans failure
Date: Thu, 12 Feb 2004 05:24:33 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c0f2mh$h8s$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402112008500.25672-100000@elaine26.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1076563473 17692 171.64.15.118 (12 Feb 2004 05:24:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6009


>Considering how conserative TCP often is, it seems that the latter is
>needed but maybe we can avoid a special case here and frankly anything to
>make this simpler sounds good to me.

There isn't much point to sending the FIN--if you think the network or
the other side failed, why try to send any more packets?

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1 #6a
Date: Thu, 12 Feb 2004 00:16:57 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.GSO.4.44.0402120001510.7764-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 1076573827 709 171.64.15.100 (12 Feb 2004 08:17:07 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6010


I was going over PS1 and i'm still bothered by this problem

"Write down an expression for the length of the buffer, B, in bits so we
can be sure that the buffer will never overflow."

The solution says the answer to this question is L bits...
but the solution assumes that C has a sufficient enough rate so that
the Q won't keep growing out of bound.

But the problem never indicated  that we can make this assumption about C,
(or did it and I just missed it???).

All it said was R > C, so C could've been so low, that this whole system
would've been unstable,

If the problem said something like: "assume C is large enough to mantain a
stable queue", then it seems like the solution would apply...

Am I thinking about this incorrectly?

--v

.

Path: shelby.stanford.edu!elaine27.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: assert in stcp_api.c:204 [stcp_network_send()]
Date: Thu, 12 Feb 2004 15:38:03 +0000 (UTC)
Lines: 22
Distribution: su
Message-ID: <c0g6kr$q51$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine27.stanford.edu
X-Trace: news.Stanford.EDU 1076600283 26785 171.64.15.102 (12 Feb 2004 15:38:03 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6011

You're either passing in too long a packet, or you didn't include a final
NULL pointer to terminate the argument list (this is more likely).  and the
va_arg returns a size_t, not a size_t *.

> I have a problem. I get an assert failed on
>
> Assertion failed: packet_len + next_len <= sizeof(packet), file
> stcp_api.c,
> line 204
> Abort
>
> When I looked at the code, I have the following
>
> >  size_t next_len = va_arg(argptr, size_t);
> >  assert(packet_len + next_len <= sizeof(packet));
>
> I think the va_arg returns size_t *,  basically an address
> and its assigned to next_len. So I think the assertion fails.
>
> Am I missing something?


.

Path: shelby.stanford.edu!elaine27.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS1 #6a
Date: Thu, 12 Feb 2004 15:40:24 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c0g6p8$qbf$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402120001510.7764-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine27.stanford.edu
X-Trace: news.Stanford.EDU 1076600424 26991 171.64.15.102 (12 Feb 2004 15:40:24 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6012



>But the problem never indicated  that we can make this assumption about C,
>(or did it and I just missed it???).

If you don't make the assumption, there is no such expression, so the
question wouldn't make any sense... so I don't think it's ambiguous.

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: th_win field...
Date: Thu, 12 Feb 2004 14:48:17 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.GSO.4.44.0402121445340.1038-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 1076626098 26618 171.64.15.106 (12 Feb 2004 22:48:18 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6013


does the advertised window field only make sense if the ACK bit is set?

The reason i ask is the wording in the RFC describing this field:

   "The number of data octets beginning with the one indicated in the
    acknowledgment field which the sender of this segment is willing to
    accept"

But the acknowledgment field is only valid when the ACK bit is set, so
does it follow that th_win is only set for ACK packets?

--vishal

.

Path: shelby.stanford.edu!elaine6.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: th_win field...
Date: Thu, 12 Feb 2004 23:32:14 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c0h2du$92$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402121445340.1038-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine6.stanford.edu
X-Trace: news.Stanford.EDU 1076628734 290 171.64.15.71 (12 Feb 2004 23:32:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6014


>But the acknowledgment field is only valid when the ACK bit is set, so
>does it follow that th_win is only set for ACK packets?

That's what the RFC seems to imply.

N.B. Every TCP implementation I've seen always sets both th_ack and th_win
whenever they can.  If the packet isn't an ACK, there's no real reason
that th_win should be set--after all, you don't have "permission" to send
any more data than you did at the last ACK received from the peer...

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Review session 6(b)
Date: Fri, 13 Feb 2004 15:14:07 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0402131504220.17487-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 1076714050 9990 171.64.66.201 (13 Feb 2004 23:14:10 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6015


 I botched this one, here is the correct answer:

 - TCP sequence field is 32 bits
 - need 2^32 bytes to wrap (+1)
 - Have 160 byte packes with 100 bytes of data
  
   therefore

   need roughly 2^30 packets of 160 bytes

   (2^30*160)/ 1 Gbps

   Sorry about that.
       .martin

.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: compression at the router level
Date: Fri, 13 Feb 2004 15:40:15 -0800
Lines: 19
Distribution: su
Message-ID: <c0jn96$bkd$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1076715624 11917 127.0.0.1 (13 Feb 2004 23:40: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:6016

Do routers support any compression at the IP layer?  I'm thinking of the
case where a router has a bunch of packets backed up in the queue and
they're all destined for the same next hop address. As a simple solution,
the router might take those IP packets, append them all together, compress
the contents and then send them out on one or more ethernet packets.  The
router at the other end would reform the packets into the original packets.

I know for http, much of the tcp data is already gzip'd between the client
and the server, so you might not get much compression on a single packet
(although for a TCP packet, there's duplicate src and dst addresses between
IP and TCP layer).  But, for successive IP packets, you might get some
compression.  For instance, the source ports would probably be similar for
multiple packets and the ttl would probably be the same for almost all
packets.  Also, sequence and acknowledgement numbers would be similar for
TCP packets associated with the same connection.

Would this kind of compression buy you much?  Is it done today?


.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: checksum in IP
Date: Fri, 13 Feb 2004 17:59:45 -0800
Lines: 8
Distribution: su
Message-ID: <c0jvf5$l1n$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1076724005 21559 128.12.189.163 (14 Feb 2004 02:00: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:6017

Hi,
How well does the checksum perform for the bits in an IP packet?Is there
some way in which bits are changed that the checksum cannot detect?
Also , is a packet with all zeroes a valid IP packet?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: do we need a calculator for the midterm
Date: Fri, 13 Feb 2004 18:09:12 -0800
Lines: 3
Distribution: su
Message-ID: <Pine.GSO.4.44.0402131807430.13586-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 1076724553 22206 171.64.15.106 (14 Feb 2004 02:09:13 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6018


--vishal

.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: 2 questions (Assignment 3)
Date: Sat, 14 Feb 2004 14:26:46 -0800
Lines: 13
Distribution: su
Message-ID: <c0m7b9$4ld$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc409.stanford.edu
X-Trace: news.Stanford.EDU 1076797610 4781 128.12.196.9 (14 Feb 2004 22:26: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:6019

(1) How can the passive end of a connection send its own sequence number and
ACK the original SYN request?  The way I understand it is:

if you send an ACK, you toggle th_flags field and set th_seq to be the
sequence number you just recieved + 1, but if you also want to SYN, you
would have to set th_seq to be your init_sequence_num.  That's one field for
two values.  Should it be two packets?

(2) When are we allowed to call stcp_app_send?  It seems like we could call
it every time we get a packet from the network (that has data), which means
that we really wouldn't need a buffer bigger than 536.


.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Review session 6(b)
Date: Sat, 14 Feb 2004 15:29:36 -0800
Lines: 32
Distribution: su
Message-ID: <Pine.GSO.4.44.0402141526160.1069-100000@elaine25.Stanford.EDU>
References: <Pine.LNX.4.44.0402131504220.17487-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1076801378 8911 171.64.15.100 (14 Feb 2004 23:29:38 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0402131504220.17487-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6020


I am still confused!

I thought there need be roughly (2^32)/100 packets of 160 bytes to make
the sequence number wrap.

So, the final answer should be:

 	((2^32)*1.6)/ 1Gbps

Please let me know whether my answer is correct.

On Fri, 13 Feb 2004, Martin Casado wrote:

>
>  I botched this one, here is the correct answer:
>
>  - TCP sequence field is 32 bits
>  - need 2^32 bytes to wrap (+1)
>  - Have 160 byte packes with 100 bytes of data
>
>    therefore
>
>    need roughly 2^30 packets of 160 bytes
>
>    (2^30*160)/ 1 Gbps
>
>    Sorry about that.
>        .martin
>
>

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Review session Question 7
Date: Sat, 14 Feb 2004 15:35:36 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.GSO.4.44.0402141529480.1069-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 1076801738 9285 171.64.15.100 (14 Feb 2004 23:35:38 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6021


7(b) why is the buffer time for the first packet 299ms? Should it be 300ms?
  Is there an assumption that the first packet takes 1 ms to play?

7(c) The answer that was given class is 2933 bytes.  However, my
calculation gave something else:

	299ms * 64kb/s = 299 * 64 bits = 299 * 8 bytes = 2392 bytes

What is wrong with my calculation?

-Laura

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Handout 3 Slide 37 (calculating av Q occupancy)
Date: Sat, 14 Feb 2004 18:47:00 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0402141839340.11330-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 1076813221 21141 171.64.15.106 (15 Feb 2004 02:47:01 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6022


I'm trying to figure out the equations used to calculate this on this
particular example.

first, it says when q is not empty, which is from time 0 - .2,
av Q = .5 * ( .1 * 500 ) = 25

What is this equation, where did the .5 come from?

It is not the area of the triangle made by A(t) and D(t)...that area
comes out to be 5 when I calculate geometricly (am I doing something
wrong)

Can someone explain this more in terms of how the area is related to the
intermediate answer of 25 bits and then the final answer of 5 bits

--v

.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: 2 questions (Assignment 3)
Date: Sun, 15 Feb 2004 03:10:47 -0800
Lines: 27
Distribution: su
Message-ID: <c0nk3u$m95$1@news.Stanford.EDU>
References: <c0m7b9$4ld$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc409.stanford.edu
X-Trace: news.Stanford.EDU 1076843454 22821 128.12.196.9 (15 Feb 2004 11:10: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:6023

ignore my first question, i just didn't see the th_ack field.

Thanks,

Justin

"Justin" <justinfw@stanford.edu> wrote in message
news:c0m7b9$4ld$1@news.Stanford.EDU...
> (1) How can the passive end of a connection send its own sequence number
and
> ACK the original SYN request?  The way I understand it is:
>
> if you send an ACK, you toggle th_flags field and set th_seq to be the
> sequence number you just recieved + 1, but if you also want to SYN, you
> would have to set th_seq to be your init_sequence_num.  That's one field
for
> two values.  Should it be two packets?
>
> (2) When are we allowed to call stcp_app_send?  It seems like we could
call
> it every time we get a packet from the network (that has data), which
means
> that we really wouldn't need a buffer bigger than 536.
>
>


.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Congestion Window vs. Receiver window
Date: Sun, 15 Feb 2004 09:11:22 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.GSO.4.44.0402150858080.13008-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 1076865084 12491 171.64.15.42 (15 Feb 2004 17:11:24 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6024

The handouts indicate that maximum congestion window ranges
from 10-40 packets in most cases, while receiver window
is about 4KB.  Explanation in packets does not make sense since
a). packets sizes vary
b). max TCP packet size ultimately will depend on MTU which Transport
layer might not know.

Is it correct to assume that 10-40 packets translate into 15000-60000
bytes?

Boris.



.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: multithreading
Date: Sun, 15 Feb 2004 12:53:18 -0800
Lines: 11
Distribution: su
Message-ID: <c0om81$oku$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc409.stanford.edu
X-Trace: news.Stanford.EDU 1076878401 25246 128.12.196.9 (15 Feb 2004 20:53: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:6025

For assignment 3, even though the application is multithreaded, we can just
ignore that fact when writing our code, right?  The stub code takes care of
launching the thread and stcp_wait_for_event() allows us to block.  Just
wanted to make sure I am understanding it and not missing some concurrency
issue.

Thanks,

Justin


.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Review session 6(b)
Date: Sun, 15 Feb 2004 14:06:36 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.GSO.4.44.0402151403380.4563-100000@elaine31.Stanford.EDU>
References: <Pine.LNX.4.44.0402131504220.17487-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 1076882797 29784 171.64.15.106 (15 Feb 2004 22:06:37 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0402131504220.17487-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6026

where do you get 2^30 from...wouldn't you need ( 2^32 / 100 ) packets,
since each packet takes 100 sequence numbers ...

also, wouldn't each ack also take 60 bytes, so we'd have 160+60 bytes
per every packet

--vishal

On Fri, 13 Feb 2004, Martin Casado wrote:

>
>  I botched this one, here is the correct answer:
>
>  - TCP sequence field is 32 bits
>  - need 2^32 bytes to wrap (+1)
>  - Have 160 byte packes with 100 bytes of data
>
>    therefore
>
>    need roughly 2^30 packets of 160 bytes
>
>    (2^30*160)/ 1 Gbps
>
>    Sorry about that.
>        .martin
>
>

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Problem session 7b
Date: Sun, 15 Feb 2004 14:32:50 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.GSO.4.44.0402151431170.4563-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 1076884372 1574 171.64.15.106 (15 Feb 2004 22:32:52 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6027



it just says that the minimum delay is 1ms...not that the first
packet arrives at 1ms...so shouldn't the answer be anywhere
in between 0 to 299 ms, depending on when the first packet actually
arrives...

or 299 - arrivaltime of first packet

--vishal


.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Handout 7, Page 11
Date: Sun, 15 Feb 2004 15:09:39 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.GSO.4.44.0402151506240.13358-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 1076886581 3762 171.64.15.100 (15 Feb 2004 23:09:41 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6028


On page 11 of handout 7, it states that
	cwnd + = MSS * (MSS/cwnd)

As the professor explained in the class, this is equivalent to cwnd +=1 in
bytes.

However, should this be:
	cwnd += MSS            (MSS is the byte count for one packet.)
Assuming that the ACK is coming back for each segment (packet)?

-Laura

.

Path: shelby.stanford.edu!not-for-mail
From: "Dmitry Belogolovsky" <dbb@stanford.edu>
Newsgroups: su.class.cs244a
Subject: DECbit and RED
Date: Sun, 15 Feb 2004 16:29:33 -0800
Lines: 4
Distribution: su
Message-ID: <c0p2ta$9aq$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab428be3.stanford.edu
X-Trace: news.Stanford.EDU 1076891370 9562 171.66.139.227 (16 Feb 2004 00:29: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:6029

How's RED based on DECbit? It's on one of the slides. Aren't the two
completely orthogonal?


.

Path: shelby.stanford.edu!not-for-mail
From: "Dmitry Belogolovsky" <dbb@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Weighted Fair Queueing
Date: Sun, 15 Feb 2004 16:40:05 -0800
Lines: 5
Distribution: su
Message-ID: <c0p3h2$a34$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab428be3.stanford.edu
X-Trace: news.Stanford.EDU 1076892002 10340 171.66.139.227 (16 Feb 2004 00:40: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:6030

We can only gaurantee either delay time or data rate.  Why can we only
gaurantee one or the other and what do we do differently in each case to
offer the gaurantee of service?


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: compression at the router level
Date: Sun, 15 Feb 2004 19:11:02 -0800
Lines: 34
Distribution: su
Message-ID: <Pine.LNX.4.44.0402151906190.32092-100000@Xenon.Stanford.EDU>
References: <c0jn96$bkd$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 1076901064 20375 171.64.66.201 (16 Feb 2004 03:11:04 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c0jn96$bkd$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6031


On Fri, 13 Feb 2004, Joshua Silver wrote:

> Do routers support any compression at the IP layer?  I'm thinking of the

I don't think so.

> case where a router has a bunch of packets backed up in the queue and
> they're all destined for the same next hop address. As a simple solution,
> the router might take those IP packets, append them all together, compress
> the contents and then send them out on one or more ethernet packets.  The
> router at the other end would reform the packets into the original packets.
> 
> I know for http, much of the tcp data is already gzip'd between the client
> and the server, so you might not get much compression on a single packet
> (although for a TCP packet, there's duplicate src and dst addresses between
> IP and TCP layer).  But, for successive IP packets, you might get some
> compression.  For instance, the source ports would probably be similar for
> multiple packets and the ttl would probably be the same for almost all
> packets.  Also, sequence and acknowledgement numbers would be similar for
> TCP packets associated with the same connection.
> 
> Would this kind of compression buy you much?  Is it done today?
> 

I don't think compressing IP and TCP headers will buy you much. 

Coming back to HTTP, "delta encoding" is an active area of research. 
(Suppose that you have a cached version of some web page, and you are 
looking to get the most recent version -- one strategy for the server is 
to only send the diffs.)

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: checksum in IP
Date: Sun, 15 Feb 2004 19:13:28 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0402151911150.32092-100000@Xenon.Stanford.EDU>
References: <c0jvf5$l1n$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 1076901209 20505 171.64.66.201 (16 Feb 2004 03:13:29 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c0jvf5$l1n$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6032


On Fri, 13 Feb 2004, Haripriya Rajagopal wrote:

> Hi,
> How well does the checksum perform for the bits in an IP packet?Is there
> some way in which bits are changed that the checksum cannot detect?

Bits can be changed such that the TCP checksum can't catch the error. We 
will study more about error-coding and detection later in the class.

> Also , is a packet with all zeroes a valid IP packet?

Among other things, this will mean a source and destination address of 0, 
so it will be a useless packet. 

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: 2 questions (Assignment 3)
Date: Sun, 15 Feb 2004 19:22:15 -0800
Lines: 22
Distribution: su
Message-ID: <Pine.LNX.4.44.0402151920060.32092-100000@Xenon.Stanford.EDU>
References: <c0m7b9$4ld$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 1076901737 21026 171.64.66.201 (16 Feb 2004 03:22:17 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c0m7b9$4ld$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6033

On Sat, 14 Feb 2004, Justin wrote:

> (1) How can the passive end of a connection send its own sequence number and
> ACK the original SYN request?  The way I understand it is:
> 
> if you send an ACK, you toggle th_flags field and set th_seq to be the
> sequence number you just recieved + 1, but if you also want to SYN, you
> would have to set th_seq to be your init_sequence_num.  That's one field for
> two values.  Should it be two packets?

It's one packet. There are two fields in the header (seq# and ack#).

> 
> (2) When are we allowed to call stcp_app_send?  It seems like we could call
> it every time we get a packet from the network (that has data), which means
> that we really wouldn't need a buffer bigger than 536.

What happens if you receive data out of order? Think about all 
possible cases!

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: multithreading
Date: Sun, 15 Feb 2004 19:27:29 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.LNX.4.44.0402151926130.32092-100000@Xenon.Stanford.EDU>
References: <c0om81$oku$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 1076902050 21274 171.64.66.201 (16 Feb 2004 03:27:30 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c0om81$oku$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6034


On Sun, 15 Feb 2004, Justin wrote:

> For assignment 3, even though the application is multithreaded, we can just
> ignore that fact when writing our code, right?  The stub code takes care of
> launching the thread and stcp_wait_for_event() allows us to block.  Just
> wanted to make sure I am understanding it and not missing some concurrency
> issue.
> 

The stub code does launch the thread and allows you to block using the 
wait_for_event call.

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Handout 3 Slide 37 (calculating av Q occupancy)
Date: Sun, 15 Feb 2004 19:50:17 -0800
Lines: 31
Distribution: su
Message-ID: <Pine.LNX.4.44.0402151939030.32092-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402141839340.11330-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 1076903418 22655 171.64.66.201 (16 Feb 2004 03:50:18 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402141839340.11330-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6035

On Sat, 14 Feb 2004, Vishal Patel wrote:

> 
> I'm trying to figure out the equations used to calculate this on this
> particular example.
> 
> first, it says when q is not empty, which is from time 0 - .2,
> av Q = .5 * ( .1 * 500 ) = 25
> 
> What is this equation, where did the .5 come from?

This equation is one way of calculating the avg queue occupancy during the 
first 0.2 seconds. Since the queue occupancy increases linearly during 
the first 0.1 second, the avg during this period will be 
(minimum+maximum)/2 = (0 + 500*0.1)/2 = 500 * 0.1 * 0.5 = 25bits. You can 
similarly determine that the average in the interval (0.1,0.2) is also 25 
bits. 

> It is not the area of the triangle made by A(t) and D(t)...that area
> comes out to be 5 when I calculate geometricly (am I doing something
> wrong)
> Can someone explain this more in terms of how the area is related to the
> intermediate answer of 25 bits and then the final answer of 5 bits
> 

25 bits is the average queue occupancy during the first 0.2 seconds. If 
you take the average over the whole second, it will be 5 bits because the 
queue is empty for the rest of the 0.8 seconds. 

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: do we need a calculator for the midterm
Date: Sun, 15 Feb 2004 19:56:46 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0402151952320.32092-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402131807430.13586-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 1076903807 22985 171.64.66.201 (16 Feb 2004 03:56:47 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402131807430.13586-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6036


bring it along, although you shouldn't really need it unless you are 
"arithmetically" challenged :-)

Shankar

On Fri, 13 Feb 2004, Vishal Patel wrote:

> 
> --vishal
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Handout 7, Page 11
Date: Sun, 15 Feb 2004 20:01:32 -0800
Lines: 36
Distribution: su
Message-ID: <Pine.LNX.4.44.0402151958210.32092-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402151506240.13358-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 1076904094 23419 171.64.66.201 (16 Feb 2004 04:01:34 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402151506240.13358-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6037


As explained on pages 466-67 of the second edition of the book, the 
strategy is to increase the congestion window by one packet every time the 
source has successfully sent *one congestion window's worth* of packets. 
Since a congestion window can fit cwnd/MSS packets, the formula below 
(i.e., cwnd = cwnd + MSS * MSS/cwnd) will implement the above strategy.

Shankar

On Sun, 15 Feb 2004, Xiaohua Fang wrote:

> 
> On page 11 of handout 7, it states that
> 	cwnd + = MSS * (MSS/cwnd)
> 
> As the professor explained in the class, this is equivalent to cwnd +=1 in
> bytes.
> 
> However, should this be:
> 	cwnd += MSS            (MSS is the byte count for one packet.)
> Assuming that the ACK is coming back for each segment (packet)?
> 
> -Laura
> 
> 

-- 

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: DECbit and RED
Date: Sun, 15 Feb 2004 20:08:39 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0402152007030.32092-100000@Xenon.Stanford.EDU>
References: <c0p2ta$9aq$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 1076904521 23781 171.64.66.201 (16 Feb 2004 04:08:41 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c0p2ta$9aq$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6038


On Sun, 15 Feb 2004, Dmitry Belogolovsky wrote:

> How's RED based on DECbit? It's on one of the slides. Aren't the two
> completely orthogonal?
> 

both of them share the basic idea that the router monitors its queue 
length and notifies the host. in decbit the notification is explicit, 
while in red it is implicit.

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Weighted Fair Queueing
Date: Sun, 15 Feb 2004 20:45:07 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.LNX.4.44.0402152030490.19462-100000@Xenon.Stanford.EDU>
References: <c0p3h2$a34$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 1076906709 25958 171.64.66.201 (16 Feb 2004 04:45:09 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c0p3h2$a34$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6039

On Sun, 15 Feb 2004, Dmitry Belogolovsky wrote:

> We can only gaurantee either delay time or data rate.  Why can we only
> gaurantee one or the other and what do we do differently in each case to
> offer the gaurantee of service?

Weighted fair queueing provides each flow with a bandwidth  share 
proportional to its weight, but provides no delay gaurantees. Providing 
delay guarantees is complicated, but as explained in the class, it 
is possible in some cases (such as with sigma,rho contrained flows). 
Also review the lecture slides on RSVP.

Shankar

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: multithreading
Date: Mon, 16 Feb 2004 05:56:36 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c0pm2k$gc$1@news.Stanford.EDU>
References: <c0om81$oku$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1076910996 524 171.64.15.66 (16 Feb 2004 05:56:36 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6040


>For assignment 3, even though the application is multithreaded, we can just
>ignore that fact when writing our code, right?  The stub code takes care of
>launching the thread and stcp_wait_for_event() allows us to block.  Just
>wanted to make sure I am understanding it and not missing some concurrency
>issue.

Yep--you shouldn't have to worry about threading at all for this assignment.

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Sample midterm 2003 6b
Date: Mon, 16 Feb 2004 07:22:42 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c0pr42$51l$1@news.Stanford.EDU>
NNTP-Posting-Host: raptor12.stanford.edu
X-Trace: news.Stanford.EDU 1076916162 5173 171.64.12.173 (16 Feb 2004 07:22:42 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:6041

The solution says

"in each period of the sawtooh...the transmitter sends 1+W/2 windows of packets"

How is that expression obtained?


Tyrone
.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Handout 7, Page 11
Date: Mon, 16 Feb 2004 10:57:05 -0800
Lines: 51
Distribution: su
Message-ID: <Pine.GSO.4.44.0402161053200.2638-100000@elaine25.Stanford.EDU>
References: <Pine.GSO.4.44.0402151506240.13358-100000@elaine25.Stanford.EDU>
 <Pine.LNX.4.44.0402151958210.32092-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1076957827 15962 171.64.15.100 (16 Feb 2004 18:57:07 GMT)
X-Complaints-To: news@news.stanford.edu
To: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0402151958210.32092-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6042

I am still confused!

I thought one packet contains MSS bytes. Is that true?
cwnd is in bytes, right?
then, increasing the cwnd by one packet would be "cwnd = cwnd + MSS",
right?

Why do we have to use "cwnd/MSS" factor?

-Laura

On Sun, 15 Feb 2004, Shankar Ponnekanti wrote:

>
> As explained on pages 466-67 of the second edition of the book, the
> strategy is to increase the congestion window by one packet every time the
> source has successfully sent *one congestion window's worth* of packets.
> Since a congestion window can fit cwnd/MSS packets, the formula below
> (i.e., cwnd = cwnd + MSS * MSS/cwnd) will implement the above strategy.
>
> Shankar
>
> On Sun, 15 Feb 2004, Xiaohua Fang wrote:
>
> >
> > On page 11 of handout 7, it states that
> > 	cwnd + = MSS * (MSS/cwnd)
> >
> > As the professor explained in the class, this is equivalent to cwnd +=1 in
> > bytes.
> >
> > However, should this be:
> > 	cwnd += MSS            (MSS is the byte count for one packet.)
> > Assuming that the ACK is coming back for each segment (packet)?
> >
> > -Laura
> >
> >
>
> --
>
> 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: Handout 7, Page 11
Date: Mon, 16 Feb 2004 11:04:52 -0800
Lines: 79
Distribution: su
Message-ID: <Pine.LNX.4.44.0402161101510.16486-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402151506240.13358-100000@elaine25.Stanford.EDU>
 <Pine.LNX.4.44.0402151958210.32092-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402161053200.2638-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 1076958294 16585 171.64.66.201 (16 Feb 2004 19:04:54 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402161053200.2638-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6043



On Mon, 16 Feb 2004, Xiaohua Fang wrote:

> I am still confused!
> 
> I thought one packet contains MSS bytes. Is that true?
> cwnd is in bytes, right?
> then, increasing the cwnd by one packet would be "cwnd = cwnd + MSS",
> right?

As I say below, you want to increase the window by one packet *only after 
you have you have successfully sent one congestion window of packets*, 
i.e., cwnd/MSS packets. If I use the formula:
cwnd = cwnd + MSS * (MSS/cwnd)
then after cwnd/MSS packets, I would increase the window by:
MSS * (MSS/cwnd) * (cwnd/MSS) = MSS = 1 packet
which is what we want.

Shankar


> 
> Why do we have to use "cwnd/MSS" factor?
> 
> -Laura
> 
> On Sun, 15 Feb 2004, Shankar Ponnekanti wrote:
> 
> >
> > As explained on pages 466-67 of the second edition of the book, the
> > strategy is to increase the congestion window by one packet every time the
> > source has successfully sent *one congestion window's worth* of packets.
> > Since a congestion window can fit cwnd/MSS packets, the formula below
> > (i.e., cwnd = cwnd + MSS * MSS/cwnd) will implement the above strategy.
> >
> > Shankar
> >
> > On Sun, 15 Feb 2004, Xiaohua Fang wrote:
> >
> > >
> > > On page 11 of handout 7, it states that
> > > 	cwnd + = MSS * (MSS/cwnd)
> > >
> > > As the professor explained in the class, this is equivalent to cwnd +=1 in
> > > bytes.
> > >
> > > However, should this be:
> > > 	cwnd += MSS            (MSS is the byte count for one packet.)
> > > Assuming that the ACK is coming back for each segment (packet)?
> > >
> > > -Laura
> > >
> > >
> >
> > --
> >
> > 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
> >
> >
> 
> 

-- 

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!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: multithreading
Date: Mon, 16 Feb 2004 11:51:42 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.GSO.4.44.0402161147480.8175-100000@elaine31.Stanford.EDU>
References: <c0om81$oku$1@news.Stanford.EDU> <c0pm2k$gc$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 1076961104 21351 171.64.15.106 (16 Feb 2004 19:51:44 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c0pm2k$gc$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6044


> Yep--you shouldn't have to worry about threading at all for this assignment.

Do you mean for all of assignemnt 3, or just the first part?

I thought we'd surely need another thread to handle all the retransmission
stuff...
so then do we just wait for the ack's synchronously after sending a
packet?

--vishal

On Mon, 16 Feb 2004, Matthew Jonathan Holliman wrote:

>
> >For assignment 3, even though the application is multithreaded, we can just
> >ignore that fact when writing our code, right?  The stub code takes care of
> >launching the thread and stcp_wait_for_event() allows us to block.  Just
> >wanted to make sure I am understanding it and not missing some concurrency
> >issue.
>
>
>

.

Path: shelby.stanford.edu!elaine6.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Sample midterm 2003 6b
Date: Mon, 16 Feb 2004 20:10:26 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c0r83i$1pg$1@news.Stanford.EDU>
References: <c0pr42$51l$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine6.stanford.edu
X-Trace: news.Stanford.EDU 1076962226 1840 171.64.15.71 (16 Feb 2004 20:10:26 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6045


>The solution says

>"in each period of the sawtooh...the transmitter sends 1+W/2 windows of packets"

>How is that expression obtained?

http://www.stanford.edu/class/cs244a/news/news2003.html#4664
.

Path: shelby.stanford.edu!elaine6.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: multithreading
Date: Mon, 16 Feb 2004 20:11:05 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c0r84p$1rs$1@news.Stanford.EDU>
References: <c0om81$oku$1@news.Stanford.EDU> <c0pm2k$gc$1@news.Stanford.EDU> <Pine.GSO.4.44.0402161147480.8175-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine6.stanford.edu
X-Trace: news.Stanford.EDU 1076962265 1916 171.64.15.71 (16 Feb 2004 20:11:05 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6046



>Do you mean for all of assignemnt 3, or just the first part?

any of it.

>I thought we'd surely need another thread to handle all the retransmission
>stuff...
>so then do we just wait for the ack's synchronously after sending a
>packet?

sure, why not?

.

Path: shelby.stanford.edu!elaine6.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Congestion Window vs. Receiver window
Date: Mon, 16 Feb 2004 20:18:17 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c0r8i9$28i$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402150858080.13008-100000@epic9.Stanford.EDU>
NNTP-Posting-Host: elaine6.stanford.edu
X-Trace: news.Stanford.EDU 1076962697 2322 171.64.15.71 (16 Feb 2004 20:18:17 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6047


>The handouts indicate that maximum congestion window ranges
>from 10-40 packets in most cases, while receiver window
>is about 4KB.  Explanation in packets does not make sense since
>a). packets sizes vary
>b). max TCP packet size ultimately will depend on MTU which Transport
>layer might not know.

This is correct, but if you look at slide 18 of the congestion control
handout, the main point concerns buffer size vs. receiver window size,
both of which are given here in "packets".  Exactly what average packet
size is assumed here really doesn't matter... but if you want a number,
a rough estimate of 1000 bytes on average is as good as any.

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Handout 7, Page 11
Date: Mon, 16 Feb 2004 12:54:08 -0800
Lines: 65
Distribution: su
Message-ID: <c0rajv$gr$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402151506240.13358-100000@elaine25.Stanford.EDU> <Pine.LNX.4.44.0402151958210.32092-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0402161053200.2638-100000@elaine25.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1076964799 539 127.0.0.1 (16 Feb 2004 20:53:19 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (X11/20040209)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0402161053200.2638-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6048

This is the way I understand it (please correct me if I'm wrong).  You 
want to increase cwnd by one packet each time "one congestion window's 
worth" of packets is sent.  However, you are doing the update on receipt 
of each ACK, you don't wait for a whole cwnd to be sent before updating. 
  Therefore, for each congestion window's worth of packets, you will 
receive cwnd/MSS ACKs.  So, if you want to make it so that after you 
send a whole cwnd's worth of packets you increase cwnd by one, then 
since there are cwnd/MSS ACKs per whole window sent, you should 
increment cwnd by MSS / (cwnd/MSS) bytes per ACK received.

-Will

Xiaohua Fang wrote:
> I am still confused!
> 
> I thought one packet contains MSS bytes. Is that true?
> cwnd is in bytes, right?
> then, increasing the cwnd by one packet would be "cwnd = cwnd + MSS",
> right?
> 
> Why do we have to use "cwnd/MSS" factor?
> 
> -Laura
> 
> On Sun, 15 Feb 2004, Shankar Ponnekanti wrote:
> 
> 
>>As explained on pages 466-67 of the second edition of the book, the
>>strategy is to increase the congestion window by one packet every time the
>>source has successfully sent *one congestion window's worth* of packets.
>>Since a congestion window can fit cwnd/MSS packets, the formula below
>>(i.e., cwnd = cwnd + MSS * MSS/cwnd) will implement the above strategy.
>>
>>Shankar
>>
>>On Sun, 15 Feb 2004, Xiaohua Fang wrote:
>>
>>
>>>On page 11 of handout 7, it states that
>>>	cwnd + = MSS * (MSS/cwnd)
>>>
>>>As the professor explained in the class, this is equivalent to cwnd +=1 in
>>>bytes.
>>>
>>>However, should this be:
>>>	cwnd += MSS            (MSS is the byte count for one packet.)
>>>Assuming that the ACK is coming back for each segment (packet)?
>>>
>>>-Laura
>>>
>>>
>>
>>--
>>
>>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: Handout 7, Page 11
Date: Mon, 16 Feb 2004 14:10:27 -0800
Lines: 87
Distribution: su
Message-ID: <Pine.LNX.4.44.0402161408480.21481-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402151506240.13358-100000@elaine25.Stanford.EDU>
 <Pine.LNX.4.44.0402151958210.32092-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402161053200.2638-100000@elaine25.Stanford.EDU>
 <c0rajv$gr$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 1076969428 9837 171.64.66.201 (16 Feb 2004 22:10:28 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c0rajv$gr$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6049


On Mon, 16 Feb 2004, William Chan wrote:

> This is the way I understand it (please correct me if I'm wrong).  You 
> want to increase cwnd by one packet each time "one congestion window's 
> worth" of packets is sent.  However, you are doing the update on receipt 
> of each ACK, you don't wait for a whole cwnd to be sent before updating. 
>   Therefore, for each congestion window's worth of packets, you will 
> receive cwnd/MSS ACKs.  So, if you want to make it so that after you 
> send a whole cwnd's worth of packets you increase cwnd by one, then 
> since there are cwnd/MSS ACKs per whole window sent, you should 
> increment cwnd by MSS / (cwnd/MSS) bytes per ACK received.
> 

This is right and is a more detailed explanation of what's in the book and 
my earlier email ..

Shankar


> -Will
> 
> Xiaohua Fang wrote:
> > I am still confused!
> > 
> > I thought one packet contains MSS bytes. Is that true?
> > cwnd is in bytes, right?
> > then, increasing the cwnd by one packet would be "cwnd = cwnd + MSS",
> > right?
> > 
> > Why do we have to use "cwnd/MSS" factor?
> > 
> > -Laura
> > 
> > On Sun, 15 Feb 2004, Shankar Ponnekanti wrote:
> > 
> > 
> >>As explained on pages 466-67 of the second edition of the book, the
> >>strategy is to increase the congestion window by one packet every time the
> >>source has successfully sent *one congestion window's worth* of packets.
> >>Since a congestion window can fit cwnd/MSS packets, the formula below
> >>(i.e., cwnd = cwnd + MSS * MSS/cwnd) will implement the above strategy.
> >>
> >>Shankar
> >>
> >>On Sun, 15 Feb 2004, Xiaohua Fang wrote:
> >>
> >>
> >>>On page 11 of handout 7, it states that
> >>>	cwnd + = MSS * (MSS/cwnd)
> >>>
> >>>As the professor explained in the class, this is equivalent to cwnd +=1 in
> >>>bytes.
> >>>
> >>>However, should this be:
> >>>	cwnd += MSS            (MSS is the byte count for one packet.)
> >>>Assuming that the ACK is coming back for each segment (packet)?
> >>>
> >>>-Laura
> >>>
> >>>
> >>
> >>--
> >>
> >>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
> >>
> >>
> > 
> > 
> 

-- 

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!elaine3.Stanford.EDU!bergerj
From: Jonathan Berger <bergerj@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: midterm sheet of notes
Date: Mon, 16 Feb 2004 14:59:51 -0800
Lines: 7
Sender: bergerj@elaine3.Stanford.EDU
Distribution: su
Message-ID: <Pine.GSO.4.44.0402161458550.23113-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 1076972393 13596 171.64.15.68 (16 Feb 2004 22:59:53 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6050


Sorry if this is specified somewhere else but...
....are we allowed to bring a sheet of notes into the midterm? One side or
two?

-Jonathan

.

Path: shelby.stanford.edu!saga18.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: midterm sheet of notes
Date: Mon, 16 Feb 2004 16:34:04 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.GSO.4.44.0402161631441.7871-100000@saga18.Stanford.EDU>
References: <Pine.GSO.4.44.0402161458550.23113-100000@elaine3.Stanford.EDU>
NNTP-Posting-Host: saga18.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1076978046 20724 171.64.15.148 (17 Feb 2004 00:34:06 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402161458550.23113-100000@elaine3.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6051

In class we were told a 1 sided sheet for the midterm.
For the final we get to use both sides of a sheet of paper (8x11).

On Mon, 16 Feb 2004, Jonathan Berger wrote:

> Date: Mon, 16 Feb 2004 14:59:51 -0800
> From: Jonathan Berger <bergerj@cs.stanford.edu>
> Newsgroups: su.class.cs244a
> Subject: midterm sheet of notes
>
>
> Sorry if this is specified somewhere else but...
> ...are we allowed to bring a sheet of notes into the midterm? One side or
> two?
>
> -Jonathan
>
>

Edward G. Chron

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Sample Midterm 2003 Prob 4
Date: Mon, 16 Feb 2004 17:09:43 -0800
Lines: 7
Distribution: su
Message-ID: <c0rpi7$gr$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1076980103 539 127.0.0.1 (17 Feb 2004 01:08:23 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (X11/20040209)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6052

Why do retransmissions get triggered without packet loss?  Is it because 
the RTT varies depending on which service provider's router you forward 
to, so the inaccurate RTT sampling causes the retransmission timeout to 
be too inaccurate?

Thanks,
William
.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: prefix aggregation
Date: Mon, 16 Feb 2004 17:25:17 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0402161719130.8743-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 1076981126 24258 171.64.15.100 (17 Feb 2004 01:25:26 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6053


171.22/16 and 171.21/16, What would the aggregate prefix be?

22 = (0001,0110)b
21 = (0001,0101)b

Could it be 171.20/14?  If it is, then this prefix contains the addresses
that are not specified in the orginal two prefixes. Is this allowed?

-Laura

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS#2 Q5: distance vector
Date: Mon, 16 Feb 2004 17:30:38 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0402161725290.8743-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 1076981439 24576 171.64.15.100 (17 Feb 2004 01:30:39 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6054

As shown in the solution for Q5, there are the full vector table for all
routers to all other routers.  Is that needed for answering the question?
I thought the question is only about the route from all other routers to
the route R7.  Would a simple table (similar to one in the textbook, Table
4.7 (page 276, 3rd Ed)) be sufficient?

-Laura

.

Path: shelby.stanford.edu!elaine18.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Sample Midterm 2003 Prob 4
Date: Tue, 17 Feb 2004 01:37:48 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c0rr9c$oc5$1@news.Stanford.EDU>
References: <c0rpi7$gr$2@news.Stanford.EDU>
NNTP-Posting-Host: elaine18.stanford.edu
X-Trace: news.Stanford.EDU 1076981868 24965 171.64.15.83 (17 Feb 2004 01:37:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6055


>Why do retransmissions get triggered without packet loss?  Is it because 
>the RTT varies depending on which service provider's router you forward 
>to, so the inaccurate RTT sampling causes the retransmission timeout to 
>be too inaccurate?

Yep, exactly.
.

Path: shelby.stanford.edu!elaine18.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: prefix aggregation
Date: Tue, 17 Feb 2004 01:43:46 +0000 (UTC)
Lines: 16
Distribution: su
Message-ID: <c0rrki$oqa$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402161719130.8743-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine18.stanford.edu
X-Trace: news.Stanford.EDU 1076982226 25418 171.64.15.83 (17 Feb 2004 01:43:46 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6056



>171.22/16 and 171.21/16, What would the aggregate prefix be?

>22 = (0001,0110)b
>21 = (0001,0101)b

>Could it be 171.20/14?  If it is, then this prefix contains the addresses
>that are not specified in the orginal two prefixes. Is this allowed?

Whether there's an aggregate prefix or not depends on the circumstances--
keep in mind that this is a device to reduce the size of forwarding tables,
and it probably doesn't make sense in your example for the reason you state.
(e.g. why would a router advertise implicitly that it knows how to reach
171.23/16 if it doesn't actually know this?)

.

Path: shelby.stanford.edu!elaine18.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS#2 Q5: distance vector
Date: Tue, 17 Feb 2004 01:50:51 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c0rs1r$p72$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402161725290.8743-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine18.stanford.edu
X-Trace: news.Stanford.EDU 1076982651 25826 171.64.15.83 (17 Feb 2004 01:50:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6057


>As shown in the solution for Q5, there are the full vector table for all
>routers to all other routers.  Is that needed for answering the question?
>I thought the question is only about the route from all other routers to
>the route R7.  Would a simple table (similar to one in the textbook, Table
>4.7 (page 276, 3rd Ed)) be sufficient?

I don't have the 3rd ed., so I can't say whether that table suffices.
But for Q5, since you're finding the shortest path from every router to
R7, yes--the full tables are needed.  (You need to keep track of which
other routers each router's heard from at each iteration, and the
corresponding distance to R7).

.

Path: shelby.stanford.edu!elaine11.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: STCP questions
Date: Mon, 16 Feb 2004 20:49:05 -0800
Lines: 34
Distribution: su
Message-ID: <Pine.GSO.4.44.0402162044200.15950-100000@elaine11.Stanford.EDU>
NNTP-Posting-Host: elaine11.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1076993346 7779 171.64.15.76 (17 Feb 2004 04:49:06 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6058

1). When user application tries to write data into the socket, mywrite
never blocks if socket buffer is full because there is no queue limit,
until malloc will fail.  This means that if sender's window is 0,
user could continue to populate the queue and we can't block it.
Is this correct?

Similarly, if the user application decides not to read any data
then TCP protocol will continue to queue data for the user.
Since queue has no limit, then it will never be the case that
receiver will start dropping packets from the peer because
user stoped consuming them.  Newsgroup posting from last
year says not to worry about this.  Is it still the case?

2). Suppose user has 836 bytes to send.
If sender's window allows to send 300 bytes, then TCP should only
read 300 bytes from the queue and send it to the peer.  Looking in the
code,if the user does not have any more data to send, (i.e. done with sending
after 836 bytes of data and just waiting to read data and not yet calling
myclose) then stcp_wait_for_event
will not trigger an event from user application and we must remember to
read out remaining 536 bytes as receiver's ACKs start arriving.

Now suppose, reciver's window opened up to  600 bytes.
We read remaining user's 536 bytes.  The problem is that
we don't know whether there is more data left in the user's queue or not
because our packet size is also 536 bytes. Since sender's window allows
for 64 more bytes to be sent and we think that user's might still have
more data pending, we'll try to read it from the queue and because the
stcp_app_recv calls _mysock_dequeue_buffer which
blocks if queue is empty, we'll be blocked waiting.  How is this solved?

Thanks.
Boris.

.

Path: shelby.stanford.edu!elaine40.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: STCP questions
Date: Tue, 17 Feb 2004 05:30:14 +0000 (UTC)
Lines: 45
Distribution: su
Message-ID: <c0s8t6$a35$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402162044200.15950-100000@elaine11.Stanford.EDU>
NNTP-Posting-Host: elaine40.stanford.edu
X-Trace: news.Stanford.EDU 1076995814 10341 171.64.15.115 (17 Feb 2004 05:30:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6059


>1). When user application tries to write data into the socket, mywrite
>never blocks if socket buffer is full because there is no queue limit,
>until malloc will fail.  This means that if sender's window is 0,
>user could continue to populate the queue and we can't block it.
>Is this correct?

Yeah--and if you try to transfer a huge file, you'll notice this kind of
behaviour.  Hence the "S" in STCP :-)

>Since queue has no limit, then it will never be the case that
>receiver will start dropping packets from the peer because
>user stoped consuming them.  Newsgroup posting from last
>year says not to worry about this.  Is it still the case?

Yep.  You can imagine how the mysocket/STCP layers would interact
to implement proper flow control (it's really only a small change),
but it's not required for this assignment.

>If sender's window allows to send 300 bytes, then TCP should only
>read 300 bytes from the queue and send it to the peer.  Looking in the
>code,if the user does not have any more data to send, (i.e. done with sending
>after 836 bytes of data and just waiting to read data and not yet calling
>myclose) then stcp_wait_for_event
>will not trigger an event from user application and we must remember to
>read out remaining 536 bytes as receiver's ACKs start arriving.

yep--stcp_wait_for_event() should return immediately if there's data pending,
and you've asked to be notified about that event.

>Now suppose, reciver's window opened up to  600 bytes.
>We read remaining user's 536 bytes.  The problem is that
>we don't know whether there is more data left in the user's queue or not
>because our packet size is also 536 bytes. Since sender's window allows
>for 64 more bytes to be sent and we think that user's might still have
>more data pending, we'll try to read it from the queue and because the
>stcp_app_recv calls _mysock_dequeue_buffer which
>blocks if queue is empty, we'll be blocked waiting.  How is this solved?

Why would you try to read from the queue if it's empty?  stcp_wait_for_event()
won't tell you there's app data waiting to be sent if there isn't any...
i.e. there's no reason to try and process multiple segments from the app
in one fell swoop if you don't know exactly how much data there is
waiting to be sent.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Review session 6(b)
Date: Mon, 16 Feb 2004 22:17:04 -0800
Lines: 39
Distribution: su
Message-ID: <Pine.LNX.4.44.0402162215270.24234-100000@Xenon.Stanford.EDU>
References: <Pine.LNX.4.44.0402131504220.17487-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402141526160.1069-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 1076998625 13378 171.64.66.201 (17 Feb 2004 06:17:05 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402141526160.1069-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6060


 My fault, bad math ... you are correct and I shouldn't post on the run.   

  .m

> 
> I am still confused!
> 
> I thought there need be roughly (2^32)/100 packets of 160 bytes to make
> the sequence number wrap.
> 
> So, the final answer should be:
> 
>  	((2^32)*1.6)/ 1Gbps
> 
> Please let me know whether my answer is correct.
> 
> On Fri, 13 Feb 2004, Martin Casado wrote:
> 
> >
> >  I botched this one, here is the correct answer:
> >
> >  - TCP sequence field is 32 bits
> >  - need 2^32 bytes to wrap (+1)
> >  - Have 160 byte packes with 100 bytes of data
> >
> >    therefore
> >
> >    need roughly 2^30 packets of 160 bytes
> >
> >    (2^30*160)/ 1 Gbps
> >
> >    Sorry about that.
> >        .martin
> >
> >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Problem session 7b
Date: Mon, 16 Feb 2004 22:25:12 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0402162223240.25103-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402151431170.4563-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 1076999113 14029 171.64.66.201 (17 Feb 2004 06:25:13 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402151431170.4563-100000@elaine31.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6061


> 
> 
> it just says that the minimum delay is 1ms...not that the first
> packet arrives at 1ms...so shouldn't the answer be anywhere
> in between 0 to 299 ms, depending on when the first packet actually
> arrives...

 No, how would the receiver know when the sender actually sent the
 packet? The answer is correct.

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: David Yu Chen <dychen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Assignment #3 linux/x86 libraries?
Date: Tue, 17 Feb 2004 06:45:51 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c0sdav$dho$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1077000351 13880 171.64.15.69 (17 Feb 2004 06:45: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:6062

Any chance we could get linux/x86 versions of the libraries in
hw3/hw1obj ? Thanks!

---
David Yu Chen
http://www.stanford.edu/~dychen/
.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS#2 Q5: distance vector
Date: Tue, 17 Feb 2004 00:22:04 -0800
Lines: 25
Distribution: su
Message-ID: <Pine.GSO.4.44.0402170018440.15298-100000@elaine25.Stanford.EDU>
References: <Pine.GSO.4.44.0402161725290.8743-100000@elaine25.Stanford.EDU>
 <c0rs1r$p72$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077006126 22645 171.64.15.100 (17 Feb 2004 08:22:06 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
In-Reply-To: <c0rs1r$p72$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6063

Actually, in handout 5, page 11 - 12, the tables that are presented there
are similar to Table 4.7 I mentioned before.  These tables only concern
the route from all other routers to R8. Not the complete distance vector.
Would this kind of table be sufficient?

-Laura


On Tue, 17 Feb 2004, Matthew Jonathan Holliman wrote:

>
> >As shown in the solution for Q5, there are the full vector table for all
> >routers to all other routers.  Is that needed for answering the question?
> >I thought the question is only about the route from all other routers to
> >the route R7.  Would a simple table (similar to one in the textbook, Table
> >4.7 (page 276, 3rd Ed)) be sufficient?
>
> I don't have the 3rd ed., so I can't say whether that table suffices.
> But for Q5, since you're finding the shortest path from every router to
> R7, yes--the full tables are needed.  (You need to keep track of which
> other routers each router's heard from at each iteration, and the
> corresponding distance to R7).
>
>

.

Path: shelby.stanford.edu!elaine35.Stanford.EDU!zavislak
From: Mark Zavislak <zavislak@elaine35.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Test script error
Date: Tue, 17 Feb 2004 07:22:58 -0800
Lines: 22
Distribution: su
Message-ID: <Pine.GSO.4.44.0402170719520.16764-100000@elaine35.Stanford.EDU>
NNTP-Posting-Host: elaine35.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077031388 16632 171.64.15.110 (17 Feb 2004 15:23:08 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6064

I'm getting the following error upon running the hw3a test script:

.... successful compilation ...

Testing input file TESTDATA.0

Starting server:
/afs/ir.stanford.edu/users/z/a/zavislak/cs244a/stcp/grading_src/build/server
-p
/afs/ir.stanford.edu/users/z/a/zavislak/cs244a/stcp/grading_src/build/.server_port
2>&1 >
/afs/ir.stanford.edu/users/z/a/zavislak/cs244a/stcp/grading_src/build/.server_output
Server started
can't find client:  /usr/class/cs244a/grading_script/hw3/client!
couldn't submit code for testing

....

Anyone know what's up?

-M

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS#2 Q5: distance vector
Date: Tue, 17 Feb 2004 08:20:41 -0800
Lines: 35
Distribution: su
Message-ID: <Pine.LNX.4.44.0402170811090.4212-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402161725290.8743-100000@elaine25.Stanford.EDU>
 <c0rs1r$p72$1@news.Stanford.EDU> <Pine.GSO.4.44.0402170018440.15298-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 1077034844 19924 171.64.66.201 (17 Feb 2004 16:20:44 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402170018440.15298-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6065


> Actually, in handout 5, page 11 - 12, the tables that are presented there
> are similar to Table 4.7 I mentioned before.  These tables only concern
> the route from all other routers to R8. Not the complete distance vector.
> Would this kind of table be sufficient?

  In PS2 Q5 we accepted the column showing router 7 (this matches the
  handouts).  But as Matt says you must keep track of the column's progression
  through each iteration of the algorithm.

  .m


> -Laura
> 
> 
> On Tue, 17 Feb 2004, Matthew Jonathan Holliman wrote:
> 
> >
> > >As shown in the solution for Q5, there are the full vector table for all
> > >routers to all other routers.  Is that needed for answering the question?
> > >I thought the question is only about the route from all other routers to
> > >the route R7.  Would a simple table (similar to one in the textbook, Table
> > >4.7 (page 276, 3rd Ed)) be sufficient?
> >
> > I don't have the 3rd ed., so I can't say whether that table suffices.
> > But for Q5, since you're finding the shortest path from every router to
> > R7, yes--the full tables are needed.  (You need to keep track of which
> > other routers each router's heard from at each iteration, and the
> > corresponding distance to R7).
> >
> >
> 
> 

.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: SYN, SYNACK lost
Date: Tue, 17 Feb 2004 10:32:13 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.GSO.4.44.0402171030450.28956-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 1077042734 28256 171.64.15.103 (17 Feb 2004 18:32:14 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6066

How should we handle packet loss during the 3 way hand shake? Do we need
to resend the SYn, SYNACK etc? Thanks

Lin

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Assignment #3 linux/x86 libraries?
Date: Tue, 17 Feb 2004 20:42:30 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c0tubm$6ie$1@news.Stanford.EDU>
References: <c0sdav$dho$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077050550 6734 171.64.15.66 (17 Feb 2004 20:42:30 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6067


>Any chance we could get linux/x86 versions of the libraries in
>hw3/hw1obj ? Thanks!

I've put a tarball in the hw1obj directory (libftp_linux.tgz).
I haven't tested this, and you should consider this unsupported--but it
used to work.

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: SYN, SYNACK lost
Date: Tue, 17 Feb 2004 20:43:32 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c0tudk$6j7$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402171030450.28956-100000@elaine28.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077050612 6759 171.64.15.66 (17 Feb 2004 20:43:32 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6068


>How should we handle packet loss during the 3 way hand shake? Do we need
>to resend the SYn, SYNACK etc? Thanks

SYNs are subject to the same retransmission requirements as any other segment.

.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: STCP questions
Date: Tue, 17 Feb 2004 12:43:42 -0800
Lines: 35
Distribution: su
Message-ID: <Pine.GSO.4.44.0402171231200.27257-100000@epic6.Stanford.EDU>
References: <Pine.GSO.4.44.0402162044200.15950-100000@elaine11.Stanford.EDU>
 <c0s8t6$a35$1@news.Stanford.EDU>
NNTP-Posting-Host: epic6.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077050623 6766 171.64.15.39 (17 Feb 2004 20:43:43 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
In-Reply-To: <c0s8t6$a35$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6069

> >Now suppose, reciver's window opened up to  600 bytes.
> >We read remaining user's 536 bytes.  The problem is that
> >we don't know whether there is more data left in the user's queue or not
> >because our packet size is also 536 bytes. Since sender's window allows
> >for 64 more bytes to be sent and we think that user's might still have
> >more data pending, we'll try to read it from the queue and because the
> >stcp_app_recv calls _mysock_dequeue_buffer which
> >blocks if queue is empty, we'll be blocked waiting.  How is this solved?
>
> Why would you try to read from the queue if it's empty?  stcp_wait_for_event()
> won't tell you there's app data waiting to be sent if there isn't any...
> i.e. there's no reason to try and process multiple segments from the app
> in one fell swoop if you don't know exactly how much data there is
> waiting to be sent.
>
>
Ok, maybe my example was not very clear.
Clearly, there is no point to read out more data from user's buffer
than you can send out.  Hence, I imagine you'd read out only window
size bytes from user's socket.  I.E if current window is 600 bytes, then
you'll read out 600 bytes and then remember to comeback and read more after
receiving some ACKS from the peer.  But supose that there was exactly
600 bytes in the user's socket, Then this code sequence..

bytes_read = stcp_app_recv(sd, buf, sender_window); /* sender_window = 600 bytes */
After this call bytes_read is 600 as well. How do I distinguish between
two cases

a). stcp_app_recv(...) fills upto sender_window bytes and there is more
data to read
b). there were exacly 600 bytes adn any attempt to read more later
will block the caller.

Boris.

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: STCP questions
Date: Tue, 17 Feb 2004 20:57:22 +0000 (UTC)
Lines: 17
Distribution: su
Message-ID: <c0tv7i$7da$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402162044200.15950-100000@elaine11.Stanford.EDU>  <c0s8t6$a35$1@news.Stanford.EDU> <Pine.GSO.4.44.0402171231200.27257-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077051442 7594 171.64.15.66 (17 Feb 2004 20:57:22 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6070

>bytes_read = stcp_app_recv(sd, buf, sender_window); /* sender_window = 600 bytes */
>After this call bytes_read is 600 as well. How do I distinguish between
>two cases

>a). stcp_app_recv(...) fills upto sender_window bytes and there is more
>data to read
>b). there were exacly 600 bytes adn any attempt to read more later
>will block the caller.

I understood the question, but perhaps my answer wasn't very clear.
I still don't understand why you need to distinguish between them.
You'll loop around again in your main event loop, wait for the next
event--and in the second case you just won't see any app data ready
event... therefore, there's nothing to do except wait for a timeout,
incoming packet, etc.  You've no reason to go into stcp_app_recv()
unless there really is data there ready (and able) to be sent.

.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: STCP questions
Date: Tue, 17 Feb 2004 13:18:12 -0800
Lines: 36
Distribution: su
Message-ID: <Pine.GSO.4.44.0402171310250.27539-100000@epic6.Stanford.EDU>
References: <Pine.GSO.4.44.0402162044200.15950-100000@elaine11.Stanford.EDU>
  <c0s8t6$a35$1@news.Stanford.EDU> <Pine.GSO.4.44.0402171231200.27257-100000@epic6.Stanford.EDU>
 <c0tv7i$7da$1@news.Stanford.EDU>
NNTP-Posting-Host: epic6.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077052693 9418 171.64.15.39 (17 Feb 2004 21:18:13 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
In-Reply-To: <c0tv7i$7da$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6071

I guess the confusion is how stcp_wait_for_event function works.
If user called mywrite with 700 bytes and I'm waiting on an event,
stcp_wait_for_event returns indicating that APP_DATA is pending.
I read out 600 bytes only, process them and then call stcp_wait_for_event
function again.  ARe you saying that the function will immediately return
indicating that more data pending (100 bytes to be exact) even though
user never called mywrite again?  If this is the case, then I was wrong
because I thought that notification was just a hint.  You get it in
response to real action (explicit mywrite call from the user) and
if you can't process it now, then it's your responsibiiity to
remember it. If I understood your explanation correctly, I don't have
to remember anything, just keep calling stcp_wait_for_event.

Boris.

On Tue, 17 Feb 2004, Matthew Jonathan Holliman wrote:

> >bytes_read = stcp_app_recv(sd, buf, sender_window); /* sender_window = 600 bytes */
> >After this call bytes_read is 600 as well. How do I distinguish between
> >two cases
>
> >a). stcp_app_recv(...) fills upto sender_window bytes and there is more
> >data to read
> >b). there were exacly 600 bytes adn any attempt to read more later
> >will block the caller.
>
> I understood the question, but perhaps my answer wasn't very clear.
> I still don't understand why you need to distinguish between them.
> You'll loop around again in your main event loop, wait for the next
> event--and in the second case you just won't see any app data ready
> event... therefore, there's nothing to do except wait for a timeout,
> incoming packet, etc.  You've no reason to go into stcp_app_recv()
> unless there really is data there ready (and able) to be sent.
>
>

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: STCP questions
Date: Tue, 17 Feb 2004 21:22:42 +0000 (UTC)
Lines: 20
Distribution: su
Message-ID: <c0u0n2$9ka$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402162044200.15950-100000@elaine11.Stanford.EDU>   <c0s8t6$a35$1@news.Stanford.EDU> <Pine.GSO.4.44.0402171231200.27257-100000@epic6.Stanford.EDU>  <c0tv7i$7da$1@news.Stanford.EDU> <Pine.GSO.4.44.0402171310250.27539-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077052962 9866 171.64.15.66 (17 Feb 2004 21:22:42 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6072

>If user called mywrite with 700 bytes and I'm waiting on an event,
>stcp_wait_for_event returns indicating that APP_DATA is pending.
>I read out 600 bytes only, process them and then call stcp_wait_for_event
>function again.  ARe you saying that the function will immediately return
>indicating that more data pending (100 bytes to be exact) even though
>user never called mywrite again?  If this is the case, then I was wrong
>because I thought that notification was just a hint.  You get it in
>response to real action (explicit mywrite call from the user) and
>if you can't process it now, then it's your responsibiiity to
>remember it. If I understood your explanation correctly, I don't have
>to remember anything, just keep calling stcp_wait_for_event.

Exactly--
it's a simpler model for you if stcp_wait_for_event() just returns
immediately if there's still more data to be read (and this is more akin
to how a regular event loop would work).  this is exactly the way
it handles data from the peer, too--if you dequeue just one packet,
but several had arrived at once, a subsequent call to the function
will indicate that there are more packets to process.

.

Path: shelby.stanford.edu!not-for-mail
From: David Yu Chen <dychen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Assignment #3 linux/x86 libraries?
Date: Tue, 17 Feb 2004 22:13:26 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c0u3m6$cea$1@news.Stanford.EDU>
References: <c0sdav$dho$1@news.Stanford.EDU> <c0tubm$6ie$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1077056006 12746 171.64.15.69 (17 Feb 2004 22:13:26 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:6073

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

> I've put a tarball in the hw1obj directory (libftp_linux.tgz).
> I haven't tested this, and you should consider this unsupported--but it
> used to work.
Thanks!  They worked like a charm after adding -lcrypt before -lftpd in my 
private makefile.

Any chance of unsupported linux/x86 binaries of src/sr_transport objects 
too?

---
David Yu Chen
http://www.stanford.edu/~dychen/
.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: errno
Date: Tue, 17 Feb 2004 16:30:20 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.GSO.4.44.0402171627360.22136-100000@elaine7.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077064221 22536 171.64.15.72 (18 Feb 2004 00:30:21 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6074

What are the standard behaviour if stcp_network_send returns -1? will it
return a number that does not match the number of bytes we wanted it to
send? Since we are giving it the size of our buffers, the buffer need not
to be null terminated right?

Also, if we are to set the errno, how can we know which errno is
associated with what error? And where can we find the list of errnos that
we need to worry about?

Thanks

Lin

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: application data size
Date: Tue, 17 Feb 2004 16:45:27 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.GSO.4.44.0402171638500.22136-100000@elaine7.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077065129 23511 171.64.15.72 (18 Feb 2004 00:45:29 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6075

Is there a maximum for the data send to us from the application in a
single recv call? What will happen if the application want to send 4000
bytes and we only have 3072 bytes buffer?

Can i do a recv from application for 3072 first and do another recv later
when i have more buffer? will the data be lost?

Another thing is our outgoing window is going to be 3072 bytes fixed, but
that does not mean our buffer should also be fixed at 3072 right? I can
buffer more from application and all i need to do is to make sure no more
that 3072 bytes are not acked, right? Is there an optimum buffer size for
this?

Thanks

Lin

.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Running the stcp on Linux machines
Date: Tue, 17 Feb 2004 16:50:22 -0800
Lines: 12
Distribution: su
Message-ID: <4032B6CE.DF069DF7@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077065441 23886 127.0.0.1 (18 Feb 2004 00:50: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:6076

Are we supposed to run the stcp only on Solaris machines?

The project description says:
> Please do not run your assignment on other machines in Sweet Hall
> than the elaines, myths and sagas. Namely DO NOT run your jobs on
> tree, junior, or any of the big irons. 

Does this mean that we should not try firebird or raptor machines?

-- 
Seungbeom Kim

.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Assignment #3 linux/x86 libraries?
Date: Wed, 18 Feb 2004 07:42:00 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c0v508$pda$1@news.Stanford.EDU>
References: <c0sdav$dho$1@news.Stanford.EDU> <c0tubm$6ie$1@news.Stanford.EDU> <c0u3m6$cea$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1077090120 26026 171.64.15.67 (18 Feb 2004 07:42:00 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6077


>Any chance of unsupported linux/x86 binaries of src/sr_transport objects 
>too?

I've put a tarball in WWW/homeworks/hw4/linux_sr_transport.tgz

Same caveats as before--this used to work a couple of weeks ago, but
hasn't been touched since...

.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: errno
Date: Wed, 18 Feb 2004 07:46:06 +0000 (UTC)
Lines: 22
Distribution: su
Message-ID: <c0v57u$pmd$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402171627360.22136-100000@elaine7.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1077090366 26317 171.64.15.67 (18 Feb 2004 07: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:6078


>What are the standard behaviour if stcp_network_send returns -1? will it
>return a number that does not match the number of bytes we wanted it to
>send? Since we are giving it the size of our buffers, the buffer need not
>to be null terminated right?

Well, you have all the source code, so you can probably answer this
yourself... but if this function fails, it's a pretty catastrophic error
that you probably won't be able to recover from.

Why would the buffer be null-terminated?  It's not an ASCIIZ string...

>Also, if we are to set the errno, how can we know which errno is
>associated with what error? And where can we find the list of errnos that
>we need to worry about?

We aren't looking for much here--you should just do something sensible
if your connection fails.  e.g. "man -s 3socket connect" lists many possible
errors, one or two of which probably make sense for you to catch
(connection refused, for example).  there's no need for elaborate
error handling/reporting though.

.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: application data size
Date: Wed, 18 Feb 2004 07:48:14 +0000 (UTC)
Lines: 16
Distribution: su
Message-ID: <c0v5bu$pp1$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402171638500.22136-100000@elaine7.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1077090494 26401 171.64.15.67 (18 Feb 2004 07:48:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6079


>Can i do a recv from application for 3072 first and do another recv later
>when i have more buffer? will the data be lost?

no, the data is kept around for a subsequent stcp_app_recv(), so you
can take just as much as you need in one go.

>Another thing is our outgoing window is going to be 3072 bytes fixed, but
>that does not mean our buffer should also be fixed at 3072 right? I can
>buffer more from application and all i need to do is to make sure no more
>that 3072 bytes are not acked, right? Is there an optimum buffer size for
>this?

I'm not sure why you'd want to do this--it seems to add extra complexity,
and is less efficient to boot.

.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Running the stcp on Linux machines
Date: Wed, 18 Feb 2004 07:49:59 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c0v5f7$ps4$1@news.Stanford.EDU>
References: <4032B6CE.DF069DF7@stanford.edu>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1077090599 26500 171.64.15.67 (18 Feb 2004 07:49:59 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6080


>Are we supposed to run the stcp only on Solaris machines?

we only officially support it on the Solaris machines, but it's been
tested quite a bit under Linux and should run okay there too.  of
course, the grading script is available only on the leland systems.

>Does this mean that we should not try firebird or raptor machines?

I don't know what the policy is regarding use of those machines, but
you can certainly develop under Linux if you'd prefer.  you'll likely
catch more errors (endian isues etc.) on there than you will under
Solaris...

.

Path: shelby.stanford.edu!not-for-mail
From: David Yu Chen <dychen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Assignment #3 linux/x86 libraries?
Date: Wed, 18 Feb 2004 08:32:31 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c0v7uv$t2v$1@news.Stanford.EDU>
References: <c0sdav$dho$1@news.Stanford.EDU> <c0tubm$6ie$1@news.Stanford.EDU> <c0u3m6$cea$1@news.Stanford.EDU> <c0v508$pda$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1077093151 29791 171.64.15.69 (18 Feb 2004 08:32:31 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:6081

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

> I've put a tarball in WWW/homeworks/hw4/linux_sr_transport.tgz

Binaries for hw4/prebuilt too please?  Thanks for putting up 
with my desire to develop at home. =)

---
David Yu Chen
http://www.stanford.edu/~dychen/
.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ACK question
Date: Wed, 18 Feb 2004 00:51:39 -0800
Lines: 8
Distribution: su
Message-ID: <c0v934$153$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc509.stanford.edu
X-Trace: news.Stanford.EDU 1077094308 1187 128.12.197.9 (18 Feb 2004 08:51: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:6082

When you send an ACK packet with no data, should you increase your sequence
number?

Thanks,

Justin


.

Path: shelby.stanford.edu!elaine35.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: struct timespec
Date: Wed, 18 Feb 2004 09:12:25 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0402180910001.23128-100000@elaine35.Stanford.EDU>
NNTP-Posting-Host: elaine35.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077124347 2475 171.64.15.110 (18 Feb 2004 17:12:27 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6083

The stcp_wait_for_event take a struct timespec as input, however time()
returns time_t and gettimeofday() returns struct timeval. Are these struct
the same thing? Or we have to explicitly convert them ourselves?

Thanks

Lin

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ACK question
Date: Wed, 18 Feb 2004 09:45:42 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0402180941360.21624-100000@Xenon.Stanford.EDU>
References: <c0v934$153$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 1077126344 4810 171.64.66.201 (18 Feb 2004 17:45:44 GMT)
X-Complaints-To: news@news.stanford.edu
To: Justin <justinfw@stanford.edu>
In-Reply-To: <c0v934$153$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6084


 Perhaps you should recheck what the definition of the sequence number.
 networksorcery has a good overview of the header fields.

 .m

> When you send an ACK packet with no data, should you increase your sequence
> number?
> 
> Thanks,
> 
> Justin
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: struct timespec
Date: Wed, 18 Feb 2004 09:53:14 -0800
Lines: 42
Distribution: su
Message-ID: <Pine.LNX.4.44.0402180946540.21624-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402180910001.23128-100000@elaine35.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077126796 5292 171.64.66.201 (18 Feb 2004 17:53:16 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lin Chan <linchan@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402180910001.23128-100000@elaine35.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6085


 timespec uses a nanosecond field instead of microseconds which timeval uses.

struct timespec
  {
    time_t tv_sec;        /* Seconds.  */
    long int tv_nsec;       /* Nanoseconds.  */
  };

struct timeval {
    time_t      tv_sec;     /* seconds */
    long    tv_usec;    /* and microseconds */
};



sys/time.h (on linux) defines the following

/* Macros for converting between `struct timeval' and `struct timespec'.  */
# define TIMEVAL_TO_TIMESPEC(tv, ts) {                                   \
        (ts)->tv_sec = (tv)->tv_sec;                                    \
        (ts)->tv_nsec = (tv)->tv_usec * 1000;                           \
}
# define TIMESPEC_TO_TIMEVAL(tv, ts) {                                   \
        (tv)->tv_sec = (ts)->tv_sec;                                    \
        (tv)->tv_usec = (ts)->tv_nsec / 1000;                           \
}

I'm not sure if solaris has an equivalent set of macros

..m

> The stcp_wait_for_event take a struct timespec as input, however time()
> returns time_t and gettimeofday() returns struct timeval. Are these struct
> the same thing? Or we have to explicitly convert them ourselves?
> 
> Thanks
> 
> Lin
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Assignment #3 linux/x86 libraries?
Date: Wed, 18 Feb 2004 10:09:58 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.LNX.4.44.0402180953490.25079-100000@Xenon.Stanford.EDU>
References: <c0sdav$dho$1@news.Stanford.EDU> <c0tubm$6ie$1@news.Stanford.EDU>
 <c0u3m6$cea$1@news.Stanford.EDU> <c0v508$pda$1@news.Stanford.EDU>
 <c0v7uv$t2v$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 1077127799 6878 171.64.66.201 (18 Feb 2004 18:09:59 GMT)
X-Complaints-To: news@news.stanford.edu
To: David Yu Chen <dychen@Stanford.EDU>
In-Reply-To: <c0v7uv$t2v$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6086


> Matthew Jonathan Holliman <holliman@stanford.edu> wrote:
> 
> > I've put a tarball in WWW/homeworks/hw4/linux_sr_transport.tgz
> 
> Binaries for hw4/prebuilt too please?  Thanks for putting up 
> with my desire to develop at home. =)
  
  I don't think we have a reference for ftpcopy that has been 
  compiled and tested on linux and honestly, this is low on
  the priority list.  

  I have however, compiled and statically linked an sr reference binary for
  linux and copied it to: 

  WWW/homeworks/hw4/sr_hw4_linux_ref

  .martin

.

Path: shelby.stanford.edu!elaine35.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: unexpected packet
Date: Wed, 18 Feb 2004 10:37:24 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.GSO.4.44.0402181033350.24140-100000@elaine35.Stanford.EDU>
NNTP-Posting-Host: elaine35.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077129445 9370 171.64.15.110 (18 Feb 2004 18:37:25 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6087

How should we handle packets we are not expecting? I mean after I send a
SYN, then i receive a FIN from the other side, what should I do? Should I
close the connection and return a errno to application?

Thanks

Lin


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: unexpected packet
Date: Wed, 18 Feb 2004 10:47:15 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.LNX.4.44.0402181039400.6872-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402181033350.24140-100000@elaine35.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077130037 10111 171.64.66.201 (18 Feb 2004 18:47:17 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lin Chan <linchan@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402181033350.24140-100000@elaine35.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6088


 The TCP state transition diagram shows valid inputs/outputs and
 transitions to all states.   If you receive a packet outside of the
 those expected for a valid transition you may safely ignore them.
 (just don't crash!)

 .martin

> How should we handle packets we are not expecting? I mean after I send a
> SYN, then i receive a FIN from the other side, what should I do? Should I
> close the connection and return a errno to application?
> 
> Thanks
> 
> Lin
> 
> 
> 

.

Path: shelby.stanford.edu!elaine35.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: M1 assumption
Date: Wed, 18 Feb 2004 10:49:59 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0402181048260.25008-100000@elaine35.Stanford.EDU>
NNTP-Posting-Host: elaine35.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077130200 10248 171.64.15.110 (18 Feb 2004 18:50:00 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6089

In milestone 1, since there are no packet reodering, can we assume that
every packet we receive from network are intentionally sent and not from
any unexpected source?

Thanks

Lin

.

Path: shelby.stanford.edu!elaine35.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: unexpected packet
Date: Wed, 18 Feb 2004 10:51:50 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.GSO.4.44.0402181050490.25106-100000@elaine35.Stanford.EDU>
References: <Pine.GSO.4.44.0402181033350.24140-100000@elaine35.Stanford.EDU>
 <Pine.LNX.4.44.0402181039400.6872-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine35.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077130312 10426 171.64.15.110 (18 Feb 2004 18:51:52 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0402181039400.6872-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6090

So for Milestone 1, can I assume that any packet not shown in the state
transistion diagram will not show up in the network?

Thanks

Lin

On Wed, 18 Feb 2004, Martin Casado wrote:

>
>  The TCP state transition diagram shows valid inputs/outputs and
>  transitions to all states.   If you receive a packet outside of the
>  those expected for a valid transition you may safely ignore them.
>  (just don't crash!)
>
>  .martin
>
> > How should we handle packets we are not expecting? I mean after I send a
> > SYN, then i receive a FIN from the other side, what should I do? Should I
> > close the connection and return a errno to application?
> >
> > Thanks
> >
> > Lin
> >
> >
> >
>

.

Path: shelby.stanford.edu!elaine6.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: M1 assumption
Date: Wed, 18 Feb 2004 18:59:48 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c10cn4$ato$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402181048260.25008-100000@elaine35.Stanford.EDU>
NNTP-Posting-Host: elaine6.stanford.edu
X-Trace: news.Stanford.EDU 1077130788 11192 171.64.15.71 (18 Feb 2004 18:59:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6091


>In milestone 1, since there are no packet reodering, can we assume that
>every packet we receive from network are intentionally sent and not from
>any unexpected source?

yes--but since you have to handle these cases in due course, don't let this
guide you down the wrong design path...
.

Path: shelby.stanford.edu!elaine29.Stanford.EDU!casado
From: Martin Casado <casado@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: unexpected packet
Date: Wed, 18 Feb 2004 12:10:20 -0800
Lines: 39
Distribution: su
Message-ID: <Pine.GSO.4.44.0402181207480.17276-100000@elaine29.Stanford.EDU>
References: <Pine.GSO.4.44.0402181033350.24140-100000@elaine35.Stanford.EDU>
 <Pine.LNX.4.44.0402181039400.6872-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402181050490.25106-100000@elaine35.Stanford.EDU>
NNTP-Posting-Host: elaine29.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077135022 16661 171.64.15.104 (18 Feb 2004 20:10:22 GMT)
X-Complaints-To: news@news.stanford.edu
To: Lin Chan <linchan@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402181050490.25106-100000@elaine35.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6092


 It doesn't seem like this would affect you much either way.  You are going
 to have to do something if the packet isn't an expected input.  Ignoring
 it is as easy as printing an error or stopping.  I don't see why you
 wouldn't support this from the get go.

 .m

> So for Milestone 1, can I assume that any packet not shown in the state
> transistion diagram will not show up in the network?
>
> Thanks
>
> Lin
>
> On Wed, 18 Feb 2004, Martin Casado wrote:
>
> >
> >  The TCP state transition diagram shows valid inputs/outputs and
> >  transitions to all states.   If you receive a packet outside of the
> >  those expected for a valid transition you may safely ignore them.
> >  (just don't crash!)
> >
> >  .martin
> >
> > > How should we handle packets we are not expecting? I mean after I send a
> > > SYN, then i receive a FIN from the other side, what should I do? Should I
> > > close the connection and return a errno to application?
> > >
> > > Thanks
> > >
> > > Lin
> > >
> > >
> > >
> >
>
>

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: send window
Date: Wed, 18 Feb 2004 18:13:38 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.GSO.4.44.0402181809180.10281-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 1077156820 16084 171.64.15.100 (19 Feb 2004 02:13:40 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6093


"Data packets are sent as soon as data is available"

it seems that we never have a case of having data in the window
that is written by app, but unsent by STCP, since we'll only grab as
much data from the application as the receiver window allows us to.

In terms of the example in the book (page 389, 3rd edition),

(LastByteWritten == LastByteSent)

in all cases for STCP, is this a correct assumption?


--v

.

Path: shelby.stanford.edu!elaine13.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: send window
Date: Thu, 19 Feb 2004 02:34:23 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c117bf$h35$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402181809180.10281-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine13.stanford.edu
X-Trace: news.Stanford.EDU 1077158063 17509 171.64.15.78 (19 Feb 2004 02:34:23 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6094



>"Data packets are sent as soon as data is available"

This just means that you don't implement the Nagle algorithm, as a
standard TCP implementation would.

.

Path: shelby.stanford.edu!epic21.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Packets with options
Date: Wed, 18 Feb 2004 19:20:00 -0800
Lines: 6
Distribution: su
Message-ID: <Pine.GSO.4.44.0402181918100.29931-100000@epic21.Stanford.EDU>
NNTP-Posting-Host: epic21.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077160802 20580 171.64.15.56 (19 Feb 2004 03:20:02 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6095

Is there a maximum size that we can assume for packets that contain
options (to avoid truncated data if our buffer is too small)?

Thanks,
Barrett

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: max packet size
Date: Wed, 18 Feb 2004 21:26:30 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0402182124450.13125-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 1077168391 28887 171.64.15.100 (19 Feb 2004 05:26:31 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6096

Does the 536 limit include the header and option? In the Data Packet
section of the spec said the max payload is 536. Does payload simply means
data or everything in the packet?

Thanks

Lin

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: offset when no data
Date: Wed, 18 Feb 2004 21:28:27 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0402182126390.13125-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 1077168508 29024 171.64.15.100 (19 Feb 2004 05:28:28 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6097

What should the offset field in the header be when there is no data for
the packet? Can we set it to zero? If we don't, how can we tell if there
is data in this packet or not? by packet size?

Thanks

Lin

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: max packet size
Date: Wed, 18 Feb 2004 21:36:58 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0402182135410.13469-100000@elaine25.Stanford.EDU>
References: <Pine.GSO.4.44.0402182124450.13125-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 1077169019 29509 171.64.15.100 (19 Feb 2004 05:36:59 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402182124450.13125-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6098

If the 536 is simply the max data size, how do we know how big a packet
can be? Especially when we try to call stcp_recv for network, data will be
lost if we don't have enough buffer right?

Lin

On Wed, 18 Feb 2004, Lin Chan wrote:

> Does the 536 limit include the header and option? In the Data Packet
> section of the spec said the max payload is 536. Does payload simply means
> data or everything in the packet?
>
> Thanks
>
> Lin
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: application data size
Date: Thu, 19 Feb 2004 13:51:45 +0800
Lines: 24
Distribution: su
Message-ID: <40344EF1.27995CDF@leland.stanford.edu>
References: <Pine.GSO.4.44.0402171638500.22136-100000@elaine7.Stanford.EDU> <c0v5bu$pp1$1@news.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077169990 437 128.12.196.85 (19 Feb 2004 05:53:10 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6099

Is our outgoing window going to be 3072 bytes fixed? I thought our outgoing
window size is Min(other side's advertised window, congestion window). What if
the other side advertise a smaller window than 3072 bytes? Do we have to take
that into account?

Jimmy

Matthew Jonathan Holliman wrote:

> >Can i do a recv from application for 3072 first and do another recv later
> >when i have more buffer? will the data be lost?
>
> no, the data is kept around for a subsequent stcp_app_recv(), so you
> can take just as much as you need in one go.
>
> >Another thing is our outgoing window is going to be 3072 bytes fixed, but
> >that does not mean our buffer should also be fixed at 3072 right? I can
> >buffer more from application and all i need to do is to make sure no more
> >that 3072 bytes are not acked, right? Is there an optimum buffer size for
> >this?
>
> I'm not sure why you'd want to do this--it seems to add extra complexity,
> and is less efficient to boot.

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ACK loss for SYN_RCVD state
Date: Wed, 18 Feb 2004 21:53:43 -0800
Lines: 22
Distribution: su
Message-ID: <Pine.GSO.4.44.0402182144170.13469-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 1077170024 573 171.64.15.100 (19 Feb 2004 05:53:44 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6100

I am wonder what will happen in the following case.

Say I am in SYN_RCVD state and I sent a SYNACK out. Now i should be
waiting for an ACK. what will happen if the ACK from the other side is
lost?

First, I think i have to resend the SYNACK at timeout right? This should
be handled as any other packets right?

In the book, it says when the other side got my SYNACK, it will go to
establish state. Later when it sends a data packet, it will also set the
ACK bit so i can know the at later point my SYNACK is not lost. Do we need
to handle this case?

If we do have to handle this, that means we may need to handle packet
with data in transport_init. Then do we call stcp_unblock_application
first, or we pass the data by calling stcp_app_send first?

Thanks

Lin

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Packets with options
Date: Wed, 18 Feb 2004 22:51:52 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.GSO.4.44.0402182249590.15697-100000@elaine25.Stanford.EDU>
References: <Pine.GSO.4.44.0402181918100.29931-100000@epic21.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077173515 4255 171.64.15.100 (19 Feb 2004 06:51:55 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402181918100.29931-100000@epic21.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6101


This is copy/pasted from networksorcery.com

Options. 0 to 44 bytes.
Options occupy space at the end of the TCP header. All options are
included in the checksum. An option may begin on any byte boundary. The
TCP header must be padded with zeros to make the header length a multiple
of 32 bits.

--v

On Wed, 18 Feb 2004, Barrett Trask wrote:

> Is there a maximum size that we can assume for packets that contain
> options (to avoid truncated data if our buffer is too small)?
>
> Thanks,
> Barrett
>
>

.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: max packet size
Date: Thu, 19 Feb 2004 06:55:45 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c11mlh$4b4$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402182124450.13125-100000@elaine25.Stanford.EDU> <Pine.GSO.4.44.0402182135410.13469-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
X-Trace: news.Stanford.EDU 1077173745 4452 171.64.15.101 (19 Feb 2004 06:55:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6102


>If the 536 is simply the max data size, how do we know how big a packet
>can be? Especially when we try to call stcp_recv for network, data will be
>lost if we don't have enough buffer right?

Max packet size is header length (fixed) + max payload size (anything
other than header, i.e. MSS).  And yes, if you call stcp_network_recv()
with an inadequately sized buffer, data will be lost.

.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: offset when no data
Date: Thu, 19 Feb 2004 07:00:55 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c11mv7$4nq$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402182126390.13125-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
X-Trace: news.Stanford.EDU 1077174055 4858 171.64.15.101 (19 Feb 2004 07:00:55 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6103


>What should the offset field in the header be when there is no data for
>the packet? Can we set it to zero? If we don't, how can we tell if there
>is data in this packet or not? by packet size?

Zero doesn't seem a very logical choice to me--it's inconsistent with the
usual interpretation of the field, and may well break some TCP
implementations.  It would definitely break the STCP ref soln, which
assumes th_off has the interpretation given in the RFC.

You can tell if there's data in the packet by looking at the packet length,
and comparing to the value given by the offset field.

.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: application data size
Date: Thu, 19 Feb 2004 07:02:31 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <c11n27$4pv$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402171638500.22136-100000@elaine7.Stanford.EDU> <c0v5bu$pp1$1@news.Stanford.EDU> <40344EF1.27995CDF@leland.stanford.edu>
NNTP-Posting-Host: elaine26.stanford.edu
X-Trace: news.Stanford.EDU 1077174151 4927 171.64.15.101 (19 Feb 2004 07:02:31 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6104


>Is our outgoing window going to be 3072 bytes fixed? I thought our outgoing
>window size is Min(other side's advertised window, congestion window). What if
>the other side advertise a smaller window than 3072 bytes? Do we have to take
>that into account?

No, it won't necessarily be 3072 bytes, for the reason you state (although
we won't have a real congestion window, obviously)--and yes, you should
handle the case where the other side advertises a smaller window.  (You
don't need to worry about silly window syndrome or anything like that,
though).

.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ACK loss for SYN_RCVD state
Date: Thu, 19 Feb 2004 07:11:32 +0000 (UTC)
Lines: 28
Distribution: su
Message-ID: <c11nj4$5fd$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402182144170.13469-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
X-Trace: news.Stanford.EDU 1077174692 5613 171.64.15.101 (19 Feb 2004 07:11:32 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6105


>Say I am in SYN_RCVD state and I sent a SYNACK out. Now i should be
>waiting for an ACK. what will happen if the ACK from the other side is
>lost?

Ah, one of the many questions you will have to answer as you work on
this assignment!  What do you think will (or should) happen?

>First, I think i have to resend the SYNACK at timeout right? This should
>be handled as any other packets right?

Yes, SYNs are subject to the usual retransmission rules.

>In the book, it says when the other side got my SYNACK, it will go to
>establish state. Later when it sends a data packet, it will also set the
>ACK bit so i can know the at later point my SYNACK is not lost. Do we need
>to handle this case?

Yes, you should.  (Although having said that, it's unlikely that you'll
actually encounter an ACK for a SYN-ACK that is piggybacked on data).

>If we do have to handle this, that means we may need to handle packet
>with data in transport_init. Then do we call stcp_unblock_application
>first, or we pass the data by calling stcp_app_send first?

Either way should work, although I can't say that I've actually tested
this.  I'd call stcp_unblock_application() first, which I know works :-)

.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!kayvonf
From: Kayvon Fatahalian <kayvonf@elaine2.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: clarification on receiver window
Date: Thu, 19 Feb 2004 01:45:29 -0800
Lines: 33
Distribution: su
Message-ID: <Pine.GSO.4.44.0402190126380.25684-100000@elaine2.Stanford.EDU>
References: <Pine.GSO.4.44.0402182144170.13469-100000@elaine25.Stanford.EDU>
 <c11nj4$5fd$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077183932 15997 171.64.15.67 (19 Feb 2004 09:45:32 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c11nj4$5fd$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6106



Assignment spec states "first byte of all windows is always the last acked
byte of data."

This implies that as soon as the receiver acks data, the data should
be sent up to the application via a stcp_app_send() call (otherwise we'd
have to buffer the unread data in the receiver window).

There is no way to tell when the app actually consumes this data via
a myread(), therefore:

1. We just keep sending data up to the app via stcp_app_send() and assume
the higher level socket layer can buffer an infinite amount of data (which
it appears it is designed to do by looking at the code).

2. We assume (using terms from book pg 390-391) that lastByteRead =
lastByteAcked = nextByteExpected-1.  But if nextByteExpected is always the
start of the receive window, then following the math in the book, the
advertized window window is ALWAYS the max receive window size.



Both of these conclusions differ from a regular TCP implementation so I
feared my interpretation of the spec is incorrect.  Could you please clarify
this part of the spec.



Thanks,
Kayvon


.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: max packet size
Date: Thu, 19 Feb 2004 19:42:44 +0800
Lines: 18
Distribution: su
Message-ID: <4034A133.D0B31824@leland.stanford.edu>
References: <Pine.GSO.4.44.0402182124450.13125-100000@elaine25.Stanford.EDU> <Pine.GSO.4.44.0402182135410.13469-100000@elaine25.Stanford.EDU> <c11mlh$4b4$1@news.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077191074 22724 128.12.196.85 (19 Feb 2004 11:44:34 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6107



Matthew Jonathan Holliman wrote:

> >If the 536 is simply the max data size, how do we know how big a packet
> >can be? Especially when we try to call stcp_recv for network, data will be
> >lost if we don't have enough buffer right?
>
> Max packet size is header length (fixed) + max payload size (anything
> other than header, i.e. MSS).  And yes, if you call stcp_network_recv()
> with an inadequately sized buffer, data will be lost.

Does the MSS take into account of the options already? Or should the max packet
size be header length (fixed) + MSS + max options size?

Thanks,
Jimmy

.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: max packet size
Date: Thu, 19 Feb 2004 10:29:11 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.GSO.4.44.0402191028190.589-100000@elaine2.Stanford.EDU>
References: <Pine.GSO.4.44.0402182124450.13125-100000@elaine25.Stanford.EDU>
 <Pine.GSO.4.44.0402182135410.13469-100000@elaine25.Stanford.EDU>
 <c11mlh$4b4$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077215353 21401 171.64.15.67 (19 Feb 2004 18:29:13 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c11mlh$4b4$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6108

But this means the option is also counted as payload? Although we don't
have to handle option, but we still need to handle them as a correct
packet right?

Lin

On Thu, 19 Feb 2004, Matthew Jonathan Holliman wrote:

>
> >If the 536 is simply the max data size, how do we know how big a packet
> >can be? Especially when we try to call stcp_recv for network, data will be
> >lost if we don't have enough buffer right?
>
> Max packet size is header length (fixed) + max payload size (anything
> other than header, i.e. MSS).  And yes, if you call stcp_network_recv()
> with an inadequately sized buffer, data will be lost.
>
>

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: clarification on receiver window
Date: Thu, 19 Feb 2004 18:51:28 +0000 (UTC)
Lines: 31
Distribution: su
Message-ID: <c130jg$mca$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402182144170.13469-100000@elaine25.Stanford.EDU>  <c11nj4$5fd$1@news.Stanford.EDU> <Pine.GSO.4.44.0402190126380.25684-100000@elaine2.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1077216688 22922 171.64.15.74 (19 Feb 2004 18:51:28 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6109



>This implies that as soon as the receiver acks data, the data should
>be sent up to the application via a stcp_app_send() call (otherwise we'd
>have to buffer the unread data in the receiver window).

>There is no way to tell when the app actually consumes this data via
>a myread(), therefore:

correct.

>1. We just keep sending data up to the app via stcp_app_send() and assume
>the higher level socket layer can buffer an infinite amount of data (which
>it appears it is designed to do by looking at the code).

>2. We assume (using terms from book pg 390-391) that lastByteRead =
>lastByteAcked = nextByteExpected-1.  But if nextByteExpected is always the
>start of the receive window, then following the math in the book, the
>advertized window window is ALWAYS the max receive window size.

Both of these conclusions are correct (and the first has been addressed
on the newsgroup before).  BTW, just because you advertise a fixed
receiver window, doesn't mean that the other side will...

>Both of these conclusions differ from a regular TCP implementation so I
>feared my interpretation of the spec is incorrect.  Could you please clarify
>this part of the spec.

We aren't implementing TCP--we're implementing STCP, which happens to
do just enough to be compatible with TCP...

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: max packet size
Date: Thu, 19 Feb 2004 18:53:09 +0000 (UTC)
Lines: 17
Distribution: su
Message-ID: <c130ml$men$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402182124450.13125-100000@elaine25.Stanford.EDU> <Pine.GSO.4.44.0402182135410.13469-100000@elaine25.Stanford.EDU> <c11mlh$4b4$1@news.Stanford.EDU> <4034A133.D0B31824@leland.stanford.edu>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1077216789 22999 171.64.15.74 (19 Feb 2004 18:53:09 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6110




>> >If the 536 is simply the max data size, how do we know how big a packet
>> >can be? Especially when we try to call stcp_recv for network, data will be
>> >lost if we don't have enough buffer right?
>>
>> Max packet size is header length (fixed) + max payload size (anything
>> other than header, i.e. MSS).  And yes, if you call stcp_network_recv()
>> with an inadequately sized buffer, data will be lost.

>Does the MSS take into account of the options already? Or should the max packet
>size be header length (fixed) + MSS + max options size?

nope, it doesn't include options--network sorcery is a good source of info
(http://www.networksorcery.com/enp/protocol/tcp.htm)

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: max packet size
Date: Thu, 19 Feb 2004 18:55:08 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c130qc$mhb$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402182124450.13125-100000@elaine25.Stanford.EDU>  <Pine.GSO.4.44.0402182135410.13469-100000@elaine25.Stanford.EDU>  <c11mlh$4b4$1@news.Stanford.EDU> <Pine.GSO.4.44.0402191028190.589-100000@elaine2.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1077216908 23083 171.64.15.74 (19 Feb 2004 18:55:08 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6111


>But this means the option is also counted as payload? Although we don't
>have to handle option, but we still need to handle them as a correct
>packet right?

Yes, you need to be able to ignore them correctly...

The options are counted as part of the header--I shouldn't have written
fixed before.  The maximum header length is fixed (struct tcphdr + up to
44 bytes of options), plus your MSS worth of data (536 bytes in STCP).

.

Path: shelby.stanford.edu!elaine8.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: max packet size
Date: Thu, 19 Feb 2004 14:09:05 -0800
Lines: 25
Distribution: su
Message-ID: <Pine.GSO.4.44.0402191407110.18014-100000@elaine8.Stanford.EDU>
References: <Pine.GSO.4.44.0402182124450.13125-100000@elaine25.Stanford.EDU>
  <Pine.GSO.4.44.0402182135410.13469-100000@elaine25.Stanford.EDU> 
 <c11mlh$4b4$1@news.Stanford.EDU> <Pine.GSO.4.44.0402191028190.589-100000@elaine2.Stanford.EDU>
 <c130qc$mhb$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine8.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077228546 6883 171.64.15.73 (19 Feb 2004 22:09:06 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c130qc$mhb$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6112

That means a maximum TCP packet is 20 + 44 + 536 for our case right?

And you say we can ignore them, you mean we just ignore the option part of
the packet right? We are not ignoring the whole packet if it has option
right?

Thanks

Lin

On Thu, 19 Feb 2004, Matthew Jonathan Holliman wrote:

>
> >But this means the option is also counted as payload? Although we don't
> >have to handle option, but we still need to handle them as a correct
> >packet right?
>
> Yes, you need to be able to ignore them correctly...
>
> The options are counted as part of the header--I shouldn't have written
> fixed before.  The maximum header length is fixed (struct tcphdr + up to
> 44 bytes of options), plus your MSS worth of data (536 bytes in STCP).
>
>

.

Path: shelby.stanford.edu!elaine8.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: application misbehaviour
Date: Thu, 19 Feb 2004 14:15:51 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.GSO.4.44.0402191413010.18014-100000@elaine8.Stanford.EDU>
NNTP-Posting-Host: elaine8.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077228953 7378 171.64.15.73 (19 Feb 2004 22:15:53 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6113

Do we have to handle weird behaviour of the application in our code? I
mean if the application do mywrite after it called myclose, what will
happen? Will we still get the data? If we have to check for this
situation, what and how should we tell the application there is something
wrong?

Thanks

Lin

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: transport.h
Date: Thu, 19 Feb 2004 15:31:31 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0402191529200.19918-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 1077233492 13569 171.64.15.118 (19 Feb 2004 23:31:32 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6114

Are we allowed to modify the data structure in the transport.h?
Or is it the requirement that everything(data structure, code) is done in
transport.c?

Other than the interfaces defined in stcp_api.h, what other
interfaces/header file that we are allowed to use?

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: max packet size
Date: Thu, 19 Feb 2004 23:50:33 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c13i49$elb$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402182124450.13125-100000@elaine25.Stanford.EDU>   <Pine.GSO.4.44.0402182135410.13469-100000@elaine25.Stanford.EDU>   <c11mlh$4b4$1@news.Stanford.EDU> <Pine.GSO.4.44.0402191028190.589-100000@elaine2.Stanford.EDU>  <c130qc$mhb$1@news.Stanford.EDU> <Pine.GSO.4.44.0402191407110.18014-100000@elaine8.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1077234633 15019 171.64.15.111 (19 Feb 2004 23:50:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6115


>And you say we can ignore them, you mean we just ignore the option part of
>the packet right? We are not ignoring the whole packet if it has option
>right?

Does it seem reasonable to ignore the data portion of a packet that happens
to contain options?

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: application misbehaviour
Date: Thu, 19 Feb 2004 23:53:14 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <c13i9a$eqa$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402191413010.18014-100000@elaine8.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1077234794 15178 171.64.15.111 (19 Feb 2004 23:53:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6116


>Do we have to handle weird behaviour of the application in our code? I
>mean if the application do mywrite after it called myclose, what will
>happen? Will we still get the data? If we have to check for this
>situation, what and how should we tell the application there is something
>wrong?

You can look through mysock_api.c to see how mywrite/myclose would
interact.  How would you (and how could you?) handle this with the given
stub code?  (You don't have to worry about two threads simultaneously
calling mywrite and myclose...)

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: transport.h
Date: Thu, 19 Feb 2004 23:55:24 +0000 (UTC)
Lines: 16
Distribution: su
Message-ID: <c13idc$ett$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402191529200.19918-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1077234924 15293 171.64.15.111 (19 Feb 2004 23:55:24 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6117


>Are we allowed to modify the data structure in the transport.h?
>Or is it the requirement that everything(data structure, code) is done in
>transport.c?

No--you can only submit transport.c in parts (a) and (b), so we won't see any
changes you make to transport.h (and your code won't compile for us).
I realise this is a bit icky, but a correct solution can be pretty
compact...

>Other than the interfaces defined in stcp_api.h, what other
>interfaces/header file that we are allowed to use?

stcp_api.h and transport.h are the only ones you may use in your
transport layer.

.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: stcp_app_send()
Date: Thu, 19 Feb 2004 16:47:36 -0800
Lines: 13
Distribution: su
Message-ID: <c13lff$mkv$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1077238065 23199 127.0.0.1 (20 Feb 2004 00:47: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:6118

Could you clarify this statement from the assignment description:

If a host calls mywrite() twice with 256 bytes each time, and then the peer
calls myread() with a buffer of 512 bytes, it will receive all 512 bytes of
available data, not just the first 256 bytes.

It seems like this is controlled by the functions myread() and mywrite().
Are we supposed to do something special with stcp_app_[send|rcv]()  to
guarantee that myread() will maximize the amount of bytes it can return when
called?



.

Path: shelby.stanford.edu!elaine30.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: stcp_app_send()
Date: Fri, 20 Feb 2004 01:18:21 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c13n8t$qdp$1@news.Stanford.EDU>
References: <c13lff$mkv$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine30.stanford.edu
X-Trace: news.Stanford.EDU 1077239901 27065 171.64.15.105 (20 Feb 2004 01:18:21 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6119



>It seems like this is controlled by the functions myread() and mywrite().
>Are we supposed to do something special with stcp_app_[send|rcv]()  to
>guarantee that myread() will maximize the amount of bytes it can return when
>called?

Nope--mywrite()/myread() handle this already.

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Server doesn't close
Date: Fri, 20 Feb 2004 01:28:11 +0000 (UTC)
Lines: 23
Distribution: su
Message-ID: <c13nrb$qqm$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077240491 27478 171.64.15.103 (20 Feb 2004 01:28: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:6120

When the client has finished sending its data (the filename over) the 
application calls myclose() which in turn instructs the transport layer to 
issue a FIN packet.

The problem is that the server does not respond to this.  We can write the 
code to issue an ACK in response to the client's FIN, but isn't it still 
the server application's responsibility to call myclose() in order for the 
transport layer to send its FIN?

The server code only calls myclose() after the for loop in the 
do_connection() function in server.c has terminated.  This only happens if 
a call to myread() fails.  This never happens; after the client has issued 
its FIN, the server remains stuck on the myread() waiting (in the 
CLOSE_WAIT state).  The client also remains stuck in the FIN_WAIT_2 state 
for a FIN message from the server.

Should not the application-level protocol between the client and server 
have some indication that the file exchange is over (i.e. something like 
the FTP EXIT command)?


Tyrone

.

Path: shelby.stanford.edu!elaine30.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Server doesn't close
Date: Fri, 20 Feb 2004 01:44:17 +0000 (UTC)
Lines: 30
Distribution: su
Message-ID: <c13oph$4d$1@news.Stanford.EDU>
References: <c13nrb$qqm$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine30.stanford.edu
X-Trace: news.Stanford.EDU 1077241457 141 171.64.15.105 (20 Feb 2004 01:44:17 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6121


>The problem is that the server does not respond to this.  We can write the 
>code to issue an ACK in response to the client's FIN, but isn't it still 
>the server application's responsibility to call myclose() in order for the 
>transport layer to send its FIN?

No, connection teardown is a four-way handshake; the client closes its end,
and that FIN must be ACKed.  The server still has to close its end, which
it will do when myclose() is called on that side.

>The server code only calls myclose() after the for loop in the 
>do_connection() function in server.c has terminated.  This only happens if 
>a call to myread() fails.  This never happens; after the client has issued 
>its FIN, the server remains stuck on the myread() waiting (in the 
>CLOSE_WAIT state).  The client also remains stuck in the FIN_WAIT_2 state 
>for a FIN message from the server.

Did you let the application know that a FIN was received?  (with
stcp_fin_received(), to indicate that myread() should return 0)

>Should not the application-level protocol between the client and server 
>have some indication that the file exchange is over (i.e. something like 
>the FTP EXIT command)?

I'm assuming you're running in interactive mode...
The client closes its end of the connection when you enter ctrl-D at
the prompt.  When the server's myread() returns zero (which it does if
you've handled the incoming FIN from the client correctly), do_connection()
exits and the server does its myclose(), sending its FIN.

.

Path: shelby.stanford.edu!saga17.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: max packet size
Date: Thu, 19 Feb 2004 18:09:01 -0800
Lines: 27
Distribution: su
Message-ID: <Pine.GSO.4.44.0402191804390.8272-100000@saga17.Stanford.EDU>
References: <Pine.GSO.4.44.0402182124450.13125-100000@elaine25.Stanford.EDU>
  <Pine.GSO.4.44.0402182135410.13469-100000@elaine25.Stanford.EDU> 
 <c11mlh$4b4$1@news.Stanford.EDU> <Pine.GSO.4.44.0402191028190.589-100000@elaine2.Stanford.EDU>
 <c130qc$mhb$1@news.Stanford.EDU>
NNTP-Posting-Host: saga17.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077242944 3190 171.64.15.147 (20 Feb 2004 02:09:04 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c130qc$mhb$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6122

The th_off is a 4 bit field and it's value should be multiplied by 4.
That means the max option size should be 15*4 = 60 bytes.
A header with no options has a value of 5 (as we have seen so often)
5*4=20. Does that mean that a 64 byte header has a length of zero in th_off?

Thanks,
Ed
On Thu, 19 Feb 2004, Matthew Jonathan Holliman wrote:

> Date: Thu, 19 Feb 2004 18:55:08 +0000 (UTC)
> From: Matthew Jonathan Holliman <holliman@Stanford.EDU>
> Newsgroups: su.class.cs244a
> Subject: Re: max packet size
>
>
> >But this means the option is also counted as payload? Although we don't
> >have to handle option, but we still need to handle them as a correct
> >packet right?
>
> Yes, you need to be able to ignore them correctly...
>
> The options are counted as part of the header--I shouldn't have written
> fixed before.  The maximum header length is fixed (struct tcphdr + up to
> 44 bytes of options), plus your MSS worth of data (536 bytes in STCP).
>
>

.

Path: shelby.stanford.edu!saga17.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: The Prudent ACKer
Date: Thu, 19 Feb 2004 18:19:22 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0402191816360.8857-100000@saga17.Stanford.EDU>
NNTP-Posting-Host: saga17.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077243564 4602 171.64.15.147 (20 Feb 2004 02:19:24 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6123

Since we should always send an ACK if possible, the only case for sure
where it makes no sense is on the inital SYN. When an app does a close()
we need to send a FIN but it doesn't hurt to set the ACK flag on as well.
Correct?

Ed

.

Path: shelby.stanford.edu!elaine30.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: max packet size
Date: Fri, 20 Feb 2004 02:28:59 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c13rdb$5nd$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402182124450.13125-100000@elaine25.Stanford.EDU>   <Pine.GSO.4.44.0402182135410.13469-100000@elaine25.Stanford.EDU>   <c11mlh$4b4$1@news.Stanford.EDU> <Pine.GSO.4.44.0402191028190.589-100000@elaine2.Stanford.EDU>  <c130qc$mhb$1@news.Stanford.EDU> <Pine.GSO.4.44.0402191804390.8272-100000@saga17.Stanford.EDU>
NNTP-Posting-Host: elaine30.stanford.edu
X-Trace: news.Stanford.EDU 1077244139 5869 171.64.15.105 (20 Feb 2004 02:28:59 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6124


>The th_off is a 4 bit field and it's value should be multiplied by 4.
>That means the max option size should be 15*4 = 60 bytes.
>A header with no options has a value of 5 (as we have seen so often)
>5*4=20. Does that mean that a 64 byte header has a length of zero in th_off?

Hmm, good question.  Your interpretation would seem to make sense, but
I don't know for sure.  I can't say that I've ever seen an options field
that long--and in practice, since we don't support any options, you
shouldn't actually encounter any after the initial SYN exchange.

.

Path: shelby.stanford.edu!elaine30.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: The Prudent ACKer
Date: Fri, 20 Feb 2004 02:29:54 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c13rf2$5ps$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402191816360.8857-100000@saga17.Stanford.EDU>
NNTP-Posting-Host: elaine30.stanford.edu
X-Trace: news.Stanford.EDU 1077244194 5948 171.64.15.105 (20 Feb 2004 02:29:54 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6125


>Since we should always send an ACK if possible, the only case for sure
>where it makes no sense is on the inital SYN. When an app does a close()
>we need to send a FIN but it doesn't hurt to set the ACK flag on as well.

Correct.  And in fact, you'd find in HW4 that many firewalls will silently
drop FINs without the ACK bit set.

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Unable to run test script
Date: Fri, 20 Feb 2004 02:39:43 +0000 (UTC)
Lines: 43
Distribution: su
Message-ID: <c13s1f$68s$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077244783 6428 171.64.15.103 (20 Feb 2004 02:39:43 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:6126

When I attempt to run a test, I get the following:

Testing input file TESTDATA.0

Starting server: 
/afs/ir.stanford.edu/users/t/y/tyronen/244a/a3/grading_src/build/server  -p /afs/ir.stanford.edu/users/t/y/tyronen/244a/a3/grading_src/build/.server_port 2>&1 > /afs/ir.stanford.edu/users/t/y/
tyronen/244a/a3/grading_src/build/.server_output
Server started
Starting client: /usr/class/cs244a/grading_script/hw3/client  -p .server_port -f TESTDATA.0 foo
warning:  client exited with non-zero status (256)
program output:

Killed

Test 1.C, using current source tree and build
make -f /usr/class/cs244a/grading_script/hw3/Makefile 
LIBDIR=/usr/class/cs244a/grading_script/hw3 client
gcc -g -ansi -DSOLARIS -D__EXTENSIONS__ -Wall 
-I/usr/class/cs244a/WWW/homeworks/hw3/src -o client /usr/class/cs244a/grading_script/hw3/client.o 
/usr/class/cs244a/grading_script/hw3/connection_demux.o 
/usr/class/cs244a/grading_script/hw3/mysock.o /usr/class/cs244a/grading_script/hw3/mysock_api.o 
/usr/class/cs244a/grading_script/hw3/network_io.o 
/usr/class/cs244a/grading_script/hw3/network_io_socket.o /usr/class/cs244a/grading_script/hw3/network_io_tcp.o 
/usr/class/cs244a/grading_script/hw3/stcp_api.o /usr/class/cs244a/grading_script/hw3/tcp_sum.o 
/usr/class/cs244a/grading_script/hw3/network.o transport.c -lsocket -lnsl -lm 
-lmd5 -lpthread

Testing input file TESTDATA.0

Starting server: /usr/class/cs244a/grading_script/hw3/server_no_retrans  
-p /afs/ir.stanford.edu/users/t/y/tyronen/244a/a3/grading_src/build/.server_port 
2>&1 > 
/afs/ir.stanford.edu/users/t/y/tyronen/244a/a3/grading_src/build/.server_output
warning:  server not responding, retrying

The latter keeps repeating, even after pressing Ctrl-C, until I explicitly 
kill the 'submit_t' process.

It appears that it is not even my code that is crashing, but the grading 
script's code.  My own server and client seem to work correctly with each 
other, but whatever the script does doesn't work.

Tyrone
.

Path: shelby.stanford.edu!saga17.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: max packet size
Date: Thu, 19 Feb 2004 19:12:59 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.GSO.4.44.0402191859440.9703-100000@saga17.Stanford.EDU>
References: <Pine.GSO.4.44.0402182124450.13125-100000@elaine25.Stanford.EDU>
   <Pine.GSO.4.44.0402182135410.13469-100000@elaine25.Stanford.EDU>  
 <c11mlh$4b4$1@news.Stanford.EDU> <Pine.GSO.4.44.0402191028190.589-100000@elaine2.Stanford.EDU>
  <c130qc$mhb$1@news.Stanford.EDU> <Pine.GSO.4.44.0402191804390.8272-100000@saga17.Stanford.EDU>
 <c13rdb$5nd$1@news.Stanford.EDU>
NNTP-Posting-Host: saga17.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077246782 10876 171.64.15.147 (20 Feb 2004 03:13:02 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c13rdb$5nd$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6127

Stevens (who seems to know TCP as well as anyone) says:
"With a 4-bit field, TCP is limited to a 60-bye header."
Why the class text authors say 64 bytes, repeatedly too so I doubt it is a
typeo, is curious. Maybe the IETF/Network wizards decided to squeeze in
the last possilbe 4 bytes of options space with a zero means 64 hack.
The Stevens book I have is old so maybe the rules have changed.

Ed
On Fri, 20 Feb 2004, Matthew Jonathan Holliman wrote:

> Date: Fri, 20 Feb 2004 02:28:59 +0000 (UTC)
> From: Matthew Jonathan Holliman <holliman@Stanford.EDU>
> Newsgroups: su.class.cs244a
> Subject: Re: max packet size
>
>
> >The th_off is a 4 bit field and it's value should be multiplied by 4.
> >That means the max option size should be 15*4 = 60 bytes.
> >A header with no options has a value of 5 (as we have seen so often)
> >5*4=20. Does that mean that a 64 byte header has a length of zero in th_off?
>
> Hmm, good question.  Your interpretation would seem to make sense, but
> I don't know for sure.  I can't say that I've ever seen an options field
> that long--and in practice, since we don't support any options, you
> shouldn't actually encounter any after the initial SYN exchange.
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: tcpdump
Date: Thu, 19 Feb 2004 19:25:32 -0800
Lines: 7
Distribution: su
Message-ID: <40357E2C.CD9BBE9B@stanford.edu>
NNTP-Posting-Host: dnab408275.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077247574 12396 171.64.130.117 (20 Feb 2004 03:26:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6128

I want to use tcpdump to view what normal tcp/ip does but I am having
trouble doing this.  I planned to use telnet as an example.  How can I
do this on the elaines?  I got a permission denied error when I tried to
run tcpdump from the cs244a bin.

Ryan

.

Path: shelby.stanford.edu!saga17.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Reset
Date: Thu, 19 Feb 2004 21:26:38 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.GSO.4.44.0402192110350.12680-100000@saga17.Stanford.EDU>
NNTP-Posting-Host: saga17.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077254799 25872 171.64.15.147 (20 Feb 2004 05:26:39 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6129

The assignment seems to say we don't have to worry about reset. The SPEC
seems to say we need to worry about RESET. If the side that has done a
passive open gets a RESET on in response to SYN/ACK (from SYN_RCVD) it
should transition from the SYN_RCVD back to listen (this makes prefect
sense). But the State Transition Diagram in the text doesn't show this, so
unless the TAs say otherwise, we shouldn't have to worry about this.
I hope. :-)

Ed

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ISN
Date: Thu, 19 Feb 2004 21:53:04 -0800
Lines: 6
Distribution: su
Message-ID: <4035A0C0.1DC13BFB@stanford.edu>
NNTP-Posting-Host: dnab408275.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077256426 27986 171.64.130.117 (20 Feb 2004 05:53:46 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6130

Page. 24 of the RFC talks about a method to gaurantee that ISN will be
differnet if a connetion is reestablished, etc. (bind to clock).  For
our implementation in which we range just from 0 to 255 and do not worry
about wrap around, can our sequence number just be generated purely
randomly?

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: TIME_WAIT
Date: Thu, 19 Feb 2004 22:26:32 -0800
Lines: 4
Distribution: su
Message-ID: <4035A898.D253BDD5@stanford.edu>
NNTP-Posting-Host: dnab408275.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077258438 926 171.64.130.117 (20 Feb 2004 06:27:18 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6131

 The assignment says we are not required to support TIME_WAIT.  I am
assuming that this means in a situation that would normally trigger
TIME_WAIT we immediately go to CLOSED.

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Question
Date: Thu, 19 Feb 2004 22:27:13 -0800
Lines: 3
Distribution: su
Message-ID: <4035A8C1.2231A928@stanford.edu>
NNTP-Posting-Host: dnab408275.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077258474 926 171.64.130.117 (20 Feb 2004 06:27:54 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6132

Sorry, I hit send before asking my question which is simply whether or
not that is correct.

.

Path: shelby.stanford.edu!elaine17.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: APP_DATA and APP_CLOSE_REQUESTED
Date: Thu, 19 Feb 2004 22:51:32 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.GSO.4.44.0402192246310.5164-100000@elaine17.Stanford.EDU>
NNTP-Posting-Host: elaine17.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077259893 2418 171.64.15.82 (20 Feb 2004 06:51:33 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6133

When we do a wait, will both of these events be returned? What I am trying
to figure out is that will stcp_wait_for_event give us APP_CLOSE_REQUESTED
flag when there are more data kept in the mysock layer.

Also, if application has called close(), does that mean if we conitnue to
do wait with the APP_CLOSE_REQUESTED flag on, the wait function will
always return immediately?

Thanks

Lin

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Receiver buffer any data it receives
Date: Thu, 19 Feb 2004 23:04:27 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.GSO.4.44.0402192301210.19609-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 1077260669 3219 171.64.15.118 (20 Feb 2004 07:04:29 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6134


It says the following in the assignment:

Your receiver must always buffer any data it receives, evein if it arrives
out of order.

===
Why do we have to buffer any data it receives, especially if it arrives
out of order?  I thought "Go-back_N" protocl should take care of
retransmit the out-of-order packet.  Why does the receiver have to buffer
it?

-Laura

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: errno
Date: Thu, 19 Feb 2004 23:05:56 -0800
Lines: 16
Distribution: su
Message-ID: <c14bjd$35u$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402171627360.22136-100000@elaine7.Stanford.EDU> <c0v57u$pmd$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077260717 3262 128.12.61.97 (20 Feb 2004 07:05: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:6135

Do the functions stcp_network_send/recv set the appropriate errno value when
they return -1?  During the initiation handshake, I don't see any other way
for us to determine the specific error when they fail.

Also, the comment in the starter code gives ECONNREFUSED as an example of an
errno we should set, and the man page defines this as "the attempt to
connect was forcefully rejected."  Does this mean that the receiver sent a
FIN?  What exactly does "forcefully rejected" mean?

Finally, the only other errno I think we can detect ourselves is ETIMEDOUT.
Any others I'm overlooking?

Thanks,
Oded


.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: tcpdump
Date: Fri, 20 Feb 2004 07:56:54 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c14ek6$6mq$1@news.Stanford.EDU>
References: <40357E2C.CD9BBE9B@stanford.edu>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1077263814 6874 171.64.15.98 (20 Feb 2004 07:56:54 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6136


>I want to use tcpdump to view what normal tcp/ip does but I am having
>trouble doing this.  I planned to use telnet as an example.  How can I
>do this on the elaines?  I got a permission denied error when I tried to
>run tcpdump from the cs244a bin.

The easiest way would probably be to use your router from HW2 (with -l),
access one of the app servers, and examine the resulting log--as you
presumably did when debugging your router.
.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Reset
Date: Fri, 20 Feb 2004 07:58:48 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c14eno$6q8$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402192110350.12680-100000@saga17.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1077263928 6984 171.64.15.98 (20 Feb 2004 07:58:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6137


>The assignment seems to say we don't have to worry about reset. The SPEC
>seems to say we need to worry about RESET. If the side that has done a
>passive open gets a RESET on in response to SYN/ACK (from SYN_RCVD) it
>should transition from the SYN_RCVD back to listen (this makes prefect
>sense). But the State Transition Diagram in the text doesn't show this, so
>unless the TAs say otherwise, we shouldn't have to worry about this.
>I hope. :-)

We aren't implementing TCP--we're implementing a barebones transport layer
that does almost the minimum necessary to interoperate with TCP.  Resets
are one of the (several) things we don't handle "correctly" per the TCP
specs--we just ignore these, in flagrant violation of the RFC...

.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ISN
Date: Fri, 20 Feb 2004 08:02:16 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c14eu8$76t$1@news.Stanford.EDU>
References: <4035A0C0.1DC13BFB@stanford.edu>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1077264136 7389 171.64.15.98 (20 Feb 2004 08:02:16 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6138


>Page. 24 of the RFC talks about a method to gaurantee that ISN will be
>differnet if a connetion is reestablished, etc. (bind to clock).  For
>our implementation in which we range just from 0 to 255 and do not worry
>about wrap around, can our sequence number just be generated purely
>randomly?

yes, we're basically ignoring several of the edge conditions that TCP
has to deal with, e.g. sequence number wraparound, rapid reuse of ports,
etc.

.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: TIME_WAIT
Date: Fri, 20 Feb 2004 08:02:33 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c14eup$77d$1@news.Stanford.EDU>
References: <4035A898.D253BDD5@stanford.edu>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1077264153 7405 171.64.15.98 (20 Feb 2004 08:02:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6139


> The assignment says we are not required to support TIME_WAIT.  I am
>assuming that this means in a situation that would normally trigger
>TIME_WAIT we immediately go to CLOSED.

correct.

.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: APP_DATA and APP_CLOSE_REQUESTED
Date: Fri, 20 Feb 2004 08:04:49 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c14f31$7b7$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402192246310.5164-100000@elaine17.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1077264289 7527 171.64.15.98 (20 Feb 2004 08:04:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6140


>When we do a wait, will both of these events be returned? What I am trying
>to figure out is that will stcp_wait_for_event give us APP_CLOSE_REQUESTED
>flag when there are more data kept in the mysock layer.

Please take a look at the definition of stcp_wait_for_event() in stcp_api.c

>Also, if application has called close(), does that mean if we conitnue to
>do wait with the APP_CLOSE_REQUESTED flag on, the wait function will
>always return immediately?

Again, please take a look at the definition of stcp_wait_for_event(),
or the comments in stcp_api.h about the function's use.  Thanks.

.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Receiver buffer any data it receives
Date: Fri, 20 Feb 2004 08:07:54 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <c14f8q$7fv$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402192301210.19609-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1077264474 7679 171.64.15.98 (20 Feb 2004 08:07:54 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6141



>Why do we have to buffer any data it receives, especially if it arrives
>out of order?  I thought "Go-back_N" protocl should take care of
>retransmit the out-of-order packet.  Why does the receiver have to buffer
>it?

Yes, in principle, you could just throw out any out-of-order segment and
have a functionally correct transport layer--but almost any real TCP
implementation would buffer out-of-order data as an optimisation, and your
STCP implementation must likewise.  (There's no guarantee that you'll
always receive data in order, so not buffering data can waste bandwidth
and increase latency; plus newer TCP mechanisms such as SACKs implicitly
assume buffering).

.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: errno
Date: Fri, 20 Feb 2004 08:13:26 +0000 (UTC)
Lines: 27
Distribution: su
Message-ID: <c14fj6$8e2$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402171627360.22136-100000@elaine7.Stanford.EDU> <c0v57u$pmd$1@news.Stanford.EDU> <c14bjd$35u$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1077264806 8642 171.64.15.98 (20 Feb 2004 08:13:26 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6142


>Do the functions stcp_network_send/recv set the appropriate errno value when
>they return -1?  During the initiation handshake, I don't see any other way
>for us to determine the specific error when they fail.

if you delve in the code, you'll see that they eventually just send
"packets" over a regular TCP connection in HW3 (and via VNS in HW4).
so if the functions fail, it's likely because the other side's died--errno
should indicate why, but I doubt it's particularly meaningful.

>Also, the comment in the starter code gives ECONNREFUSED as an example of an
>errno we should set, and the man page defines this as "the attempt to
>connect was forcefully rejected."  Does this mean that the receiver sent a
>FIN?  What exactly does "forcefully rejected" mean?

in real TCP, you'd receive a RST if you try to connect to a closed
port, and this would be reported to the app as ECONNREFUSED.  in STCP,
if you don't receive a SYN-ACK after your retransmissions, you can
just treat this as connection refused.  (It could also be ETIMEDOUT,
as you point out, but since we don't tell you when you receive a RST--and
we don't even have RSTs in HW3--you can't disambiguate these two error
conditions in your code).

we really aren't expecting any kind of fancy error handling or
checking--the stub code as it is guesses at errno=ECONNREFUSED if you don't
specify anything.

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Receiver buffer any data it receives
Date: Fri, 20 Feb 2004 00:49:25 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.GSO.4.44.0402200040460.25262-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0402192301210.19609-100000@elaine43.Stanford.EDU>
 <c14f8q$7fv$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077266967 10724 171.64.15.118 (20 Feb 2004 08:49:27 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
In-Reply-To: <c14f8q$7fv$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6143


Does this TCP optimization mean that the receiver buffers the
out-of-order packet (say packet k); once the packet in-between (say
packet (k-1)) arrives, the receiver will send an ACK that
acks all packets through k?

If this is true, how would the advertised window be considered?  Should we
consider packet k when calculating advertised window (before packet k-1
arrives)?  Or should we consider only through packet k-2?


  On Fri, 20 Feb 2004, Matthew Jonathan Holliman wrote:

>
>
> >Why do we have to buffer any data it receives, especially if it arrives
> >out of order?  I thought "Go-back_N" protocl should take care of
> >retransmit the out-of-order packet.  Why does the receiver have to buffer
> >it?
>
> Yes, in principle, you could just throw out any out-of-order segment and
> have a functionally correct transport layer--but almost any real TCP
> implementation would buffer out-of-order data as an optimisation, and your
> STCP implementation must likewise.  (There's no guarantee that you'll
> always receive data in order, so not buffering data can waste bandwidth
> and increase latency; plus newer TCP mechanisms such as SACKs implicitly
> assume buffering).
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: How to detect send?
Date: Fri, 20 Feb 2004 00:49:45 -0800
Lines: 15
Distribution: su
Message-ID: <c14hnc$afg$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1077266988 10736 128.12.189.163 (20 Feb 2004 08:49: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:6144

Hi,
There is a part of the tcp state diagram where we are in passive
"listen".Now there is an arrow from it to SYN_SENT as "send/SYN"
This is a special case where you are initially in the passive state and then
your application layer suddenly decides that it was to become active
instead.
My question is-Do we need to implement this functionality too?
If so, how do we detect that the application layer called send?
Does it mean that in the LISTEN state, if I get APP_DATA I am supposed to
consider that  my application wants me to become active now and implement
the transition?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Receiver buffer any data it receives
Date: Fri, 20 Feb 2004 08:53:16 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <c14hts$ana$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402192301210.19609-100000@elaine43.Stanford.EDU>  <c14f8q$7fv$1@news.Stanford.EDU> <Pine.GSO.4.44.0402200040460.25262-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1077267196 10986 171.64.15.98 (20 Feb 2004 08:53:16 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6145



>Does this TCP optimization mean that the receiver buffers the
>out-of-order packet (say packet k); once the packet in-between (say
>packet (k-1)) arrives, the receiver will send an ACK that
>acks all packets through k?

Yes.

>If this is true, how would the advertised window be considered?  Should we
>consider packet k when calculating advertised window (before packet k-1
>arrives)?  Or should we consider only through packet k-2?

on the other side?  it's still whatever th_ack + th_win was advertised by
the other side--the fact that packet k happened to have turned up on the
other side doesn't have any bearing on this... (when it received packet k,
it would still have acked for k-1 anyway)

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sender window
Date: Fri, 20 Feb 2004 01:00:26 -0800
Lines: 11
Distribution: su
Message-ID: <c14ibd$b55$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1077267629 11429 128.12.189.163 (20 Feb 2004 09:00:29 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:6146

Hi,
For the sender window since I can always take data from the application as
needed, I can just take data = size of advertised window  and so never will
need to track unsent data .Am I correct?
So my sender window will keep track of just the unacknowledged data and I
will have a pointer which tells me the next byte to send.
Please let me know if  I have understood this correctly.
Thanks,
Haripriya


.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: How to detect send?
Date: Fri, 20 Feb 2004 09:00:32 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c14ibg$b5b$1@news.Stanford.EDU>
References: <c14hnc$afg$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1077267632 11435 171.64.15.98 (20 Feb 2004 09:00:32 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6147


>There is a part of the tcp state diagram where we are in passive
>"listen".Now there is an arrow from it to SYN_SENT as "send/SYN"
>This is a special case where you are initially in the passive state and then
>your application layer suddenly decides that it was to become active
>instead.
>My question is-Do we need to implement this functionality too?

No--this doesn't appear to be a state transition that's supported by
the socket interface.  (Unless you can listen() on a socket, and then
connect() on it--I don't know whether regular sockets support this or not.
Whether they do or not is a bit academic, anyway, as the mysocket layer
certainly doesn't allow this).

.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: sender window
Date: Fri, 20 Feb 2004 09:04:28 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c14iis$bd5$1@news.Stanford.EDU>
References: <c14ibd$b55$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1077267868 11685 171.64.15.98 (20 Feb 2004 09:04:28 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6148


>For the sender window since I can always take data from the application as
>needed, I can just take data = size of advertised window  and so never will
>need to track unsent data .Am I correct?

I don't know, I'm really having a hard time understanding the question.
What does "track" mean?  And how does data = size of advertised window?

>So my sender window will keep track of just the unacknowledged data and I
>will have a pointer which tells me the next byte to send.

However you want to keep track of data for retransmissions/ACKs is fine...

.

Path: shelby.stanford.edu!elaine15.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Receiver buffer any data it receives
Date: Fri, 20 Feb 2004 01:16:15 -0800
Lines: 34
Distribution: su
Message-ID: <Pine.GSO.4.44.0402200109510.2987-100000@elaine15.Stanford.EDU>
References: <Pine.GSO.4.44.0402192301210.19609-100000@elaine43.Stanford.EDU>
  <c14f8q$7fv$1@news.Stanford.EDU> <Pine.GSO.4.44.0402200040460.25262-100000@elaine43.Stanford.EDU>
 <c14hts$ana$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine15.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077268577 12263 171.64.15.80 (20 Feb 2004 09:16:17 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
In-Reply-To: <c14hts$ana$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6149

On Fri, 20 Feb 2004, Matthew Jonathan Holliman wrote:

>
>
> >Does this TCP optimization mean that the receiver buffers the
> >out-of-order packet (say packet k); once the packet in-between (say
> >packet (k-1)) arrives, the receiver will send an ACK that
> >acks all packets through k?
>
> Yes.
>
> >If this is true, how would the advertised window be considered?  Should we
> >consider packet k when calculating advertised window (before packet k-1
> >arrives)?  Or should we consider only through packet k-2?
>
> on the other side?  it's still whatever th_ack + th_win was advertised by
> the other side--the fact that packet k happened to have turned up on the
> other side doesn't have any bearing on this... (when it received packet k,
> it would still have acked for k-1 anyway)
>
>

I am asking about the advertised window the receiver is sending to the
sender.  Would the fact that packet k arrives out of order make the
receiver window one packet smaller?

From the text book:

AdvertisedWindown = MaxRcvBuffer - ((NextByteExpected -1) - LastByteRead)

It seems to me that the advertised window does not consider the packet out
of order.  Please confirm.


.

Path: shelby.stanford.edu!saga4.Stanford.EDU!mylesw
From: mylesw@Stanford.EDU (Myles Barrett Williams)
Newsgroups: su.class.cs244a
Subject: Re: Reset
Date: Fri, 20 Feb 2004 09:24:31 +0000 (UTC)
Organization: Stanford University, CA 94305, USA
Lines: 15
Distribution: su
Message-ID: <c14jof$cdl$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402192110350.12680-100000@saga17.Stanford.EDU>
NNTP-Posting-Host: saga4.stanford.edu
X-Trace: news.Stanford.EDU 1077269071 12725 171.64.15.134 (20 Feb 2004 09:24:31 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6150

In article <Pine.GSO.4.44.0402192110350.12680-100000@saga17.Stanford.EDU>,
Edward Chron  <echron@stanford.edu> wrote:
>The assignment seems to say we don't have to worry about reset. The SPEC
>seems to say we need to worry about RESET. If the side that has done a
>passive open gets a RESET on in response to SYN/ACK (from SYN_RCVD) it
>should transition from the SYN_RCVD back to listen (this makes prefect
>sense). But the State Transition Diagram in the text doesn't show this, so
>unless the TAs say otherwise, we shouldn't have to worry about this.
>I hope. :-)

and there are many other cases where the RFC requires RSTs to be sent in
response to unexpected field values. Are we just supposed to drop packets with
such values?

Myles
.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Do we have to handle simultaneous initiation for milestone A?
Date: Fri, 20 Feb 2004 03:51:57 -0800
Lines: 3
Distribution: su
Message-ID: <4035F4DC.3C0773B6@stanford.edu>
NNTP-Posting-Host: dnab408275.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077277961 21373 171.64.130.117 (20 Feb 2004 11:52:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6151

This is discussed in the RFC on page 28.  Are we responsible for
handling it for milestone A?

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: sequence number for FIN
Date: Fri, 20 Feb 2004 22:28:29 +0800
Lines: 9
Distribution: su
Message-ID: <4036198D.8AD652F0@leland.stanford.edu>
References: <Pine.GSO.4.44.0402192246310.5164-100000@elaine17.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077287438 1369 128.12.196.85 (20 Feb 2004 14:30:38 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6152

The assignment page says the FIN segment takes up 1 byte of sequence number
space. So suppose we receive a segment with sequence number 1, with the FIN
flag set, and 10 bytes of data. Do we ack on sequence number 11 (not counting
the FIN) or 12 (counting the FIN as occupying one byte)?

Thanks,
Jimmy


.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Use of stcp_app_recv
Date: Fri, 20 Feb 2004 06:40:58 -0800
Lines: 19
Distribution: su
Message-ID: <40361C79.26CD5F11@stanford.edu>
NNTP-Posting-Host: dnab408275.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077288102 2269 171.64.130.117 (20 Feb 2004 14:41:42 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6153

The application writes data of an arbitrary length to the buffer.  We
then read from this buffer as often as we want the data using the
function stcp_app_recv.  So, if we have a certain window size available,
we can read a loop of MSS and almost always tell when the application
has no more data available because at this point the return value will
be less than MSS.  However, what about the case that the application
happened to write a length of data that is a multiple of MSS.  Then the
last value read would still equal MSS and the stcp_app_recv function
would block.  At this point, eventually it would unblock when the
application writes again, but what if the application is waiting to
receive some data on the socket before it writes anymore.  At this
point, our tcp implementation is blocked, so we are not going to receive
any more data from the network and the application program is blocked so
it's not going to write anymore.  The application program and our tcp
implementation our now frozen.

How do we handle this edge case of the length of data written being a
multiple of MSS?

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Unable to run test script
Date: Fri, 20 Feb 2004 23:39:59 +0800
Lines: 87
Distribution: su
Message-ID: <40362A4F.E50E01A4@leland.stanford.edu>
References: <c13s1f$68s$1@news.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077291730 5945 128.12.196.85 (20 Feb 2004 15:42:10 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6154

I got a similar problem. Here's the output for the test script:

Testing input file TESTDATA.0

Starting server: /afs/ir.stanford.edu/users/h/c/hcpang/cs244a/hw3/grading_src/bu
ild/server  -p /afs/ir.stanford.edu/users/h/c/hcpang/cs244a/hw3/grading_src/buil
d/.server_port 2>&1 > /afs/ir.stanford.edu/users/h/c/hcpang/cs244a/hw3/grading_s
rc/build/.server_output
Server started
Starting client: /usr/class/cs244a/grading_script/hw3/client  -p .server_port -f
 TESTDATA.0 foo
warning:  client exited with non-zero status (256)
program output:

Variable name too long
Test 1.C, using current source tree and build
Variable name too long
make -f /usr/class/cs244a/grading_script/hw3/Makefile LIBDIR=/usr/class/cs244a/g
rading_script/hw3 client
gcc -g -ansi -DSOLARIS -D__EXTENSIONS__ -Wall -I/usr/class/cs244a/WWW/homeworks/
hw3/src -o client /usr/class/cs244a/grading_script/hw3/client.o /usr/class/cs244
a/grading_script/hw3/connection_demux.o /usr/class/cs244a/grading_script/hw3/mys
ock.o /usr/class/cs244a/grading_script/hw3/mysock_api.o /usr/class/cs244a/gradin
g_script/hw3/network_io.o /usr/class/cs244a/grading_script/hw3/network_io_socket
..o /usr/class/cs244a/grading_script/hw3/network_io_tcp.o /usr/class/cs244a/gradi
ng_script/hw3/stcp_api.o /usr/class/cs244a/grading_script/hw3/tcp_sum.o /usr/cla
ss/cs244a/grading_script/hw3/network.o transport.c -lsocket -lnsl -lm -lmd5 -lpt
hread

Testing input file TESTDATA.0

Starting server: /usr/class/cs244a/grading_script/hw3/server_no_retrans  -p /afs
/ir.stanford.edu/users/h/c/hcpang/cs244a/hw3/grading_src/build/.server_port 2>&1
 > /afs/ir.stanford.edu/users/h/c/hcpang/cs244a/hw3/grading_src/build/.server_ou
tput
warning:  server not responding, retrying

Is it something wrong with my code? or is the test script broken? I can't really tell...

Jimmy

Tyrone Nicholas wrote:

> When I attempt to run a test, I get the following:
>
> Testing input file TESTDATA.0
>
> Starting server:
> /afs/ir.stanford.edu/users/t/y/tyronen/244a/a3/grading_src/build/server  -p /afs/ir.stanford.edu/users/t/y/tyronen/244a/a3/grading_src/build/.server_port 2>&1 > /afs/ir.stanford.edu/users/t/y/
> tyronen/244a/a3/grading_src/build/.server_output
> Server started
> Starting client: /usr/class/cs244a/grading_script/hw3/client  -p .server_port -f TESTDATA.0 foo
> warning:  client exited with non-zero status (256)
> program output:
>
> Killed
>
> Test 1.C, using current source tree and build
> make -f /usr/class/cs244a/grading_script/hw3/Makefile
> LIBDIR=/usr/class/cs244a/grading_script/hw3 client
> gcc -g -ansi -DSOLARIS -D__EXTENSIONS__ -Wall
> -I/usr/class/cs244a/WWW/homeworks/hw3/src -o client /usr/class/cs244a/grading_script/hw3/client.o
> /usr/class/cs244a/grading_script/hw3/connection_demux.o
> /usr/class/cs244a/grading_script/hw3/mysock.o /usr/class/cs244a/grading_script/hw3/mysock_api.o
> /usr/class/cs244a/grading_script/hw3/network_io.o
> /usr/class/cs244a/grading_script/hw3/network_io_socket.o /usr/class/cs244a/grading_script/hw3/network_io_tcp.o
> /usr/class/cs244a/grading_script/hw3/stcp_api.o /usr/class/cs244a/grading_script/hw3/tcp_sum.o
> /usr/class/cs244a/grading_script/hw3/network.o transport.c -lsocket -lnsl -lm
> -lmd5 -lpthread
>
> Testing input file TESTDATA.0
>
> Starting server: /usr/class/cs244a/grading_script/hw3/server_no_retrans
> -p /afs/ir.stanford.edu/users/t/y/tyronen/244a/a3/grading_src/build/.server_port
> 2>&1 >
> /afs/ir.stanford.edu/users/t/y/tyronen/244a/a3/grading_src/build/.server_output
> warning:  server not responding, retrying
>
> The latter keeps repeating, even after pressing Ctrl-C, until I explicitly
> kill the 'submit_t' process.
>
> It appears that it is not even my code that is crashing, but the grading
> script's code.  My own server and client seem to work correctly with each
> other, but whatever the script does doesn't work.
>
> Tyrone

.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: sequence number for FIN
Date: Fri, 20 Feb 2004 16:57:10 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c15e96$ams$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402192246310.5164-100000@elaine17.Stanford.EDU> <4036198D.8AD652F0@leland.stanford.edu>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1077296230 10972 171.64.15.84 (20 Feb 2004 16:57:10 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6155


>The assignment page says the FIN segment takes up 1 byte of sequence number
>space. So suppose we receive a segment with sequence number 1, with the FIN
>flag set, and 10 bytes of data. Do we ack on sequence number 11 (not counting
>the FIN) or 12 (counting the FIN as occupying one byte)?

12--the FIN occupies the sequence number byte following those assigned to
the data.

.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Receiver buffer any data it receives
Date: Fri, 20 Feb 2004 17:15:13 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c15fb1$c99$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402192301210.19609-100000@elaine43.Stanford.EDU>   <c14f8q$7fv$1@news.Stanford.EDU> <Pine.GSO.4.44.0402200040460.25262-100000@elaine43.Stanford.EDU>  <c14hts$ana$1@news.Stanford.EDU> <Pine.GSO.4.44.0402200109510.2987-100000@elaine15.Stanford.EDU>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1077297313 12585 171.64.15.84 (20 Feb 2004 17:15:13 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6156


>AdvertisedWindown = MaxRcvBuffer - ((NextByteExpected -1) - LastByteRead)

NextByteExpected is still the first byte of packet k-1 (the missing
packet), i.e. unchanged.  LastByteRead and MaxRcvBuffer are also unchanged
by packet k's out of order arrival.  Why would packet k arriving have any
impact on the advertised window?

.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Reset
Date: Fri, 20 Feb 2004 17:15:49 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c15fc5$ca8$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402192110350.12680-100000@saga17.Stanford.EDU> <c14jof$cdl$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1077297349 12616 171.64.15.84 (20 Feb 2004 17:15:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6157


>and there are many other cases where the RFC requires RSTs to be sent in
>response to unexpected field values. Are we just supposed to drop packets with
>such values?

that seems reasonable to me, doesn't it to you?

.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Do we have to handle simultaneous initiation for milestone A?
Date: Fri, 20 Feb 2004 17:17:15 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c15fer$cc3$1@news.Stanford.EDU>
References: <4035F4DC.3C0773B6@stanford.edu>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1077297435 12675 171.64.15.84 (20 Feb 2004 17:17:15 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6158


>This is discussed in the RFC on page 28.  Are we responsible for
>handling it for milestone A?

no, and not for milestones B or C either.  if you think about the
typical socket API, and especially the one that mysocket defines,
this is a situation that hardly ever (maybe never) occurs in real life.
the TCP specs predated the socket interface, which precludes some
of these cases from happening.

.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Use of stcp_app_recv
Date: Fri, 20 Feb 2004 17:18:07 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c15fgf$ce1$1@news.Stanford.EDU>
References: <40361C79.26CD5F11@stanford.edu>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1077297487 12737 171.64.15.84 (20 Feb 2004 17:18:07 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6159


>How do we handle this edge case of the length of data written being a
>multiple of MSS?

This has been answered previously on the newsgroup... see
stcp_wait_for_event().
.

Path: shelby.stanford.edu!elaine15.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sequence number for FIN
Date: Fri, 20 Feb 2004 10:15:36 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0402201014080.13049-100000@elaine15.Stanford.EDU>
References: <Pine.GSO.4.44.0402192246310.5164-100000@elaine17.Stanford.EDU>
 <4036198D.8AD652F0@leland.stanford.edu> <c15e96$ams$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine15.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077300938 17304 171.64.15.80 (20 Feb 2004 18:15:38 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
In-Reply-To: <c15e96$ams$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6160

Is it possible to combine the 10-byte data and FIN flag in one packet?
I thought FIN is always sent separarely, maybe with ACK, but never with
the final packet of data.  Is this the right assumption?


On Fri, 20 Feb 2004, Matthew Jonathan Holliman wrote:

>
> >The assignment page says the FIN segment takes up 1 byte of sequence number
> >space. So suppose we receive a segment with sequence number 1, with the FIN
> >flag set, and 10 bytes of data. Do we ack on sequence number 11 (not counting
> >the FIN) or 12 (counting the FIN as occupying one byte)?
>
> 12--the FIN occupies the sequence number byte following those assigned to
> the data.
>
>

.

Path: shelby.stanford.edu!elaine12.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: sequence number for FIN
Date: Fri, 20 Feb 2004 19:08:48 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c15m00$l07$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402192246310.5164-100000@elaine17.Stanford.EDU>  <4036198D.8AD652F0@leland.stanford.edu> <c15e96$ams$1@news.Stanford.EDU> <Pine.GSO.4.44.0402201014080.13049-100000@elaine15.Stanford.EDU>
NNTP-Posting-Host: elaine12.stanford.edu
X-Trace: news.Stanford.EDU 1077304128 21511 171.64.15.77 (20 Feb 2004 19:08:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6161


>Is it possible to combine the 10-byte data and FIN flag in one packet?
>I thought FIN is always sent separarely, maybe with ACK, but never with
>the final packet of data.  Is this the right assumption?

Yes, they can be combined, and you'll find that real TCP stacks do this
on occasion.

.

Path: shelby.stanford.edu!not-for-mail
From: sumeet shendrikar <sumeets@stanford.edu>
Newsgroups: su.class.cs244a
Subject: reference stcp implementation
Date: Fri, 20 Feb 2004 12:04:34 -0800
Lines: 7
Distribution: su
Message-ID: <c15p8j$puu$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-60149.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077307476 26590 128.12.197.131 (20 Feb 2004 20:04:36 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6162

does a reference tcp implementation exist somewhere (similar to the 
reference router for hw2)?
Curious for both functionality and performance comparisons.

thanks,
sumeet

.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: reference stcp implementation
Date: Fri, 20 Feb 2004 20:07:24 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c15pds$qak$1@news.Stanford.EDU>
References: <c15p8j$puu$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077307644 26964 171.64.15.103 (20 Feb 2004 20:07:24 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6163


>does a reference tcp implementation exist somewhere (similar to the 
>reference router for hw2)?
>Curious for both functionality and performance comparisons.

for HW4, there's one in WWW/homeworks/hw4/prebuilt/

--but not for HW3, though.

functionality-wise, there's not so much need for it since you can
cross-check against standard TCP implementations anyway.  and we make no
claims about good performance :-)  (the mysocket layer was written
to be fairly easy to read, not necessarily efficient).

.

Path: shelby.stanford.edu!not-for-mail
From: sumeet shendrikar <sumeets@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Unable to run test script
Date: Fri, 20 Feb 2004 12:11:08 -0800
Lines: 94
Distribution: su
Message-ID: <c15pkt$qh2$1@news.Stanford.EDU>
References: <c13s1f$68s$1@news.Stanford.EDU> <40362A4F.E50E01A4@leland.stanford.edu>
NNTP-Posting-Host: rescomp-03-60149.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077307869 27170 128.12.197.131 (20 Feb 2004 20:11:09 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6164

one more to the list... exact same output as tyrone's.


Jimmy Pang wrote:
> I got a similar problem. Here's the output for the test script:
> 
> Testing input file TESTDATA.0
> 
> Starting server: /afs/ir.stanford.edu/users/h/c/hcpang/cs244a/hw3/grading_src/bu
> ild/server  -p /afs/ir.stanford.edu/users/h/c/hcpang/cs244a/hw3/grading_src/buil
> d/.server_port 2>&1 > /afs/ir.stanford.edu/users/h/c/hcpang/cs244a/hw3/grading_s
> rc/build/.server_output
> Server started
> Starting client: /usr/class/cs244a/grading_script/hw3/client  -p .server_port -f
>  TESTDATA.0 foo
> warning:  client exited with non-zero status (256)
> program output:
> 
> Variable name too long
> Test 1.C, using current source tree and build
> Variable name too long
> make -f /usr/class/cs244a/grading_script/hw3/Makefile LIBDIR=/usr/class/cs244a/g
> rading_script/hw3 client
> gcc -g -ansi -DSOLARIS -D__EXTENSIONS__ -Wall -I/usr/class/cs244a/WWW/homeworks/
> hw3/src -o client /usr/class/cs244a/grading_script/hw3/client.o /usr/class/cs244
> a/grading_script/hw3/connection_demux.o /usr/class/cs244a/grading_script/hw3/mys
> ock.o /usr/class/cs244a/grading_script/hw3/mysock_api.o /usr/class/cs244a/gradin
> g_script/hw3/network_io.o /usr/class/cs244a/grading_script/hw3/network_io_socket
> .o /usr/class/cs244a/grading_script/hw3/network_io_tcp.o /usr/class/cs244a/gradi
> ng_script/hw3/stcp_api.o /usr/class/cs244a/grading_script/hw3/tcp_sum.o /usr/cla
> ss/cs244a/grading_script/hw3/network.o transport.c -lsocket -lnsl -lm -lmd5 -lpt
> hread
> 
> Testing input file TESTDATA.0
> 
> Starting server: /usr/class/cs244a/grading_script/hw3/server_no_retrans  -p /afs
> /ir.stanford.edu/users/h/c/hcpang/cs244a/hw3/grading_src/build/.server_port 2>&1
>  > /afs/ir.stanford.edu/users/h/c/hcpang/cs244a/hw3/grading_src/build/.server_ou
> tput
> warning:  server not responding, retrying
> 
> Is it something wrong with my code? or is the test script broken? I can't really tell...
> 
> Jimmy
> 
> Tyrone Nicholas wrote:
> 
> 
>>When I attempt to run a test, I get the following:
>>
>>Testing input file TESTDATA.0
>>
>>Starting server:
>>/afs/ir.stanford.edu/users/t/y/tyronen/244a/a3/grading_src/build/server  -p /afs/ir.stanford.edu/users/t/y/tyronen/244a/a3/grading_src/build/.server_port 2>&1 > /afs/ir.stanford.edu/users/t/y/
>>tyronen/244a/a3/grading_src/build/.server_output
>>Server started
>>Starting client: /usr/class/cs244a/grading_script/hw3/client  -p .server_port -f TESTDATA.0 foo
>>warning:  client exited with non-zero status (256)
>>program output:
>>
>>Killed
>>
>>Test 1.C, using current source tree and build
>>make -f /usr/class/cs244a/grading_script/hw3/Makefile
>>LIBDIR=/usr/class/cs244a/grading_script/hw3 client
>>gcc -g -ansi -DSOLARIS -D__EXTENSIONS__ -Wall
>>-I/usr/class/cs244a/WWW/homeworks/hw3/src -o client /usr/class/cs244a/grading_script/hw3/client.o
>>/usr/class/cs244a/grading_script/hw3/connection_demux.o
>>/usr/class/cs244a/grading_script/hw3/mysock.o /usr/class/cs244a/grading_script/hw3/mysock_api.o
>>/usr/class/cs244a/grading_script/hw3/network_io.o
>>/usr/class/cs244a/grading_script/hw3/network_io_socket.o /usr/class/cs244a/grading_script/hw3/network_io_tcp.o
>>/usr/class/cs244a/grading_script/hw3/stcp_api.o /usr/class/cs244a/grading_script/hw3/tcp_sum.o
>>/usr/class/cs244a/grading_script/hw3/network.o transport.c -lsocket -lnsl -lm
>>-lmd5 -lpthread
>>
>>Testing input file TESTDATA.0
>>
>>Starting server: /usr/class/cs244a/grading_script/hw3/server_no_retrans
>>-p /afs/ir.stanford.edu/users/t/y/tyronen/244a/a3/grading_src/build/.server_port
>>2>&1 >
>>/afs/ir.stanford.edu/users/t/y/tyronen/244a/a3/grading_src/build/.server_output
>>warning:  server not responding, retrying
>>
>>The latter keeps repeating, even after pressing Ctrl-C, until I explicitly
>>kill the 'submit_t' process.
>>
>>It appears that it is not even my code that is crashing, but the grading
>>script's code.  My own server and client seem to work correctly with each
>>other, but whatever the script does doesn't work.
>>
>>Tyrone
> 
> 

.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Unable to run test script
Date: Fri, 20 Feb 2004 20:14:14 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <c15pqm$r01$1@news.Stanford.EDU>
References: <c13s1f$68s$1@news.Stanford.EDU> <40362A4F.E50E01A4@leland.stanford.edu> <c15pkt$qh2$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077308054 27649 171.64.15.103 (20 Feb 2004 20:14:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6165


>one more to the list... exact same output as tyrone's.

on which machine?  I can't reproduce the behaviour...

.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Milestone A
Date: Fri, 20 Feb 2004 12:43:33 -0800
Lines: 8
Distribution: su
Message-ID: <c15rhv$t73$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1077309825 29923 127.0.0.1 (20 Feb 2004 20:43: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:6166

If we can pass the test script, should we submit the assignment?  I've got
some edge conditions which I know are not yet handled properly (things like
weird packets received in certain states).  Can these be completed after
milestone A?




.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: SYN/ACK FIN/ACK
Date: Fri, 20 Feb 2004 13:57:31 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.GSO.4.44.0402201354420.5799-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 1077314253 5361 171.64.15.106 (20 Feb 2004 21:57:33 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6167


Suppose we are expecting only a SYN (ie...in LISTEN state)
but we get a SYN/ACK

Should we treat this as a condition to ignore the SYN/ACK, or should
we accept the SYN part of this packet and ignore only the ACK.

This situation arised in multiple cases accross multiple states, so
just wanted to clear this up before proceeding

--v


.

Path: shelby.stanford.edu!not-for-mail
From: sumeet shendrikar <sumeets@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Unable to run test script
Date: Fri, 20 Feb 2004 14:25:31 -0800
Lines: 10
Distribution: su
Message-ID: <c161gs$77k$1@news.Stanford.EDU>
References: <c13s1f$68s$1@news.Stanford.EDU> <40362A4F.E50E01A4@leland.stanford.edu> <c15pkt$qh2$1@news.Stanford.EDU> <c15pqm$r01$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-60149.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077315932 7412 128.12.197.131 (20 Feb 2004 22:25:32 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6168

i was running on one of the elaines.. don't remember which exactly


Matthew Jonathan Holliman wrote:
>>one more to the list... exact same output as tyrone's.
> 
> 
> on which machine?  I can't reproduce the behaviour...
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: SYN/ACK FIN/ACK
Date: Fri, 20 Feb 2004 14:32:14 -0800
Lines: 22
Distribution: su
Message-ID: <c161s1$7ov$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402201354420.5799-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077316290 7967 128.12.61.97 (20 Feb 2004 22:31: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:6169

Yeah, same situation after sending a SYN/ACK and expecting only an ACK, if
we receive a SYN/ACK should we ignore the SYN and pay attention only to the
ACK?

My guess is yes to both situations.

Oded
>
> Suppose we are expecting only a SYN (ie...in LISTEN state)
> but we get a SYN/ACK
>
> Should we treat this as a condition to ignore the SYN/ACK, or should
> we accept the SYN part of this packet and ignore only the ACK.
>
> This situation arised in multiple cases accross multiple states, so
> just wanted to clear this up before proceeding
>
> --v
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Unable to run test script
Date: Sat, 21 Feb 2004 06:29:55 +0800
Lines: 17
Distribution: su
Message-ID: <40368A63.60FDD7C1@leland.stanford.edu>
References: <c13s1f$68s$1@news.Stanford.EDU> <40362A4F.E50E01A4@leland.stanford.edu> <c15pkt$qh2$1@news.Stanford.EDU> <c15pqm$r01$1@news.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077316332 8003 128.12.196.85 (20 Feb 2004 22:32:12 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6170

I was running on elaine29. And the weird thing is, I tried just running the
command:
/usr/class/cs244a/grading_script/hw3/server_no_retrans  -p
/afs/ir.stanford.edu/users/h/c/hcpang/cs244a/hw3/grading_src/build/.server_port

which I think is supposed to start the test server, but the command just
returns. I don't know if that's expected, or that explains why we get the
server not responding error.

Jimmy

Matthew Jonathan Holliman wrote:

> >one more to the list... exact same output as tyrone's.
>
> on which machine?  I can't reproduce the behaviour...

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: FIN bit set: return any pending RECEIVES ...
Date: Fri, 20 Feb 2004 15:01:09 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.GSO.4.44.0402201457050.16868-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 1077318071 10047 171.64.15.118 (20 Feb 2004 23:01:11 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6171


In RFC793 (pg 75),

===
If the FIN bit is set, (1) signal the user "connection closing" and
(2) return any pending RECEIVES with same message, ...
===

Does (1) mean setting proper errno, and unblocking the user?

What does (2) mean?  What is the pending RECEIVES?  what is the "same
message"?  "return any pending RECEIVES..." to who?








.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: FIN and the last packet of data
Date: Fri, 20 Feb 2004 15:08:05 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0402201504360.16868-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 1077318488 10576 171.64.15.118 (20 Feb 2004 23:08:08 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6172


Assume the FIN bit is set for the last packet of data.
This packet of data has a length of 10, however, the receiver window is
only 5 byte long.  So the last 5 byte of data will be discarded, right?
What about the FIN bit?  Should it be processed or discarded?


.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Unable to run test script
Date: Fri, 20 Feb 2004 23:11:34 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c16476$adh$1@news.Stanford.EDU>
References: <c13s1f$68s$1@news.Stanford.EDU> <40362A4F.E50E01A4@leland.stanford.edu> <c15pkt$qh2$1@news.Stanford.EDU> <c15pqm$r01$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine5.stanford.edu
X-Trace: news.Stanford.EDU 1077318694 10673 171.64.15.70 (20 Feb 2004 23:11:34 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:6173

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

> on which machine?  I can't reproduce the behaviour...

It happens to me on every elaine I've tried it on.  Perhaps it is a permissions issue?

Alternatively, is there anyone for whom the script DOES work?  Perhaps a diff on the code 
might provide a clue...

Tyrone
.

Path: shelby.stanford.edu!elaine17.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Unable to run test script
Date: Fri, 20 Feb 2004 15:51:35 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.GSO.4.44.0402201550530.23968-100000@elaine17.Stanford.EDU>
References: <c13s1f$68s$1@news.Stanford.EDU> <40362A4F.E50E01A4@leland.stanford.edu>
 <c15pkt$qh2$1@news.Stanford.EDU> <c15pqm$r01$1@news.Stanford.EDU>
 <c16476$adh$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine17.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077321097 13920 171.64.15.82 (20 Feb 2004 23:51:37 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c16476$adh$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6174

Same here, cannot run the test script, give me infinite loop and i have to
explicitly kill it.

Lin

On Fri, 20 Feb 2004, Tyrone Nicholas wrote:

> Matthew Jonathan Holliman <holliman@stanford.edu> wrote:
>
> > on which machine?  I can't reproduce the behaviour...
>
> It happens to me on every elaine I've tried it on.  Perhaps it is a permissions issue?
>
> Alternatively, is there anyone for whom the script DOES work?  Perhaps a diff on the code
> might provide a clue...
>
> Tyrone
>

.

Path: shelby.stanford.edu!not-for-mail
From: David Yu Chen <dychen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Modifying context_t?
Date: Sat, 21 Feb 2004 00:08:23 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c167hn$cf1$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1077322103 12769 171.64.15.69 (21 Feb 2004 00:08:23 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:6175

How are we allowed to modify context_t?  Clearly we need to keep 
initial_sequence_num.  Do we need to keep or make use of done or 
connection_state for the grading scripts to work?  

Thanks

---
David Yu Chen
http://www.stanford.edu/~dychen/
.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: APP send data only in CSTATE_ESTABLISHED?
Date: Fri, 20 Feb 2004 16:16:59 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.GSO.4.44.0402201615200.19777-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 1077322621 16026 171.64.15.118 (21 Feb 2004 00:17:01 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6176

Can we assume that ONLY when the connection state is CSTATE_ESTABLISHED,
would the applcation send data?



.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: User receive positive acknowlegemnet for buffers that have been sent
Date: Fri, 20 Feb 2004 17:32:42 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.GSO.4.44.0402201730230.22436-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 1077327164 25096 171.64.15.118 (21 Feb 2004 01:32:44 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6177


RFC793 (Page 78)

===
Established State

..... User should receive positive acknowledgements for buffers which have
been sent and fully acknowledged (...

....

===

Are we required to do this?  If yes, how?



.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ACK for unsent data
Date: Fri, 20 Feb 2004 17:44:32 -0800
Lines: 7
Distribution: su
Message-ID: <c16d4h$pu0$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1077327825 26560 128.12.189.163 (21 Feb 2004 01:43: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:6178

Hi,
If I get an ACK for data which is greater than the sender window, ie data I
never sent, do I just ignore it, or what is the required processing?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Unable to run test script
Date: Sat, 21 Feb 2004 02:07:25 +0000 (UTC)
Lines: 23
Distribution: su
Message-ID: <c16egt$ruk$1@news.Stanford.EDU>
References: <c13s1f$68s$1@news.Stanford.EDU> <40362A4F.E50E01A4@leland.stanford.edu> <c15pkt$qh2$1@news.Stanford.EDU> <c15pqm$r01$1@news.Stanford.EDU> <40368A63.60FDD7C1@leland.stanford.edu>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077329245 28628 171.64.15.103 (21 Feb 2004 02:07:25 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6179


>which I think is supposed to start the test server, but the command just
>returns. I don't know if that's expected, or that explains why we get the
>server not responding error.

no, that's expected behaviour--it runs only from inside the test script.

I don't have a theory for what's going on--a couple of people have
posted on here or e-mailed me that they pass all tests for part (A),
so that would seem to rule out permissions as a problem.

I tried changing the way in which it starts the server slightly, although
I'd be surprised if this changed anything--but you can give it a shot.
If this still doesn't fix the problem:

(1) Can you let me know what 'set' and 'env' show for you?  What shell
    are you running?

(2) If I don't find anything suspicious in the environment/shell variables,
    I can come in to Sweet Hall tomorrow afternoon to try and debug this
    with someone who consistently sees this behaviour.  As I can't
    reproduce it, I can't debug the problem by myself...

.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Milestone A
Date: Sat, 21 Feb 2004 02:08:35 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c16ej3$s3m$1@news.Stanford.EDU>
References: <c15rhv$t73$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077329315 28790 171.64.15.103 (21 Feb 2004 02:08:35 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6180


>If we can pass the test script, should we submit the assignment?  I've got
>some edge conditions which I know are not yet handled properly (things like
>weird packets received in certain states).  Can these be completed after
>milestone A?

sure, that sounds fine...

.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: SYN/ACK FIN/ACK
Date: Sat, 21 Feb 2004 02:10:52 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <c16enc$sge$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402201354420.5799-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077329452 29198 171.64.15.103 (21 Feb 2004 02:10:52 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6181


>Suppose we are expecting only a SYN (ie...in LISTEN state)
>but we get a SYN/ACK

>Should we treat this as a condition to ignore the SYN/ACK, or should
>we accept the SYN part of this packet and ignore only the ACK.

You definitely shouldn't accept it--it's obviously not a valid packet
for your connection (what could it be ACKing?)  Normal TCP would send
a RST here, but we just bury our heads in the sand on these kinds of
issues... so dropping the packet is fine.

.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: SYN/ACK FIN/ACK
Date: Sat, 21 Feb 2004 02:14:12 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c16etk$sml$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402201354420.5799-100000@elaine31.Stanford.EDU> <c161s1$7ov$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077329652 29397 171.64.15.103 (21 Feb 2004 02:14:12 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6182


>Yeah, same situation after sending a SYN/ACK and expecting only an ACK, if
>we receive a SYN/ACK should we ignore the SYN and pay attention only to the
>ACK?

it would take a really broken TCP stack to send this to you--but if the ACK
corresponds to what you were expecting, and the seq # is correct from
the other side, I guess you should accept it.  (if either of those is
violated, of course you just ignore it as usual).
.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: FIN bit set: return any pending RECEIVES ...
Date: Sat, 21 Feb 2004 02:16:46 +0000 (UTC)
Lines: 20
Distribution: su
Message-ID: <c16f2e$t20$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402201457050.16868-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077329806 29760 171.64.15.103 (21 Feb 2004 02:16:46 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6183




>If the FIN bit is set, (1) signal the user "connection closing" and
>(2) return any pending RECEIVES with same message, ...

>Does (1) mean setting proper errno, and unblocking the user?

>What does (2) mean?  What is the pending RECEIVES?  what is the "same
>message"?  "return any pending RECEIVES..." to who?

No--the user is notified that the other side has shutdown its end of
the connection for writing by the fact that myread() returns 0.
You indicate this by stcp_fin_received(), once all pending data's
been passed up to the app.

If you look at the implementation of myread(), you'll see that (2) is
handled already in there--once you let the socket layer know that a
FIN's been received, it takes care of always returning 0 to the user...

.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: FIN and the last packet of data
Date: Sat, 21 Feb 2004 02:19:45 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c16f81$a$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402201504360.16868-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077329985 10 171.64.15.103 (21 Feb 2004 02:19:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6184



>Assume the FIN bit is set for the last packet of data.
>This packet of data has a length of 10, however, the receiver window is
>only 5 byte long.  So the last 5 byte of data will be discarded, right?
>What about the FIN bit?  Should it be processed or discarded?

well, it would take a very broken TCP stack to generate such a segment.
but if you did encounter such a case, remember that the FIN indicator
occupies one byte of sequence space (at the end of the sequence space
covered by the packet's data).  since you ack only up through the
first five bytes of the packet, what interpretation makes sense?

.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Modifying context_t?
Date: Sat, 21 Feb 2004 02:22:02 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c16fca$71$1@news.Stanford.EDU>
References: <c167hn$cf1$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077330122 225 171.64.15.103 (21 Feb 2004 02:22:02 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6185


>How are we allowed to modify context_t?  Clearly we need to keep 
>initial_sequence_num.  Do we need to keep or make use of done or 
>connection_state for the grading scripts to work?  

You can change the context however you like--obviously, you need to
make sure you use the specified ISN when FIXED_INITNUM is defined,
but anything else is fair game.  There's really no reason to keep
done or connection_state if you don't feel like it.

Basically, as long as the ISN is the same, and there are still
transport_init() and our_dprintf(), you can change transport.c in any way
you see fit.

.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: APP send data only in CSTATE_ESTABLISHED?
Date: Sat, 21 Feb 2004 02:22:39 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c16fdf$96$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402201615200.19777-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077330159 294 171.64.15.103 (21 Feb 2004 02:22:39 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6186


>Can we assume that ONLY when the connection state is CSTATE_ESTABLISHED,
>would the applcation send data?

no--what about when the other side's sent a FIN?

.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: User receive positive acknowlegemnet for buffers that have been sent
Date: Sat, 21 Feb 2004 02:24:38 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c16fh6$eu$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402201730230.22436-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077330278 478 171.64.15.103 (21 Feb 2004 02:24:38 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6187



>.... User should receive positive acknowledgements for buffers which have
>been sent and fully acknowledged (...


Again:  We are *not* implementing TCP!  We're implementing STCP, which
happens to do just enough to be able to talk to TCP.

The real socket layer doesn't even implement that section that you
mention, as far as I know.  The mysocket interfaces we provide certainly
don't support it...

.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ACK for unsent data
Date: Sat, 21 Feb 2004 02:25:28 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c16fio$h7$1@news.Stanford.EDU>
References: <c16d4h$pu0$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077330328 551 171.64.15.103 (21 Feb 2004 02:25:28 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6188


>If I get an ACK for data which is greater than the sender window, ie data I
>never sent, do I just ignore it, or what is the required processing?

Regular TCP would send a RST, since it's a packet that's apparently not
intended for the current connection.  Since we ignore these errors,
ignoring the packet is the most reasonable course of action.

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: myaccept: Invalid argument
Date: Fri, 20 Feb 2004 19:06:53 -0800
Lines: 10
Distribution: su
Message-ID: <c16i0r$415$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077332828 4133 128.12.61.97 (21 Feb 2004 03:07: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:6189

I keep getting an "invalid argument" error for myaccept.  I think I've
narrowed it down to calling stcp_network_recv() by the passive server with
the socket descriptor passed into transport_init.  Is there something I'm
not understanding about the mysock layer?  Is the sd passed to
transport_init not the one I should be trying to receive through?

Thanks,
Oded


.

Path: shelby.stanford.edu!elaine17.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: myaccept: Invalid argument
Date: Sat, 21 Feb 2004 04:00:33 +0000 (UTC)
Lines: 19
Distribution: su
Message-ID: <c16l51$7vi$1@news.Stanford.EDU>
References: <c16i0r$415$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine17.stanford.edu
X-Trace: news.Stanford.EDU 1077336033 8178 171.64.15.82 (21 Feb 2004 04:00:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6190


>I keep getting an "invalid argument" error for myaccept.  I think I've
>narrowed it down to calling stcp_network_recv() by the passive server with
>the socket descriptor passed into transport_init.  Is there something I'm
>not understanding about the mysock layer?  Is the sd passed to
>transport_init not the one I should be trying to receive through?

your understanding is correct; the sd passed in to transport_init() is the
one you use for stcp_network_send()/stcp_network_recv()/etc.

do you mean myaccept() indicates EINVAL?  the only reason I could
see for that happening were if 'listening' were false for that
socket for some reason.

(on the passive side, your transport layer thread actually starts when a
SYN arrives for a listening socket--the only interaction there should be
between your transport layer and myaccept occurs in the blocking/unblocking
of the accept call).

.

Path: shelby.stanford.edu!elaine8.Stanford.EDU!spathak
From: Sumedh Pathak <spathak@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Hanging on ftpcopy
Date: Fri, 20 Feb 2004 20:33:23 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.GSO.4.44.0402202029270.11480-100000@elaine8.Stanford.EDU>
NNTP-Posting-Host: elaine8.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077338004 10629 171.64.15.73 (21 Feb 2004 04:33:24 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6191


hi,

Im trying to get my code working with an outside implementation of tcp. I
tried using the supplied ftpcopy_tcp to connect to some outside ftp
servers. (ftp.microsoft.com, ftp.lcs.mit.edu).

However, once I send the SYN packet, it just hangs. I dont receive any
SYN-ACK.
I set the flag to SYN, the initial sequence no, and window size. I also
set the ack to 0.

Is there something im missing?

thanks,
Sumedh

.

Path: shelby.stanford.edu!elaine39.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Hanging on ftpcopy
Date: Sat, 21 Feb 2004 04:46:39 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <c16nrf$bcl$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402202029270.11480-100000@elaine8.Stanford.EDU>
NNTP-Posting-Host: elaine39.stanford.edu
X-Trace: news.Stanford.EDU 1077338799 11669 171.64.15.114 (21 Feb 2004 04:46:39 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6192



ftpcopy_tcp?  that uses the simulated datagram layer.  you need to
use the VNS/IP network layer to talk to real TCP.

.

Path: shelby.stanford.edu!epic11.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: APP_CLOSE_REQUESTED
Date: Fri, 20 Feb 2004 20:47:21 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.GSO.4.44.0402202044400.18327-100000@epic11.Stanford.EDU>
NNTP-Posting-Host: epic11.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077338842 11715 171.64.15.44 (21 Feb 2004 04:47:22 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6193

The assignment states that we should take particular
care of sending out all of USER's data before sending
a FIN if user requested to close the connection.

However, I don't understand why special care is needed.
If you look at stcp_wait_for_event implementation,
it won't return event APP_CLOSE_REQUESTED until we
drain all of user's data.  So how would it be possible
for us to screw up and send FIN before getting all
of user's data out.

Boris.

.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine33.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: APP_CLOSE_REQUESTED
Date: 20 Feb 2004 21:43:11 -0800
Organization: Stanford University, CA, USA
Lines: 25
Distribution: su
Message-ID: <snnznbdj8cw.fsf@elaine33.Stanford.EDU>
References: <Pine.GSO.4.44.0402202044400.18327-100000@epic11.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077342191 12623 171.64.15.108 (21 Feb 2004 05:43:11 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:6194

The statement isn't refering to draining app to stcp data but rather
draining stcp to peer data.  You could have unacknowledged data waiting in
your send window.  You want there to be no data there before sending the
FIN.

I'll have to check with Matthew, but I believe stcp_wait_for_event only
guarantees that you won't get an APP_CLOSE_REQUESTED while the app still
has data to send.

Susan

Boris Senderzon <senderzo@stanford.edu> writes:

> The assignment states that we should take particular
> care of sending out all of USER's data before sending
> a FIN if user requested to close the connection.
> 
> However, I don't understand why special care is needed.
> If you look at stcp_wait_for_event implementation,
> it won't return event APP_CLOSE_REQUESTED until we
> drain all of user's data.  So how would it be possible
> for us to screw up and send FIN before getting all
> of user's data out.
> 
> Boris.
.

Path: shelby.stanford.edu!elaine35.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: APP_CLOSE_REQUESTED
Date: Sat, 21 Feb 2004 05:55:51 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c16rt7$gd8$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402202044400.18327-100000@epic11.Stanford.EDU>
NNTP-Posting-Host: elaine35.stanford.edu
X-Trace: news.Stanford.EDU 1077342951 16808 171.64.15.110 (21 Feb 2004 05:55:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6195


>The assignment states that we should take particular
>care of sending out all of USER's data before sending
>a FIN if user requested to close the connection.

This is leftover from an older version of the assignment, where FINs
didn't have sequence numbers and would just cause immediate termination
of the connection (no 4-way handshake).  Since the protocol was changed
this year to be compatible with TCP, the statement no longer really
applies.

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Required Paths of State-Diagram to Support
Date: Fri, 20 Feb 2004 22:43:21 -0800
Lines: 21
Distribution: su
Message-ID: <4036FE08.21F7CF2F@stanford.edu>
NNTP-Posting-Host: dnab4082e3.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077345860 19834 171.64.130.227 (21 Feb 2004 06:44:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6196

I just want to confirm what we are required to support for STCP.  I am
using the state diagram from p. 241 of TCP/IP Illustrated Volume 1 by W.
Richard Stevens as a reference.

Are we required to support only the lines that indicate normal
transitions for client and normal transitions for server?

Specifically this means we do not need to support:
    LISTEN to SYN_SENT (already talked about this - simultaneous open)
    SYN_SENT to SYN_RCVS (again already talked about this - simultaneous
open)
    SYN_RCV to LISTEN (again already discussed this - RST)
    SYN_RCVD to FIN_WAIT 1 (our application is blocked so not possible)
    FIN_WAIT_1  to CLOSING (simultanous close)
    FIN_WAIT_1 to CLOSED (simulteous close)

I guess then what I am really asking is should we support simultaneous
close?



.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Checksum Assert / Truncated Packets
Date: Fri, 20 Feb 2004 23:34:25 -0800
Lines: 6
Distribution: su
Message-ID: <40370A01.F0CD93A4@stanford.edu>
NNTP-Posting-Host: dnab4082e3.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077348923 22654 171.64.130.227 (21 Feb 2004 07:35:23 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6197

Is it accpetable (for both Milestones A and where actually applicable in
Milestone B) to only read from the network when the receiver window is
at least the size of the maximum packet?  This avoids the problem of
reading too little from the packet and having that packet get truncated
(and subsequently causing the checksum to fail).

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: myaccept: Invalid argument
Date: Sat, 21 Feb 2004 00:13:18 -0800
Lines: 31
Distribution: su
Message-ID: <c173vc$p8i$1@news.Stanford.EDU>
References: <c16i0r$415$1@news.Stanford.EDU> <c16l51$7vi$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077351212 25874 128.12.61.97 (21 Feb 2004 08:13: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:6198

> do you mean myaccept() indicates EINVAL?  the only reason I could
> see for that happening were if 'listening' were false for that
> socket for some reason.

The would be my guess.

> (on the passive side, your transport layer thread actually starts when a
> SYN arrives for a listening socket--the only interaction there should be
> between your transport layer and myaccept occurs in the
blocking/unblocking
> of the accept call).

Yeah, I gathered that transport_init on the server is only called after the
SYN packet is sent.  But I still need to read that SYN packet using
stcp_network_recv( sd, buffer, sizeof( STCPHeader ) ), and that's where I'm
getting the error.  Here's a snippet of the code for the passive side:

receive_header = (STCPHeader *)malloc( sizeof( STCPHeader ) );
event_flag = stcp_wait_for_event( sd, NETWORK_DATA, NULL );
if( stcp_network_recv( sd, receive_header, sizeof( STCPHeader ) ) < 0 ){
  /* error */
}

When I comment out stcp_network_recv, no error.  Passive side shows
"connected to 171.64.15.130 at port #####".  When I put it back in, I get
the myaccept error without the "connected to..." output.

Thanks,
Oded


.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Implement sending 1 byte with 0 advertised window?
Date: Sat, 21 Feb 2004 00:35:10 -0800
Lines: 8
Distribution: su
Message-ID: <4037183D.BD762891@stanford.edu>
NNTP-Posting-Host: dnab4082e3.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077352569 27679 171.64.130.227 (21 Feb 2004 08:36:09 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6199

If a slow application has received all data but is really slow it will
send us an advertised window of 0.  Then all data is sent, receiver
window is 0, and so no more data will be sent.  Since no more data sent,
no more acks will be received.  Do we need to implement the fix of
periodically sending 1 byte packets and wiating to see a larger receiver
window (p. 392-393 of the textbook).  Or is that beyond the scope of
htis project?

.

Path: shelby.stanford.edu!not-for-mail
From: Kirk Shimano <kshimano@stanford.edu>
Newsgroups: su.class.cs244a
Subject: FIN packets and reference server
Date: Sat, 21 Feb 2004 04:51:10 -0800
Lines: 15
Distribution: su
Message-ID: <c17k86$ctt$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 1077367878 13245 128.12.41.60 (21 Feb 2004 12:51:18 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:6200

If the last packet in the server contains both data and the FIN flag, do 
we set our ack value based only on the size of the data, or do we need 
to add an extra byte for the FIN?

For example, if the last packet begins at sequence number 10, has a 
payload of 5, and has a FIN flag, do we ack 15 or 16?

Also, is there any way for us to try sending files to the reference 
server directly, without going through the grading script? My client 
works fine with my own server, but when I run test 1.C, I get an 
Unexpected exit status -1, even though the client outputs 
"TESTDATA.0,110230,Ok". If I were able to do some testing with the 
reference server directly, it would be a huge help in figuring out just 
what is going wrong there...

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftpcopy
Date: Sat, 21 Feb 2004 07:03:14 -0800
Lines: 6
Distribution: su
Message-ID: <40377332.EF37AA5@stanford.edu>
NNTP-Posting-Host: dnab4082e3.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077375857 20696 171.64.130.227 (21 Feb 2004 15:04:17 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6201

I am testing with ftpd_tcp and ftpcopy_tcp (trying to test my closing
process).  What would cause the following result?

elaine31~/cs244a>hw3/ftpcopy_tcp h 0 34001@elaine31
ERROR: 550 transport.h: Not a directory. (-5)

.

Path: shelby.stanford.edu!not-for-mail
From:  user@domain.invalid
Newsgroups: su.class.cs244a
Subject: Failed to use testscript
Date: Sat, 21 Feb 2004 07:29:42 -0800
Lines: 9
Distribution: su
Message-ID: <c17th6$llf$1@news.Stanford.EDU>
NNTP-Posting-Host: firebird7.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077377382 22191 171.64.15.21 (21 Feb 2004 15:29:42 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:6202

I eventually arrive at an infinite loop in which the following is repeated:

warning:  server not responding, retrying
Starting server: /usr/class/cs244a/grading_script/hw3/server_no_retrans 
  -p 
/afs/ir.stanford.edu/users/r/y/ryan05/cs244a/hw3/grading_src/build/.server_port 
2>&1 > 
/afs/ir.stanford.edu/users/r/y/ryan05/cs244a/hw3/grading_src/build/.server_output

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: (Failed....)
Date: Sat, 21 Feb 2004 07:29:25 -0800
Lines: 2
Distribution: su
Message-ID: <40377955.A791FD7D@stanford.edu>
NNTP-Posting-Host: dnab4082e3.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077377428 22301 171.64.130.227 (21 Feb 2004 15:30:28 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6203

Sorry my username did not post right - that was me.

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Required Paths of State-Diagram to Support
Date: Sat, 21 Feb 2004 16:54:40 +0000 (UTC)
Lines: 23
Distribution: su
Message-ID: <c182gg$qs8$1@news.Stanford.EDU>
References: <4036FE08.21F7CF2F@stanford.edu>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1077382480 27528 171.64.15.118 (21 Feb 2004 16:54:40 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6204


>Specifically this means we do not need to support:
>    LISTEN to SYN_SENT (already talked about this - simultaneous open)
>    SYN_SENT to SYN_RCVS (again already talked about this - simultaneous
>open)
>    SYN_RCV to LISTEN (again already discussed this - RST)
>    SYN_RCVD to FIN_WAIT 1 (our application is blocked so not possible)
>    FIN_WAIT_1  to CLOSING (simultanous close)
>    FIN_WAIT_1 to CLOSED (simulteous close)

>I guess then what I am really asking is should we support simultaneous
>close?

I don't have that book, so I can't check against the diagram you mention.
But FIN_WAIT_1 to CLOSING isn't an unusual case.  And there's nothing
in the TCP connection state diagram in the RFC to show how you'd
progress immediately from FIN_WAIT_1 to CLOSED.

So my answer is yes--FINs can be queued etc. so you could conceivably
encounter some of these cases (whereas you wouldn't encounter the
simultaneous open cases).  It shouldn't be much work to support these few
state transitions.

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Checksum Assert / Truncated Packets
Date: Sat, 21 Feb 2004 16:56:53 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c182kl$qvt$1@news.Stanford.EDU>
References: <40370A01.F0CD93A4@stanford.edu>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1077382613 27645 171.64.15.118 (21 Feb 2004 16:56:53 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6205


>Is it accpetable (for both Milestones A and where actually applicable in
>Milestone B) to only read from the network when the receiver window is
>at least the size of the maximum packet?  This avoids the problem of
>reading too little from the packet and having that packet get truncated
>(and subsequently causing the checksum to fail).

Well, your receiver window is a fixed size in this assignment, anyway,
always bigger than the size of the maximum length packet.  So I find
your question confusing.

But the answer is no; you should handle data from the network as it comes in.

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Implement sending 1 byte with 0 advertised window?
Date: Sat, 21 Feb 2004 16:57:54 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <c182mi$r18$1@news.Stanford.EDU>
References: <4037183D.BD762891@stanford.edu>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1077382674 27688 171.64.15.118 (21 Feb 2004 16:57:54 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6206


>If a slow application has received all data but is really slow it will
>send us an advertised window of 0.  Then all data is sent, receiver
>window is 0, and so no more data will be sent.  Since no more data sent,
>no more acks will be received.  Do we need to implement the fix of
>periodically sending 1 byte packets and wiating to see a larger receiver
>window (p. 392-393 of the textbook).  Or is that beyond the scope of
>htis project?

It doesn't really matter--it's very easy to implement the 1-byte segment
fix (probably just one line of code) anyway...

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: FIN packets and reference server
Date: Sat, 21 Feb 2004 16:59:21 +0000 (UTC)
Lines: 25
Distribution: su
Message-ID: <c182p9$r2u$1@news.Stanford.EDU>
References: <c17k86$ctt$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1077382761 27742 171.64.15.118 (21 Feb 2004 16:59:21 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6207


>If the last packet in the server contains both data and the FIN flag, do 
>we set our ack value based only on the size of the data, or do we need 
>to add an extra byte for the FIN?

The FIN always has a byte of the sequence number space assigned to it.

>For example, if the last packet begins at sequence number 10, has a 
>payload of 5, and has a FIN flag, do we ack 15 or 16?

This has been asked (and answered) before on the newsgroup (more than
once)...

>Also, is there any way for us to try sending files to the reference 
>server directly, without going through the grading script? My client 
>works fine with my own server, but when I run test 1.C, I get an 
>Unexpected exit status -1, even though the client outputs 
>"TESTDATA.0,110230,Ok". If I were able to do some testing with the 
>reference server directly, it would be a huge help in figuring out just 
>what is going wrong there...

You can cross-check against standard TCP as you develop.  There are
instructions on doing this in HW4, and this was discussed in yesterday's
review session too.

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: myaccept: Invalid argument
Date: Sat, 21 Feb 2004 17:01:51 +0000 (UTC)
Lines: 22
Distribution: su
Message-ID: <c182tv$rco$1@news.Stanford.EDU>
References: <c16i0r$415$1@news.Stanford.EDU> <c16l51$7vi$1@news.Stanford.EDU> <c173vc$p8i$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1077382911 28056 171.64.15.118 (21 Feb 2004 17:01:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6208


>The would be my guess.

Okay, but does gdb support the theory?

>Yeah, I gathered that transport_init on the server is only called after the
>SYN packet is sent.  But I still need to read that SYN packet using
>stcp_network_recv( sd, buffer, sizeof( STCPHeader ) ), and that's where I'm
>getting the error.  Here's a snippet of the code for the passive side:

>receive_header = (STCPHeader *)malloc( sizeof( STCPHeader ) );
>event_flag = stcp_wait_for_event( sd, NETWORK_DATA, NULL );
>if( stcp_network_recv( sd, receive_header, sizeof( STCPHeader ) ) < 0 ){
>  /* error */
>}

>When I comment out stcp_network_recv, no error.  Passive side shows
>"connected to 171.64.15.130 at port #####".  When I put it back in, I get
>the myaccept error without the "connected to..." output.

Does Purify show any errors?

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ack details
Date: Sat, 21 Feb 2004 10:47:19 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.GSO.4.44.0402211044540.19806-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 1077389241 4868 171.64.15.106 (21 Feb 2004 18:47:21 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6209


"Received data which has a sequence number higher than that of the last
byte of the receiver window is discarded and remains unacknowledged"

Lets say rcvr is expecting seqnum 10, and window size is 5

and we get data from peer starting at seqnum 20...this is out
of the range of our window, so we discard the data...but should we still
send an ACK w/ ack=10 to let the sender know what we're expecting next?

--vishal

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: FINWAIT-1
Date: Sat, 21 Feb 2004 11:39:47 -0800
Lines: 6
Distribution: su
Message-ID: <Pine.GSO.4.44.0402211136450.20711-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 1077392388 8420 171.64.15.106 (21 Feb 2004 19:39:48 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6210


If we receive a FIN/ACK segment in state FINWAIT-1,
should we jump directly to CLOSED state?

--v

.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: myaccept: Invalid argument
Date: Sat, 21 Feb 2004 12:08:31 -0800
Lines: 55
Distribution: su
Message-ID: <c18ds5$9vp$1@news.Stanford.EDU>
References: <c16i0r$415$1@news.Stanford.EDU> <c16l51$7vi$1@news.Stanford.EDU> <c173vc$p8i$1@news.Stanford.EDU> <c182tv$rco$1@news.Stanford.EDU>
NNTP-Posting-Host: gatesb02-pc17.stanford.edu
X-Trace: news.Stanford.EDU 1077394117 10233 172.24.65.36 (21 Feb 2004 20:08: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:6211

I am getting exactly the same error. The error is occuring exactly at the
place where the passive(server) tries to call stcp_network_recv so that it
can get the SYN packet from the active(client) side. I printed out the value
of errno before and after this function call and it came out to be 0 and
EINVAL respectively. Running purify on the server side does not tell me
where the crash is occuring...it just says program exited with status code 1
and there is some amount of memory leakage, which I suspect occurs because
the control flow gets aborted all of a sudden in between the function. Weird
thing is on the client side, I never see the message "connected to <server
ip addr> at port ####" but yet, the client side enters the ">client" prompt
(which i guess implies that the 3-way handshake completed successfully).
Also when I try to print out the states I am in both on the server and
client side, it clearly shows me the transitions from
CLOSED->LISTEN->SYN_RCVD->ESTABLISHED for server, and
CLOSED->LISTEN->SYN_SENT->ESTABLISHED for the client, ie, somehow I do reach
the ESTABLISHED state, yet the server side terminates with the error:
"myaccept: Invalid argument".

Could some one please shed a light on what is going wrong? I am not able to
make any progress on the assignment since I am stuck on this part. Funny
thing is that my 3 way handshake was working perfectly last night, and this
morning I just added some ntohX function calls at some places....Do not see
why it would start giving this error because of the above change.

Thanks

Kumar
"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c182tv$rco$1@news.Stanford.EDU...
>
> >The would be my guess.
>
> Okay, but does gdb support the theory?
>
> >Yeah, I gathered that transport_init on the server is only called after
the
> >SYN packet is sent.  But I still need to read that SYN packet using
> >stcp_network_recv( sd, buffer, sizeof( STCPHeader ) ), and that's where
I'm
> >getting the error.  Here's a snippet of the code for the passive side:
>
> >receive_header = (STCPHeader *)malloc( sizeof( STCPHeader ) );
> >event_flag = stcp_wait_for_event( sd, NETWORK_DATA, NULL );
> >if( stcp_network_recv( sd, receive_header, sizeof( STCPHeader ) ) < 0 ){
> >  /* error */
> >}
>
> >When I comment out stcp_network_recv, no error.  Passive side shows
> >"connected to 171.64.15.130 at port #####".  When I put it back in, I get
> >the myaccept error without the "connected to..." output.
>
> Does Purify show any errors?
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: recv buffer-Milestone A
Date: Sat, 21 Feb 2004 12:16:26 -0800
Lines: 9
Distribution: su
Message-ID: <c18e9n$ahk$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1077394551 10804 128.12.189.163 (21 Feb 2004 20:15: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:6212

Hi,
The RFC says weshould buffer all incoming data.Since I can make sure that my
receiver reads all data before proceding, and that all data I am currently
receiving is in order, is it ok , if for Milestone A I do not buffer the
data.I guess this buffering concerns out-of-order data.
Thanks,
Haripriya


.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: struct timespec
Date: Sat, 21 Feb 2004 13:50:49 -0800
Lines: 58
Distribution: su
Message-ID: <Pine.GSO.4.44.0402211348040.14250-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0402180910001.23128-100000@elaine35.Stanford.EDU>
 <Pine.LNX.4.44.0402180946540.21624-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 1077400251 17047 171.64.15.118 (21 Feb 2004 21:50:51 GMT)
X-Complaints-To: news@news.stanford.edu
Cc: Lin Chan <linchan@stanford.edu>
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0402180946540.21624-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6213

What is the routine to get the current time in timespec?

I found the following routine:
extern void gethrestime(timespec_t *);

However, I could not "man" it, neither could I compile with this function.

Are we supposed to use the gettimeofday() and then fill in timespec
structure?  This doesn't soun very elegant.



On Wed, 18 Feb 2004, Martin Casado wrote:

>
>  timespec uses a nanosecond field instead of microseconds which timeval uses.
>
> struct timespec
>   {
>     time_t tv_sec;        /* Seconds.  */
>     long int tv_nsec;       /* Nanoseconds.  */
>   };
>
> struct timeval {
>     time_t      tv_sec;     /* seconds */
>     long    tv_usec;    /* and microseconds */
> };
>
>
>
> sys/time.h (on linux) defines the following
>
> /* Macros for converting between `struct timeval' and `struct timespec'.  */
> # define TIMEVAL_TO_TIMESPEC(tv, ts) {                                   \
>         (ts)->tv_sec = (tv)->tv_sec;                                    \
>         (ts)->tv_nsec = (tv)->tv_usec * 1000;                           \
> }
> # define TIMESPEC_TO_TIMEVAL(tv, ts) {                                   \
>         (tv)->tv_sec = (ts)->tv_sec;                                    \
>         (tv)->tv_usec = (ts)->tv_nsec / 1000;                           \
> }
>
> I'm not sure if solaris has an equivalent set of macros
>
> .m
>
> > The stcp_wait_for_event take a struct timespec as input, however time()
> > returns time_t and gettimeofday() returns struct timeval. Are these struct
> > the same thing? Or we have to explicitly convert them ourselves?
> >
> > Thanks
> >
> > Lin
> >
> >
>
>

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: scripts down
Date: Sat, 21 Feb 2004 22:05:25 +0000 (UTC)
Lines: 3
Distribution: su
Message-ID: <c18kn5$hh9$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077401125 17961 171.64.15.116 (21 Feb 2004 22:05:25 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6214

I'm taking the scripts down for a bit to fix the problems reported on
the newsgroup--I'll post when they're back up...

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: receive queue only for outoforder packet?
Date: Sat, 21 Feb 2004 14:24:17 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0402211421530.14839-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 1077402259 19185 171.64.15.118 (21 Feb 2004 22:24:19 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6215


Since we can send data packet to the application as soon as we receive
from the network,  the receive queue is only used to queue the out of
order packet.  Is this true?  If not, what is the other scenario where the
received packets need to be queued up?

-Laura

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: ***scripts up!***
Date: Sat, 21 Feb 2004 22:28:11 +0000 (UTC)
Lines: 3
Distribution: su
Message-ID: <c18m1r$iso$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077402491 19352 171.64.15.116 (21 Feb 2004 22:28:11 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6216


okay, the problem reported on here *should* be fixed now.  happy testing!

.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test 1.I
Date: Sat, 21 Feb 2004 14:56:52 -0800
Lines: 12
Distribution: su
Message-ID: <c18nnn$km2$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1077404216 21186 127.0.0.1 (21 Feb 2004 22:56: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:6217

The test script says  "No FIN Sent" for this test.  I looked through the
logs that the grading script stores in my subdirectories and it does look
like there are no FINs sent for TESTDATA.1 for both the server and the
client.  The FINs are sent for the other test cases, though, and if I run
the client and server  from the testing subdirectories with TESTDATA.1, I
can see that the FINs are being generated.

What's this test doing and how do I find the root cause of the missing
FIN's?



.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: More test script problem: Unrecognized assertion
Date: Sat, 21 Feb 2004 15:01:16 -0800
Lines: 34
Distribution: su
Message-ID: <Pine.GSO.4.44.0402211455380.16347-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 1077404495 21656 171.64.15.118 (21 Feb 2004 23:01:35 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6218


See the following test script output.  It shows that there is an assertion
failed at transport.c:1840.  The odd thing is that my transport.c only
have 1021 lines and I don't even have those variable such as:
ctx->last_byte_acked or ctx->advertised_receiver_window

What is wrong?

==
Assertion failed: segment->seq_num + segment->data_len <=
ctx->last_byte_acked +
 ctx->advertised_receiver_window + 1, file transport.c, line 1840
=More details=

Starting server: /usr/class/cs244a/grading_script/hw3/server_no_retrans
-p /afs
/ir.stanford.edu/users/x/x/xxf5/cs244/hw3/grading_src/build/.server_port
2>&1 >
/afs/ir.stanford.edu/users/x/x/xxf5/cs244/hw3/grading_src/build/.server_output^M
Server started^M
Starting client: ./client  -p .server_port -f TESTDATA.0 foo^M
connected to 171.64.15.118 at port 60663^M
client: TESTDATA.0^M
Assertion failed: segment->seq_num + segment->data_len <=
ctx->last_byte_acked +
 ctx->advertised_receiver_window + 1, file transport.c, line 1840^M
Abort^M
warning:  client exited with non-zero status (-1)^M
program output:^M
***Timeout expired during grading^M
Program output:^M
server: TESTDATA.0,110230,Ok^M


.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: myaccept: Invalid argument
Date: Sat, 21 Feb 2004 15:29:16 -0800
Lines: 60
Distribution: su
Message-ID: <c18pkg$mvi$1@news.Stanford.EDU>
References: <c16i0r$415$1@news.Stanford.EDU> <c16l51$7vi$1@news.Stanford.EDU> <c173vc$p8i$1@news.Stanford.EDU> <c182tv$rco$1@news.Stanford.EDU> <c18ds5$9vp$1@news.Stanford.EDU>
NNTP-Posting-Host: gatesb02-pc17.stanford.edu
X-Trace: news.Stanford.EDU 1077406160 23538 172.24.65.36 (21 Feb 2004 23:29: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:6219

After struggling for nearly 4 hours with trying to figure out what is
causing this problem, I gave up and took a break and then logged into an
elaine machine (I was previously working on saga)...and surprise surprise,
the myaccept problem does not occur on elaine!!! To confirm this bizarre
behavior, I logged into 3 other saga machines and tried running the server
and client there, and they all gave me the myaccept:Invalid argument error.
But when I tried on 2-3 other elaine machines, I received no error and the 3
way handshake completed successfully with the server side displaying the
message "connected to <server ip addr> at port ####". What's happening here?
Is it some endianness problem? I really doubt that because as I pointed out
in my earlier post, the problem is not occuring due to endianness but while
calling stcp_network_recv. I just feel miserable having wasted so many hours
on something which might turn out not to be a problem with my code at all!
People who have got this errors, could they please confirm this behavior.
Any comments/insights from the TAs would be really helpful as well.

Thanks

Kumar


"Murali Kumar" <kumarm@stanford.edu> wrote in message
news:c18ds5$9vp$1@news.Stanford.EDU...
> I am getting exactly the same error. The error is occuring exactly at the
> place where the passive(server) tries to call stcp_network_recv so that it
> can get the SYN packet from the active(client) side. I printed out the
value
> of errno before and after this function call and it came out to be 0 and
> EINVAL respectively. Running purify on the server side does not tell me
> where the crash is occuring...it just says program exited with status code
1
> and there is some amount of memory leakage, which I suspect occurs because
> the control flow gets aborted all of a sudden in between the function.
Weird
> thing is on the client side, I never see the message "connected to <server
> ip addr> at port ####" but yet, the client side enters the ">client"
prompt
> (which i guess implies that the 3-way handshake completed successfully).
> Also when I try to print out the states I am in both on the server and
> client side, it clearly shows me the transitions from
> CLOSED->LISTEN->SYN_RCVD->ESTABLISHED for server, and
> CLOSED->LISTEN->SYN_SENT->ESTABLISHED for the client, ie, somehow I do
reach
> the ESTABLISHED state, yet the server side terminates with the error:
> "myaccept: Invalid argument".
>
> Could some one please shed a light on what is going wrong? I am not able
to
> make any progress on the assignment since I am stuck on this part. Funny
> thing is that my 3 way handshake was working perfectly last night, and
this
> morning I just added some ntohX function calls at some places....Do not
see
> why it would start giving this error because of the above change.
>
> Thanks
>
> Kumar


.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: myaccept: Invalid argument
Date: Sat, 21 Feb 2004 23:33:25 +0000 (UTC)
Lines: 16
Distribution: su
Message-ID: <c18ps5$ndt$1@news.Stanford.EDU>
References: <c16i0r$415$1@news.Stanford.EDU> <c16l51$7vi$1@news.Stanford.EDU> <c173vc$p8i$1@news.Stanford.EDU> <c182tv$rco$1@news.Stanford.EDU> <c18ds5$9vp$1@news.Stanford.EDU> <c18pkg$mvi$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1077406405 23997 171.64.15.72 (21 Feb 2004 23:33:25 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6220


>After struggling for nearly 4 hours with trying to figure out what is
>causing this problem, I gave up and took a break and then logged into an
>elaine machine (I was previously working on saga)...and surprise surprise,
>the myaccept problem does not occur on elaine!!! To confirm this bizarre
>behavior, I logged into 3 other saga machines and tried running the server
>and client there, and they all gave me the myaccept:Invalid argument error.
>But when I tried on 2-3 other elaine machines, I received no error and the 3
>way handshake completed successfully with the server side displaying the
>message "connected to <server ip addr> at port ####". What's happening here?

Weird--
But the reference client/server work without problems on the saga machines.
If you want, you can mail me your transport.c and I'll take a look to
confirm it isn't a problem in the stub code somewhere.

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Client exited with nonzero status
Date: Sat, 21 Feb 2004 23:39:24 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c18q7c$n0j$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077406764 23571 171.64.15.103 (21 Feb 2004 23:39: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:6221

When running Test 1.B, I get the following:

warning: client exited with non-zero status (256)

This is given as the reason for the test failing.  The trouble is that 
1.B is a test of the server, not the client.

Even assuming that a bug in the server is somehow causing the *reference 
client* to exit with an error code, what does the 256 value represent?  It 
doesn't seem to be the exit code of the application, since all calls to 
exit() in the provided code have argument 0 or 1.

Tyrone

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Client exited with nonzero status
Date: Sat, 21 Feb 2004 15:55:01 -0800
Lines: 27
Distribution: su
Message-ID: <Pine.GSO.4.44.0402211553330.28200-100000@elaine31.Stanford.EDU>
References: <c18q7c$n0j$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 1077407702 26530 171.64.15.106 (21 Feb 2004 23:55:02 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c18q7c$n0j$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6222

Same here. Got that test failed for (256) exit code. Don't understand what
is happening.

Also, seems it stopped after reporting test 1.J. Is that the last test?

Thanks

Lin

On Sat, 21 Feb 2004, Tyrone Nicholas wrote:

> When running Test 1.B, I get the following:
>
> warning: client exited with non-zero status (256)
>
> This is given as the reason for the test failing.  The trouble is that
> 1.B is a test of the server, not the client.
>
> Even assuming that a bug in the server is somehow causing the *reference
> client* to exit with an error code, what does the 256 value represent?  It
> doesn't seem to be the exit code of the application, since all calls to
> exit() in the provided code have argument 0 or 1.
>
> Tyrone
>
>

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: myaccept: Invalid argument
Date: Sun, 22 Feb 2004 00:52:26 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <c18uga$34p$1@news.Stanford.EDU>
References: <c16i0r$415$1@news.Stanford.EDU> <c16l51$7vi$1@news.Stanford.EDU> <c173vc$p8i$1@news.Stanford.EDU> <c182tv$rco$1@news.Stanford.EDU> <c18ds5$9vp$1@news.Stanford.EDU> <c18pkg$mvi$1@news.Stanford.EDU> <c18ps5$ndt$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1077411146 3225 171.64.15.72 (22 Feb 2004 00:52:26 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6223


I found the cause (although not the explanation).

On the sagas, gethostbyname_r() sometimes sets errno=EINVAL as a side
effect even on a successful return.  I'm not sure why, as these functions
should set h_errno on failure--I can only guess this is a result of the
internal implementation.  (Let this be a lesson of the evils of globals!!!)

Of course, that value of errno propagates back up to the calling thread via
stcp_unblock_application(), hence the myaccept() return value.

If you set errno=0 after that call in network_io_socket.c (which I've
changed the stub code to do), the problem is fixed.  (It happened
when you called stcp_network_recv(), since the function checks the TCP
checksum, which indirectly invokes gethostbyname_r()).

Quite why this happens on the sagas, but not on the elaines, I'm not sure...

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ack details
Date: Sun, 22 Feb 2004 00:53:33 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c18uid$36a$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402211044540.19806-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1077411213 3274 171.64.15.72 (22 Feb 2004 00:53:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6224



>"Received data which has a sequence number higher than that of the last
>byte of the receiver window is discarded and remains unacknowledged"

>Lets say rcvr is expecting seqnum 10, and window size is 5

>and we get data from peer starting at seqnum 20...this is out
>of the range of our window, so we discard the data...but should we still
>send an ACK w/ ack=10 to let the sender know what we're expecting next?

seems reasonable, doesn't it?

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: recv buffer-Milestone A
Date: Sun, 22 Feb 2004 00:56:11 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c18unb$3a6$1@news.Stanford.EDU>
References: <c18e9n$ahk$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1077411371 3398 171.64.15.72 (22 Feb 2004 00: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:6225


>The RFC says weshould buffer all incoming data.Since I can make sure that my
>receiver reads all data before proceding, and that all data I am currently
>receiving is in order, is it ok , if for Milestone A I do not buffer the
>data.I guess this buffering concerns out-of-order data.

it's up to you.  you have to implement buffering at some point, so it
doesn't make sense to take shortcuts that would cause you to spend more
time implementing it properly later on...

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: receive queue only for outoforder packet?
Date: Sun, 22 Feb 2004 00:56:45 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c18uod$3bf$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402211421530.14839-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1077411405 3439 171.64.15.72 (22 Feb 2004 00:56:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6226



>Since we can send data packet to the application as soon as we receive
>from the network,  the receive queue is only used to queue the out of
>order packet.  Is this true?

yes.

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Client exited with nonzero status
Date: Sun, 22 Feb 2004 01:03:16 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c18v4k$3pe$1@news.Stanford.EDU>
References: <c18q7c$n0j$1@news.Stanford.EDU> <Pine.GSO.4.44.0402211553330.28200-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1077411796 3886 171.64.15.72 (22 Feb 2004 01:03:16 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6227


>Same here. Got that test failed for (256) exit code. Don't understand what
>is happening.

this is a status code (waitpid result)--exit code is found in the upper
8 bits, so this *is* an exit code of 1.

>Also, seems it stopped after reporting test 1.J. Is that the last test?

yep.

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ack details
Date: Sat, 21 Feb 2004 17:04:05 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.GSO.4.44.0402211701160.20003-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0402211044540.19806-100000@elaine31.Stanford.EDU>
 <c18uid$36a$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077411847 3922 171.64.15.118 (22 Feb 2004 01:04:07 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
In-Reply-To: <c18uid$36a$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6228


I don't agree.  As specified in the assignement:

Section - "Ack Packets", last bullet:

Acknowledgement are only sent for the last contiguous received peiece of
data ...  Acknoledgement can not be sent because of the gap at
sequence number....


Could one of TA clarify on this?


On Sun, 22 Feb 2004, Matthew Jonathan Holliman wrote:

>
>
> >"Received data which has a sequence number higher than that of the last
> >byte of the receiver window is discarded and remains unacknowledged"
>
> >Lets say rcvr is expecting seqnum 10, and window size is 5
>
> >and we get data from peer starting at seqnum 20...this is out
> >of the range of our window, so we discard the data...but should we still
> >send an ACK w/ ack=10 to let the sender know what we're expecting next?
>
> seems reasonable, doesn't it?
>
>

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ack details
Date: Sun, 22 Feb 2004 01:06:42 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c18vb2$40o$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402211044540.19806-100000@elaine31.Stanford.EDU>  <c18uid$36a$1@news.Stanford.EDU> <Pine.GSO.4.44.0402211701160.20003-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1077412002 4120 171.64.15.72 (22 Feb 2004 01:06:42 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6229



>Acknowledgement are only sent for the last contiguous received peiece of
>data ...  Acknoledgement can not be sent because of the gap at
>sequence number....

The last contiguous received piece of data ends at seq #9.  thus
the receiver sends an ACK w/th_ack=10.

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test 1.I
Date: Sun, 22 Feb 2004 01:09:06 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <c18vfi$45r$1@news.Stanford.EDU>
References: <c18nnn$km2$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1077412146 4283 171.64.15.72 (22 Feb 2004 01:09:06 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6230


>The test script says  "No FIN Sent" for this test.  I looked through the
>logs that the grading script stores in my subdirectories and it does look
>like there are no FINs sent for TESTDATA.1 for both the server and the
>client.  The FINs are sent for the other test cases, though, and if I run
>the client and server  from the testing subdirectories with TESTDATA.1, I
>can see that the FINs are being generated.

>What's this test doing and how do I find the root cause of the missing
>FIN's?

All it does is run the client/server pair, logging packets, and checking
that a FIN was sent.  It doesn't do anything special beyond that.

TESTDATA.1 is the longest of the subcases--perhaps your code doesn't
run to completion in time?  is it only the FINs that are missing,
or are other packets missing from the log too?

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Initial sequence number
Date: Sun, 22 Feb 2004 01:21:51 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c1907f$4s5$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077412911 4997 171.64.15.103 (22 Feb 2004 01:21: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:6231

Test 1.E fails with

Invalid SYN sequence number 16838

Why is this invalid?  I thought any 32-bit integer can be used as the 
initial sequence number.

The manpages say that the srand() and rand() functions are not 
thread-safe; does that matter in this case (using them to generate the 
initial sequence)?

Tyrone

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: About that test script problem...
Date: Sun, 22 Feb 2004 01:36:40 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c19137$628$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077413800 6216 171.64.15.103 (22 Feb 2004 01:36:40 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:6232

Given that that effectively made testing impossible for at least two days
(in my case), could the 5-test daily limit be raised, just for this
milestone?

Tyrone

.

Path: shelby.stanford.edu!elaine18.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Initial sequence number
Date: Sun, 22 Feb 2004 02:13:51 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <c1938v$8s8$1@news.Stanford.EDU>
References: <c1907f$4s5$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine18.stanford.edu
X-Trace: news.Stanford.EDU 1077416031 9096 171.64.15.83 (22 Feb 2004 02:13:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6233


>Why is this invalid?  I thought any 32-bit integer can be used as the 
>initial sequence number.

Please read the assignment description again.

>The manpages say that the srand() and rand() functions are not 
>thread-safe; does that matter in this case (using them to generate the 
>initial sequence)?

You should use a thread-safe function, such as rand_r().

.

Path: shelby.stanford.edu!elaine18.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: About that test script problem...
Date: Sun, 22 Feb 2004 02:15:46 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c193ci$908$1@news.Stanford.EDU>
References: <c19137$628$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine18.stanford.edu
X-Trace: news.Stanford.EDU 1077416146 9224 171.64.15.83 (22 Feb 2004 02:15:46 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6234


>Given that that effectively made testing impossible for at least two days
>(in my case), could the 5-test daily limit be raised, just for this
>milestone?

I just removed the affected test runs for today, so people who had this
problem weren't penalised for today, i.e. if you used two runs when the
script was down, you still have those two runs remaining today.

So the answer to your question is, no.

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ack details
Date: Sat, 21 Feb 2004 18:36:28 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.GSO.4.44.0402211833210.24477-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0402211044540.19806-100000@elaine31.Stanford.EDU>
  <c18uid$36a$1@news.Stanford.EDU> <Pine.GSO.4.44.0402211701160.20003-100000@elaine43.Stanford.EDU>
 <c18vb2$40o$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077417391 10743 171.64.15.118 (22 Feb 2004 02:36:31 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
In-Reply-To: <c18vb2$40o$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6235


I guess I was not clear on my question.

The question is:

At the time that is decribed by the assignment, Section "ACK Packets",
last bullet, should any acknowlegement be sent out at all for this
out-of-order packet?

My interpretation is that no acknowlegement should be sent!

On Sun, 22 Feb 2004, Matthew Jonathan Holliman wrote:

>
>
> >Acknowledgement are only sent for the last contiguous received peiece of
> >data ...  Acknoledgement can not be sent because of the gap at
> >sequence number....
>
> The last contiguous received piece of data ends at seq #9.  thus
> the receiver sends an ACK w/th_ack=10.
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Joshua M Silver <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test 1.I
Date: Sat, 21 Feb 2004 18:46:24 -0800
Lines: 28
Distribution: su
Message-ID: <40381800.6070807@stanford.edu>
References: <c18nnn$km2$1@news.Stanford.EDU> <c18vfi$45r$1@news.Stanford.EDU>
NNTP-Posting-Host: epic0.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077417985 11342 171.64.15.51 (22 Feb 2004 02:46:25 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.1) Gecko/20020827
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6236

Matthew Jonathan Holliman wrote:
>>The test script says  "No FIN Sent" for this test.  I looked through the
>>logs that the grading script stores in my subdirectories and it does look
>>like there are no FINs sent for TESTDATA.1 for both the server and the
>>client.  The FINs are sent for the other test cases, though, and if I run
>>the client and server  from the testing subdirectories with TESTDATA.1, I
>>can see that the FINs are being generated.
> 
> 
>>What's this test doing and how do I find the root cause of the missing
>>FIN's?
> 
> 
> All it does is run the client/server pair, logging packets, and checking
> that a FIN was sent.  It doesn't do anything special beyond that.
> 
> TESTDATA.1 is the longest of the subcases--perhaps your code doesn't
> run to completion in time?  is it only the FINs that are missing,
> or are other packets missing from the log too?
> 


Argh.  I was afraid of that.  It just passed when I ran it on a faster, 
unloaded, machine.  On the test that failed, it looks like it timed out 
after 60seconds. Is that how long the test script waits before it kills 
the processes?


.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ack details
Date: Sun, 22 Feb 2004 03:10:57 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c196k1$cpg$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402211044540.19806-100000@elaine31.Stanford.EDU>   <c18uid$36a$1@news.Stanford.EDU> <Pine.GSO.4.44.0402211701160.20003-100000@elaine43.Stanford.EDU>  <c18vb2$40o$1@news.Stanford.EDU> <Pine.GSO.4.44.0402211833210.24477-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
X-Trace: news.Stanford.EDU 1077419457 13104 171.64.15.106 (22 Feb 2004 03:10:57 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6237


>I guess I was not clear on my question.

Ah, I see what you're referring to.  That's poor wording in the assignment--
it should say an acknowledgement for the incoming packet can't be sent.
Usual TCP behaviour would send the (duplicate) ACK for seq#10 again.

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test 1.I
Date: Sun, 22 Feb 2004 03:12:20 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c196mk$cu1$1@news.Stanford.EDU>
References: <c18nnn$km2$1@news.Stanford.EDU> <c18vfi$45r$1@news.Stanford.EDU> <40381800.6070807@stanford.edu>
NNTP-Posting-Host: elaine31.stanford.edu
X-Trace: news.Stanford.EDU 1077419540 13249 171.64.15.106 (22 Feb 2004 03:12:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6238


>Argh.  I was afraid of that.  It just passed when I ran it on a faster, 
>unloaded, machine.  On the test that failed, it looks like it timed out 
>after 60seconds. Is that how long the test script waits before it kills 
>the processes?

Yes.  60s should be more than long enough for any of those subcases to
run, so there's something a bit weird going on in your code somewhere...

.

Path: shelby.stanford.edu!not-for-mail
From: Joshua M Silver <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test 1.I
Date: Sat, 21 Feb 2004 19:12:35 -0800
Lines: 25
Distribution: su
Message-ID: <40381E23.6000506@stanford.edu>
References: <c18nnn$km2$1@news.Stanford.EDU> <c18vfi$45r$1@news.Stanford.EDU>
NNTP-Posting-Host: epic0.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077419556 13263 171.64.15.51 (22 Feb 2004 03:12:36 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.1) Gecko/20020827
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6239

Matthew Jonathan Holliman wrote:
>>The test script says  "No FIN Sent" for this test.  I looked through the
>>logs that the grading script stores in my subdirectories and it does look
>>like there are no FINs sent for TESTDATA.1 for both the server and the
>>client.  The FINs are sent for the other test cases, though, and if I run
>>the client and server  from the testing subdirectories with TESTDATA.1, I
>>can see that the FINs are being generated.
> 
> 
>>What's this test doing and how do I find the root cause of the missing
>>FIN's?
> 
> 
> All it does is run the client/server pair, logging packets, and checking
> that a FIN was sent.  It doesn't do anything special beyond that.
> 
> TESTDATA.1 is the longest of the subcases--perhaps your code doesn't
> run to completion in time?  is it only the FINs that are missing,
> or are other packets missing from the log too?
> 

Argh.  I was afraid of that.  It just passed when I ran it on a faster, 
unloaded, machine.  On the one that failed, it looks like it timed out 
after 60seconds. Is that when the test script kills the processes?

.

Path: shelby.stanford.edu!not-for-mail
From: Joshua M Silver <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test 1.I
Date: Sat, 21 Feb 2004 19:13:46 -0800
Lines: 23
Distribution: su
Message-ID: <c196pa$cuf$2@news.Stanford.EDU>
References: <c18nnn$km2$1@news.Stanford.EDU> <c18vfi$45r$1@news.Stanford.EDU>
NNTP-Posting-Host: epic0.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077419627 13263 171.64.15.51 (22 Feb 2004 03:13:47 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.1) Gecko/20020827
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6240

Matthew Jonathan Holliman wrote:
>>The test script says  "No FIN Sent" for this test.  I looked through the
>>logs that the grading script stores in my subdirectories and it does look
>>like there are no FINs sent for TESTDATA.1 for both the server and the
>>client.  The FINs are sent for the other test cases, though, and if I run
>>the client and server  from the testing subdirectories with TESTDATA.1, I
>>can see that the FINs are being generated.
> 
> 
>>What's this test doing and how do I find the root cause of the missing
>>FIN's?
> 
> 
> All it does is run the client/server pair, logging packets, and checking
> that a FIN was sent.  It doesn't do anything special beyond that.
> 
> TESTDATA.1 is the longest of the subcases--perhaps your code doesn't
> run to completion in time?  is it only the FINs that are missing,
> or are other packets missing from the log too?
> 
Argh... I think you're right.  It now passes on a faster, unloaded 
machine.  Does the testscript time out after 60seconds.

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Question about testing script output?
Date: Sat, 21 Feb 2004 19:43:19 -0800
Lines: 13
Distribution: su
Message-ID: <40382557.FDE33621@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077421400 15200 128.12.21.88 (22 Feb 2004 03:43:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6241

What is the cause of the following output from the testing script?


Test 1.C [out of 10]
Checks reference Tx (server) against student Rx (client).

Results:  NOT OK

Unexpected exit status -1.  Program output:
***Timeout expired during grading
Program output:
server: TESTDATA.0,110230,Ok

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Another testscript question
Date: Sat, 21 Feb 2004 20:09:59 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.GSO.4.44.0402212008550.22119-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 1077423001 16858 171.64.15.100 (22 Feb 2004 04:10:01 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6242


Starting server:
/afs/ir.stanford.edu/users/v/i/vishalp/private/cs244a/ass3/grading_src/build/server
-p
/afs/ir.stanford.edu/users/v/i/vishalp/private/cs244a/ass3/grading_src/build/.server_port
2>&1 >
/afs/ir.stanford.edu/users/v/i/vishalp/private/cs244a/ass3/grading_src/build/.server_output
Server started
Starting client: ./client  -p .server_port -f TESTDATA.2 foo
connected to 171.64.15.100 at port 45460
client: TESTDATA.2
Killed

What does "Killed" mean...does that mean something is timing out and my
code is hanging somewhere...should we pay attention to these, or just
focus on the summary at the end?

--vishal

.

Path: shelby.stanford.edu!elaine17.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Question about testing script output?
Date: Sun, 22 Feb 2004 04:22:56 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <c19ar0$hb2$1@news.Stanford.EDU>
References: <40382557.FDE33621@stanford.edu>
NNTP-Posting-Host: elaine17.stanford.edu
X-Trace: news.Stanford.EDU 1077423776 17762 171.64.15.82 (22 Feb 2004 04:22:56 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6243


>What is the cause of the following output from the testing script?

It means your client timed out for some reason--could be that it
didn't finish in time (60s), might be that it didn't process the FIN
exchange correctly, could be some other random reason that doesn't occur to
me offhand...

(The fact that you received the initial server response says that you
connected okay, and at least received the first packet from the server.
So your problem probably lies somewhere further on than that).

.

Path: shelby.stanford.edu!elaine17.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Another testscript question
Date: Sun, 22 Feb 2004 04:23:42 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c19ase$hbv$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402212008550.22119-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine17.stanford.edu
X-Trace: news.Stanford.EDU 1077423822 17791 171.64.15.82 (22 Feb 2004 04:23:42 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6244



>What does "Killed" mean...does that mean something is timing out and my
>code is hanging somewhere...should we pay attention to these, or just
>focus on the summary at the end?

It doesn't mean anything useful--the script just kills the server at the
end of the test case... you can just look at the summary.
.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Want to confirm...
Date: Sat, 21 Feb 2004 20:35:16 -0800
Lines: 3
Distribution: su
Message-ID: <40383184.F3A2E6F0@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077424517 18471 128.12.21.88 (22 Feb 2004 04:35:17 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6245

I just wanted to confirm that milestones A and B were graded only on
functionality (only milestone C grades style right?)

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: One more testcript question
Date: Sat, 21 Feb 2004 20:36:44 -0800
Lines: 23
Distribution: su
Message-ID: <403831DC.3C93FC19@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077424605 18471 128.12.21.88 (22 Feb 2004 04:36:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6246

Is the following output ok (specifically the Warning: unable to close
filehandle KID_TO_READ properly)?


Testing input file TESTDATA.0

Starting server:
/afs/ir.stanford.edu/users/r/y/ryan05/cs244a/hw3/grading_src/build/./server.log

 -p
/afs/ir.stanford.edu/users/r/y/ryan05/cs244a/hw3/grading_src/build/.server_port

2>&1 >
/afs/ir.stanford.edu/users/r/y/ryan05/cs244a/hw3/grading_src/build/.server_output

Server started
Starting client: ./client.log  -p .server_port -f TESTDATA.0 foo
Warning: unable to close filehandle KID_TO_READ properly.
connected to 171.64.15.114 at port 58015
client: TESTDATA.0
Killed
Testing input file TESTDATA.1

.

Path: shelby.stanford.edu!elaine17.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: One more testcript question
Date: Sun, 22 Feb 2004 04:39:15 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c19bpj$ia7$1@news.Stanford.EDU>
References: <403831DC.3C93FC19@stanford.edu>
NNTP-Posting-Host: elaine17.stanford.edu
X-Trace: news.Stanford.EDU 1077424755 18759 171.64.15.82 (22 Feb 2004 04:39:15 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6247


>Is the following output ok (specifically the Warning: unable to close
>filehandle KID_TO_READ properly)?

Yes, you can ignore this message.

.

Path: shelby.stanford.edu!elaine17.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Want to confirm...
Date: Sun, 22 Feb 2004 04:39:58 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c19bqu$ibb$1@news.Stanford.EDU>
References: <40383184.F3A2E6F0@stanford.edu>
NNTP-Posting-Host: elaine17.stanford.edu
X-Trace: news.Stanford.EDU 1077424798 18795 171.64.15.82 (22 Feb 2004 04:39:58 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6248


>I just wanted to confirm that milestones A and B were graded only on
>functionality (only milestone C grades style right?)

Yes--but we'll be able to tell if you wrote horrible code for parts A
and B that you suddenly tried to make nice for part C! :-)

.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Fix ftpd_tcp for PASV command
Date: Sun, 22 Feb 2004 05:45:04 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c19fl0$m3l$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine37.stanford.edu
X-Trace: news.Stanford.EDU 1077428704 22645 171.64.15.112 (22 Feb 2004 05:45: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:6249

I used PASV for my ftpcopy in HW1. A PASV command on the ftpd_tcp daemon 
returns "0.0.0.0" as IP address always (it does return the correct port).
So when I try to connect, I get:

Assertion failed: dst_addr > 0, file tcp_sum.c, line 39
Abort

There was a post on the newsgroup (Thread 2, "Local Host IP Address on 
Linux"), where there's a good discussion on obtaining the local IP 
correctly. Could the TA please fix this? Otherwise I can't connect.

Thanks
Jason
.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Duplicate ACKs
Date: Sat, 21 Feb 2004 22:58:10 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0402212250470.18555-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 1077433092 27377 171.64.15.42 (22 Feb 2004 06:58:12 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6250

I was failing on 1.C during connection termination
until I realized that after client sends FIN to the server,
the server ACKs client's FIN in one packet (which is correct)
and then sends another packet containing both ACK and FIN fields.
The FIN was expected but not the ACK.
The th_ack field is the same in both packets.  What does
the referent server acknowledge the 2nd time? I did not send it
anything? Is this something that we should handle in milestone B?

Boris.

.

Path: shelby.stanford.edu!not-for-mail
From: "Tony Hsieh" <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: stcp_network_recv
Date: Sat, 21 Feb 2004 23:26:54 -0800
Lines: 12
Distribution: su
Message-ID: <c19lk3$soi$1@news.Stanford.EDU>
NNTP-Posting-Host: acc53af4.ipt.aol.com
X-Trace: news.Stanford.EDU 1077434821 29458 172.197.58.244 (22 Feb 2004 07:27: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:6251

I have a very simple question that i wanted to confirm.  When I call
stcp_network_recv(), I am receiving a packet of length up to the max buffer
length value I pass in right?  For example, say I put a STCP packet of 256
bytes (including header and options) onto the network, and then immediately
put another STCP packet of 256 bytes on the network.  On the receiver side,
when I call stcp_network_recv() with 536 bytes it returns with 256 bytes
read right?  Then if I call stcp_network_recv() I get the next 256 byte
packet? Thanks.

-Tony


.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: RePost: struct timespec
Date: Sat, 21 Feb 2004 23:31:06 -0800
Lines: 64
Distribution: su
Message-ID: <Pine.GSO.4.44.0402212330160.1630-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0402180910001.23128-100000@elaine35.Stanford.EDU>
 <Pine.LNX.4.44.0402180946540.21624-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402211348040.14250-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 1077435069 29770 171.64.15.118 (22 Feb 2004 07:31:09 GMT)
X-Complaints-To: news@news.stanford.edu
Cc: Lin Chan <linchan@stanford.edu>
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.GSO.4.44.0402211348040.14250-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6252

Could TA please asnwer the following question?

On Sat, 21 Feb 2004, Xiaohua Fang wrote:

> What is the routine to get the current time in timespec?
>
> I found the following routine:
> extern void gethrestime(timespec_t *);
>
> However, I could not "man" it, neither could I compile with this function.
>
> Are we supposed to use the gettimeofday() and then fill in timespec
> structure?  This doesn't soun very elegant.
>
>
>
> On Wed, 18 Feb 2004, Martin Casado wrote:
>
> >
> >  timespec uses a nanosecond field instead of microseconds which timeval uses.
> >
> > struct timespec
> >   {
> >     time_t tv_sec;        /* Seconds.  */
> >     long int tv_nsec;       /* Nanoseconds.  */
> >   };
> >
> > struct timeval {
> >     time_t      tv_sec;     /* seconds */
> >     long    tv_usec;    /* and microseconds */
> > };
> >
> >
> >
> > sys/time.h (on linux) defines the following
> >
> > /* Macros for converting between `struct timeval' and `struct timespec'.  */
> > # define TIMEVAL_TO_TIMESPEC(tv, ts) {                                   \
> >         (ts)->tv_sec = (tv)->tv_sec;                                    \
> >         (ts)->tv_nsec = (tv)->tv_usec * 1000;                           \
> > }
> > # define TIMESPEC_TO_TIMEVAL(tv, ts) {                                   \
> >         (tv)->tv_sec = (ts)->tv_sec;                                    \
> >         (tv)->tv_usec = (ts)->tv_nsec / 1000;                           \
> > }
> >
> > I'm not sure if solaris has an equivalent set of macros
> >
> > .m
> >
> > > The stcp_wait_for_event take a struct timespec as input, however time()
> > > returns time_t and gettimeofday() returns struct timeval. Are these struct
> > > the same thing? Or we have to explicitly convert them ourselves?
> > >
> > > Thanks
> > >
> > > Lin
> > >
> > >
> >
> >
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: jsilver <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: stcp_network_send
Date: Sun, 22 Feb 2004 00:01:59 -0800
Lines: 8
Distribution: su
Message-ID: <c19nln$1i2$1@news.Stanford.EDU>
NNTP-Posting-Host: epic20.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077436919 1602 171.64.15.55 (22 Feb 2004 08:01:59 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.1) Gecko/20020827
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6253

I'm curious about the interface stcp_network_send(mysocket_t sd, const 
void *src, size_t src_len, ...).  I assume this is so I can send 
multiple buffers to a single tcp packet without doing an extra malloc. 
I'd like to use this, but I don't know how many buffers I'll want to use 
until run-time.   Is there a way I could form this list dyanmically at 
runtime.  If not, wouldn't it be better to have an interface like
stcp_network_send(mysocket_t, void**)?

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Initial sequence number
Date: Sun, 22 Feb 2004 00:11:05 -0800
Lines: 17
Distribution: su
Message-ID: <c19o6v$2l6$1@news.Stanford.EDU>
References: <c1907f$4s5$1@news.Stanford.EDU> <c1938v$8s8$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077437471 2726 128.12.61.97 (22 Feb 2004 08:11: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:6254

Does {MT-Level,Safe} in the attributes list of the man page mean a function
is thread safe (specifically drand48)?

>
> >Why is this invalid?  I thought any 32-bit integer can be used as the
> >initial sequence number.
>
> Please read the assignment description again.
>
> >The manpages say that the srand() and rand() functions are not
> >thread-safe; does that matter in this case (using them to generate the
> >initial sequence)?
>
> You should use a thread-safe function, such as rand_r().
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Sliding windows and ACKs
Date: Sun, 22 Feb 2004 00:18:31 -0800
Lines: 30
Distribution: su
Message-ID: <c19okn$3bh$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1077437911 3441 128.12.173.169 (22 Feb 2004 08:18: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:6255

I have two questions regarding the bullet points listed in the assignment
description under the heading "Sliding Windows".

1. I am a little confused as to what exactly are we supposed to do when we
get a packet with a seq number < next_byte_expected from the network (ie,
seq no lower than the start of the receiver window). Bullet point 4 seems to
suggest that we should send an acknowledgment and drop the packet, but
bullet point 6 seems to suggest that we should be splitting the payload part
into two parts and handle those bytes in the payload which have a seq number
>= next_byte_expected. Am I interpreting bullet point 6 wrongly (it says
that received data may cross either end of the receiver window in which case
we need to split it) ? I looked up RFC 793 and it also suggests that we
should simply drop the packet and send an ack, but since we are not exactly
implementing TCP, I just wanted to confirm if the handling of this case was
any different in STCP than in TCP

2. Bullet point 5 says that if a received packet has seq no > last byte of
the receiver window, then we drop the packet and "it remains
unacknowledged". What does the last phrase(in quotes) imply? We do not send
any ack back? This again seems to be a deviation from what is written in RFC
793 (pg 68-69) where it says that whenever an incoming segment is
unacceptable, one must send an ack back still, which would seem to suggest
that even when the seq_no > rcv.nxt + rcv.wnd, an ack must be sent. Perhaps
I am again interpreting point 5 wrongly...the words are a bit misleading.

Thanks

Kumar


.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine39.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Initial sequence number
Date: 22 Feb 2004 00:42:05 -0800
Organization: Stanford University, CA, USA
Lines: 25
Distribution: su
Message-ID: <snn65dz4iaq.fsf@elaine39.Stanford.EDU>
References: <c1907f$4s5$1@news.Stanford.EDU> <c1938v$8s8$1@news.Stanford.EDU> <c19o6v$2l6$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine39.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077439325 4149 171.64.15.114 (22 Feb 2004 08:42:05 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:6256

"Oded Wurman" <owurman@stanford.edu> writes:

> Does {MT-Level,Safe} in the attributes list of the man page mean a function
> is thread safe (specifically drand48)?

From the appropriate man page:

     Safe  Safe is an attribute of code that can be called from a
           multithreaded  application. The effect of calling into
           a Safe interface or a safe code segment  is  that  the
           results   are  valid  even  when  called  by  multiple
           threads.  Often overlooked is the fact that the result
           of  this  Safe interface or safe code segment can have
           global consequences  that  affect  all  threads.   For
           example,  the action of opening or closing a file from
           one thread is visible by all the threads within a pro-
           cess.   A multi-threaded application has the responsi-
           bility for using these interfaces in  a  safe  manner,
           which  is  different from whether or not the interface
           is Safe.  For example,  a  multi-threaded  application
           that  closes  a  file  that  is  still in use by other
           threads  within  the  application  is  not  using  the
           close(2) interface safely.

Susan
.

Path: shelby.stanford.edu!not-for-mail
From: Jeremy Slade <jeremy@jkslade.net>
Newsgroups: su.class.cs244a
Subject: Re: RePost: struct timespec
Date: 22 Feb 2004 02:09:12 -0700
Lines: 82
Sender: jeremy@dad.jkslade.net
Distribution: su
Message-ID: <m3ad3bv5tz.fsf@dad.jkslade.net>
References: <Pine.GSO.4.44.0402180910001.23128-100000@elaine35.Stanford.EDU> <Pine.LNX.4.44.0402180946540.21624-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0402211348040.14250-100000@elaine43.Stanford.EDU> <Pine.GSO.4.44.0402212330160.1630-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077440941 4272 171.64.15.111 (22 Feb 2004 09:09:01 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)
Xref: shelby.stanford.edu su.class.cs244a:6257


I used clock_gettime() in hw2, but that is not an option for hw3a,
unfortunately -- it requires linking with librt (-lrt), which means
changing the Makefile, and that is not an option for this assignment.

It is simple enough to use gettimeofday and convert the timeval to a
timespec:

  struct timeval tv = { 0, 0 };
  gettimeofday ( &tv, 0 );
  struct timespec ts = { tv.tv_sec, tv.tv_usec*1000 };


Jeremy


> On Sat, 21 Feb 2004, Xiaohua Fang wrote:
> 
> > What is the routine to get the current time in timespec?
> >
> > I found the following routine:
> > extern void gethrestime(timespec_t *);
> >
> > However, I could not "man" it, neither could I compile with this function.
> >
> > Are we supposed to use the gettimeofday() and then fill in timespec
> > structure?  This doesn't soun very elegant.
> >
> >
> >
> > On Wed, 18 Feb 2004, Martin Casado wrote:
> >
> > >
> > >  timespec uses a nanosecond field instead of microseconds which timeval uses.
> > >
> > > struct timespec
> > >   {
> > >     time_t tv_sec;        /* Seconds.  */
> > >     long int tv_nsec;       /* Nanoseconds.  */
> > >   };
> > >
> > > struct timeval {
> > >     time_t      tv_sec;     /* seconds */
> > >     long    tv_usec;    /* and microseconds */
> > > };
> > >
> > >
> > >
> > > sys/time.h (on linux) defines the following
> > >
> > > /* Macros for converting between `struct timeval' and `struct timespec'.  */
> > > # define TIMEVAL_TO_TIMESPEC(tv, ts) {                                   \
> > >         (ts)->tv_sec = (tv)->tv_sec;                                    \
> > >         (ts)->tv_nsec = (tv)->tv_usec * 1000;                           \
> > > }
> > > # define TIMESPEC_TO_TIMEVAL(tv, ts) {                                   \
> > >         (tv)->tv_sec = (ts)->tv_sec;                                    \
> > >         (tv)->tv_usec = (ts)->tv_nsec / 1000;                           \
> > > }
> > >
> > > I'm not sure if solaris has an equivalent set of macros
> > >
> > > .m
> > >
> > > > The stcp_wait_for_event take a struct timespec as input, however time()
> > > > returns time_t and gettimeofday() returns struct timeval. Are these struct
> > > > the same thing? Or we have to explicitly convert them ourselves?
> > > >
> > > > Thanks
> > > >
> > > > Lin
> > > >
> > > >
> > >
> > >
> >
> >
> 

-- 
Jeremy Slade
jeremy@jkslade.net
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine39.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Fix ftpd_tcp for PASV command
Date: 22 Feb 2004 01:16:41 -0800
Organization: Stanford University, CA, USA
Lines: 21
Distribution: su
Message-ID: <snn1xon4gp2.fsf@elaine39.Stanford.EDU>
References: <c19fl0$m3l$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine39.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077441401 4149 171.64.15.114 (22 Feb 2004 09:16:41 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:6258

Jason Ying Li <jasonyli@Stanford.EDU> writes:

> I used PASV for my ftpcopy in HW1. A PASV command on the ftpd_tcp daemon 
> returns "0.0.0.0" as IP address always (it does return the correct port).
> So when I try to connect, I get:
> 
> Assertion failed: dst_addr > 0, file tcp_sum.c, line 39
> Abort
> 
> There was a post on the newsgroup (Thread 2, "Local Host IP Address on 
> Linux"), where there's a good discussion on obtaining the local IP 
> correctly. Could the TA please fix this? Otherwise I can't connect.
> 
> Thanks
> Jason

Let me get back to you on this, should be sometime Sunday.  I'm not an
expert on the test scripts and don't want to accidentally break it for
everyone in the process.

Susan
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine39.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: RePost: struct timespec
Date: 22 Feb 2004 01:41:53 -0800
Organization: Stanford University, CA, USA
Lines: 76
Distribution: su
Message-ID: <snnvflz30ym.fsf@elaine39.Stanford.EDU>
References: <Pine.GSO.4.44.0402180910001.23128-100000@elaine35.Stanford.EDU> <Pine.LNX.4.44.0402180946540.21624-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0402211348040.14250-100000@elaine43.Stanford.EDU> <Pine.GSO.4.44.0402212330160.1630-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine39.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077442913 4149 171.64.15.114 (22 Feb 2004 09:41: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:6259

Xiaohua Fang <xxf5@stanford.edu> writes:

I did some research...it looks like there are some functions like
clock_gettime() that update a timespec. It doesn't look like solaris has
the conversion macros (at least not in sys/time.h).  However, I don't see
why it's a big deal.  You can have two wrapper functions to set times as
necessary from the gettimeofday().  You could even re-create the
conversion macros.

Using gettimeofday() should be sufficient granularity.

Susan

> Could TA please asnwer the following question?
> 
> On Sat, 21 Feb 2004, Xiaohua Fang wrote:
> 
> > What is the routine to get the current time in timespec?
> >
> > I found the following routine:
> > extern void gethrestime(timespec_t *);
> >
> > However, I could not "man" it, neither could I compile with this function.
> >
> > Are we supposed to use the gettimeofday() and then fill in timespec
> > structure?  This doesn't soun very elegant.
> >
> >
> >
> > On Wed, 18 Feb 2004, Martin Casado wrote:
> >
> > >
> > >  timespec uses a nanosecond field instead of microseconds which timeval uses.
> > >
> > > struct timespec
> > >   {
> > >     time_t tv_sec;        /* Seconds.  */
> > >     long int tv_nsec;       /* Nanoseconds.  */
> > >   };
> > >
> > > struct timeval {
> > >     time_t      tv_sec;     /* seconds */
> > >     long    tv_usec;    /* and microseconds */
> > > };
> > >
> > >
> > >
> > > sys/time.h (on linux) defines the following
> > >
> > > /* Macros for converting between `struct timeval' and `struct timespec'.  */
> > > # define TIMEVAL_TO_TIMESPEC(tv, ts) {                                   \
> > >         (ts)->tv_sec = (tv)->tv_sec;                                    \
> > >         (ts)->tv_nsec = (tv)->tv_usec * 1000;                           \
> > > }
> > > # define TIMESPEC_TO_TIMEVAL(tv, ts) {                                   \
> > >         (tv)->tv_sec = (ts)->tv_sec;                                    \
> > >         (tv)->tv_usec = (ts)->tv_nsec / 1000;                           \
> > > }
> > >
> > > I'm not sure if solaris has an equivalent set of macros
> > >
> > > .m
> > >
> > > > The stcp_wait_for_event take a struct timespec as input, however time()
> > > > returns time_t and gettimeofday() returns struct timeval. Are these struct
> > > > the same thing? Or we have to explicitly convert them ourselves?
> > > >
> > > > Thanks
> > > >
> > > > Lin
> > > >
> > > >
> > >
> > >
> >
> >
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine39.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Duplicate ACKs
Date: 22 Feb 2004 01:57:34 -0800
Organization: Stanford University, CA, USA
Lines: 27
Distribution: su
Message-ID: <snnr7wn308h.fsf@elaine39.Stanford.EDU>
References: <Pine.GSO.4.44.0402212250470.18555-100000@epic9.Stanford.EDU>
NNTP-Posting-Host: elaine39.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077443854 4149 171.64.15.114 (22 Feb 2004 09:57: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:6260

Remember it's a four-way handshake on teardown.

Here's a good explanation of why the ACK is set with FIN:

since the connection is not yet torn down, it is always accompanied by the
ACK flag. A packet with only the FIN flag set is NOT legal and is likely
maliciously generated.

Review the RFC. I believe the ACK flag is actually stating the the ACK
field sequence number is significant.

Since teardown is fundamental to tcp/stcp, you need to handle this now.

Susan

Boris Senderzon <senderzo@stanford.edu> writes:

> I was failing on 1.C during connection termination
> until I realized that after client sends FIN to the server,
> the server ACKs client's FIN in one packet (which is correct)
> and then sends another packet containing both ACK and FIN fields.
> The FIN was expected but not the ACK.
> The th_ack field is the same in both packets.  What does
> the referent server acknowledge the 2nd time? I did not send it
> anything? Is this something that we should handle in milestone B?
> 
> Boris.
.

Path: shelby.stanford.edu!not-for-mail
From: Chris Edstrom <cedstrom@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test 1.J
Date: Sun, 22 Feb 2004 02:26:52 -0800
Organization: Stanford University
Lines: 24
Distribution: su
Message-ID: <pan.2004.02.22.10.26.52.637083@stanford.edu>
NNTP-Posting-Host: redux.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.Stanford.EDU 1077445612 11073 128.12.69.27 (22 Feb 2004 10:26:52 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:6261

So on running the grading script, I get:

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

Test 1.J [out of 14]
Checks student Tx (server) against student Rx (client).

Results:  NOT OK

Unexpected exit status -1.  Program output:
***Timeout expired during grading
Program output:
server: TESTDATA.0,110230,Ok

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

So it appeared that it actually worked, but the script doesn't think so. 
(I actually retried with the same data file, and it worked.)  However,
when the sending is completed, the server does not terminate, which, from
what I can gather from the server.c code is the proper behavior but which
the script seems to imply is the incorrect behavior.  Any insight into why
this is happening?

--Chris
.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ACK loss for SYN_RCVD state
Date: Sun, 22 Feb 2004 03:33:51 -0800
Lines: 21
Distribution: su
Message-ID: <c1a435$ef1$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402182144170.13469-100000@elaine25.Stanford.EDU> <c11nj4$5fd$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077449637 14817 128.12.61.97 (22 Feb 2004 11:33: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:6262

> >In the book, it says when the other side got my SYNACK, it will go to
> >establish state. Later when it sends a data packet, it will also set the
> >ACK bit so i can know the at later point my SYNACK is not lost. Do we
need
> >to handle this case?
>
> Yes, you should.  (Although having said that, it's unlikely that you'll
> actually encounter an ACK for a SYN-ACK that is piggybacked on data).

Actually, I think this is likely.  In fact, I believe it happened to my when
I was testing in unreliable mode (which I had forgotten I was doing).  Feel
free to correct me if I'm wrong... at 3:30 AM, anything is possible:

My SYN-ACK is sent, and my client's response ACK is lost.  I resend SYN-ACK
5 times, but since my client is no longer listening, it never sends another
ACK.  Thus, the first ACK my server will get will be when my client tries
sending data.

Oded


.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Following RFC 793 for handling segments arriving over the network
Date: Sun, 22 Feb 2004 08:15:09 -0800
Lines: 33
Distribution: su
Message-ID: <c1akid$24v$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1077466509 2207 128.12.173.169 (22 Feb 2004 16:15: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:6263

Hi,

I wanted to ask if it is ok to exactly follow the RFC 793 when we write code
to handle the segments that arrive over the network as detailed out on pg
65-76 in the RFC (ofcourse skipping over the RST, URG, and TIME_WAIT
details)? The reason I am unsure is because it has been said quite a few
times on the newsgroup that we are implementing STCP which is not exactly
TCP, and I am not sure what are all the possible differences between STCP
and TCP (especially in terms of handling segments that arrive over the
network).

Another related question I have is that on pg 72 of the RFC, for the SEGMENT
ARRIVES section, it says:

"fifth check the ACK field
  if the ACK bit is off drop the segment and return
...."

The part that bothers me a bit is about dropping the segment when the ACK
bit is off. If we follow the RFC algorithm, then the payload (segment data)
and FIN are checked ONLY AFTER this fifth step...so if the ACK bit is not
set, this seems to suggest that we should completely discard the data (which
makes sense to me), and the FIN as well (which is where i feel a bit
troubled). Is this correct? Should we completely ignore the FIN as well if
ACK is not set (in other words, does STCP allow for segments with FIN set
but not the ACK, and hence we would need to deviate a bit from the standard
procedure)?

Thanks

Kumar


.

Path: shelby.stanford.edu!epic12.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Client exited with nonzero status
Date: Sun, 22 Feb 2004 08:58:49 -0800
Lines: 31
Distribution: su
Message-ID: <Pine.GSO.4.44.0402220852440.23462-100000@epic12.Stanford.EDU>
References: <c18q7c$n0j$1@news.Stanford.EDU>
 <Pine.GSO.4.44.0402211553330.28200-100000@elaine31.Stanford.EDU>
 <c18v4k$3pe$1@news.Stanford.EDU>
NNTP-Posting-Host: epic12.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077469131 4274 171.64.15.45 (22 Feb 2004 16:58:51 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
In-Reply-To: <c18v4k$3pe$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6264


A couple of questions about this:

1. How similar is the "client" part of the code to the dummy client we
were given?  It would have to be functionally equivalent to interoperate
with our server, but I noticed that the args are different.

2. Can we get access to the client binary or output from the client?

Without this debugging why the client exits will be extremely difficult.
I suppose it is possible that you don't want us to have this information,
but I'd appreciate if this could at least be clarified.

Thanks,
Barrett

On Sun, 22 Feb 2004, Matthew Jonathan Holliman wrote:

>
> >Same here. Got that test failed for (256) exit code. Don't understand what
> >is happening.
>
> this is a status code (waitpid result)--exit code is found in the upper
> 8 bits, so this *is* an exit code of 1.
>
> >Also, seems it stopped after reporting test 1.J. Is that the last test?
>
> yep.
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: sumeet shendrikar <sumeets@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sending FIN after receiving close from application
Date: Sun, 22 Feb 2004 09:14:05 -0800
Lines: 22
Distribution: su
Message-ID: <c1ao0u$552$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-60149.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077470046 5282 128.12.197.131 (22 Feb 2004 17:14:06 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6265

question for anyone...

let's say a FIN has been sent and an ACK was received from the peer for 
the FIN.  But the peer continues to send data, which requires ACKs to be 
sent in response to the data.  Now.. would the FIN flag be set also for 
these ACKs? i.e. a method of overkill to make sure that the peer knows 
the FIN has been sent.

The problem with this, that I see at least, is that doing the above 
would generate extra traffic, as the peer would have to keep sending 
ACKs every time it received the FIN + ACK packets (the ACK would be for 
the FIN).

Does TCP in general allow ACK packets after a FIN has been acknowledged? 
Or is this another one of those things where a FIN + ACK must be sent 
all the time.

hope that was clear.

thanks,
sumeet

.

Path: shelby.stanford.edu!elaine8.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: th_win
Date: Sun, 22 Feb 2004 09:45:09 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0402220943190.278-100000@elaine8.Stanford.EDU>
NNTP-Posting-Host: elaine8.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077471910 7068 171.64.15.73 (22 Feb 2004 17:45:10 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6266

Is the th_win field always set, even in non-syn packets? We actually need
to update the window size from the other side everytime we receive a good
packet right? And we only update that value if the packet is good right?

Thanks

Lin

.

Path: shelby.stanford.edu!elaine8.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Client exited with nonzero status
Date: Sun, 22 Feb 2004 10:04:06 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.GSO.4.44.0402220959540.1384-100000@elaine8.Stanford.EDU>
References: <c18q7c$n0j$1@news.Stanford.EDU>
 <Pine.GSO.4.44.0402211553330.28200-100000@elaine31.Stanford.EDU>
 <c18v4k$3pe$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine8.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077473047 8223 171.64.15.73 (22 Feb 2004 18:04:07 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c18v4k$3pe$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6267

So is the client for this test the same as the client given but just uses
reference transport layer? In the given client code, there is no exit(1)
besides the initial stage where the application is reading arg from
command.

Is it possible to get a little more hint on say at what stage the
reference client died? It just seems impossible to figure out what has
happend with just the description of client exited with 256 code.

Thanks

Lin

On Sun, 22 Feb 2004, Matthew Jonathan Holliman wrote:

>
> >Same here. Got that test failed for (256) exit code. Don't understand what
> >is happening.
>
> this is a status code (waitpid result)--exit code is found in the upper
> 8 bits, so this *is* an exit code of 1.
>
> >Also, seems it stopped after reporting test 1.J. Is that the last test?
>
> yep.
>
>

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Duplicate ACKs
Date: Sun, 22 Feb 2004 10:21:53 -0800
Lines: 35
Distribution: su
Message-ID: <Pine.GSO.4.44.0402221020530.17341-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0402212250470.18555-100000@epic9.Stanford.EDU>
 <snnr7wn308h.fsf@elaine39.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077474115 9582 171.64.15.118 (22 Feb 2004 18:21:55 GMT)
X-Complaints-To: news@news.stanford.edu
To: Susan Noreen Shepard <shepard8@elaine39.Stanford.EDU>
In-Reply-To: <snnr7wn308h.fsf@elaine39.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6268


Is it a valid assumption that the FIN bit is always sent along with an
ACK?

On 22 Feb 2004, Susan Noreen Shepard wrote:

> Remember it's a four-way handshake on teardown.
>
> Here's a good explanation of why the ACK is set with FIN:
>
> since the connection is not yet torn down, it is always accompanied by the
> ACK flag. A packet with only the FIN flag set is NOT legal and is likely
> maliciously generated.
>
> Review the RFC. I believe the ACK flag is actually stating the the ACK
> field sequence number is significant.
>
> Since teardown is fundamental to tcp/stcp, you need to handle this now.
>
> Susan
>
> Boris Senderzon <senderzo@stanford.edu> writes:
>
> > I was failing on 1.C during connection termination
> > until I realized that after client sends FIN to the server,
> > the server ACKs client's FIN in one packet (which is correct)
> > and then sends another packet containing both ACK and FIN fields.
> > The FIN was expected but not the ACK.
> > The th_ack field is the same in both packets.  What does
> > the referent server acknowledge the 2nd time? I did not send it
> > anything? Is this something that we should handle in milestone B?
> >
> > Boris.
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Tony Hsieh" <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: advertised window
Date: Sun, 22 Feb 2004 10:36:08 -0800
Lines: 12
Distribution: su
Message-ID: <c1asqt$a72$1@news.Stanford.EDU>
NNTP-Posting-Host: acc53ec0.ipt.aol.com
X-Trace: news.Stanford.EDU 1077474975 10466 172.197.62.192 (22 Feb 2004 18:36: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:6269

It seems to me when I calculate the advertised window I always get 3072
bytes.  According to p. 391 of the Peterson book: Advertised Window =
MaxRcvBuffer - ((NextByteExpected-1)-LastByteRead).  However according to a
previous post which says we can send data to the application as soon as we
receive from the network and that the receive queue is only used to queue
the out of order packets.  If this is true, then NextByteExpected-1 =
LastByteRead and we get an AdvertisedWindow = MaxRcvBuffer.  Is this right?
or what am I missing?  Thanks so much.

-Tony


.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: APP_CLOSE_REQUESTED
Date: Sun, 22 Feb 2004 10:51:45 -0800
Lines: 38
Distribution: su
Message-ID: <c1ato6$b8v$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402202044400.18327-100000@epic11.Stanford.EDU> <c16rt7$gd8$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1077475910 11551 128.12.173.169 (22 Feb 2004 18:51: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:6270

I am confused by your answer. I think the statement still applies to this
assignment. The way I interpret this statement is that even though we are
ensured that stcp_wait_for_event will not return a APP_CLOSE_REQUESTED
unless the app has sent all data to the send buffer that it wanted to send,
we still could have unsent or unacked data in our send buffer, and hence we
need to make sure that we have sent and gotten an ack for all the
unacked/unsent data left over in the buffer after we see a
APP_CLOSE_REQUESTED, and ONLY then can we send a FIN. In other words, if we
get an APP_CLOSE_REQUESTED, we send a FIN only if last_byte_acked =
last_byte_sent = last_byte_written (using the terminology in the book), and
if this equality is not satisfied, then we simply make a note of the fact
the a Close has been requested, and try sending the unsent data and
receiving acks, and whenever we find that the equality has been satisfied,
we send a FIN and progress to the next state. This seems to correspond to
Susan's reply to this question as well. Is my interpretation correct? Or do
we only ensure that we have no unsent data left in the send buffer, but
unacked data is still fine and we can send a FIN as long as last_byte_sent =
last_byte_written (and not worry if last_byte_acked <> last_byte_sent)?

Hope my question made sense. Thanks

Kumar

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c16rt7$gd8$1@news.Stanford.EDU...
>
> >The assignment states that we should take particular
> >care of sending out all of USER's data before sending
> >a FIN if user requested to close the connection.
>
> This is leftover from an older version of the assignment, where FINs
> didn't have sequence numbers and would just cause immediate termination
> of the connection (no 4-way handshake).  Since the protocol was changed
> this year to be compatible with TCP, the statement no longer really
> applies.
>


.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Fix ftpd_tcp for PASV command
Date: Sun, 22 Feb 2004 19:33:44 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c1b06o$e08$1@news.Stanford.EDU>
References: <c19fl0$m3l$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077478424 14344 171.64.15.68 (22 Feb 2004 19:33:44 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6271


>I used PASV for my ftpcopy in HW1. A PASV command on the ftpd_tcp daemon 
>returns "0.0.0.0" as IP address always (it does return the correct port).

This should be fixed now--I can't verify this easily, though, as I don't
have an FTP client based on passive mode.  Please let me know if it still
doesn't work for you.

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Error Handling
Date: Sun, 22 Feb 2004 11:35:48 -0800
Lines: 7
Distribution: su
Message-ID: <40390494.39E0049@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077478549 14312 128.12.21.88 (22 Feb 2004 19:35:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6272

So, if the connection cannot be established (which the stub takes care
of by default anyhow) we set ERRNO to connection refused and then call
stcp_unblock_app(sd)   (as specified by comment).  What about if an
error occurs while the clinent is in establish mode/unblocked.  How do
we handle this error case?  Do we set the errno and then set done to
true?  Do we set the errno and then exit?

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: strange URM's
Date: Sun, 22 Feb 2004 11:36:04 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0402221133220.13188-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 1077478565 14477 171.64.15.100 (22 Feb 2004 19:36:05 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6273


I am getting a strange UMR in the following scenario:

tcphdr_init( ...., unsigned char offset, ..., STCPHeader *hdr )

{
 ...
 hdr->th_off = offset;  //getting UMR on this line
 ...
}

I double check to make sure I'm passing in the correct value for
offset (i pass in sizeof(STCPHeader) / sizeof(uint32) )

I don't understand why its complaining...has anyone else seen this?

--v

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: stcp_network_send
Date: Sun, 22 Feb 2004 19:38:55 +0000 (UTC)
Lines: 23
Distribution: su
Message-ID: <c1b0gf$eak$1@news.Stanford.EDU>
References: <c19nln$1i2$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077478735 14676 171.64.15.68 (22 Feb 2004 19:38:55 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6274


>I'm curious about the interface stcp_network_send(mysocket_t sd, const 
>void *src, size_t src_len, ...).  I assume this is so I can send 
>multiple buffers to a single tcp packet without doing an extra malloc. 
>I'd like to use this, but I don't know how many buffers I'll want to use 
>until run-time.   Is there a way I could form this list dyanmically at 
>runtime.  If not, wouldn't it be better to have an interface like
>stcp_network_send(mysocket_t, void**)?

That seems kind of a convoluted interface--a pointer and length has to be
passed in for each buffer, so you'd have extra bookkeeping code even
in the common case of sending only a single buffer.  I guess we could
have provided this, and then an easier-to-use wrapper around this similar
to the current stcp_network_send(), but whether that's worthwhile seems
questionable.

To be honest, the interface just corresponds to that used in an old
version of the assignment, so I could port old code into the new
framework more easily--chances are, most people only pass in one
buffer anyway, but it's there if you want to manage, say, header
and data separately.  If you need to decide how many buffers to pass
in at run-time, you'll probably need to do the memory management yourself.

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Duplicate ACKs
Date: Sun, 22 Feb 2004 19:40:48 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c1b0k0$ef9$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402212250470.18555-100000@epic9.Stanford.EDU>  <snnr7wn308h.fsf@elaine39.Stanford.EDU> <Pine.GSO.4.44.0402221020530.17341-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077478848 14825 171.64.15.68 (22 Feb 2004 19:40:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6275


>Is it a valid assumption that the FIN bit is always sent along with an
>ACK?

No, not necessarily.  You'll find that most TCP stacks will do this,
but they'll also process FINs without ACK set (at least Linux seems to).
And we send FINs without ACK set in some test cases in milestone B.

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Sliding windows and ACKs
Date: Sun, 22 Feb 2004 19:48:41 +0000 (UTC)
Lines: 22
Distribution: su
Message-ID: <c1b12p$et2$1@news.Stanford.EDU>
References: <c19okn$3bh$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077479321 15266 171.64.15.68 (22 Feb 2004 19:48:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6276


>1. I am a little confused as to what exactly are we supposed to do when we
>get a packet with a seq number < next_byte_expected from the network (ie,
>seq no lower than the start of the receiver window). Bullet point 4 seems to
>suggest that we should send an acknowledgment and drop the packet, but
>bullet point 6 seems to suggest that we should be splitting the payload part
>into two parts and handle those bytes in the payload which have a seq number
>>= next_byte_expected.

Bullet 6 is correct.  Bullet 4 should probably read "*all* sequence numbers
lower than the start of the recv window..."  Basically, just whatever
common sense would tell you...

>2. Bullet point 5 says that if a received packet has seq no > last byte of
>the receiver window, then we drop the packet and "it remains
>unacknowledged". What does the last phrase(in quotes) imply? We do not send

This has been answered on the newsgroup before.  The incoming data can't
be acknowledged, because you can't accept it.  But you can still send
an ACK packet back, indicating the data that you're expecting next
(which is consistent with TCP).

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Duplicate ACKs
Date: Sun, 22 Feb 2004 11:49:30 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.GSO.4.44.0402221147020.19971-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0402212250470.18555-100000@epic9.Stanford.EDU> 
 <snnr7wn308h.fsf@elaine39.Stanford.EDU> <Pine.GSO.4.44.0402221020530.17341-100000@elaine43.Stanford.EDU>
 <c1b0k0$ef9$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077479372 15316 171.64.15.118 (22 Feb 2004 19:49:32 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
In-Reply-To: <c1b0k0$ef9$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6277


You answer seems to indicate that STCP has to handle FIN alone and FIN
with ACK.  That I understand.  I have one more question: for STCP, is it
required to always send out FIN with an ACK?  I thougth some of the
previous post state that if FIN is sent out without ACK, most of the
network will discard the FIN.  Please confirm.

On Sun, 22 Feb 2004, Matthew Jonathan Holliman wrote:

>
> >Is it a valid assumption that the FIN bit is always sent along with an
> >ACK?
>
> No, not necessarily.  You'll find that most TCP stacks will do this,
> but they'll also process FINs without ACK set (at least Linux seems to).
> And we send FINs without ACK set in some test cases in milestone B.
>
>

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Daily limit of 5 tests
Date: Sun, 22 Feb 2004 11:52:00 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0402221150140.19971-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 1077479522 15547 171.64.15.118 (22 Feb 2004 19:52:02 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6278


Say today, I am trying the test both HW3A and HW3b, do I get 5 test for
HW3A, and 5 for HW3b, or 5 total for both?

How about tomorrow, 3 for HW3A, 5 for HW3B?

-Laura

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Duplicate ACKs
Date: Sun, 22 Feb 2004 19:52:51 +0000 (UTC)
Lines: 19
Distribution: su
Message-ID: <c1b1aj$f71$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402212250470.18555-100000@epic9.Stanford.EDU>   <snnr7wn308h.fsf@elaine39.Stanford.EDU> <Pine.GSO.4.44.0402221020530.17341-100000@elaine43.Stanford.EDU>  <c1b0k0$ef9$1@news.Stanford.EDU> <Pine.GSO.4.44.0402221147020.19971-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077479571 15585 171.64.15.68 (22 Feb 2004 19:52:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6279



>You answer seems to indicate that STCP has to handle FIN alone and FIN
>with ACK.  That I understand.  I have one more question: for STCP, is it
>required to always send out FIN with an ACK?  I thougth some of the
>previous post state that if FIN is sent out without ACK, most of the
>network will discard the FIN.  Please confirm.

Yes, STCP itself doesn't really care about whether you always set ACKs
or not.

Most firewalls will discard FINs without the ACK field set.  This
is really the only reason the assignment points out that the ACK
field should be set--to avoid problems in HW4 when we talk to external
FTP servers.  The TCP stacks themselves would generally process such
packets correctly (at least, the internal ftp server using Linux does),
but such packets will often never reach their destination because of
security concerns.  So it's simplest to just set th_ack whenever you can.

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Daily limit of 5 tests
Date: Sun, 22 Feb 2004 19:53:26 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c1b1bm$f7l$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221150140.19971-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077479606 15605 171.64.15.68 (22 Feb 2004 19:53:26 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6280


>Say today, I am trying the test both HW3A and HW3b, do I get 5 test for
>HW3A, and 5 for HW3b, or 5 total for both?

5 for each.

>How about tomorrow, 3 for HW3A, 5 for HW3B?

yep.

.

Path: shelby.stanford.edu!firebird6.Stanford.EDU!spathak
From: Sumedh Pathak <spathak@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test 1.J
Date: Sun, 22 Feb 2004 11:54:34 -0800
Lines: 50
Distribution: su
Message-ID: <Pine.LNX.4.44.0402221151370.32537-100000@firebird6.Stanford.EDU>
References: <pan.2004.02.22.10.26.52.637083@stanford.edu>
NNTP-Posting-Host: firebird6.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077479675 15686 171.64.15.19 (22 Feb 2004 19:54:35 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <pan.2004.02.22.10.26.52.637083@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:6281


I actually get the same error on test 1.C.  I tried downloading bigger
files than TESTDATA.0, and it works fine.

Do I have to do something other than set ctx->done = TRUE? I have no idea
what the problem could be.

-------------------------------------------
connected to 171.64.15.139 at port 48502
client: TESTDATA.0
warning:  client exited with non-zero status (-1)
program output:
***Timeout expired during grading
Program output:
server: TESTDATA.0,110230,Ok

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

Sumedh



On Sun, 22 Feb 2004, Chris Edstrom wrote:

> So on running the grading script, I get:
>
> ----------------------------------------------------------------------
>
> Test 1.J [out of 14]
> Checks student Tx (server) against student Rx (client).
>
> Results:  NOT OK
>
> Unexpected exit status -1.  Program output:
> ***Timeout expired during grading
> Program output:
> server: TESTDATA.0,110230,Ok
>
> ----------------------------------------------------------------------
>
> So it appeared that it actually worked, but the script doesn't think so.
> (I actually retried with the same data file, and it worked.)  However,
> when the sending is completed, the server does not terminate, which, from
> what I can gather from the server.c code is the proper behavior but which
> the script seems to imply is the incorrect behavior.  Any insight into why
> this is happening?
>
> --Chris
>

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Client exited with nonzero status
Date: Sun, 22 Feb 2004 19:57:04 +0000 (UTC)
Lines: 30
Distribution: su
Message-ID: <c1b1ig$fe9$1@news.Stanford.EDU>
References: <c18q7c$n0j$1@news.Stanford.EDU>  <Pine.GSO.4.44.0402211553330.28200-100000@elaine31.Stanford.EDU>  <c18v4k$3pe$1@news.Stanford.EDU> <Pine.GSO.4.44.0402220852440.23462-100000@epic12.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077479824 15817 171.64.15.68 (22 Feb 2004 19:57:04 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6282



>1. How similar is the "client" part of the code to the dummy client we
>were given?  It would have to be functionally equivalent to interoperate
>with our server, but I noticed that the args are different.

The client in those tests (B, C, J) is basically identical--the only
difference is that it reads the destination address from a file (since
it has to run from a script).

>2. Can we get access to the client binary or output from the client?

nope, that would make things very easy for you :-)

The script gives you whatever output your client prints out,
e.g. if you see the "server: OK, 10000 bytes" or whatever it is,
you know that you established the connection and received at least
one packet correctly from the server.  so you've narrowed down
the problem already.  if the error message is a timeout, chances
are you've made a mistake in connection teardown somewhere, or
that your transport layer downloaded data too slowly (there's a 60s
timeout on the test).

If you still can't figure out the problem from these clues, you can
always test against standard TCP.  The HW4 topologies aren't
installed yet, but you can use your old HW2 topology (same ID)
to test against TCP echo client/server--see stcp_echo_server and
stcp_echo_client.  If you work against those, you should almost
certainly work against the ref soln.

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: th_win
Date: Sun, 22 Feb 2004 19:59:21 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c1b1mp$fho$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402220943190.278-100000@elaine8.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077479961 15928 171.64.15.68 (22 Feb 2004 19:59:21 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6283


>Is the th_win field always set, even in non-syn packets? We actually need
>to update the window size from the other side everytime we receive a good
>packet right? And we only update that value if the packet is good right?

The field is set whenever th_ack is set.  And yes, you should keep track of
the other side's advertised window when deciding whether you can send new
data.  (If you receive a packet that's obviously bogus, e.g. bad ack # etc.,
yes, it probably makes sense to ignore the th_win).

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test 1.J
Date: Sun, 22 Feb 2004 20:00:44 +0000 (UTC)
Lines: 21
Distribution: su
Message-ID: <c1b1pc$fmk$1@news.Stanford.EDU>
References: <pan.2004.02.22.10.26.52.637083@stanford.edu>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077480044 16084 171.64.15.68 (22 Feb 2004 20:00:44 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6284

>----------------------------------------------------------------------

>Test 1.J [out of 14]
>Checks student Tx (server) against student Rx (client).

>Results:  NOT OK

>Unexpected exit status -1.  Program output:
>***Timeout expired during grading
>Program output:
>server: TESTDATA.0,110230,Ok

>----------------------------------------------------------------------

>So it appeared that it actually worked, but the script doesn't think so. 

No, it appears to me that you connected okay, received at least one packet
from the server, but didn't finish within 60s.  The timeout refers to
the client, not the server.  You might check that your code consistently
works, and that it finishes within a reasonable timeframe.

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test 1.J
Date: Sun, 22 Feb 2004 20:01:25 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c1b1ql$fnq$1@news.Stanford.EDU>
References: <pan.2004.02.22.10.26.52.637083@stanford.edu> <Pine.LNX.4.44.0402221151370.32537-100000@firebird6.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077480085 16122 171.64.15.68 (22 Feb 2004 20:01:25 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6285


>I actually get the same error on test 1.C.  I tried downloading bigger
>files than TESTDATA.0, and it works fine.

Please see my comments elsewhere about possible problems in this part--
there are a number of hints from the script output, as well as ways
of debugging this.

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ACK loss for SYN_RCVD state
Date: Sun, 22 Feb 2004 20:04:54 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c1b216$fub$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402182144170.13469-100000@elaine25.Stanford.EDU> <c11nj4$5fd$1@news.Stanford.EDU> <c1a435$ef1$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077480294 16331 171.64.15.68 (22 Feb 2004 20:04:54 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6286


>Actually, I think this is likely.  In fact, I believe it happened to my when
>I was testing in unreliable mode (which I had forgotten I was doing).  Feel
>free to correct me if I'm wrong... at 3:30 AM, anything is possible:

I think it's possible, too, now that you point this out.

>My SYN-ACK is sent, and my client's response ACK is lost.  I resend SYN-ACK
>5 times, but since my client is no longer listening, it never sends another
>ACK.  Thus, the first ACK my server will get will be when my client tries
>sending data.

your client?  why doesn't it send another ACK on the repeated SYN-ACK?

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Following RFC 793 for handling segments arriving over the network
Date: Sun, 22 Feb 2004 20:09:35 +0000 (UTC)
Lines: 23
Distribution: su
Message-ID: <c1b29v$g7r$1@news.Stanford.EDU>
References: <c1akid$24v$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077480575 16635 171.64.15.68 (22 Feb 2004 20:09:35 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6287



>I wanted to ask if it is ok to exactly follow the RFC 793 when we write code
>to handle the segments that arrive over the network as detailed out on pg
>65-76 in the RFC (ofcourse skipping over the RST, URG, and TIME_WAIT
>details)? The reason I am unsure is because it has been said quite a few
>times on the newsgroup that we are implementing STCP which is not exactly
>TCP, and I am not sure what are all the possible differences between STCP
>and TCP (especially in terms of handling segments that arrive over the
>network).

No, you should follow the specs in the assignment description.
The protocol is designed so that it should interoperate with TCP--but
this does not mean that you implement TCP.

In particular, STCP doesn't require that th_ack be set.

BTW, many TCP stacks will accept packets that don't have th_ack set.
So even they aren't strictly RFC-compliant!

I would highly suggest ignoring the RFC for the moment if you find it
confusing.

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: sending FIN after receiving close from application
Date: Sun, 22 Feb 2004 20:13:06 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c1b2gi$gln$1@news.Stanford.EDU>
References: <c1ao0u$552$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077480786 17079 171.64.15.68 (22 Feb 2004 20: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:6288


>Does TCP in general allow ACK packets after a FIN has been acknowledged? 
>Or is this another one of those things where a FIN + ACK must be sent 
>all the time.

I'm not sure, but this doesn't seem particularly relevant to me.  I don't
recall the assignment spec saying anything about such a case--so whatever
seems reasonable to you.  You've identified at least one problem with
setting FIN every time.

TCP should behave correctly if you don't set it every time, but instead
just use the regular timeout for FIN.  I've had no problems interoperating
with it with this approach.

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: advertised window
Date: Sun, 22 Feb 2004 20:13:34 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <c1b2he$gnc$1@news.Stanford.EDU>
References: <c1asqt$a72$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077480814 17132 171.64.15.68 (22 Feb 2004 20:13:34 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6289


>It seems to me when I calculate the advertised window I always get 3072
>bytes.  According to p. 391 of the Peterson book: Advertised Window =
>MaxRcvBuffer - ((NextByteExpected-1)-LastByteRead).  However according to a
>previous post which says we can send data to the application as soon as we
>receive from the network and that the receive queue is only used to queue
>the out of order packets.  If this is true, then NextByteExpected-1 =
>LastByteRead and we get an AdvertisedWindow = MaxRcvBuffer.  Is this right?
>or what am I missing?  Thanks so much.

sounds like you're doing fine...

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: APP_CLOSE_REQUESTED
Date: Sun, 22 Feb 2004 20:17:05 +0000 (UTC)
Lines: 25
Distribution: su
Message-ID: <c1b2o1$gup$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402202044400.18327-100000@epic11.Stanford.EDU> <c16rt7$gd8$1@news.Stanford.EDU> <c1ato6$b8v$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077481025 17369 171.64.15.68 (22 Feb 2004 20:17:05 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6290


>I am confused by your answer. I think the statement still applies to this
>assignment. The way I interpret this statement is that even though we are
>ensured that stcp_wait_for_event will not return a APP_CLOSE_REQUESTED
>unless the app has sent all data to the send buffer that it wanted to send,
>we still could have unsent or unacked data in our send buffer, and hence we
>need to make sure that we have sent and gotten an ack for all the
>unacked/unsent data left over in the buffer after we see a
>APP_CLOSE_REQUESTED, and ONLY then can we send a FIN. In other words, if we

the old version of the assignment (previous years) did not associate a
seq# with FIN packets.  thus when one side received a FIN, it would ACK
it and bail out immediately.  in such a case, the side sending the FIN
must make sure that all outstanding data has been transferred before it
closes the connection.

now, FIN segments have a sequence number.  so there shouldn't be any
problem in sending a FIN before all app data has been ACKed--if it's
implemented correctly, the other side won't process it until the
outstanding data has been passed up to the app on the other side.

of course, you can certainly just wait and send the FIN after all data's
been ACKed--that would be fine too, and is guaranteed to do the right
thing.

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Error Handling
Date: Sun, 22 Feb 2004 20:19:19 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <c1b2s7$h3i$1@news.Stanford.EDU>
References: <40390494.39E0049@stanford.edu>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077481159 17522 171.64.15.68 (22 Feb 2004 20:19:19 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6291


>So, if the connection cannot be established (which the stub takes care
>of by default anyhow) we set ERRNO to connection refused and then call
>stcp_unblock_app(sd)   (as specified by comment).  What about if an
>error occurs while the clinent is in establish mode/unblocked.  How do
>we handle this error case?  Do we set the errno and then set done to
>true?  Do we set the errno and then exit?

there really isn't any provision in the code for handling this case--you
can just silently close the connection.  the error won't be passed up to
myread()/mywrite()/myclose().

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ACK loss for SYN_RCVD state
Date: Sun, 22 Feb 2004 12:38:23 -0800
Lines: 15
Distribution: su
Message-ID: <c1b402$i64$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402182144170.13469-100000@elaine25.Stanford.EDU> <c11nj4$5fd$1@news.Stanford.EDU> <c1a435$ef1$1@news.Stanford.EDU> <c1b216$fub$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077482306 18628 128.12.61.97 (22 Feb 2004 20:38: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:6292

> your client?  why doesn't it send another ACK on the repeated SYN-ACK?

After receiving the first SYN-ACK and responding with an ACK, my client
moves to the ESTABLISHED state.  At this point, it doesn't expect a SYN-ACK
packet, so it doesn't respond with an ACK.

However, further down the line, what I'll do is have both my client and
server respond with an ACK to all packets received in the ESTABLISHED state,
even if they are unexpected packets that are dropped.  This way if one end
of the connection tries resending data that the other end has already seen,
ACKed, and processed, another ACK will be transmitted in case the first one
was lost.  This will also handle the case of ACKing repeated SYN-ACK
packets.


.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Checksums
Date: Sun, 22 Feb 2004 21:19:29 +0000 (UTC)
Lines: 31
Distribution: su
Message-ID: <c1b6d1$jdr$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine27.stanford.edu
X-Trace: news.Stanford.EDU 1077484769 19899 171.64.15.102 (22 Feb 2004 21:19:29 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:6293

I get the following error on Test 1.C:

Unexpected exit status 6.  Program output:
server: TESTDATA.0,110230,Ok
Assertion failed: _mysock_verify_checksum(_mysock_get_context(sd), dst, len), 
file stcp_api.c, line 158

The actual output while running is:

Server started
Starting client: ./client  -p .server_port -f TESTDATA.0 foo
connected to 171.64.15.102 at port 45575
client: TESTDATA.0
warning:  client exited with non-zero status (6)
program output:
server: TESTDATA.0,110230,Ok
Assertion failed: _mysock_verify_checksum(_mysock_get_context(sd), dst, len), 
file stcp_api.c, line 158

Line 158 is inside the stcp_network_recv function.  The client is thus 
reporting a checksum error on data sent by the *reference* server.

Offhand I don't see how this could be the result of a bug in the client.  
Even if the client sent incorrect data to the server, and the server thus 
sends an incorrect response, why would that cause the checksum to be 
calculated incorrectly?  Why would the checksum calculated by the server on 
the same data received by the client be incorrect?


Tyrone

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Checksums
Date: Sun, 22 Feb 2004 21:28:39 +0000 (UTC)
Lines: 16
Distribution: su
Message-ID: <c1b6u7$lb4$1@news.Stanford.EDU>
References: <c1b6d1$jdr$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077485319 21860 171.64.15.68 (22 Feb 2004 21:28:39 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6294


>I get the following error on Test 1.C:

This error is occurring on the client side--for the checksum not to agree,
one likely cause is that the packet was truncated in some way.
(The same checksum is computed on both the server, when it's set, and
the client, when it's received--assuming src/dest addr are passed
in correctly, which should be the case).

Another explanation might be that if the underlying network_recv fails
(e.g. if one side of the connection abruptly dies), the len returned is
-1... the checksum shouldn't be verified in that case, but it was.  I've
just fixed the assert to properly handle this case.

Does the error happen consistently now, if you rerun the test?

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: seg fault
Date: Sun, 22 Feb 2004 13:34:04 -0800
Lines: 14
Distribution: su
Message-ID: <c1b77r$ln9$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1077485627 22249 128.12.189.163 (22 Feb 2004 21:33: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:6295

Hi ,
I get this error:

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 5]
0xff142384 in realfree () from /usr/lib/libc.so.1

This happens at the line when I malloc a buffer to store data from
stcp_app_recv.
Any guesses why?Please help!
Thanks,
Haripriya


.

Path: shelby.stanford.edu!elaine21.Stanford.EDU!kayvonf
From: Kayvon Fatahalian <kayvonf@elaine21.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: reference client producing incorrect sequence number?
Date: Sun, 22 Feb 2004 14:06:01 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.GSO.4.44.0402221357060.24855-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 1077487569 24286 171.64.15.86 (22 Feb 2004 22:06:09 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6296


I observe the following behavior when running test 1B in the test script.
(your reference client speaking to my server)

At the end of the connection, the server receives:

FIN+ACK with seq=X and ack=Y   (0 data bytes in this FIN packet)

My server responds with two packets:

ACK with seq=Y and ack=X+1

FIN+ACK with seq=Y and ack=X+1

Then your client response with:

ACK with seq=X and ack=Y+1


By the specification, this final ack by the server should have the
sequence number set to X+1, since the FIN packet sent previously should be
occupying a byte of sequence space.

While this does not prevent my server from passing the test correctly, I
believe your client is breaking protocol in this case.

Kayvon

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: reference client producing incorrect sequence number?
Date: Sun, 22 Feb 2004 22:09:13 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <c1b9a9$nsr$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221357060.24855-100000@elaine21.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077487753 24475 171.64.15.68 (22 Feb 2004 22:09:13 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6297


Hmm, I thought I'd fixed that.  I'll take another look,  BTW, STCP itself
doesn't care about sequence numbers in ACK packets, so this shouldn't break
anyone's implementations.

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: seg fault
Date: Sun, 22 Feb 2004 14:12:39 -0800
Lines: 22
Distribution: su
Message-ID: <c1b9gq$o6t$1@news.Stanford.EDU>
References: <c1b77r$ln9$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077487962 24797 128.12.61.97 (22 Feb 2004 22:12: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:6298

I would run purify on it.  That might point out some memory issues.

Oded

"Haripriya Rajagopal" <hpriya@stanford.edu> wrote in message
news:c1b77r$ln9$1@news.Stanford.EDU...
> Hi ,
> I get this error:
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to LWP 5]
> 0xff142384 in realfree () from /usr/lib/libc.so.1
>
> This happens at the line when I malloc a buffer to store data from
> stcp_app_recv.
> Any guesses why?Please help!
> Thanks,
> Haripriya
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: test1.A
Date: Sun, 22 Feb 2004 14:20:58 -0800
Lines: 9
Distribution: su
Message-ID: <c1b9vq$ol6$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1077488442 25254 128.12.189.163 (22 Feb 2004 22:20: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:6299

Hi,
When I run my grading scripts my summary shows results from test1.B to
test1.J
Is there no test1.A?
Also is there any test after test1.J
Thanks,
Haripriya


.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: changing the advertised window
Date: Sun, 22 Feb 2004 14:24:57 -0800
Lines: 8
Distribution: su
Message-ID: <c1ba78$orp$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1077488681 25465 128.12.189.163 (22 Feb 2004 22:24: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:6300

Hi,
Do we change the advertised window only when we get an ACK packet, or with
every received packet?
Then if we get a pure data packet, what does its th_win field indicate?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: reference client producing incorrect sequence number?
Date: Sun, 22 Feb 2004 14:36:22 -0800
Lines: 29
Distribution: su
Message-ID: <c1bat7$pl9$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221357060.24855-100000@elaine21.Stanford.EDU> <c1b9a9$nsr$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1077489383 26281 128.12.173.169 (22 Feb 2004 22:36: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:6301

I thought that seq numbers must be always set correctly in every packet we
send/receive. The assignment description itself says in the 4th bullet under
"Sequence Numbers" - "The sequence number should always be set in every
packet. If the packet is a pure ACK packet (i.e., no data, and the SYN/FIN
flags are unset), the sequence number is set to the next unsent sequence
number". So this would imply that even when we ahve a pure ACK packet, we
can rely on the fact that sequence numbers are set correctly and hence STCP
"should" care about sequence numbers in ACK packets. From what you said
below, do you mean that if I get a packet that has a sequence number > last
byte of my receiver window, but is a pure ACK packet, then this packet is
still valid, and we dont care if its sequence number is unacceptable or
wrong(if it had data, then this sequence number would have been unacceptable
anyways)?

Thanks

Murali Kumar


"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1b9a9$nsr$1@news.Stanford.EDU...
>
> Hmm, I thought I'd fixed that.  I'll take another look,  BTW, STCP itself
> doesn't care about sequence numbers in ACK packets, so this shouldn't
break
> anyone's implementations.
>


.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: reference client producing incorrect sequence number?
Date: Sun, 22 Feb 2004 23:13:16 +0000 (UTC)
Lines: 36
Distribution: su
Message-ID: <c1bd2c$s5l$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221357060.24855-100000@elaine21.Stanford.EDU> <c1b9a9$nsr$1@news.Stanford.EDU> <c1bat7$pl9$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077491596 28853 171.64.15.68 (22 Feb 2004 23:13:16 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6302


Sequence numbers should be set correctly.  The assignment description
only says that because if you don't set it (i.e. leave it 0), real
TCP implementations drop the packets.  Setting it to the next unsent
byte fixed that behaviour.  I don't remember if the RFC actually says
to do this or not, but that seems to be how most TCP implementations
behave.  It's really just in there for HW4.  The HW3 ref soln doesn't
even look at th_seq for ACK packets.

If you receive an ACK, though, and the sequence number is 'semi-'
reasonable (i.e. >= ISN), you can't generally ignore it.  Consider
this example where data X and FIN X+1 is delayed from side 2:

side 1       side 2
A        --> A
         <-- X
		 <-- FIN
ack(A+1) <-- seq(X+2),ack(A+1)
X        <--
FIN      <--

if you "care" about sequence numbers, you could end up discarding a
potentially valid ACK, since the sequence number could be outside
the expected range of sender sequence numbers.

for the particular bug mentioned, the ACK could have been valid anyway
(from milestone B onwards, when packets may be reordered), so you
shouldn't discard it then anyway.

I might mention also that although TCP acks a FIN w/seq th_seq=X with
th_ack=X+1, some stacks I've seen still send ACKs with th_seq=X after the
FIN.  others seem to increment th_seq.  basically, if your soln works,
fine!  it's probably best not to be too picky on these kinds of points.
I believe the RFC actually comments that TCPs should be conservative on
what they send out, liberal in what they accept...

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: test1.A
Date: Sun, 22 Feb 2004 23:14:35 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c1bd4r$s7j$1@news.Stanford.EDU>
References: <c1b9vq$ol6$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077491675 28915 171.64.15.68 (22 Feb 2004 23:14:35 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6303


>Is there no test1.A?

nope--per the grading guidelines, this is a check that your code
compiles (which is done before the script even runs).

>Also is there any test after test1.J

no, as answered previously on the newsgroup.

.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: changing the advertised window
Date: Sun, 22 Feb 2004 23:15:09 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c1bd5t$s8l$1@news.Stanford.EDU>
References: <c1ba78$orp$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1077491709 28949 171.64.15.68 (22 Feb 2004 23:15:09 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6304


>Do we change the advertised window only when we get an ACK packet, or with
>every received packet?

th_win is valid when the ACK bit is set.

>Then if we get a pure data packet, what does its th_win field indicate?

does it have the ACK bit set?

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Checksums
Date: Sun, 22 Feb 2004 23:27:46 +0000 (UTC)
Lines: 17
Distribution: su
Message-ID: <c1bdti$t1o$1@news.Stanford.EDU>
References: <c1b6d1$jdr$1@news.Stanford.EDU> <c1b6u7$lb4$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine27.stanford.edu
X-Trace: news.Stanford.EDU 1077492466 29752 171.64.15.102 (22 Feb 2004 23:27: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:6305

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

> Does the error happen consistently now, if you rerun the test?

Yes.  Output now reads:

Server started
Starting client: ./client  -p .server_port -f TESTDATA.0 foo
connected to 171.64.15.102 at port 46246
client: TESTDATA.0
warning:  client exited with non-zero status (6)
program output:
server: TESTDATA.0,110230,Ok
Assertion failed: len <= 0 || 
_mysock_verify_checksum(_mysock_get_context(sd), dst,
len), file stcp_api.c, line 159

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: ftpcopy_vns
Date: Sun, 22 Feb 2004 23:37:14 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <c1befa$t1o$2@news.Stanford.EDU>
NNTP-Posting-Host: elaine27.stanford.edu
X-Trace: news.Stanford.EDU 1077493034 29752 171.64.15.102 (22 Feb 2004 23:37:14 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:6306

I enter the command:

ftpcopy_vns -t 162 -s vns-1.stanford.edu -r rtable exe 1 www.sunsite.dk

The copy program then issues a series of statements like this:

-> received ARP request
* arp is not for us 192.168.129.201

This repeats endlessly, with the addresses being either the above or 
171.67.71.168 or 171.67.71.173.

The IP addresses don't match anything I recognize; my VNS configuration 
contains 192.168.129.56-60, and I was running from elaine27, which is 
171.64.15.102.

Or am I entering the wrong command?  I read through hw4, but don't quite 
understand what the "virtual host" is supposed to be.
.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Is AFS down?
Date: Sun, 22 Feb 2004 16:16:44 -0800
Lines: 6
Distribution: su
Message-ID: <c1bgpd$362$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1077495405 3266 128.12.173.169 (23 Feb 2004 00:16: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:6307

Is AFS down? I cannot log into any sweet hall machines and access my home
directory. Is anyone else facing the same problem?

Kumar


.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Thanks, it works now.
Date: Mon, 23 Feb 2004 00:40:56 +0000 (UTC)
Lines: 1
Distribution: su
Message-ID: <c1bi6o$4qd$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine18.stanford.edu
X-Trace: news.Stanford.EDU 1077496856 4941 171.64.15.83 (23 Feb 2004 00:40:56 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:6308

Thanks for fixing it.
.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: data in SYN received state
Date: Sun, 22 Feb 2004 16:49:26 -0800
Lines: 13
Distribution: su
Message-ID: <c1bim8$5dj$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1077497352 5555 128.12.189.163 (23 Feb 2004 00:49: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:6309

Hi,
When I am in SYN_RCVD state ,I am waiting for an ACK for my side of
connection setup.However the other side is already setup.So I could receive
data at this point.Am I correct?
I know that if I get an ACK & data packet I process both.My question is-what
do I do if a pure data packet arrives & I haven't received an ACK yet
?Should I process it too because the sequence number can be validated.But
then how do I send an ACK back(coz my side of the connection may or may not
be setup.)
Thanks,
Haripriya


.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: data in SYN received state
Date: Sun, 22 Feb 2004 17:08:30 -0800
Lines: 22
Distribution: su
Message-ID: <Pine.GSO.4.44.0402221707090.5427-100000@epic6.Stanford.EDU>
References: <c1bim8$5dj$1@news.Stanford.EDU>
NNTP-Posting-Host: epic6.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077498511 7151 171.64.15.39 (23 Feb 2004 01:08:31 GMT)
X-Complaints-To: news@news.stanford.edu
To: Haripriya Rajagopal <hpriya@stanford.edu>
In-Reply-To: <c1bim8$5dj$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6310

You could penalize the peer by not acking its data packets since it
violated protocol and did not send you an ACK.  You can do the same :-).

Boris.

On Sun, 22 Feb 2004, Haripriya Rajagopal wrote:

> Hi,
> When I am in SYN_RCVD state ,I am waiting for an ACK for my side of
> connection setup.However the other side is already setup.So I could receive
> data at this point.Am I correct?
> I know that if I get an ACK & data packet I process both.My question is-what
> do I do if a pure data packet arrives & I haven't received an ACK yet
> ?Should I process it too because the sequence number can be validated.But
> then how do I send an ACK back(coz my side of the connection may or may not
> be setup.)
> Thanks,
> Haripriya
>
>
>

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: What is the requirement for the re-transimssion timer granularity?
Date: Sun, 22 Feb 2004 17:09:04 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0402221701580.29697-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 1077498546 7162 171.64.15.118 (23 Feb 2004 01:09:06 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6311


What is the requirement for the re-transimssion timer granularity?

Say, I only keep a timer that times out every 100ms.  When that happens,
the retranmission is done for all the unacked packets.  The same thing is
going to happen every 100ms.

Use this design, there are certain packets that could be re-transmitted in
less than 100ms for the first re-transmission.  Of course, for the next 4
re-transmissions, they will wait a full 100ms.  Is this good enough?

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: What is the requirement for the re-transimssion timer granularity?
Date: Sun, 22 Feb 2004 17:14:36 -0800
Lines: 24
Distribution: su
Message-ID: <c1bk5v$7gl$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221701580.29697-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077498879 7701 128.12.61.97 (23 Feb 2004 01:14: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:6312

As I interpret the problem, the only data that should really be on a timer
is the data in the first unacked data packet.  The way I'm implementing it
is just having a timer for that one, and when that data is finally ACK'd, I
start all over for the next unACK'd data, even if that's been transmitted
several times before.  I think this is how go-back-N should work, someone
please correct me if I'm wrong.

Oded

"Xiaohua Fang" <xxf5@stanford.edu> wrote in message
news:Pine.GSO.4.44.0402221701580.29697-100000@elaine43.Stanford.EDU...
>
> What is the requirement for the re-transimssion timer granularity?
>
> Say, I only keep a timer that times out every 100ms.  When that happens,
> the retranmission is done for all the unacked packets.  The same thing is
> going to happen every 100ms.
>
> Use this design, there are certain packets that could be re-transmitted in
> less than 100ms for the first re-transmission.  Of course, for the next 4
> re-transmissions, they will wait a full 100ms.  Is this good enough?
>


.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Go back N and retransmissions.
Date: Sun, 22 Feb 2004 17:16:06 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.GSO.4.44.0402221708330.5427-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 1077498967 7757 171.64.15.39 (23 Feb 2004 01:16:07 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6313

Let's say I sent 4 packets to the peer and timeout occurred for packet 1.
I resend all 4 packets again.  Let's say that after 2nd attempt,
I received an ACK for packet 1.  Here are few questions:

1). Does timeout for packet 2 should be counted from time wnen it
was sent the first time or when it was retransimitted due to
retransmission of packet 1.  I'm leaning towards the former.

2). After retransmission of all of the packets due to timeout of
packet # 1, packet # 1 should have # of retries field set to 1
(i.e 1  retry commenced).
What about packets # 2,3, and 4.  Techinically their original timeout
never occurred, yet they were sent twice already.
Here I'm leaning towards not counting this as a time out for packets
2, 3, and 4.

Thanks.



.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Required Paths of State-Diagram to Support
Date: Sun, 22 Feb 2004 17:17:36 -0800
Lines: 15
Distribution: su
Message-ID: <c1bkbi$7la$1@news.Stanford.EDU>
References: <4036FE08.21F7CF2F@stanford.edu> <c182gg$qs8$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077499058 7850 128.12.61.97 (23 Feb 2004 01:17: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:6314

> I don't have that book, so I can't check against the diagram you mention.
> But FIN_WAIT_1 to CLOSING isn't an unusual case.  And there's nothing
> in the TCP connection state diagram in the RFC to show how you'd
> progress immediately from FIN_WAIT_1 to CLOSED.

From FIN_WAIT_1 if you get a ACK+FIN, you respond with an ACK and go
straight to CLOSED (since we are bypassing TIME_WAIT).  This is what the
diagram shows in P&D.

I simply dealt with this by checking ACK first (thus going from FIN_WAIT_1
to FIN_WAIT_2) and FIN second (thus going from FIN_WAIT_2 to CLOSED).

Oded


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Go back N and retransmissions.
Date: Sun, 22 Feb 2004 17:20:43 -0800
Lines: 35
Distribution: su
Message-ID: <c1bkhc$7ui$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221708330.5427-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077499244 8146 128.12.61.97 (23 Feb 2004 01:20: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:6315

I think the issue is bigger than that.  As I said in the post before this, I
don't even keep track of packets.
What happens if while waiting for a timeout the peer advertises a receiver
window size smaller than the data in your first packet?  You'd have to break
it up.  I keep a queue of unsent _data_, and when my ACK times out, I
repackage the data into a new packet and send it again, counting that as a
retransmission.  Thus if the window size changes, I'm resending the
appropriate amount of data.
Again, if I'm going about this all wrong, someone please tell me sooner than
later =)

Oded

> Let's say I sent 4 packets to the peer and timeout occurred for packet 1.
> I resend all 4 packets again.  Let's say that after 2nd attempt,
> I received an ACK for packet 1.  Here are few questions:
>
> 1). Does timeout for packet 2 should be counted from time wnen it
> was sent the first time or when it was retransimitted due to
> retransmission of packet 1.  I'm leaning towards the former.
>
> 2). After retransmission of all of the packets due to timeout of
> packet # 1, packet # 1 should have # of retries field set to 1
> (i.e 1  retry commenced).
> What about packets # 2,3, and 4.  Techinically their original timeout
> never occurred, yet they were sent twice already.
> Here I'm leaning towards not counting this as a time out for packets
> 2, 3, and 4.
>
> Thanks.
>
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Nicolas Pombourcq" <nicolas.pombourcq@stanford.edu>
Newsgroups: su.class.cs244a
Subject: synchronisation problem
Date: Sun, 22 Feb 2004 17:35:36 -0800
Lines: 15
Distribution: su
Message-ID: <c1blh5$9bm$1@news.Stanford.EDU>
NNTP-Posting-Host: mummy.stanford.edu
X-Trace: news.Stanford.EDU 1077500261 9590 128.12.188.73 (23 Feb 2004 01:37: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:6316

I have weird problems with STCP. My implementation seems to work fine most
of the time, but in several cases it hangs in the middle of the transfer. I
tried to debug it using our_dprintf statements, but depending on the number
of printf I put it changes the time at which the problem happens or
completely suppresses it. The same thing happen's when running in the
debugger, so I suppose there is some kind of thread synchronization problem
in the provided code. Does anyone experience the same problem ?



Thanks

Nicolas


.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Retransmission for paritally acked packets
Date: Sun, 22 Feb 2004 18:12:49 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.GSO.4.44.0402221804500.16712-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 1077502371 12782 171.64.15.100 (23 Feb 2004 02:12:51 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6317


Lets say i have a packet, seqnum=100-199 on my retransmit q.  Each packet
has an associated count that keeps in track of how many times i've
attempted to retransmit, call it retrans_attempts.

I get an ack from the peer for 150,
do i have to break up the packet on my queue to only be from
150-199, or can i resend the entire packet?  If i do break it up,
does the retrans_attempts count get reset, since this is in essence
a whole new packet?

--v


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: final ACK
Date: Sun, 22 Feb 2004 18:51:45 -0800
Lines: 24
Distribution: su
Message-ID: <c1bps1$fam$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077504705 15702 128.12.61.97 (23 Feb 2004 02:51: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:6318

I have a question about the final FIN/ACK.

Side 1 sends FIN, side 2 sends ACK.

Side 2 keeps sending data.

Eventually, side 2 sends FIN.

Side 1 gets the FIN, and then sends an ACK.
Since we aren't implementing the TIME_WAIT, shouldn't side 1 immediately
close the connection now?  The problem is that this doesn't give side 2 a
chance to retransmit...

How can we predict how long side 2 needs to complete it's retransmission
attempts?

I figured I could use stcp_wait_for_event until there are no more
NETWORK_DATA events, but this still requires some sort of arbitrary timeout,
doesn't it?

Thanks,
Oded


.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: synchronisation problem
Date: Mon, 23 Feb 2004 11:20:24 +0800
Lines: 20
Distribution: su
Message-ID: <40397178.E5D1E5D4@leland.stanford.edu>
References: <c1blh5$9bm$1@news.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077506509 17256 128.12.196.85 (23 Feb 2004 03:21:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6319

I have similar problems before - my program didn't hang, but seg faults when I
remove certain printf's. And it turns out to be some UMR error that I fixed
using purify.

Jimmy

Nicolas Pombourcq wrote:

> I have weird problems with STCP. My implementation seems to work fine most
> of the time, but in several cases it hangs in the middle of the transfer. I
> tried to debug it using our_dprintf statements, but depending on the number
> of printf I put it changes the time at which the problem happens or
> completely suppresses it. The same thing happen's when running in the
> debugger, so I suppose there is some kind of thread synchronization problem
> in the provided code. Does anyone experience the same problem ?
>
> Thanks
>
> Nicolas

.

Path: shelby.stanford.edu!not-for-mail
From: "Joshua Silver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: final ACK
Date: Sun, 22 Feb 2004 20:15:39 -0800
Lines: 43
Distribution: su
Message-ID: <c1bupk$lho$1@news.Stanford.EDU>
References: <c1bps1$fam$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1077509750 22072 127.0.0.1 (23 Feb 2004 04:15: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:6320

Oded,

I was confused about this too, but after reading over this with a fine tooth
comb, I think Side 2 keeps retransmitting the FIN (every 100ms for 5 times)
and then eventually exits because it doesn't get an ACK since Side1 has
already closed the connection.  Of course, I could be way off base.

The instructions for connection termination seem really convoluted for STCP.
Matthew, what's the reason that we aren't just implementing standard TCP
termination?

Josh


 "Oded Wurman" <owurman@stanford.edu> wrote in message
news:c1bps1$fam$1@news.Stanford.EDU...
> I have a question about the final FIN/ACK.
>
> Side 1 sends FIN, side 2 sends ACK.
>
> Side 2 keeps sending data.
>
> Eventually, side 2 sends FIN.
>
> Side 1 gets the FIN, and then sends an ACK.
> Since we aren't implementing the TIME_WAIT, shouldn't side 1 immediately
> close the connection now?  The problem is that this doesn't give side 2 a
> chance to retransmit...
>
> How can we predict how long side 2 needs to complete it's retransmission
> attempts?
>
> I figured I could use stcp_wait_for_event until there are no more
> NETWORK_DATA events, but this still requires some sort of arbitrary
timeout,
> doesn't it?
>
> Thanks,
> Oded
>
>


.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: final ACK
Date: Mon, 23 Feb 2004 04:42:52 +0000 (UTC)
Lines: 38
Distribution: su
Message-ID: <c1c0cc$n9r$1@news.Stanford.EDU>
References: <c1bps1$fam$1@news.Stanford.EDU> <c1bupk$lho$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1077511372 23867 171.64.15.72 (23 Feb 2004 04:42:52 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6321



>I was confused about this too, but after reading over this with a fine tooth
>comb, I think Side 2 keeps retransmitting the FIN (every 100ms for 5 times)
>and then eventually exits because it doesn't get an ACK since Side1 has
>already closed the connection.  Of course, I could be way off base.

No, this is exactly right.  This is a bit of an edge case (it only occurs
if the ACK for a FIN is lost when one side has already had its FIN ACKed,
so it's a rare case), and even if/when it occurs, the other side can still
close the connection... just with a bit of a delay.

>The instructions for connection termination seem really convoluted for STCP.
>Matthew, what's the reason that we aren't just implementing standard TCP
>termination?

The only difference really is that we don't have TIME_WAIT.  That
wouldn't make much sense for us--in real TCP, since the kernel handles all
this, it can keep state around to close a connection gracefully, detect
lingering packets from an old connection, etc.  In our case, we have
a simulated kernel/socket layer, which just goes away completely when
the application dies--so we could only catch a subset of cases that
would normally be handled by TIME_WAIT anyway.  And it would be a bit more
work to implement TIME_WAIT, since then we'd have to keep state around for
2 MSLs before cleaning up/freeing the transport control block, rather
than just deleting it immediately.  (Maybe not a whole lot more work, now
that I think about it, really, but there were plenty of higher priority
things to debug and get working before that.  To be honest, I hadn't even
really thought a lot about this, it had just seemed more trouble than it's
probably worth).

(A more pragmatic viewpoint:  The other reason it's done this way is
because in previous years, STCP had a simple two-way termination... one
side would send a FIN, the other would ACK it and immediately quit.  Making
the termination a 4-way handshake but with similar semantics was the
quickest way to make the protocol roughly TCP-compatible, while porting the
old code into the new framework).

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: data in SYN received state
Date: Mon, 23 Feb 2004 04:56:41 +0000 (UTC)
Lines: 19
Distribution: su
Message-ID: <c1c169$o5l$1@news.Stanford.EDU>
References: <c1bim8$5dj$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1077512201 24757 171.64.15.72 (23 Feb 2004 04:56:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6322


>When I am in SYN_RCVD state ,I am waiting for an ACK for my side of
>connection setup.However the other side is already setup.So I could receive
>data at this point.Am I correct?

Yes.

>I know that if I get an ACK & data packet I process both.My question is-what
>do I do if a pure data packet arrives & I haven't received an ACK yet
>?Should I process it too because the sequence number can be validated.But
>then how do I send an ACK back(coz my side of the connection may or may not
>be setup.)

the data packet is legal (per STCP specs), so you shouldn't just throw it
out because an ACK was lost...

there are any number of possible approaches you can take--why don't
you think through some of them, and suggest one that seems reasonable?

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: data in SYN received state
Date: Mon, 23 Feb 2004 04:57:19 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c1c17f$o6b$1@news.Stanford.EDU>
References: <c1bim8$5dj$1@news.Stanford.EDU> <Pine.GSO.4.44.0402221707090.5427-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1077512239 24779 171.64.15.72 (23 Feb 2004 04:57:19 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6323


>You could penalize the peer by not acking its data packets since it
>violated protocol and did not send you an ACK.  You can do the same :-).

It may have sent an ACK that was dropped somewhere...

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: What is the requirement for the re-transimssion timer granularity?
Date: Mon, 23 Feb 2004 04:58:17 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c1c199$o7v$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221701580.29697-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1077512297 24831 171.64.15.72 (23 Feb 2004 04:58:17 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6324



>Use this design, there are certain packets that could be re-transmitted in
>less than 100ms for the first re-transmission.  Of course, for the next 4
>re-transmissions, they will wait a full 100ms.  Is this good enough?

Yes, this is implied by Go-back N, so this is fine.

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Go back N and retransmissions.
Date: Mon, 23 Feb 2004 05:02:22 +0000 (UTC)
Lines: 24
Distribution: su
Message-ID: <c1c1gu$oi7$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221708330.5427-100000@epic6.Stanford.EDU> <c1bkhc$7ui$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1077512542 25159 171.64.15.72 (23 Feb 2004 05:02:22 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6325


>What happens if while waiting for a timeout the peer advertises a receiver
>window size smaller than the data in your first packet?  You'd have to break
>it up.  I keep a queue of unsent _data_, and when my ACK times out, I
>repackage the data into a new packet and send it again, counting that as a
>retransmission.  Thus if the window size changes, I'm resending the
>appropriate amount of data.

Yes--
The RFC says that TCP implementations "shouldn't" shrink their advertised
window.  We won't be checking this case, so you can assume that if the
data was sent on its initial transmission, it can just be resent on
subsequent transmissions without regard to the advertised receiver window.
(i.e. you only need to worry about sender window on initial transmission
for STCP)

Of course, if you can implement your solution to always obey th_win,
that's even better.  You probably won't actually see a difference in this
assignment, since it's highly unlikely that any real TCP implementation
would advertise th_win < 3072 anyway...

Whether or not you choose to implement the 'correct' way, you should
think about how real TCP would do it anyway :-)

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Go back N and retransmissions.
Date: Mon, 23 Feb 2004 05:06:36 +0000 (UTC)
Lines: 24
Distribution: su
Message-ID: <c1c1os$ore$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221708330.5427-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1077512796 25454 171.64.15.72 (23 Feb 2004 05:06:36 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6326


>Let's say I sent 4 packets to the peer and timeout occurred for packet 1.
>I resend all 4 packets again.  Let's say that after 2nd attempt,
>I received an ACK for packet 1.  Here are few questions:

>1). Does timeout for packet 2 should be counted from time wnen it
>was sent the first time or when it was retransimitted due to
>retransmission of packet 1.  I'm leaning towards the former.

probably doesn't matter too much--whatever suits your fancy.
STCP timeouts are a bit nebulous--choices are arbitrary, and in practice,
a real transport layer wouldn't just give up after 5 retries of 100ms
each...

>2). After retransmission of all of the packets due to timeout of
>packet # 1, packet # 1 should have # of retries field set to 1
>(i.e 1  retry commenced).
>What about packets # 2,3, and 4.  Techinically their original timeout
>never occurred, yet they were sent twice already.

this is a somewhat arbitrary decision, but each transmission of a segment is
counted, regardless of whether it was because the segment timed out, or
because it was retransmitted as part of go-back-n.

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Required Paths of State-Diagram to Support
Date: Mon, 23 Feb 2004 05:09:03 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c1c1tf$ov3$1@news.Stanford.EDU>
References: <4036FE08.21F7CF2F@stanford.edu> <c182gg$qs8$1@news.Stanford.EDU> <c1bkbi$7la$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1077512943 25571 171.64.15.72 (23 Feb 2004 05:09:03 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6327


>From FIN_WAIT_1 if you get a ACK+FIN, you respond with an ACK and go
>straight to CLOSED (since we are bypassing TIME_WAIT).  This is what the
>diagram shows in P&D.

>I simply dealt with this by checking ACK first (thus going from FIN_WAIT_1
>to FIN_WAIT_2) and FIN second (thus going from FIN_WAIT_2 to CLOSED).

Yes, that was what I meant--this is two transitions per the RFC793 state
diagram...

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: More test script problem: Unrecognized assertion
Date: Mon, 23 Feb 2004 13:21:06 +0800
Lines: 52
Distribution: su
Message-ID: <40398DC2.4AE39CD2@leland.stanford.edu>
References: <Pine.GSO.4.44.0402211455380.16347-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077513755 26763 128.12.196.85 (23 Feb 2004 05:22:35 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6328

I have a similar problem on running the test script for hw3b:

Test 2.B [out of 20]
Checks student Tx (server) against reference Rx (client).

Results:  NOT OK

Unexpected exit status 6.  Program output:
server: TESTDATA.0,110230,Ok
Assertion failed: segment->offset >= 0 && segment->offset < MAX_PAYLOAD_SIZE, file
transport.c, line 1613

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

I don't have those variables in my transport.c either. What is going on?

Jimmy

Xiaohua Fang wrote:

> See the following test script output.  It shows that there is an assertion
> failed at transport.c:1840.  The odd thing is that my transport.c only
> have 1021 lines and I don't even have those variable such as:
> ctx->last_byte_acked or ctx->advertised_receiver_window
>
> What is wrong?
>
> ==
> Assertion failed: segment->seq_num + segment->data_len <=
> ctx->last_byte_acked +
>  ctx->advertised_receiver_window + 1, file transport.c, line 1840
> =More details=
>
> Starting server: /usr/class/cs244a/grading_script/hw3/server_no_retrans
> -p /afs
> /ir.stanford.edu/users/x/x/xxf5/cs244/hw3/grading_src/build/.server_port
> 2>&1 >
> /afs/ir.stanford.edu/users/x/x/xxf5/cs244/hw3/grading_src/build/.server_output^M
> Server started^M
> Starting client: ./client  -p .server_port -f TESTDATA.0 foo^M
> connected to 171.64.15.118 at port 60663^M
> client: TESTDATA.0^M
> Assertion failed: segment->seq_num + segment->data_len <=
> ctx->last_byte_acked +
>  ctx->advertised_receiver_window + 1, file transport.c, line 1840^M
> Abort^M
> warning:  client exited with non-zero status (-1)^M
> program output:^M
> ***Timeout expired during grading^M
> Program output:^M
> server: TESTDATA.0,110230,Ok^M

.

Path: shelby.stanford.edu!not-for-mail
From: Tony Hsieh <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: server stays open
Date: Sun, 22 Feb 2004 21:55:32 -0800
Lines: 7
Distribution: su
Message-ID: <403995D4.8030209@stanford.edu>
NNTP-Posting-Host: perch.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077515675 28951 171.64.75.22 (23 Feb 2004 05:54:35 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6329

when i run the debugging server and client, i am able to transmit a file 
and have the client shut down.  However, the server performs the correct 
4 way handshake, sets ctx->done to TRUE, but does not exit.  If I run it 
in gdb, I interrupt it and it just says the thread is polling.  I have 
no idea why b/c the program should have exited.  Is there something I'm 
missing?  Thanks.

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: are data and flags correlated
Date: Sun, 22 Feb 2004 23:14:38 -0800
Lines: 16
Distribution: su
Message-ID: <c1c98l$4mn$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1077520469 4823 128.12.189.163 (23 Feb 2004 07:14:29 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:6330

Hi,
Should I be checking for legality of flags, ie process all the falgs before
I process my data?
right now, when I check for an acceptable segement, then I accept the
segment data, if the data falls within the receiver window.
Then i process the various flags.If any of the flags don't match, i do print
an error.
But at this point my packet with invalid flags has had its data processed.Is
it ok to do that?
ie assume that you may get a data packet with invalid flags thus effectively
checking flags & data independently
Or do you completely ignore the packet which does not have valid flags?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: What is the requirement for the re-transimssion timer granularity?
Date: Sun, 22 Feb 2004 23:26:02 -0800
Lines: 26
Distribution: su
Message-ID: <c1c9uc$5da$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221701580.29697-100000@elaine43.Stanford.EDU> <c1c199$o7v$1@news.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1077521164 5546 128.12.44.20 (23 Feb 2004 07:26: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:6331

A quick question about the wording of how long the retransmission timeout
should be:

"The only requirement is that you clamp the timeout to be at least 100ms."

This would seem to imply that you can't retransmit a packet until 100ms have
passed, ie, if 50ms go by and your retransmit thread wakes up, you're not
allowed to send the packet yet. However, you just said that such a situation
(retransmitting after 50ms) would be fine. Does that mean that the
assignment description was improperly worded somehow?

- Sean

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1c199$o7v$1@news.Stanford.EDU...
>
>
> >Use this design, there are certain packets that could be re-transmitted
in
> >less than 100ms for the first re-transmission.  Of course, for the next 4
> >re-transmissions, they will wait a full 100ms.  Is this good enough?
>
> Yes, this is implied by Go-back N, so this is fine.
>


.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: retrieve() msg from ftpd_tcp
Date: Mon, 23 Feb 2004 07:26:37 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <c1c9vc$5cj$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine6.stanford.edu
X-Trace: news.Stanford.EDU 1077521197 5523 171.64.15.71 (23 Feb 2004 07:26:37 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:6332

Everytime I transfer some data using ftpd_tcp, I get:

retrieve(): closed socket after sending data

What does that mean? Is that normal?
.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: data in SYN received state
Date: Sun, 22 Feb 2004 23:40:39 -0800
Lines: 48
Distribution: su
Message-ID: <c1capm$6ci$1@news.Stanford.EDU>
References: <c1bim8$5dj$1@news.Stanford.EDU> <c1c169$o5l$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1077522038 6546 128.12.173.169 (23 Feb 2004 07:40: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:6333

I am confused by your reply. So I understand why in SYN_RCVD state, if we
get a packet with no ACK field set but with data, we cannot just throw away
the data, because STCP does not care about ack numbers for packets that have
some data. But shouldn't such a case be disallowed specially for SYN_RCVD
state, because what can we possibly do after storing the data in our recv
buffer...it is definitely NOT OK to send this data upto the app above
because the connection has not been established from our side, is that
correct?

If it is actually OK to send this data upto the app, this would imply that
we MUST send an ACK back. But if we send an ACK, that could be really bad
because that would "signify" to the other side that the connection is all
setup and working and then the other side might just keep on sending more
and more data packets with no ACK field set.

So I do not see any option here but to discard the data completely when we
are in SYN_RCVD state AND the packet does not have ACK field set.

Thanks

Kumar

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1c169$o5l$1@news.Stanford.EDU...
>
> >When I am in SYN_RCVD state ,I am waiting for an ACK for my side of
> >connection setup.However the other side is already setup.So I could
receive
> >data at this point.Am I correct?
>
> Yes.
>
> >I know that if I get an ACK & data packet I process both.My question
is-what
> >do I do if a pure data packet arrives & I haven't received an ACK yet
> >?Should I process it too because the sequence number can be validated.But
> >then how do I send an ACK back(coz my side of the connection may or may
not
> >be setup.)
>
> the data packet is legal (per STCP specs), so you shouldn't just throw it
> out because an ACK was lost...
>
> there are any number of possible approaches you can take--why don't
> you think through some of them, and suggest one that seems reasonable?
>


.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Real TCP
Date: Mon, 23 Feb 2004 07:59:53 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c1cbtp$7lm$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine15.stanford.edu
X-Trace: news.Stanford.EDU 1077523193 7862 171.64.15.80 (23 Feb 2004 07:59:53 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:6334

Has anyone figured out how to test against a real TCP host?  I haven't been able to get 
ftpcopy_vns or the echo server/client to work.  Without these, test attempts run out very 
fast.

Tyrone

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: data in SYN received state
Date: Mon, 23 Feb 2004 00:08:36 -0800
Lines: 38
Distribution: su
Message-ID: <Pine.GSO.4.44.0402230003050.15053-100000@elaine43.Stanford.EDU>
References: <c1bim8$5dj$1@news.Stanford.EDU> <c1c169$o5l$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077523719 8994 171.64.15.118 (23 Feb 2004 08:08:39 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
In-Reply-To: <c1c169$o5l$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6335


Matthew,

Could you please point me to the assignment section where specified what
you stated in the post?
===
 the data packet is legal (per STCP specs),
===

Per RFC 793, for the SYN_RCVD state, it has to receive an ACK before it
can process the data (pg. 72, "SYN-RECEIVED STATE ... enter ESTABLISHED
state ...", pg. 74, "seventh, process the segment text ..", no mention of
SEND_RCVD state at all).


On Mon, 23 Feb 2004, Matthew Jonathan Holliman wrote:

>
> >When I am in SYN_RCVD state ,I am waiting for an ACK for my side of
> >connection setup.However the other side is already setup.So I could receive
> >data at this point.Am I correct?
>
> Yes.
>
> >I know that if I get an ACK & data packet I process both.My question is-what
> >do I do if a pure data packet arrives & I haven't received an ACK yet
> >?Should I process it too because the sequence number can be validated.But
> >then how do I send an ACK back(coz my side of the connection may or may not
> >be setup.)
>
> the data packet is legal (per STCP specs), so you shouldn't just throw it
> out because an ACK was lost...
>
> there are any number of possible approaches you can take--why don't
> you think through some of them, and suggest one that seems reasonable?
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Lei Zhang" <lei.zhang@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test 1.H
Date: Mon, 23 Feb 2004 00:14:58 -0800
Lines: 56
Distribution: su
Message-ID: <c1ccqd$9if$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1077524112 9807 127.0.0.1 (23 Feb 2004 08:15: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:6336

I passed this test twice on epic. But it failed once with 'No FIN sent!'
when I was on elaine. There is no code change between runs. And I manually
run tests for 1.H on elaine, the end of the log are as follows, which looks
ok to me.

TESTDATA.0
Server:
....
log: network_recv: a FIN packet with seq=145, len=0 and timestamp=3781624943
log: network_send: an ACK packet with seq=110384, len=0 and ack=146 and
timestamp=3781624943
log: network_send: a FIN packet with seq=110385, len=0 and
timestamp=3781624944
log: network_recv: an ACK packet with seq=145, len=0 and ack=110386 and
timestamp=3781625140

Client:
....
log: network_send: a FIN packet with seq=145, len=0 and timestamp=3781624896
log: network_recv: an ACK packet with seq=110384, len=0 and ack=146 and
timestamp=3781625040
log: network_recv: a FIN packet with seq=110385, len=0 and
timestamp=3781625040
log: network_send: an ACK packet with seq=145, len=0 and ack=110386 and
timestamp=3781625040

TESTDATA.1
Server:
....
log: network_recv: a FIN packet with seq=145, len=0 and timestamp=3781943645
log: network_send: an ACK packet with seq=299482, len=0 and ack=146 and
timestamp=3781943645
log: network_send: a FIN packet with seq=299483, len=0 and
timestamp=3781943645
log: network_recv: an ACK packet with seq=145, len=0 and ack=299484 and
timestamp=3781943845

Client:
....
log: network_send: a FIN packet with seq=145, len=0 and timestamp=3781943604
log: network_recv: an ACK packet with seq=299482, len=0 and ack=146 and
timestamp=3781943744
log: network_recv: a FIN packet with seq=299483, len=0 and
timestamp=3781943745
log: network_send: an ACK packet with seq=145, len=0 and ack=299484 and
timestamp=3781943745

What does this test do? Will it cause any difference running on different
boxes? Or just timing (my elaine run was between two epic runs)? I have
(almost) no testing quota left to figure this out.

Any input is very appreciated.

Lei


.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: What is the requirement for the re-transimssion timer granularity?
Date: Mon, 23 Feb 2004 00:17:01 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.GSO.4.44.0402230009130.15053-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0402221701580.29697-100000@elaine43.Stanford.EDU>
 <c1c199$o7v$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077524226 9967 171.64.15.118 (23 Feb 2004 08:17:06 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
In-Reply-To: <c1c199$o7v$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6337

One futher question:

Say, at t = 50ms, the packet is sent out and queued for retransmission
(this is the first queued packet),
at time t = 100ms, the 100ms timer times out, that queued packet will be sent
out then, which means only 50 ms RTO.  After that, the re-transmission
will happen every 100ms.
Is this good enough?

-Laura

On Mon, 23 Feb 2004, Matthew Jonathan Holliman wrote:

>
>
> >Use this design, there are certain packets that could be re-transmitted in
> >less than 100ms for the first re-transmission.  Of course, for the next 4
> >re-transmissions, they will wait a full 100ms.  Is this good enough?
>
> Yes, this is implied by Go-back N, so this is fine.
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Nicolas Pombourcq" <nicolas.pombourcq@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: synchronisation problem
Date: Mon, 23 Feb 2004 01:35:15 -0800
Lines: 3
Distribution: su
Message-ID: <c1chjh$eat$1@news.Stanford.EDU>
References: <c1blh5$9bm$1@news.Stanford.EDU> <40397178.E5D1E5D4@leland.stanford.edu>
NNTP-Posting-Host: mummy.stanford.edu
X-Trace: news.Stanford.EDU 1077529009 14685 128.12.188.73 (23 Feb 2004 09:36: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:6338

I forgot to mention that purify doesn't find any memory error.


.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: synchronisation problem
Date: Mon, 23 Feb 2004 09:44:00 +0000 (UTC)
Lines: 21
Distribution: su
Message-ID: <c1ci0v$eiu$1@news.Stanford.EDU>
References: <c1blh5$9bm$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine39.stanford.edu
X-Trace: news.Stanford.EDU 1077529440 14942 171.64.15.114 (23 Feb 2004 09:44:00 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:6339

I'm getting something like this, but only while testing the client against 
the reference server.  My own server and client work fine.

Tyrone

Nicolas Pombourcq <nicolas.pombourcq@stanford.edu> wrote:
> I have weird problems with STCP. My implementation seems to work fine most
> of the time, but in several cases it hangs in the middle of the transfer. I
> tried to debug it using our_dprintf statements, but depending on the number
> of printf I put it changes the time at which the problem happens or
> completely suppresses it. The same thing happen's when running in the
> debugger, so I suppose there is some kind of thread synchronization problem
> in the provided code. Does anyone experience the same problem ?



> Thanks

> Nicolas


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: final ACK
Date: Mon, 23 Feb 2004 02:01:13 -0800
Lines: 7
Distribution: su
Message-ID: <c1cj1b$frq$1@news.Stanford.EDU>
References: <c1bps1$fam$1@news.Stanford.EDU> <c1bupk$lho$1@news.Stanford.EDU> <c1c0cc$n9r$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077530475 16250 128.12.61.97 (23 Feb 2004 10:01: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:6340

Well, my connection does terminate after timeout, but it seems to fail test
1.I as a result (no ACK for FIN...) Should I just up my timeout?  It's
cuirrently at 100 ms....

Oded


.

Path: shelby.stanford.edu!elaine33.Stanford.EDU!hcpang
From: Hoi-Cheung Pang <hcpang@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Timeout for Receiver?
Date: Mon, 23 Feb 2004 02:23:29 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.GSO.4.44.0402230218310.3670-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 1077531812 17727 171.64.15.108 (23 Feb 2004 10:23:32 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6341

Hi,

So I'm wondering if we need to handle the following two cases:
1. Suppose the sender side suddenly died during sending, how can the
receiver know about it? One way to do this is to timeout when we have
sequence numbers missing in the receiver buffer for a long time period.
However this is not mentioned in the assignment page. Do we have to handle
this case?

2. Suppose side A just sent FIN to side B. Side B sends ACK to A. Then
side B suddenly died. In the current description of STCP, side A would
just wait indefinitely for side B to send a FIN. Again, do we have to
handle this case?

Thanks,
Jimmy

.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Assertion (th_seq==next_expected) and the testing script
Date: Mon, 23 Feb 2004 06:40:50 -0800
Lines: 13
Distribution: su
Message-ID: <403A10F2.B7BF315E@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077547271 3831 127.0.0.1 (23 Feb 2004 14:41: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:6342

In Test 1.B, I could see some assertion failures (all happening
at the same place) but the final result said OK.
How should I interpret the result? Is it really okay?

What failed was the assertion that, when a packet was received from
the network layer, the sequence number should be the next byte number
expected. I thought it made sense since the network was in-order and
reliable for this milestone, but I don't see how it could possibly
have failed. Any idea?

-- 
Seungbeom Kim

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: final ACK
Date: Mon, 23 Feb 2004 07:37:12 -0800
Lines: 54
Distribution: su
Message-ID: <c1d6n5$6tn$1@news.Stanford.EDU>
References: <c1bps1$fam$1@news.Stanford.EDU> <c1bupk$lho$1@news.Stanford.EDU> <c1c0cc$n9r$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077550629 7095 128.12.61.97 (23 Feb 2004 15:37: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:6343

So I changed my timeout to 200 ms and it works better now.  However, to not
be reliant on timeout values, is it acceptable if I interpret a
stcp_network_send return value of -1 in the LAST_ACK state as the other side
closing the connection and automatically terminate my side of the
connection?

Thanks,
Oded

>
>
> >I was confused about this too, but after reading over this with a fine
tooth
> >comb, I think Side 2 keeps retransmitting the FIN (every 100ms for 5
times)
> >and then eventually exits because it doesn't get an ACK since Side1 has
> >already closed the connection.  Of course, I could be way off base.
>
> No, this is exactly right.  This is a bit of an edge case (it only occurs
> if the ACK for a FIN is lost when one side has already had its FIN ACKed,
> so it's a rare case), and even if/when it occurs, the other side can still
> close the connection... just with a bit of a delay.
>
> >The instructions for connection termination seem really convoluted for
STCP.
> >Matthew, what's the reason that we aren't just implementing standard TCP
> >termination?
>
> The only difference really is that we don't have TIME_WAIT.  That
> wouldn't make much sense for us--in real TCP, since the kernel handles all
> this, it can keep state around to close a connection gracefully, detect
> lingering packets from an old connection, etc.  In our case, we have
> a simulated kernel/socket layer, which just goes away completely when
> the application dies--so we could only catch a subset of cases that
> would normally be handled by TIME_WAIT anyway.  And it would be a bit more
> work to implement TIME_WAIT, since then we'd have to keep state around for
> 2 MSLs before cleaning up/freeing the transport control block, rather
> than just deleting it immediately.  (Maybe not a whole lot more work, now
> that I think about it, really, but there were plenty of higher priority
> things to debug and get working before that.  To be honest, I hadn't even
> really thought a lot about this, it had just seemed more trouble than it's
> probably worth).
>
> (A more pragmatic viewpoint:  The other reason it's done this way is
> because in previous years, STCP had a simple two-way termination... one
> side would send a FIN, the other would ACK it and immediately quit.
Making
> the termination a 4-way handshake but with similar semantics was the
> quickest way to make the protocol roughly TCP-compatible, while porting
the
> old code into the new framework).
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Real TCP
Date: Mon, 23 Feb 2004 09:44:58 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.LNX.4.44.0402230943470.3766-100000@Xenon.Stanford.EDU>
References: <c1cbtp$7lm$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 1077558300 15367 171.64.66.201 (23 Feb 2004 17:45:00 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <c1cbtp$7lm$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6344


 Tyrone,

   The topologies for hw4 have not been set up yet (I'll do that today).
   However you should still be able to connect to your old topology and connect
   using your TCP stack to an external ftp server.  

   What exact problems are you having?

   .m

> Has anyone figured out how to test against a real TCP host?  I haven't been able to get 
> ftpcopy_vns or the echo server/client to work.  Without these, test attempts run out very 
> fast.
> 
> Tyrone
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Martin's Office Hours
Date: Mon, 23 Feb 2004 09:47:02 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.LNX.4.44.0402230946190.3766-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 1077558424 15522 171.64.66.201 (23 Feb 2004 17:47:04 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6345


 Hi All,

   I am moving my office hours to tomorrow evening.  Email me directly if this
   will be a problem.

   Cheers,
   Martin

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Real TCP
Date: Mon, 23 Feb 2004 18:21:25 +0000 (UTC)
Lines: 28
Distribution: su
Message-ID: <c1dgb5$hh7$1@news.Stanford.EDU>
References: <c1cbtp$7lm$1@news.Stanford.EDU> <Pine.LNX.4.44.0402230943470.3766-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine18.stanford.edu
X-Trace: news.Stanford.EDU 1077560485 17959 171.64.15.83 (23 Feb 2004 18: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:6346

Martin Casado <casado@xenon.stanford.edu> wrote:

>    What exact problems are you having?

ftpcopy_vns -t 162 -v 192.168.129.56 -s vns-1.stanford.edu -r rtable exe 
1 ftp.microsoft.com
********************
Destination: 0.0.0.0
  Gateway : 172.24.74.17
  Mask : 0.0.0.0
  Interface : eth0
Destination: 0.0.0.0
  Gateway : 172.24.74.17
  Mask : 0.0.0.0
  Interface : eth0
********************
Client pepe connecting to Server vns-1.stanford.edu:12345
Requesting topology 162
Sending c_open (type=1 len=108)
vns server closed session.
Reason: reservehost failed
recv(..):sr_client.c::sr_read_from_server: Bad file number
Error: could not get hardware information from the server[TODO]: 
sr_vns_integ_destroy
can't initialise VNS subsystem


Tyrone
.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Real TCP
Date: Mon, 23 Feb 2004 18:31:02 +0000 (UTC)
Lines: 67
Distribution: su
Message-ID: <c1dgt6$ia4$1@news.Stanford.EDU>
References: <c1cbtp$7lm$1@news.Stanford.EDU> <Pine.LNX.4.44.0402230943470.3766-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077561062 18756 171.64.15.66 (23 Feb 2004 18:31:02 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:6347

I also tried it leaving out the -v option (I read through hw4 and the review
session notes, but still don't understand just what this option does) and got
this result (on elaine1):

ftpcopy_vns -t 162 -s vns-1.stanford.edu -r rtable exe 1 ftp.microsoft.com
********************
Destination: 0.0.0.0
  Gateway : 172.24.74.17
  Mask : 0.0.0.0
  Interface : eth0
Destination: 0.0.0.0
  Gateway : 172.24.74.17
  Mask : 0.0.0.0
  Interface : eth0
********************
Client pepe connecting to Server vns-1.stanford.edu:12345
Requesting topology 162
Sending c_open (type=1 len=108)
Received Hardware Info with 18 entries
Interface: eth0
Speed: 0
Hardware Address: 70:00:00:a2:00:01
Ethernet IP: 192.168.129.56
Subnet: 0.0.0.0
Mask: 0.0.0.0
Interface: eth1
Speed: 0
Hardware Address: 70:00:00:a2:00:02
Ethernet IP: 192.168.129.57
Subnet: 0.0.0.0
Mask: 0.0.0.0
Interface: eth2
Speed: 0
Hardware Address: 70:00:00:a2:00:06
Ethernet IP: 192.168.129.59
Subnet: 0.0.0.0
Mask: 0.0.0.0
Interface: eth0
  hardware address 70:00:00:a2:00:01
  ip address 192.168.129.56
Interface: eth1
  hardware address 70:00:00:a2:00:02
  ip address 192.168.129.57
Interface: eth2
  hardware address 70:00:00:a2:00:06
  ip address 192.168.129.59
* routing packet to default gateway at 172.24.74.17 on interface eth0
<- sending arp request for ip 172.24.74.17 on interface eth0
* added ip packet  to arp queue
-> received ARP reply from 172.24.74.17
<- sending queued packet
Attempting to send packet out on interface eth0
-> received ARP request
* arp is not for us 171.67.71.83
-> received ARP request
* arp is not for us 171.67.71.188
-> received ARP request
* arp is not for us 192.168.129.201
-> received ARP request
* arp is not for us 171.67.71.83
-> received ARP request
* arp is not for us 171.67.71.188
-> received ARP request
* arp is not for us 192.168.129.201
^C

(Terminated with Ctrl-C)
.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: No retransmission for pure ACK message, why?
Date: Mon, 23 Feb 2004 10:52:38 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.GSO.4.44.0402231047530.1582-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 1077562360 20661 171.64.15.118 (23 Feb 2004 18:52:40 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6348


In the assignment, Section "Retransmission", the first bullet:

"Whenever a SYN, data or FIN segment (.... anything more than just an
ack...) is transmitted ...."

My intepretation from this is that a pure ACK message should not be
re-transmitted.  But why?  If I understand STCP correctly, ACK could be
sent out
in a separate packet.  If this packet is lost somewhere (without
retransmission), how could the other side sync up? This is especially a
problem in the connection set up time.

Could TA please explain?

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: No retransmission for pure ACK message, why?
Date: Mon, 23 Feb 2004 11:24:28 -0800
Lines: 24
Distribution: su
Message-ID: <c1dk18$lv5$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402231047530.1582-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077564264 22501 128.12.61.97 (23 Feb 2004 19:24: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:6349

If the ACK is lost, it's up to the other side of the connection to
retransmit it's SYN/FIN/data, thus generating another ACK.  To retransmit
ACKs we would need to ACK an ACK, which will cause an infinite loop.

Oded


>
> In the assignment, Section "Retransmission", the first bullet:
>
> "Whenever a SYN, data or FIN segment (.... anything more than just an
> ack...) is transmitted ...."
>
> My intepretation from this is that a pure ACK message should not be
> re-transmitted.  But why?  If I understand STCP correctly, ACK could be
> sent out
> in a separate packet.  If this packet is lost somewhere (without
> retransmission), how could the other side sync up? This is especially a
> problem in the connection set up time.
>
> Could TA please explain?
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Real TCP
Date: Mon, 23 Feb 2004 11:35:07 -0800
Lines: 88
Distribution: su
Message-ID: <Pine.LNX.4.44.0402231127440.16165-100000@Xenon.Stanford.EDU>
References: <c1cbtp$7lm$1@news.Stanford.EDU> <Pine.LNX.4.44.0402230943470.3766-100000@Xenon.Stanford.EDU>
 <c1dgt6$ia4$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 1077564909 23272 171.64.66.201 (23 Feb 2004 19:35:09 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <c1dgt6$ia4$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6350



 This looks OK except that I don't see  a reply to your initial SYN packet
which you can see is being sent here:

  * routing packet to default gateway at 172.24.74.17 on interface eth0
  <- sending arp request for ip 172.24.74.17 on interface eth0
  * added ip packet  to arp queue
  -> received ARP reply from 172.24.74.17
  <- sending queued packet
  Attempting to send packet out on interface eth0

 You should get a response back from the server.  Either your SYN is being
dropped or the response isn't making it back.  You can test this by hand
if you have access to a machine with root.  Or you can come to my office hours on Tues. and
we can see what is going on.

 .m

> I also tried it leaving out the -v option (I read through hw4 and the review
> session notes, but still don't understand just what this option does) and got
> this result (on elaine1):
> 
> ftpcopy_vns -t 162 -s vns-1.stanford.edu -r rtable exe 1 ftp.microsoft.com
> ********************
> Destination: 0.0.0.0
>   Gateway : 172.24.74.17
>   Mask : 0.0.0.0
>   Interface : eth0
> Destination: 0.0.0.0
>   Gateway : 172.24.74.17
>   Mask : 0.0.0.0
>   Interface : eth0
> ********************
> Client pepe connecting to Server vns-1.stanford.edu:12345
> Requesting topology 162
> Sending c_open (type=1 len=108)
> Received Hardware Info with 18 entries
> Interface: eth0
> Speed: 0
> Hardware Address: 70:00:00:a2:00:01
> Ethernet IP: 192.168.129.56
> Subnet: 0.0.0.0
> Mask: 0.0.0.0
> Interface: eth1
> Speed: 0
> Hardware Address: 70:00:00:a2:00:02
> Ethernet IP: 192.168.129.57
> Subnet: 0.0.0.0
> Mask: 0.0.0.0
> Interface: eth2
> Speed: 0
> Hardware Address: 70:00:00:a2:00:06
> Ethernet IP: 192.168.129.59
> Subnet: 0.0.0.0
> Mask: 0.0.0.0
> Interface: eth0
>   hardware address 70:00:00:a2:00:01
>   ip address 192.168.129.56
> Interface: eth1
>   hardware address 70:00:00:a2:00:02
>   ip address 192.168.129.57
> Interface: eth2
>   hardware address 70:00:00:a2:00:06
>   ip address 192.168.129.59
> * routing packet to default gateway at 172.24.74.17 on interface eth0
> <- sending arp request for ip 172.24.74.17 on interface eth0
> * added ip packet  to arp queue
> -> received ARP reply from 172.24.74.17
> <- sending queued packet
> Attempting to send packet out on interface eth0
> -> received ARP request
> * arp is not for us 171.67.71.83
> -> received ARP request
> * arp is not for us 171.67.71.188
> -> received ARP request
> * arp is not for us 192.168.129.201
> -> received ARP request
> * arp is not for us 171.67.71.83
> -> received ARP request
> * arp is not for us 171.67.71.188
> -> received ARP request
> * arp is not for us 192.168.129.201
> ^C
> 
> (Terminated with Ctrl-C)
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: VNS
Date: Mon, 23 Feb 2004 13:33:22 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.LNX.4.44.0402231332270.31394-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 1077572004 1724 171.64.66.201 (23 Feb 2004 21:33:24 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6351


 I'll be installing and testing topologies for the next hour or so
 so the VNS may behave strangely during this time).

 If this is a problem, please let me know ASAP.

 Cheers,
 .martin

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Real TCP
Date: Mon, 23 Feb 2004 22:28:15 +0000 (UTC)
Lines: 22
Distribution: su
Message-ID: <c1dupv$54f$1@news.Stanford.EDU>
References: <c1cbtp$7lm$1@news.Stanford.EDU> <Pine.LNX.4.44.0402230943470.3766-100000@Xenon.Stanford.EDU>  <c1dgt6$ia4$1@news.Stanford.EDU> <Pine.LNX.4.44.0402231127440.16165-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077575295 5263 171.64.15.66 (23 Feb 2004 22:28:15 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6352




>  * routing packet to default gateway at 172.24.74.17 on interface eth0
>  <- sending arp request for ip 172.24.74.17 on interface eth0
>  * added ip packet  to arp queue
>  -> received ARP reply from 172.24.74.17
>  <- sending queued packet
>  Attempting to send packet out on interface eth0

Be sure that you're using the right routing table.  You'll have to create
this yourself, based on whatever your topology looks like.

> I also tried it leaving out the -v option (I read through hw4 and the review
> session notes, but still don't understand just what this option does) and got
> this result (on elaine1):

This allows you to specify the place in the topology where your FTP
client runs--vhost will be the virtual host connected off your router,
vrouter basically allows you to run the client in place of your router.
(of course, this assumes the HW4 topology, which is being installed now).

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Retransmission for paritally acked packets
Date: Mon, 23 Feb 2004 22:30:33 +0000 (UTC)
Lines: 20
Distribution: su
Message-ID: <c1duu9$59j$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221804500.16712-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077575433 5427 171.64.15.66 (23 Feb 2004 22:30:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6353


>Lets say i have a packet, seqnum=100-199 on my retransmit q.  Each packet
>has an associated count that keeps in track of how many times i've
>attempted to retransmit, call it retrans_attempts.

>I get an ack from the peer for 150,
>do i have to break up the packet on my queue to only be from
>150-199, or can i resend the entire packet?  If i do break it up,

A compliant peer should be able to handle either case.  It seems
friendlier to just send 150-199, though.

>does the retrans_attempts count get reset, since this is in essence
>a whole new packet?

If you followed that rule, you could 'cheat' and retransmit some bytes
a huge number of times...

Every sequence number should be retransmitted no more than 5 times.

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: server stays open
Date: Mon, 23 Feb 2004 22:32:28 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <c1dv1s$5e0$1@news.Stanford.EDU>
References: <403995D4.8030209@stanford.edu>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077575548 5568 171.64.15.66 (23 Feb 2004 22:32:28 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6354


>when i run the debugging server and client, i am able to transmit a file 
>and have the client shut down.  However, the server performs the correct 
>4 way handshake, sets ctx->done to TRUE, but does not exit.  If I run it 
>in gdb, I interrupt it and it just says the thread is polling.  I have 
>no idea why b/c the program should have exited.  Is there something I'm 
>missing?  Thanks.

Can you clarify exactly which server you're referring to?  The
regular server (server.c) just loops around forever accepting
connections.  I don't know what the "debugging server" is...

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: are data and flags correlated
Date: Mon, 23 Feb 2004 22:38:41 +0000 (UTC)
Lines: 22
Distribution: su
Message-ID: <c1dvdh$5rh$1@news.Stanford.EDU>
References: <c1c98l$4mn$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077575921 6001 171.64.15.66 (23 Feb 2004 22:38:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6355


>Should I be checking for legality of flags, ie process all the falgs before
>I process my data?

I refer you again to the course programming guidelines:
http://www.stanford.edu/class/cs244a/project_guidelines.html

Please read over the section on "Implementation Rules," particularly
the final paragraph.

Does this seem a reasonable design decision to you?  Why or why not?
What flags are invalid?  In which situations would it make sense to
accept data, and when should you throw it out?  (As is, your question
is too vague to even provide any guidance).

>right now, when I check for an acceptable segement, then I accept the
>segment data, if the data falls within the receiver window.
>Then i process the various flags.If any of the flags don't match, i do print
>an error.

Don't match what, exactly?

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: What is the requirement for the re-transimssion timer granularity?
Date: Mon, 23 Feb 2004 22:44:32 +0000 (UTC)
Lines: 27
Distribution: su
Message-ID: <c1dvog$68v$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221701580.29697-100000@elaine43.Stanford.EDU> <c1c199$o7v$1@news.Stanford.EDU> <c1c9uc$5da$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077576272 6431 171.64.15.66 (23 Feb 2004 22:44:32 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6356


>"The only requirement is that you clamp the timeout to be at least 100ms."

>This would seem to imply that you can't retransmit a packet until 100ms have
>passed, ie, if 50ms go by and your retransmit thread wakes up, you're not
>allowed to send the packet yet. However, you just said that such a situation
>(retransmitting after 50ms) would be fine. Does that mean that the
>assignment description was improperly worded somehow?

not really--the timeout applies to your sender window (assuming you use
a fixed timeout interval).  it's possible that individual packets in there
may be retransmitted sooner than 100ms (the first time at least), but
whichever timer fires for the retransmission shouldn't do so quicker than
100ms.

as you can tell from the assignment description, quite how you
implement timeouts is somewhat at your discretion.  if you have
a timeout interval that's too short, you can sometimes timeout
erroneously on the leland systems when they're heavily loaded
(since we run in user space, we're more prone to this than regular
TCP would be).  100ms just seemed a reasonable value that would
mitigate this effect, but it's an ad hoc choice.  if your implementation
works with a different value, that's fine too--we aren't picky on this.

probably "requirement" should say "suggestion" instead, but then
people would just ignore the point...

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: What is the requirement for the re-transimssion timer granularity?
Date: Mon, 23 Feb 2004 22:47:14 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c1dvti$6d4$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221701580.29697-100000@elaine43.Stanford.EDU>  <c1c199$o7v$1@news.Stanford.EDU> <Pine.GSO.4.44.0402230009130.15053-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077576434 6564 171.64.15.66 (23 Feb 2004 22:47:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6357


>Say, at t = 50ms, the packet is sent out and queued for retransmission
>(this is the first queued packet),
>at time t = 100ms, the 100ms timer times out, that queued packet will be sent
>out then, which means only 50 ms RTO.  After that, the re-transmission
>will happen every 100ms.
>Is this good enough?

hmm.  if it works, I guess that's okay, but it seems a strange design to
me.  you can support precise timeouts easily enough with stcp_wait_for_event(),
rather than having a separate timer running every 100ms.  and if you
find you need to incorporate RTO estimation later, it would be easier to
do if you were waiting for the actual RTO rather than just some arbitrary
time in the future.
.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: retrieve() msg from ftpd_tcp
Date: Mon, 23 Feb 2004 22:49:25 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c1e01l$6ja$1@news.Stanford.EDU>
References: <c1c9vc$5cj$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077576565 6762 171.64.15.66 (23 Feb 2004 22:49:25 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6358


>Everytime I transfer some data using ftpd_tcp, I get:

>retrieve(): closed socket after sending data

>What does that mean? Is that normal?

Yes, this is expected behaviour--you can look in the ftpd src yourself
to confirm this.  It doesn't really mean anything, other than the
retrieve() completed okay...

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: data in SYN received state
Date: Mon, 23 Feb 2004 22:54:43 +0000 (UTC)
Lines: 39
Distribution: su
Message-ID: <c1e0bj$71t$1@news.Stanford.EDU>
References: <c1bim8$5dj$1@news.Stanford.EDU> <c1c169$o5l$1@news.Stanford.EDU> <c1capm$6ci$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077576883 7229 171.64.15.66 (23 Feb 2004 22:54:43 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6359


>I am confused by your reply. So I understand why in SYN_RCVD state, if we
>get a packet with no ACK field set but with data, we cannot just throw away
>the data, because STCP does not care about ack numbers for packets that have
>some data. But shouldn't such a case be disallowed specially for SYN_RCVD
>state, because what can we possibly do after storing the data in our recv
>buffer...it is definitely NOT OK to send this data upto the app above
>because the connection has not been established from our side, is that
>correct?

What do you mean, disallowed?  It's perfectly legal--suppose the
other side's ACK was dropped for your SYN-ACK.

And you can throw away the data, and wait for a retransmission--
but whether you should or not is a bit debatable.

In STCP, you could pass it up to the app--it just won't be able to
read it until the connection is established from your side, since
it will still be blocked in myaccept().

>If it is actually OK to send this data upto the app, this would imply that
>we MUST send an ACK back. But if we send an ACK, that could be really bad
>because that would "signify" to the other side that the connection is all
>setup and working and then the other side might just keep on sending more
>and more data packets with no ACK field set.

Why not send a SYN-ACK back then?  Or you could just wait for the SYN-ACK
timeout, resend it then, maybe ACKing the new data.

>So I do not see any option here but to discard the data completely when we
>are in SYN_RCVD state AND the packet does not have ACK field set.

It seems to me that you have several options--perhaps saying you "should"
buffer it is a bit strong, but you definitely can buffer it without
problems.  You could discard it and wait for a retransmission, although
this seems a bit unnecessary.  The exact choice you make probably
doesn't matter to much, just think through your decision and justify
it in your code/README...

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Out-Of-Order packet; no overlap?
Date: Mon, 23 Feb 2004 14:55:04 -0800
Lines: 6
Distribution: su
Message-ID: <Pine.GSO.4.44.0402231454050.8585-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 1077576906 7242 171.64.15.118 (23 Feb 2004 22:55:06 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6360


For the packets that are received out of order, can we assume that these
packets will not overlap?

-Laura

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: data in SYN received state
Date: Mon, 23 Feb 2004 22:56:51 +0000 (UTC)
Lines: 19
Distribution: su
Message-ID: <c1e0fj$751$1@news.Stanford.EDU>
References: <c1bim8$5dj$1@news.Stanford.EDU> <c1c169$o5l$1@news.Stanford.EDU> <Pine.GSO.4.44.0402230003050.15053-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077577011 7329 171.64.15.66 (23 Feb 2004 22:56:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6361



>Could you please point me to the assignment section where specified what
>you stated in the post?
>===
> the data packet is legal (per STCP specs),

I should say, implied per STCP specs, just in that the specs don't say
this is forbidden.  Since we care only about sequence numbers when
judging validity of data packets, if one comes in with a valid sequence
number it can be processed.

RFC793 is probably more stringent in this regard (but the case also
doesn't occur there normally, since the data packet would have the
ack field set anyway).

Again, quite how you handle this is up to you, pick a design strategy
that makes sense to you and justify it.

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test 1.H
Date: Mon, 23 Feb 2004 22:59:41 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <c1e0kt$79a$1@news.Stanford.EDU>
References: <c1ccqd$9if$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077577181 7466 171.64.15.66 (23 Feb 2004 22:59:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6362


>I passed this test twice on epic. But it failed once with 'No FIN sent!'
>when I was on elaine. There is no code change between runs. And I manually
>run tests for 1.H on elaine, the end of the log are as follows, which looks
>ok to me.

Does this happen consistently?  (You can re-run a test as many times
as you want if you haven't changed the code).

The test for whether a FIN is sent is pretty simple, so if it fails,
it seems likely that a FIN wasn't recorded in the log for some reason.
Where was your TESTDATA.2 output?  If your test timed out (it's given
60s), that might explain the behaviour--was the system heavily
loaded at the time?

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: synchronisation problem
Date: Mon, 23 Feb 2004 23:02:58 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c1e0r2$7js$1@news.Stanford.EDU>
References: <c1blh5$9bm$1@news.Stanford.EDU> <c1ci0v$eiu$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077577378 7804 171.64.15.66 (23 Feb 2004 23:02:58 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6363


>I'm getting something like this, but only while testing the client against 
>the reference server.  My own server and client work fine.

The most likely explanation I can think of would be some mishandling of
sequence numbers/acks.

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: final ACK
Date: Mon, 23 Feb 2004 23:04:35 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c1e0u3$7q4$1@news.Stanford.EDU>
References: <c1bps1$fam$1@news.Stanford.EDU> <c1bupk$lho$1@news.Stanford.EDU> <c1c0cc$n9r$1@news.Stanford.EDU> <c1d6n5$6tn$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077577475 8004 171.64.15.66 (23 Feb 2004 23:04:35 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6364


>So I changed my timeout to 200 ms and it works better now.  However, to not
>be reliant on timeout values, is it acceptable if I interpret a
>stcp_network_send return value of -1 in the LAST_ACK state as the other side
>closing the connection and automatically terminate my side of the
>connection?

if stcp_network_send() returns -1, that's basically a fatal error for us
anyway, so you can bail out on that.

quite why you needed to up the timeout is a bit of a mystery--that doesn't
seem like it should be necessary.  my implementation seems to work fine
with a 100ms timeout.

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Timeout for Receiver?
Date: Mon, 23 Feb 2004 23:07:14 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c1e132$80m$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402230218310.3670-100000@elaine33.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077577634 8214 171.64.15.66 (23 Feb 2004 23:07:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6365



>So I'm wondering if we need to handle the following two cases:

Nope, you don't need to implement keep-alives.

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Assertion (th_seq==next_expected) and the testing script
Date: Mon, 23 Feb 2004 23:10:07 +0000 (UTC)
Lines: 22
Distribution: su
Message-ID: <c1e18e$899$1@news.Stanford.EDU>
References: <403A10F2.B7BF315E@stanford.edu>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077577807 8489 171.64.15.66 (23 Feb 2004 23:10:07 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6366


>In Test 1.B, I could see some assertion failures (all happening
>at the same place) but the final result said OK.
>How should I interpret the result? Is it really okay?

If it works consistently, and says OK, you're probably alright.

>What failed was the assertion that, when a packet was received from
>the network layer, the sequence number should be the next byte number
>expected. I thought it made sense since the network was in-order and
>reliable for this milestone, but I don't see how it could possibly
>have failed. Any idea?

I'm not sure--I disabled retransmissions in the reference server/client
for milestone A, so this shouldn't happen.  If you assert, that
means your server died--but since you passed the test, you must have
transferred all data by that point.  So there must be something in the
FIN handling.  The ref server doesn't update the sequence number after
the FIN, so any ACK it sends out after that would have the same
sequence number as the FIN (contrary to assignment specs).  Perhaps
that would cause the assert you see?

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Out-Of-Order packet; no overlap?
Date: Mon, 23 Feb 2004 23:11:48 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c1e1bk$8bv$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402231454050.8585-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077577908 8575 171.64.15.66 (23 Feb 2004 23:11:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6367



>For the packets that are received out of order, can we assume that these
>packets will not overlap?

nope.  and this isn't just us causing trouble for you (some of the test
cases in milestone B do this intentionally), real TCP implementations will
send you this kind of rubbish anyway.

.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Using random numbers
Date: Mon, 23 Feb 2004 15:51:07 -0800
Lines: 20
Distribution: su
Message-ID: <403A91EB.C0D40ADD@stanford.edu>
References: <c1907f$4s5$1@news.Stanford.EDU> <c1938v$8s8$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077580278 11105 127.0.0.1 (23 Feb 2004 23:51:18 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:6368

Matthew Jonathan Holliman wrote:
> 
> >The manpages say that the srand() and rand() functions are not
> >thread-safe; does that matter in this case (using them to generate the
> >initial sequence)?
> 
> You should use a thread-safe function, such as rand_r().

Where and how can I initialize the random number sequence?
AFAIK it should be done only once at the start of the program,
not for every connection established, and it seems to be outside
of the area that we're allowed to modify.

And it seems that rand_r() is not available on Linux machines,
and Xrand48() family is not available on Solaris machines..
so which way should we take?

-- 
Seungbeom Kim

.

Path: shelby.stanford.edu!elaine1.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Using random numbers
Date: Tue, 24 Feb 2004 00:00:37 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c1e475$bcr$1@news.Stanford.EDU>
References: <c1907f$4s5$1@news.Stanford.EDU> <c1938v$8s8$1@news.Stanford.EDU> <403A91EB.C0D40ADD@stanford.edu>
NNTP-Posting-Host: elaine1.stanford.edu
X-Trace: news.Stanford.EDU 1077580837 11675 171.64.15.66 (24 Feb 2004 00:00:37 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6369


>Where and how can I initialize the random number sequence?

rand_r() takes its own state as input, so you can specify a unique seed
for each connection, e.g. based on current time/socket descriptor/etc.

>And it seems that rand_r() is not available on Linux machines,

the stub code uses rand_r() already, and it works fine under Linux for me...

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: HW4 Topologies Installed
Date: Mon, 23 Feb 2004 16:58:18 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.LNX.4.44.0402231656390.849-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 1077584300 16368 171.64.66.201 (24 Feb 2004 00:58:20 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6370


 Hello,

   Topologies for homework #4 have been installed.  You should get an email
   confirming this shortly, if you don't please notify me directly.

   Cheers,
   Martin

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3 Q4
Date: Mon, 23 Feb 2004 19:07:30 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0402231859580.13016-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 1077592064 6290 171.64.15.118 (24 Feb 2004 03:07:44 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6371

In the packet evolution diagram, I have a question on the labels.  It
would make more sense to me if (A) was labeled with 2W + (W/2) - 2 and (B)
with 3W - 1.  If this is not correct, can anyone explain why?

Thanks,
Barrett

.

Path: shelby.stanford.edu!not-for-mail
From: Jeremy Slade <jeremy@jkslade.net>
Newsgroups: su.class.cs244a
Subject: Re: Go back N and retransmissions.
Date: 23 Feb 2004 21:10:42 -0700
Lines: 37
Sender: jeremy@dad.jkslade.net
Distribution: su
Message-ID: <m3znb986d9.fsf@dad.jkslade.net>
References: <Pine.GSO.4.44.0402221708330.5427-100000@epic6.Stanford.EDU> <c1bkhc$7ui$1@news.Stanford.EDU> <c1c1gu$oi7$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077595804 9923 171.64.15.111 (24 Feb 2004 04:10:04 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)
Xref: shelby.stanford.edu su.class.cs244a:6372

Isn't the whole point of th_win for the peer to be able to throttle
the sender?  i.e. shrink the advertised window down to tell the sender
I can't handle any more data right now... If th_win is used in the
initial SYN segment, there's not a whole lot of flow control going on
there.

Jeremy

holliman@Stanford.EDU (Matthew Jonathan Holliman) writes:

> >What happens if while waiting for a timeout the peer advertises a receiver
> >window size smaller than the data in your first packet?  You'd have to break
> >it up.  I keep a queue of unsent _data_, and when my ACK times out, I
> >repackage the data into a new packet and send it again, counting that as a
> >retransmission.  Thus if the window size changes, I'm resending the
> >appropriate amount of data.
> 
> Yes--
> The RFC says that TCP implementations "shouldn't" shrink their advertised
> window.  We won't be checking this case, so you can assume that if the
> data was sent on its initial transmission, it can just be resent on
> subsequent transmissions without regard to the advertised receiver window.
> (i.e. you only need to worry about sender window on initial transmission
> for STCP)
> 
> Of course, if you can implement your solution to always obey th_win,
> that's even better.  You probably won't actually see a difference in this
> assignment, since it's highly unlikely that any real TCP implementation
> would advertise th_win < 3072 anyway...
> 
> Whether or not you choose to implement the 'correct' way, you should
> think about how real TCP would do it anyway :-)
> 

-- 
Jeremy Slade
jeremy@jkslade.net
.

Path: shelby.stanford.edu!not-for-mail
From: Jeremy Slade <jeremy@jkslade.net>
Newsgroups: su.class.cs244a
Subject: clamp to 100ms?
Date: 23 Feb 2004 21:20:37 -0700
Lines: 16
Sender: jeremy@dad.jkslade.net
Distribution: su
Message-ID: <m3vflx85wq.fsf@dad.jkslade.net>
NNTP-Posting-Host: elaine36.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077596399 9923 171.64.15.111 (24 Feb 2004 04:19:59 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)
Xref: shelby.stanford.edu su.class.cs244a:6373

What is the meaning of clamping the timeout to 100ms?  To me it meant
that should be the lower bound, especially if the purpose is to
prevent problems when both ends are on the local host, as indicated in
the project spec.  

But from reading other posts, it seems that some people are using a
timeout of strictly 100ms.  That would not work very well if the other
end of the connection were in Europe, say.

Just making sure...

Jeremy

-- 
Jeremy Slade
jeremy@jkslade.net
.

Path: shelby.stanford.edu!saga0.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Timeout of Send / Receive Packets
Date: Mon, 23 Feb 2004 20:21:05 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.GSO.4.44.0402232011030.20583-100000@saga0.Stanford.EDU>
NNTP-Posting-Host: saga0.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077596467 11168 171.64.15.130 (24 Feb 2004 04:21:07 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6374

For timeouts on unacked Send Window packets we have the 5 retranmssion
time limit before the packets are dropped.

In practice, do TCP implementations typically close the connection after
just a few retransmssions of this relatively short duration (if the RTO is
typically 100-200 msec we're talking about approx. 1 second)?

I've seen NFS using TCP not time out connections for minutes.
Can you set an option to keep the socket open longer? If so, that
overrides any RTO calculations for purposes of timeouts?

Also, for out of order received packets that are being buffered:
They need to fit in the window, but are they typically assigned an
expiration date? If no packets preceeding them come in, do they just
lounge around in the receive buffer hoping that some day they'll finally
meet their destination app?

Thanks,

Ed

.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS3 Q4
Date: Tue, 24 Feb 2004 07:24:32 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c1eu7g$oog$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402231859580.13016-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1077607472 25360 171.64.15.84 (24 Feb 2004 07:24:32 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6375


>In the packet evolution diagram, I have a question on the labels.  It
>would make more sense to me if (A) was labeled with 2W + (W/2) - 2 and (B)
>with 3W - 1.  If this is not correct, can anyone explain why?

Looking at this now (with a caveat that I'm quite tired), I agree--and it
sounds like you understand the diagram fine...

.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Go back N and retransmissions.
Date: Tue, 24 Feb 2004 07:37:34 +0000 (UTC)
Lines: 39
Distribution: su
Message-ID: <c1euvu$pph$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221708330.5427-100000@epic6.Stanford.EDU> <c1bkhc$7ui$1@news.Stanford.EDU> <c1c1gu$oi7$1@news.Stanford.EDU> <m3znb986d9.fsf@dad.jkslade.net>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1077608254 26417 171.64.15.84 (24 Feb 2004 07:37:34 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6376


>Isn't the whole point of th_win for the peer to be able to throttle
>the sender?  i.e. shrink the advertised window down to tell the sender
>I can't handle any more data right now... If th_win is used in the
>initial SYN segment, there's not a whole lot of flow control going on
>there.

Okay, I see where the confusion is--poor wording on my part.  Yes, th_win
is used to throttle the sender.  But in the case of retransmissions, you
really wouldn't expect the size of the sequence space you're allowed to have
outstanding to suddenly decrease (which is what I meant by the other side
being discouraged from shrinking its receiver window--I should really
say, the other side shouldn't suddenly decrease the number of bytes that
you can have outstanding).

perhaps an example would clarify:

e.g. suppose the peer advertises th_ack=1000, th_win=1000, so you
send sequence numbers 1000..1999.  let's assume these are 200 byte segments.

if something in that range times out, you should still be able to
send 1000.1999.  e.g. suppose you receive an ACK with th_ack=1000.
in this case, th_win *should* = 1000 still.  this isn't guaranteed,
although any socket-based TCP implementation would behave this way, but
nonetheless TCP *shouldn't* "shrink" its advertised window in this case.

now suppose segment 1000..1199 gets through, and you receive its ACK.
if the peer on the other side hasn't read any data, you could
receive th_ack=1200, th_win=800.  but you can still resend all
your pending data, which hasn't been ACKed yet.

of course, the peer could respond with th_ack=1200, th_win=500.
but that would be weird, discouraged by the spec, and if you
think about how TCP/sockets interact normally, this would be
quite unexpected.

so using th_win only on the initial send of a packet will behave reasonably
in most cases.

.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: clamp to 100ms?
Date: Tue, 24 Feb 2004 07:40:41 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <c1ev5p$q2p$1@news.Stanford.EDU>
References: <m3vflx85wq.fsf@dad.jkslade.net>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1077608441 26713 171.64.15.84 (24 Feb 2004 07:40:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6377


>What is the meaning of clamping the timeout to 100ms?  To me it meant
>that should be the lower bound, especially if the purpose is to
>prevent problems when both ends are on the local host, as indicated in
>the project spec.  

that's the intent.

>But from reading other posts, it seems that some people are using a
>timeout of strictly 100ms.  That would not work very well if the other
>end of the connection were in Europe, say.

you're right--this would likely perform poorly on connections with
large or highly variable RTTs.  as I mentioned in the review session,
people may need to play with this for HW4 if they take shortcuts here.
(it's not much code to do RTO estimation, only a few lines--this would
seem to make the most sense to me).

.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Timeout of Send / Receive Packets
Date: Tue, 24 Feb 2004 07:48:13 +0000 (UTC)
Lines: 23
Distribution: su
Message-ID: <c1evjt$qhs$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402232011030.20583-100000@saga0.Stanford.EDU>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1077608893 27196 171.64.15.84 (24 Feb 2004 07:48:13 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6378


>In practice, do TCP implementations typically close the connection after
>just a few retransmssions of this relatively short duration (if the RTO is
>typically 100-200 msec we're talking about approx. 1 second)?

nope--timeouts are on the order of minutes.

>Can you set an option to keep the socket open longer? If so, that
>overrides any RTO calculations for purposes of timeouts?

I'm not aware of one--this would typically be a kernel parameter,
and I'm not sure if this can be set on a per-socket basis.

>Also, for out of order received packets that are being buffered:
>They need to fit in the window, but are they typically assigned an
>expiration date? If no packets preceeding them come in, do they just
>lounge around in the receive buffer hoping that some day they'll finally
>meet their destination app?

for real TCP?  yes, they'd typically lounge around until the in-order
packets arrive--no expiration date (why would there be one?  usual TCP
keepalives would detect whether the connection is still live or not)

.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Assertion (th_seq==next_expected) and the testing script
Date: Tue, 24 Feb 2004 01:40:37 -0800
Lines: 36
Distribution: su
Message-ID: <c1f66u$561$1@news.Stanford.EDU>
References: <403A10F2.B7BF315E@stanford.edu> <c1e18e$899$1@news.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1077615646 5313 128.12.44.20 (24 Feb 2004 09:40: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:6379

I was getting the same assert, again with all "OKs" on the test results. The
way you describe the behavior of the reference server could certainly cause
an assert in my code; does that mean that we ought to change our
implementation, or should we stick by the project specifications?

Also, almost all of my later tests concluded by saying that the client or
server was "Killed". Is that supposed to happen (again, results were OK).

- Sean

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1e18e$899$1@news.Stanford.EDU...
>
> >In Test 1.B, I could see some assertion failures (all happening
> >at the same place) but the final result said OK.
> >How should I interpret the result? Is it really okay?
>
> If it works consistently, and says OK, you're probably alright.
>
> >What failed was the assertion that, when a packet was received from
> >the network layer, the sequence number should be the next byte number
> >expected. I thought it made sense since the network was in-order and
> >reliable for this milestone, but I don't see how it could possibly
> >have failed. Any idea?
>
> I'm not sure--I disabled retransmissions in the reference server/client
> for milestone A, so this shouldn't happen.  If you assert, that
> means your server died--but since you passed the test, you must have
> transferred all data by that point.  So there must be something in the
> FIN handling.  The ref server doesn't update the sequence number after
> the FIN, so any ACK it sends out after that would have the same
> sequence number as the FIN (contrary to assignment specs).  Perhaps
> that would cause the assert you see?
>


.

Path: shelby.stanford.edu!saga0.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Timeout of Send / Receive Packets
Date: Tue, 24 Feb 2004 06:59:26 -0800
Lines: 32
Distribution: su
Message-ID: <Pine.GSO.4.44.0402240632150.29761-100000@saga0.Stanford.EDU>
References: <Pine.GSO.4.44.0402232011030.20583-100000@saga0.Stanford.EDU>
 <c1evjt$qhs$1@news.Stanford.EDU>
NNTP-Posting-Host: saga0.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077634770 24255 171.64.15.130 (24 Feb 2004 14:59:30 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c1evjt$qhs$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6380

On Tue, 24 Feb 2004, Matthew Jonathan Holliman wrote:

> >Also, for out of order received packets that are being buffered:
> >They need to fit in the window, but are they typically assigned an
> >expiration date? If no packets preceeding them come in, do they just
> >lounge around in the receive buffer hoping that some day they'll finally
> >meet their destination app?
>
> for real TCP?  yes, they'd typically lounge around until the in-order
> packets arrive--no expiration date (why would there be one?  usual TCP
> keepalives would detect whether the connection is still live or not)
>
The keep-alive, which is optional, has a keep alive interval that MUST
default to no less than two hours. That is what the SPEC states. However,
and I am a complete novice to networking, it sure looks that what the SPEC
says and what gets implemented (even MUSTs) are not always congruent.

On a PC with lots of memory and low utilization who cares. On a heavily
loaded system where buffer space may be at a premium, you might care.

I would also think that real systems might shrink the window size of
flows because the system is memory constrained, not just to throttle back
a particular flow to limit their fair share utilization of the available
network bandwidth to that host. I'd suspect an implementation would try
and set a reasonable window size for each connection but networks are bursty
and so is the memory utilization on server systems.

The issue of how shrinking window sizes can effect retransmission was
discussed in a previous post. Since TCP MUST hold app data that hasn't
been ACKed or transmitted if the recvier window has closed that is another
source where buffer space could be occupied for long periods of time.

.

Path: shelby.stanford.edu!elaine8.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Assertion (th_seq==next_expected) and the testing script
Date: Tue, 24 Feb 2004 16:59:17 +0000 (UTC)
Lines: 24
Distribution: su
Message-ID: <c1fvt5$um$1@news.Stanford.EDU>
References: <403A10F2.B7BF315E@stanford.edu> <c1e18e$899$1@news.Stanford.EDU> <c1f66u$561$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine8.stanford.edu
X-Trace: news.Stanford.EDU 1077641957 982 171.64.15.73 (24 Feb 2004 16:59:17 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6381


>I was getting the same assert, again with all "OKs" on the test results. The
>way you describe the behavior of the reference server could certainly cause
>an assert in my code; does that mean that we ought to change our
>implementation, or should we stick by the project specifications?

Well, the assert is incorrect in that it isn't an invariant that's guaranteed
to hold.  You have no idea of what the other side could send--it could be
buggy (as it is in this case).  It would make more sense if it corresponded
to some condition in your code that you know (or expect) to be true.
But apart from that, your implementation is likely fine (i.e. you shouldn't
just hack it to behave the same way as the ref soln).

I might fix the ref soln at some point, but it depends on whether it's an
easy fix or not (it should be, but the less tweaking of this code I do now,
the better).  BTW, at least one TCP stack I tested against behaves the
same way, so it would probably be best not to be too picky about th_seq
in ACK packets anyway.

>Also, almost all of my later tests concluded by saying that the client or
>server was "Killed". Is that supposed to happen (again, results were OK).

Yes.

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: TEST 2.M Failed, why?
Date: Tue, 24 Feb 2004 09:01:40 -0800
Lines: 74
Distribution: su
Message-ID: <Pine.GSO.4.44.0402240854460.162-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 1077642103 1273 171.64.15.118 (24 Feb 2004 17:01:43 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6382


The following is my test result for TEST2.M
====
Test 2.M [out of 5]
Checks that Tx implements Go-Back N.

Results:  NOT OK

Go-back N not enforced (retransmitted only up until 3160 rather than
4255)
===

However, when I checked the .server_output, it showed that the
re-transmission happend up until seq=3719, len=536.  The next packet
will start with 4255, which is never sent, never mention the re-xmit. So
why the above error? Any suggestion/hint?

 ====
log: network_recv: a SYN packet with seq=167
log: network_send: a SYN-ACK packet with seq=88 and ack=168 and timestamp=3871502120
log: network_recv: an ACK packet with seq=168, len=0 and ack=89 and timestamp=3871502218
log: network_recv: a DATA packet with seq=168, len=12 and timestamp=3871502218
log: network_send: an ACK packet with seq=89, len=0 and ack=180 and timestamp=3871502219
log: network_send: a DATA packet with seq=89, len=22 and timestamp=3871502223
log: network_send: a DATA packet with seq=111, len=536 and timestamp=3871502223
log: network_send: a DATA packet with seq=647, len=536 and timestamp=3871502223
log: network_send: a DATA packet with seq=1183, len=536 and timestamp=3871502237
log: network_send: a DATA packet with seq=1719, len=536 and timestamp=3871502238
log: network_send: a DATA packet with seq=2255, len=536 and timestamp=3871502238
log: network_send: a DATA packet with seq=2791, len=369 and timestamp=3871502238
log: network_send: a SYN-ACK packet with seq=88 and ack=168 and timestamp=3871502321
log: network_send: a DATA packet with seq=89, len=22 and timestamp=3871502322
log: network_send: a DATA packet with seq=111, len=536 and timestamp=3871502322
log: network_send: a DATA packet with seq=647, len=536 and timestamp=3871502322
log: network_send: a DATA packet with seq=1183, len=536 and timestamp=3871502323
log: network_send: a DATA packet with seq=1719, len=536 and timestamp=3871502323
log: network_send: a DATA packet with seq=2255, len=536 and timestamp=3871502323
log: network_send: a DATA packet with seq=2791, len=369 and timestamp=3871502323
log: network_recv: an ACK packet with seq=180, len=0 and ack=111 and timestamp=3871502324
log: network_send: a DATA packet with seq=3160, len=23 and timestamp=3871502324
log: network_recv: an ACK packet with seq=180, len=0 and ack=647 and timestamp=3871502324
log: network_send: a DATA packet with seq=3183, len=536 and timestamp=3871502324
log: network_recv: an ACK packet with seq=180, len=0 and ack=1183 and timestamp=3871502325
log: network_send: a DATA packet with seq=3719, len=536 and timestamp=3871502325
log: network_send: a DATA packet with seq=1183, len=536 and timestamp=3871502524
log: network_send: a DATA packet with seq=1719, len=536 and timestamp=3871502524
log: network_send: a DATA packet with seq=2255, len=536 and timestamp=3871502524
log: network_send: a DATA packet with seq=2791, len=369 and timestamp=3871502525
log: network_send: a DATA packet with seq=3160, len=23 and timestamp=3871502525
log: network_send: a DATA packet with seq=3183, len=536 and timestamp=3871502525
log: network_send: a DATA packet with seq=3719, len=536 and timestamp=3871502526
log: network_send: a DATA packet with seq=1183, len=536 and timestamp=3871502726
log: network_send: a DATA packet with seq=1719, len=536 and timestamp=3871502726
log: network_send: a DATA packet with seq=2255, len=536 and timestamp=3871502726
log: network_send: a DATA packet with seq=2791, len=369 and timestamp=3871502727
log: network_send: a DATA packet with seq=3160, len=23 and timestamp=3871502727
log: network_send: a DATA packet with seq=3183, len=536 and timestamp=3871502727
log: network_send: a DATA packet with seq=3719, len=536 and timestamp=3871502728
log: network_send: a DATA packet with seq=1183, len=536 and timestamp=3871502928
log: network_send: a DATA packet with seq=1719, len=536 and timestamp=3871502928
log: network_send: a DATA packet with seq=2255, len=536 and timestamp=3871502929
log: network_send: a DATA packet with seq=2791, len=369 and timestamp=3871502929
log: network_send: a DATA packet with seq=3160, len=23 and timestamp=3871502929
log: network_send: a DATA packet with seq=3183, len=536 and timestamp=3871502929
log: network_send: a DATA packet with seq=3719, len=536 and timestamp=3871502930
log: network_send: a DATA packet with seq=1183, len=536 and timestamp=3871503130
log: network_send: a DATA packet with seq=1719, len=536 and timestamp=3871503130
log: network_send: a DATA packet with seq=2255, len=536 and timestamp=3871503131
log: network_send: a DATA packet with seq=2791, len=369 and timestamp=3871503134
log: network_send: a DATA packet with seq=3160, len=23 and timestamp=3871503134
log: network_send: a DATA packet with seq=3183, len=536 and timestamp=3871503134
log: network_send: a DATA packet with seq=3719, len=536 and timestamp=3871503135


.

Path: shelby.stanford.edu!elaine8.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Timeout of Send / Receive Packets
Date: Tue, 24 Feb 2004 17:06:31 +0000 (UTC)
Lines: 30
Distribution: su
Message-ID: <c1g0an$1d2$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402232011030.20583-100000@saga0.Stanford.EDU>  <c1evjt$qhs$1@news.Stanford.EDU> <Pine.GSO.4.44.0402240632150.29761-100000@saga0.Stanford.EDU>
NNTP-Posting-Host: elaine8.stanford.edu
X-Trace: news.Stanford.EDU 1077642391 1442 171.64.15.73 (24 Feb 2004 17:06:31 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6383



>The keep-alive, which is optional, has a keep alive interval that MUST
>default to no less than two hours. That is what the SPEC states. However,
>and I am a complete novice to networking, it sure looks that what the SPEC
>says and what gets implemented (even MUSTs) are not always congruent.

Yep--but in practice almost every TCP stack implements this, and from what
I've observed it's generally on the order of minutes.  That's certainly the
case under Windows.  I'm not aware of other standard facilities for
detecting when the connection's died.

>I would also think that real systems might shrink the window size of
>flows because the system is memory constrained, not just to throttle back
>a particular flow to limit their fair share utilization of the available
>network bandwidth to that host. I'd suspect an implementation would try
>and set a reasonable window size for each connection but networks are bursty
>and so is the memory utilization on server systems.

Systems do *not* throttle back th_win to limit fair share utilisation.
That is the job of congestion control (cwnd), not flow control.

Typically, a fixed size buffer would be allocated for the socket
(e.g. corresponding to SO_SNDBUF, SO_RCVBUF setsockopts).  This is
on the order of ~32KB-64KB, up to a maximum of, say, 1MB under Solaris.  If
you have many sockets open, you could run into memory issues on a server
(unlikely on a client), but the system wouldn't generally try and reclaim
memory by shrinking the buffer for existing sockets.  (New requests would
just fail).

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: How to debug TEST2.C: BAD_SENDER? Any suggestion?
Date: Tue, 24 Feb 2004 11:19:00 -0800
Lines: 4
Distribution: su
Message-ID: <Pine.GSO.4.44.0402241117310.4767-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 1077650346 10247 171.64.15.118 (24 Feb 2004 19:19:06 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6384


My code failed at TEST 2.C.  However, I could not find any trace/log for
that test.  Any suggestion on how to debug it?

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: How to debug TEST2.C: BAD_SENDER? Any suggestion? (more)
Date: Tue, 24 Feb 2004 11:21:52 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.GSO.4.44.0402241119470.4818-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0402241117310.4767-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 1077650513 10443 171.64.15.118 (24 Feb 2004 19:21:53 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402241117310.4767-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6385

The error message I got out of the test is following:
====
Test 2.E [out of 5]^M
Checks Rx against bad sender (overlapping packets, etc.)^M
^M
Results:  NOT OK^M
^M
File size differs for
/usr/class/cs244a/grading_script/hw3/net_instruct_resend_seqnum.out!^M
(You downloaded 997 byte(s), expected 3092).^M
Client output:^M
^M

On Tue, 24 Feb 2004, Xiaohua Fang wrote:

>
> My code failed at TEST 2.C.  However, I could not find any trace/log for
> that test.  Any suggestion on how to debug it?
>
>

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Overlap packet scenario
Date: Tue, 24 Feb 2004 11:53:05 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0402241150310.5282-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 1077652387 12327 171.64.15.118 (24 Feb 2004 19:53:07 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6386


Case (1)

Packet 1: seq = 10, len = 20; Packet 2: seq = 10, len = 30. Packet 1 comes
first and is processed first, what should be done for Paket2, drop it?  or
take the last 10 byte?


.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Assertion (th_seq==next_expected) and the testing script
Date: Tue, 24 Feb 2004 13:35:19 -0800
Lines: 40
Distribution: su
Message-ID: <c1gg2q$jm4$1@news.Stanford.EDU>
References: <403A10F2.B7BF315E@stanford.edu> <c1e18e$899$1@news.Stanford.EDU> <c1f66u$561$1@news.Stanford.EDU> <c1fvt5$um$1@news.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1077658522 20164 128.12.44.20 (24 Feb 2004 21:35: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:6387

Oh. Good point, that assertion only tenuously holds in our hw3A, and
definitely won't be true for the latter parts. Probably a good idea to just
change it now. :) Thanks!

- Sean

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1fvt5$um$1@news.Stanford.EDU...
>
> >I was getting the same assert, again with all "OKs" on the test results.
The
> >way you describe the behavior of the reference server could certainly
cause
> >an assert in my code; does that mean that we ought to change our
> >implementation, or should we stick by the project specifications?
>
> Well, the assert is incorrect in that it isn't an invariant that's
guaranteed
> to hold.  You have no idea of what the other side could send--it could be
> buggy (as it is in this case).  It would make more sense if it
corresponded
> to some condition in your code that you know (or expect) to be true.
> But apart from that, your implementation is likely fine (i.e. you
shouldn't
> just hack it to behave the same way as the ref soln).
>
> I might fix the ref soln at some point, but it depends on whether it's an
> easy fix or not (it should be, but the less tweaking of this code I do
now,
> the better).  BTW, at least one TCP stack I tested against behaves the
> same way, so it would probably be best not to be too picky about th_seq
> in ACK packets anyway.
>
> >Also, almost all of my later tests concluded by saying that the client or
> >server was "Killed". Is that supposed to happen (again, results were OK).
>
> Yes.
>


.

Path: shelby.stanford.edu!elaine22.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: waiting for connect
Date: Tue, 24 Feb 2004 13:55:42 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0402241354270.5273-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 1077659744 21471 171.64.15.87 (24 Feb 2004 21:55:44 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6388

if the init is call with is_active = false, how long should we wait for a
syn? Should we wait indefinitely or do we also wait for at least 100 ms?

Thanks

Lin

.

Path: shelby.stanford.edu!elaine22.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: retransmittion
Date: Tue, 24 Feb 2004 14:30:11 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.GSO.4.44.0402241420150.7356-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 1077661813 24084 171.64.15.87 (24 Feb 2004 22:30:13 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6389

When there is a timeout and i am trying to do go-back-N and retransmit,
must the packets be exactly the same as previously sent packets?

For example, i sent two packets of size 200(seq no 100) and 150(seq no
300) out separatedly because the application sent them at different times.
Later, timeout occured and I am going to retransmit, do i have to send the
data as two packets just like before or i can simply send a packet with
size 350?

If i can combine the packets, how should I count the number of retransmit
of packets? Say after i have retransmitted the combined packet, and then i
got an ACK with ack number 300(i.e. the first original packet is not
lost). Should I be able to tell that byte with seq 300 has actually been
send twice(this could cause a bit more complication i guess)? Do I count
the number of retransmit per packet or per byte?

Thanks

Lin

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: TEST 2.M Failed, why?
Date: Tue, 24 Feb 2004 22:46:11 +0000 (UTC)
Lines: 4
Distribution: su
Message-ID: <c1gk7j$ojb$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402240854460.162-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077662771 25195 171.64.15.116 (24 Feb 2004 22:46:11 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6390


This problem should be fixed now--the script was too stringent in its
assumptions for this test case.

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Overlap packet scenario
Date: Tue, 24 Feb 2004 22:48:34 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c1gkc2$oq8$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402241150310.5282-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077662914 25416 171.64.15.116 (24 Feb 2004 22:48:34 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6391



>Packet 1: seq = 10, len = 20; Packet 2: seq = 10, len = 30. Packet 1 comes
>first and is processed first, what should be done for Paket2, drop it?  or
>take the last 10 byte?

for STCP, we take the last 10 bytes.

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: waiting for connect
Date: Tue, 24 Feb 2004 22:49:25 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c1gkdl$or7$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402241354270.5273-100000@elaine22.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077662965 25447 171.64.15.116 (24 Feb 2004 22:49:25 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6392


>if the init is call with is_active = false, how long should we wait for a
>syn? Should we wait indefinitely or do we also wait for at least 100 ms?

indefinitely, just like real TCP.

(btw, if you look in the stub code, you'll see your transport layer is
only invoked on the passive side once a SYN turns up, anyway...)

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: retransmittion
Date: Tue, 24 Feb 2004 22:50:21 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <c1gkfd$ovi$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402241420150.7356-100000@elaine22.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077663021 25586 171.64.15.116 (24 Feb 2004 22:50:21 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6393


>When there is a timeout and i am trying to do go-back-N and retransmit,
>must the packets be exactly the same as previously sent packets?

not necessarily (although you'd probably find this simplest to implement).

>If i can combine the packets, how should I count the number of retransmit
>of packets? Say after i have retransmitted the combined packet, and then i
>got an ACK with ack number 300(i.e. the first original packet is not
>lost). Should I be able to tell that byte with seq 300 has actually been
>send twice(this could cause a bit more complication i guess)? Do I count
>the number of retransmit per packet or per byte?

for grading purposes, it's per byte.

.

Path: shelby.stanford.edu!not-for-mail
From: Adam Coates <acoates@stanford.edu>
Newsgroups: su.class.cs244a
Subject: assert()s from script server/client (Test 2.B/C)
Date: Tue, 24 Feb 2004 20:06:43 -0500
Lines: 49
Distribution: su
Message-ID: <c1h706$ib7$1@news.Stanford.EDU>
NNTP-Posting-Host: coates.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077681990 18791 128.12.17.169 (25 Feb 2004 04:06:30 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030313
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6394

Hello, there;  apparently I'm doing something which causes the server in 
the script to assert in both tests B and C.

This is from test B:

Starting server: 
/afs/ir.stanford.edu/users/a/c/acoates/cs244a/hw3/grading_src/build/server 
-U -p 
/afs/ir.stanford.edu/users/a/c/acoates/cs244a/hw3/grading_src/build/.server_port 
2>&1 > 
/afs/ir.stanford.edu/users/a/c/acoates/cs244a/hw3/grading_src/build/.server_output
Server started
Starting client: /usr/class/cs244a/grading_script/hw3/client -U -p 
..server_port -f TESTDATA.0 foo
connected to 171.64.15.80 at port 47951
client: TESTDATA.0
warning:  client exited with non-zero status (6)
program output:
server: TESTDATA.0,110230,Ok
Assertion failed: segment->offset >= 0 && segment->offset < 
MAX_PAYLOAD_SIZE, file transport.c, line 1613

I'm not sure what this is checking;  I suppose it's possible I'm sending 
something over the MSS size?  But I don't see how that's happening...?

And this is from test C:

Testing input file TESTDATA.0

Starting server: /usr/class/cs244a/grading_script/hw3/server -U -p 
/afs/ir.stanford.edu/users/a/c/acoates/cs244a/hw3/grading_src/build/.server_port 
2>&1 > 
/afs/ir.stanford.edu/users/a/c/acoates/cs244a/hw3/grading_src/build/.server_output
Server started
Starting client: ./client -U -p .server_port -f TESTDATA.0 foo
connected to 171.64.15.80 at port 47953
client: TESTDATA.0
Assertion failed: ctx->last_byte_sent - ctx->last_byte_acked <= 
MAX_SEND_WINDOW_SIZE, file transport.c, line 1797

How is it that _my_ client is causing the server to overflow its own 
sending window??

In any event, nothing in my printouts of incoming/outgoing packets 
suggests that anything malformed is going to the server.

Thanks for any suggestions,
Adam C.

.

Path: shelby.stanford.edu!not-for-mail
From: "jsilver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: "packed" for STCPHeader
Date: Tue, 24 Feb 2004 21:02:46 -0800
Lines: 6
Distribution: su
Message-ID: <c1ha9t$mnd$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1077685375 23277 127.0.0.1 (25 Feb 2004 05:02: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:6395

Would it be possible for you to change STCPHeader to use use __attribute__
((packed)) in transport.h?
I'm trying to include this data structure directly in another structure and
the byte alignment gets off.


.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: advertised win size
Date: Tue, 24 Feb 2004 21:39:43 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.GSO.4.44.0402242135500.17088-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 1077687584 25452 171.64.15.100 (25 Feb 2004 05:39:44 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6396

In the book, AdvertisedWindow(th_win in the STCP header) = MAXRcvBuffer -
((NextByteExpected -1) - LastByteRead)

Since our NextByteExpected is always 1 greater than LastByteRead(because
we always pass data up if possible), our AdvertisedWindow is always our
MaxRcvBuffer which is 3072 bytes, no matter in reliable or unreliable
mode. Is my understanding correct?

Thanks

Lin

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Timeout for Receiver?
Date: Wed, 25 Feb 2004 15:47:47 +0800
Lines: 13
Distribution: su
Message-ID: <403C5322.345D81B0@leland.stanford.edu>
References: <Pine.GSO.4.44.0402230218310.3670-100000@elaine33.Stanford.EDU> <c1e132$80m$1@news.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077695400 3905 128.12.196.85 (25 Feb 2004 07:50:00 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6397

In that case would it be possible that say the server close the socket,
after it sends five FIN to the client and gets no response. The client
misses all 5 FIN's, and keeps on waiting indefinitely for new packets in
myread(). Wouldn't this cause the ftp client to hang?

Jimmy

Matthew Jonathan Holliman wrote:

> >So I'm wondering if we need to handle the following two cases:
>
> Nope, you don't need to implement keep-alives.

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: More test script problem: Unrecognized assertion
Date: Wed, 25 Feb 2004 08:03:54 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c1hkta$54b$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402211455380.16347-100000@elaine43.Stanford.EDU> <40398DC2.4AE39CD2@leland.stanford.edu>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077696234 5259 171.64.15.116 (25 Feb 2004 08:03:54 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6398


>I don't have those variables in my transport.c either. What is going on?

I think the problem should be fixed now.  The way your server repacketised
stuff on retransmissions went down some code paths that hadn't been well
tested before (and were kind of broken).

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: TEST 2.E: Checksum error
Date: Wed, 25 Feb 2004 00:05:03 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.GSO.4.44.0402250002280.3186-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 1077696308 5317 171.64.15.118 (25 Feb 2004 08:05:08 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6399


I ran my code twice with the test script and onece failed and one
succeeded.  The failed case showed the error in TEST 2.E.  What is the
reason for this error?

=====
Test 2.E [out of 5]^M
Checks Rx against bad sender (overlapping packets, etc.)^M
^M
Results:  NOT OK^M
^M
Checksum differs for file
/usr/class/cs244a/grading_script/hw3/net_instruct_gaps
_overlapping.out!^M
(Your cksum: 316896851, expected 2741633263).^M
Client output:^M
^M

=====


.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: assert()s from script server/client (Test 2.B/C)
Date: Wed, 25 Feb 2004 08:09:37 +0000 (UTC)
Lines: 22
Distribution: su
Message-ID: <c1hl81$5l0$1@news.Stanford.EDU>
References: <c1h706$ib7$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077696577 5792 171.64.15.116 (25 Feb 2004 08:09:37 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6400


>Assertion failed: segment->offset >= 0 && segment->offset < 
>MAX_PAYLOAD_SIZE, file transport.c, line 1613

This is the same problem reported elsewhere--a few student servers
were repacketising in ways that the ref implementation hadn't seen
before.  I've reimplemented this, so it should hopefully be more
robust now.

>Assertion failed: ctx->last_byte_sent - ctx->last_byte_acked <= 
>MAX_SEND_WINDOW_SIZE, file transport.c, line 1797

This may have been a bad assert.  I've taken it out now, as it's no longer
necessarily valid in all cases.  (In this case, it's still an indication
of something suspicious, probably on your side).

One cause could have been if you shrank your advertised window to 0,
and for some reason ACKs weren't processed by the server (e.g. dropped
or in some way malformed); it would send 1-byte probes then, outside its
sender window (as TCP does in this case).  I don't know if this is really
what happened or not, but it's at least one possible explanation.

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: "packed" for STCPHeader
Date: Wed, 25 Feb 2004 08:09:55 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c1hl8j$5l6$1@news.Stanford.EDU>
References: <c1ha9t$mnd$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077696595 5798 171.64.15.116 (25 Feb 2004 08:09:55 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6401


>Would it be possible for you to change STCPHeader to use use __attribute__
>((packed)) in transport.h?

done.

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: advertised win size
Date: Wed, 25 Feb 2004 08:10:39 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c1hl9v$5p7$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402242135500.17088-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077696639 5927 171.64.15.116 (25 Feb 2004 08:10:39 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6402


>Since our NextByteExpected is always 1 greater than LastByteRead(because
>we always pass data up if possible), our AdvertisedWindow is always our
>MaxRcvBuffer which is 3072 bytes, no matter in reliable or unreliable
>mode. Is my understanding correct?

yes.

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Timeout for Receiver?
Date: Wed, 25 Feb 2004 08:13:04 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c1hleg$5vo$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402230218310.3670-100000@elaine33.Stanford.EDU> <c1e132$80m$1@news.Stanford.EDU> <403C5322.345D81B0@leland.stanford.edu>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077696784 6136 171.64.15.116 (25 Feb 2004 08:13:04 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6403


>In that case would it be possible that say the server close the socket,
>after it sends five FIN to the client and gets no response. The client
>misses all 5 FIN's, and keeps on waiting indefinitely for new packets in
>myread(). Wouldn't this cause the ftp client to hang?

yes.  there are a number of these kinds of edge conditions that we just
ignore, which a real implementation would obviously have to address.

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: TEST 2.E: Checksum error
Date: Wed, 25 Feb 2004 08:15:39 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c1hljb$6cc$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402250002280.3186-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077696939 6540 171.64.15.116 (25 Feb 2004 08:15:39 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6404



>I ran my code twice with the test script and onece failed and one
>succeeded.  The failed case showed the error in TEST 2.E.  What is the
>reason for this error?

if you ran earlier and succeeded, and then just ran recently and failed,
the reason is because I just added an additional subcase into the 'bad
sender' checks.

the error is because your client didn't assemble the correct byte stream
from the server (the length was correct, as otherwise the script would
have said that was bad instead of giving the cksum error).

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: How to debug TEST2.C: BAD_SENDER? Any suggestion?
Date: Wed, 25 Feb 2004 08:16:47 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c1hllf$6dr$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402241117310.4767-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077697007 6587 171.64.15.116 (25 Feb 2004 08:16:47 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6405


>My code failed at TEST 2.C.  However, I could not find any trace/log for
>that test.  Any suggestion on how to debug it?

you could certainly arrange for your implementation to send malformed
packets, perhaps paying attention to various boundary conditions that
would produce off-by-1 errors, overlapping packets, etc...

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: TEST 2.E: Checksum error
Date: Wed, 25 Feb 2004 16:27:32 +0800
Lines: 35
Distribution: su
Message-ID: <403C5C74.71C54ABF@leland.stanford.edu>
References: <Pine.GSO.4.44.0402250002280.3186-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077697785 7131 128.12.196.85 (25 Feb 2004 08:29:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6406

I got the same problem.
Test 2.E [out of 5]
Checks Rx against bad sender (overlapping packets, etc.)

Results:  NOT OK

Checksum differs for file
/usr/class/cs244a/grading_script/hw3/net_instruct_gaps
_overlapping.out!
(Your cksum: 316896851, expected 2741633263).
Client output:

Jimmy

Xiaohua Fang wrote:

> I ran my code twice with the test script and onece failed and one
> succeeded.  The failed case showed the error in TEST 2.E.  What is the
> reason for this error?
>
> =====
> Test 2.E [out of 5]^M
> Checks Rx against bad sender (overlapping packets, etc.)^M
> ^M
> Results:  NOT OK^M
> ^M
> Checksum differs for file
> /usr/class/cs244a/grading_script/hw3/net_instruct_gaps
> _overlapping.out!^M
> (Your cksum: 316896851, expected 2741633263).^M
> Client output:^M
> ^M
>
> =====

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: TEST 2.E: Checksum error
Date: Wed, 25 Feb 2004 16:38:16 +0800
Lines: 21
Distribution: su
Message-ID: <403C5EF7.E8CB4FF8@leland.stanford.edu>
References: <Pine.GSO.4.44.0402250002280.3186-100000@elaine43.Stanford.EDU> <c1hljb$6cc$1@news.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077698429 7728 128.12.196.85 (25 Feb 2004 08:40:29 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6407

I'm a little suspicious about this... since I got the same checksum as
Xiaohua did. Can you please check if the reference sender is sending the
correct packets?

Thanks,
Jimmy

Matthew Jonathan Holliman wrote:

> >I ran my code twice with the test script and onece failed and one
> >succeeded.  The failed case showed the error in TEST 2.E.  What is the
> >reason for this error?
>
> if you ran earlier and succeeded, and then just ran recently and failed,
> the reason is because I just added an additional subcase into the 'bad
> sender' checks.
>
> the error is because your client didn't assemble the correct byte stream
> from the server (the length was correct, as otherwise the script would
> have said that was bad instead of giving the cksum error).

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Overlapping segment
Date: Wed, 25 Feb 2004 01:52:12 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0402250144180.10759-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 1077702735 11655 171.64.15.118 (25 Feb 2004 09:52:15 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6408


Senario: let's say we receive two overlapping packets:

packet 1: seq: 10, len 12
packet 2: seq: 6, len 20

Now, the common bytes in the packets (from seq 10 to seq 21) are not the
same,
how should we treat them (this is really very BAD SENDER?  Obviously, one
of the them has to be discarded.  Is there any standard that we can
follow?  Currently, my code discards packet 1, since everything in packet
1 should be in packet 2.  However, this failed the TEST 2.E.

TA, could you please advice?


-Laura

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Overlapping segment
Date: Wed, 25 Feb 2004 18:02:21 +0800
Lines: 29
Distribution: su
Message-ID: <403C72AC.25924C14@leland.stanford.edu>
References: <Pine.GSO.4.44.0402250144180.10759-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077703477 12944 128.12.196.85 (25 Feb 2004 10:04:37 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6409

Well, my code consumes whenever data is available. So suppose the next byte
we're expecting is 10, then we'll consume data from packet 1 (assuming it
arrives before packet 2). Now packet 2 arrives. Since we're now expecting seq
22, we will read seq 22 to 25 from packet 2 and consume those.

Even though our treatment is different, we get the same checksum - that means
the test case isn't really sending packets that are 'bad' but just
overlapping. so whichever packet we take should be ok.

Jimmy

Xiaohua Fang wrote:

> Senario: let's say we receive two overlapping packets:
>
> packet 1: seq: 10, len 12
> packet 2: seq: 6, len 20
>
> Now, the common bytes in the packets (from seq 10 to seq 21) are not the
> same,
> how should we treat them (this is really very BAD SENDER?  Obviously, one
> of the them has to be discarded.  Is there any standard that we can
> follow?  Currently, my code discards packet 1, since everything in packet
> 1 should be in packet 2.  However, this failed the TEST 2.E.
>
> TA, could you please advice?
>
> -Laura

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Overlapping segment
Date: Wed, 25 Feb 2004 18:10:07 +0800
Lines: 38
Distribution: su
Message-ID: <403C747F.69DBD259@leland.stanford.edu>
References: <Pine.GSO.4.44.0402250144180.10759-100000@elaine43.Stanford.EDU> <403C72AC.25924C14@leland.stanford.edu>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077703944 13396 128.12.196.85 (25 Feb 2004 10:12:24 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6410

And I've tested my code by sending overlapping segments (every time I send a
packet, I split it into two overlapping parts and send two packets instead). My
code still seems to work fine. I really think the test case is broken. Does
anybody else have the same problem?

Jimmy

Jimmy Pang wrote:

> Well, my code consumes whenever data is available. So suppose the next byte
> we're expecting is 10, then we'll consume data from packet 1 (assuming it
> arrives before packet 2). Now packet 2 arrives. Since we're now expecting seq
> 22, we will read seq 22 to 25 from packet 2 and consume those.
>
> Even though our treatment is different, we get the same checksum - that means
> the test case isn't really sending packets that are 'bad' but just
> overlapping. so whichever packet we take should be ok.
>
> Jimmy
>
> Xiaohua Fang wrote:
>
> > Senario: let's say we receive two overlapping packets:
> >
> > packet 1: seq: 10, len 12
> > packet 2: seq: 6, len 20
> >
> > Now, the common bytes in the packets (from seq 10 to seq 21) are not the
> > same,
> > how should we treat them (this is really very BAD SENDER?  Obviously, one
> > of the them has to be discarded.  Is there any standard that we can
> > follow?  Currently, my code discards packet 1, since everything in packet
> > 1 should be in packet 2.  However, this failed the TEST 2.E.
> >
> > TA, could you please advice?
> >
> > -Laura

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Overlapping segment (more)
Date: Wed, 25 Feb 2004 02:16:28 -0800
Lines: 45
Distribution: su
Message-ID: <Pine.GSO.4.44.0402250211300.11884-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0402250144180.10759-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 1077704190 13590 171.64.15.118 (25 Feb 2004 10:16:30 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402250144180.10759-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6411


I forgot to mention that these two packets are both out-of-order packet
therefore, they will be queued up first and processed after the missing
packets arrives.

I found the following in the RFC 793 (page 53)

==
A natural way to think about processing incoming segments is to
  imagine that they are first tested for proper sequence number (i.e.,
  that their contents lie in the range of the expected "receive window"
  in the sequence number space) and then that they are generally queued
  and processed in sequence number order.
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  When a segment overlaps other already received segments we reconstruct
  the segment to contain just the new data, and adjust the header fields
  to be consistent.
==

My intepretaion is that the packet 1 should be discarded since packet 2
has a smaller sequence number.  TA, do you agree with me?

On Wed, 25 Feb 2004, Xiaohua Fang wrote:

>
> Senario: let's say we receive two overlapping packets:
>
> packet 1: seq: 10, len 12
> packet 2: seq: 6, len 20
>
> Now, the common bytes in the packets (from seq 10 to seq 21) are not the
> same,
> how should we treat them (this is really very BAD SENDER?  Obviously, one
> of the them has to be discarded.  Is there any standard that we can
> follow?  Currently, my code discards packet 1, since everything in packet
> 1 should be in packet 2.  However, this failed the TEST 2.E.
>
> TA, could you please advice?
>
>
> -Laura
>
>

.

Path: shelby.stanford.edu!elaine8.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Overlapping segment
Date: Wed, 25 Feb 2004 17:32:51 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <c1im83$8o1$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402250144180.10759-100000@elaine43.Stanford.EDU> <403C72AC.25924C14@leland.stanford.edu> <403C747F.69DBD259@leland.stanford.edu>
NNTP-Posting-Host: elaine8.stanford.edu
X-Trace: news.Stanford.EDU 1077730371 8961 171.64.15.73 (25 Feb 2004 17:32:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6416


>And I've tested my code by sending overlapping segments (every time I send a
>packet, I split it into two overlapping parts and send two packets instead). My
>code still seems to work fine. I really think the test case is broken. Does
>anybody else have the same problem?

The test case was doing exactly what it was supposed to.  However, the
scripts assume that you keep the first copy of any data.  This was supposed
to have been mentioned in the assignment--but that detail seems to have
been lost!  Since this apparently went missing from the specification, I
took the new test case out--it assumes details about your implementation
that may no longer be true.  (If your receiver buffered data and always
discarded incoming data that duplicated existing sequence numbers, you
would pass this case.  This particular test case sends overlapping
packets, but with different data, to test precisely this condition).

Sorry for the trouble...

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Overlapping segment
Date: Wed, 25 Feb 2004 10:10:03 -0800
Lines: 6
Distribution: su
Message-ID: <c1ioe2$br2$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402250144180.10759-100000@elaine43.Stanford.EDU> <403C72AC.25924C14@leland.stanford.edu> <403C747F.69DBD259@leland.stanford.edu> <c1im83$8o1$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077732610 12130 128.12.61.97 (25 Feb 2004 18:10: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:6417

So are we free to choose whether to keep the first copy of the data or the
last copy of the data?

Oded


.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: after 5 retransmissions
Date: Wed, 25 Feb 2004 10:11:06 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0402251008290.13440-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 1077732668 12219 171.64.15.100 (25 Feb 2004 18:11:08 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6418


What exactly are we supposed to do in this case...

Do we have to call stcp_fin_received to let the application know
there's no more data coming, even though we didn't really receive a fin

What is the application and mysock layers expecting from us at this point?

--vishal


.

Path: shelby.stanford.edu!elaine22.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ctx->blocking
Date: Wed, 25 Feb 2004 10:24:25 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0402251022300.896-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 1077733467 13423 171.64.15.87 (25 Feb 2004 18:24:27 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6419

I seems to get a lot of assertion on ctx->blocking. What does that mean?
OR what would have caused that assertion?

Thanks

Lin

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Overlapping segment
Date: Wed, 25 Feb 2004 18:42:12 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c1iqa4$e8e$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402250144180.10759-100000@elaine43.Stanford.EDU> <403C72AC.25924C14@leland.stanford.edu> <403C747F.69DBD259@leland.stanford.edu> <c1im83$8o1$1@news.Stanford.EDU> <c1ioe2$br2$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077734532 14606 171.64.15.116 (25 Feb 2004 18:42:12 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6420


>So are we free to choose whether to keep the first copy of the data or the
>last copy of the data?

As long as you pass data up to the app as soon as you can, it shouldn't
make a difference.

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: after 5 retransmissions
Date: Wed, 25 Feb 2004 18:48:48 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c1iqmg$enl$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402251008290.13440-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077734928 15093 171.64.15.116 (25 Feb 2004 18:48:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6421


>What is the application and mysock layers expecting from us at this point?

there really isn't a good provision in the stub code for passing an
error up to the mysock/application layers--this is kind of an engineering
detail that doesn't add much to the assignment.  if your thread just
exits, that's fine.  the stub code will cause myread() to eventually
(erroneously) return 0 in this case, so there isn't really a need to call
stcp_fin_received().

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ctx->blocking
Date: Wed, 25 Feb 2004 18:54:46 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <c1ir1m$f82$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402251022300.896-100000@elaine22.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077735286 15618 171.64.15.116 (25 Feb 2004 18:54:46 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6422


>I seems to get a lot of assertion on ctx->blocking. What does that mean?
>OR what would have caused that assertion?

I only see one such assert in the code, in stcp_unblock_application().
'ctx->blocking' is true while the connection is being established; it's
used so that myconnect() or myaccept() on the socket will block until the
connection's established.  Once 'ctx->blocking' is set to false, passive
sockets are moved from the pending to established connection queue, and
myconnect()/myaccept() are allowed to return.

I've never seen the assert fire.  Possible causes might be calling
stcp_unblock_application() with the wrong mysocket descriptor, or
calling stcp_unblock_application() twice or more for the same descriptor.

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: SYN/FIN management
Date: Wed, 25 Feb 2004 11:08:09 -0800
Lines: 13
Distribution: su
Message-ID: <c1irqu$g54$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077736094 16548 128.12.61.97 (25 Feb 2004 19:08: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:6423

This is a stylistic question.  Is it okay if we treat our SYN/FIN
retransmissions separately than the way we treat data retransmission?  Data
retransmission occurs when we receive a timeout in the control loop, so I
don't actually see another way to handle SYN's except seperately, before
unblocking the application.  For FINs, I suppose they could be handled like
data packets, but since I don't send my FIN until all data is acked anyway,
I've also been handling them as special cases as well.
Is this acceptable?

Thanks,
Oded


.

Path: shelby.stanford.edu!not-for-mail
From: "jsilver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: General question about socket api
Date: Wed, 25 Feb 2004 11:16:27 -0800
Lines: 6
Distribution: su
Message-ID: <c1isai$glv$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1077736595 17087 127.0.0.1 (25 Feb 2004 19:16: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:6424

In TCP, one can piggyback data onto the final ACK (and also the SYN-ACK?) of
the 3 way handshake.  Does the BSD socket interface support this?  This
would seem like an important thing in things like HTTP where the client can
normally send his entire HTTP request in a single packet.


.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: SYN/FIN management
Date: Wed, 25 Feb 2004 19:20:01 +0000 (UTC)
Lines: 22
Distribution: su
Message-ID: <c1ish1$gt6$1@news.Stanford.EDU>
References: <c1irqu$g54$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077736801 17318 171.64.15.116 (25 Feb 2004 19:20:01 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6425


>This is a stylistic question.  Is it okay if we treat our SYN/FIN
>retransmissions separately than the way we treat data retransmission?  Data
>retransmission occurs when we receive a timeout in the control loop, so I
>don't actually see another way to handle SYN's except seperately, before
>unblocking the application.  For FINs, I suppose they could be handled like
>data packets, but since I don't send my FIN until all data is acked anyway,
>I've also been handling them as special cases as well.
>Is this acceptable?

It could be.  What I mean is, I assume you've factored out the common code
where you can, etc., but exactly how you decompose your solution is up to
you... I can't guess at whether your design is a good one without looking
at your code.

I don't quite understand your first comment though--you don't have to
unblock the application in transport_init().  You're free to move this
about where you want, e.g. if you need to handle it elsewhere to support
SYN retransmissions in the main event loop.  In fact, you'll almost
certainly have to move the call to stcp_unblock_application() out of
transport_init() if you decide to handle SYNs like other retransmissions.

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: General question about socket api
Date: Wed, 25 Feb 2004 19:32:16 +0000 (UTC)
Lines: 26
Distribution: su
Message-ID: <c1it80$hmq$1@news.Stanford.EDU>
References: <c1isai$glv$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077737536 18138 171.64.15.116 (25 Feb 2004 19:32:16 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6426


>In TCP, one can piggyback data onto the final ACK (and also the SYN-ACK?) of
>the 3 way handshake.  Does the BSD socket interface support this?  This
>would seem like an important thing in things like HTTP where the client can
>normally send his entire HTTP request in a single packet.

Not that I know of.  In principle, there doesn't seem to be a good reason
why an HTTP request couldn't be sent in one packet, SYN+FIN+data.  Stevens
had a modified version of TCP called T/TCP (TCP for transactions, I
think--he might even talk about it in one of his books) that supported
something like this.  In practice, most web clients don't open a new
connection for every request, instead issuing multiple requests over one
connection to a server, so this is less of an issue from HTTP/1.1 onwards
(which supports HTTP pipelining).

BTW, piggybacking on the final ACK of the SYN/SYN-ACK handshake might be
implicitly supported by delayed ACKs in TCP.  If you do a connect()
and then write() immediately, it's possible that data from the write
could be piggybacked on the ACK for the passive side's SYN-ACK.  It
depends on how quickly the active side ACKs the SYN-ACK.

Piggybacking on the passive side is unlikely, because the TCP
connection is established for a socket on which listen() has been called.
The application has no way of accessing this until it calls accept(),
which dequeues an already established connection.

.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: stcp_wait_for_event
Date: Wed, 25 Feb 2004 11:33:08 -0800
Lines: 14
Distribution: su
Message-ID: <c1it9p$hng$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab40466e.stanford.edu
X-Trace: news.Stanford.EDU 1077737593 18160 171.64.70.110 (25 Feb 2004 19:33: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:6427

if stcp_wait_for_event is called with a timeout that is in the past (i.e.
the absolute time is bigger than it), will stcp_wait_for_event return
immediately?  When stcp_wait_for_event returns a timeout, can multiple bits
be set in the return value?

Thanks,

Justin


P.S.  The reason I ask, it that I call stcp_wait_for_event with a timeout in
the past (by a few nanoseconds) and it returns me event = 1 (APP_DATA).


.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: stcp_wait_for_event
Date: Wed, 25 Feb 2004 19:34:55 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c1itcv$hqf$1@news.Stanford.EDU>
References: <c1it9p$hng$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077737695 18255 171.64.15.116 (25 Feb 2004 19:34:55 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6428


>if stcp_wait_for_event is called with a timeout that is in the past (i.e.
>the absolute time is bigger than it), will stcp_wait_for_event return
>immediately?  When stcp_wait_for_event returns a timeout, can multiple bits
>be set in the return value?

Yes, and yes.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: General question about socket api
Date: Wed, 25 Feb 2004 11:37:58 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0402251131490.27217-100000@Xenon.Stanford.EDU>
References: <c1isai$glv$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 1077737879 18410 171.64.66.201 (25 Feb 2004 19:37:59 GMT)
X-Complaints-To: news@news.stanford.edu
To: jsilver <jmsilver@stanford.edu>
In-Reply-To: <c1isai$glv$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6429


> In TCP, one can piggyback data onto the final ACK (and also the SYN-ACK?) of
> the 3 way handshake.  Does the BSD socket interface support this?  This
> would seem like an important thing in things like HTTP where the client can
> normally send his entire HTTP request in a single packet.

 As far as I know there is no way to specify exactly how the data is
 transferred (regarding piggybacking).  For various optimizations, you can turn
 off the nagle algorithm via TCP_NODELAY sockopt, set the packet as out of band
 OOB, or set the PUSH bit.

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: stcp_wait_for_event
Date: Wed, 25 Feb 2004 11:39:51 -0800
Lines: 24
Distribution: su
Message-ID: <c1itme$i3l$1@news.Stanford.EDU>
References: <c1it9p$hng$1@news.Stanford.EDU> <c1itcv$hqf$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab40466e.stanford.edu
X-Trace: news.Stanford.EDU 1077737998 18549 171.64.70.110 (25 Feb 2004 19: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:6430

How can multiple bits be set... if TIMEOUT = 0 and I do:

event & TIMEOUT == 0

that will always be true so all events would also be timeouts.  What am I
not understanding?

Thanks,

Justin

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1itcv$hqf$1@news.Stanford.EDU...
>
> >if stcp_wait_for_event is called with a timeout that is in the past (i.e.
> >the absolute time is bigger than it), will stcp_wait_for_event return
> >immediately?  When stcp_wait_for_event returns a timeout, can multiple
bits
> >be set in the return value?
>
> Yes, and yes.
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: SYN/FIN management
Date: Wed, 25 Feb 2004 12:12:17 -0800
Lines: 15
Distribution: su
Message-ID: <c1ivj7$k0g$1@news.Stanford.EDU>
References: <c1irqu$g54$1@news.Stanford.EDU> <c1ish1$gt6$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077739943 20496 128.12.61.97 (25 Feb 2004 20: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:6431


> I don't quite understand your first comment though--you don't have to
> unblock the application in transport_init().  You're free to move this
> about where you want, e.g. if you need to handle it elsewhere to support
> SYN retransmissions in the main event loop.  In fact, you'll almost
> certainly have to move the call to stcp_unblock_application() out of
> transport_init() if you decide to handle SYNs like other retransmissions.

That was the point of my comment.  I thought we shouldn't unblock the
application until the SYN handshake completes.  I guess I'm wrong about
that?

Oded


.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: stcp_wait_for_event
Date: Wed, 25 Feb 2004 20:14:16 +0000 (UTC)
Lines: 23
Distribution: su
Message-ID: <c1ivmo$k3u$1@news.Stanford.EDU>
References: <c1it9p$hng$1@news.Stanford.EDU> <c1itcv$hqf$1@news.Stanford.EDU> <c1itme$i3l$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077740056 20606 171.64.15.103 (25 Feb 2004 20:14:16 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6432


Well, TIMEOUT isn't intended as a bit flag in the same way that the
others are--instead, if no bits are set, the function timed out with
no 'interesting' events happening.  But I should have looked at my code
before I answered before--if the wait returns with a timeout, no bits will
be set (the moral of the story is to trust the source we give you rather
than the TA).

For your original question, stcp_wait_for_event() checks for
any pending events before it goes into the wait.  So even if
you specify a timeout, if there's already an event of interest, it
will be returned immediately.  (If an 'interesting' event during the
wait, that will be returned, interrupting the timeout interval).
And if the timeout was in the past, the wait just returns immediately, with
zero or more flags set depending on what events have been queued.


>How can multiple bits be set... if TIMEOUT = 0 and I do:

>event & TIMEOUT == 0

>that will always be true so all events would also be timeouts.  What am I
>not understanding?
.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: SYN/FIN management
Date: Wed, 25 Feb 2004 20:15:45 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c1ivph$k8u$1@news.Stanford.EDU>
References: <c1irqu$g54$1@news.Stanford.EDU> <c1ish1$gt6$1@news.Stanford.EDU> <c1ivj7$k0g$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1077740145 20766 171.64.15.103 (25 Feb 2004 20:15:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6433



>That was the point of my comment.  I thought we shouldn't unblock the
>application until the SYN handshake completes.  I guess I'm wrong about
>that?

No, that's exactly right--but there's no reason that you should keep the
SYN handshake stuff in transport_init() if it makes more sense to move it
elsewhere in your implementation...

.

Path: shelby.stanford.edu!not-for-mail
From: "jsilver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: General question about socket api
Date: Wed, 25 Feb 2004 12:18:20 -0800
Lines: 44
Distribution: su
Message-ID: <c1ivuf$kde$1@news.Stanford.EDU>
References: <c1isai$glv$1@news.Stanford.EDU> <c1it80$hmq$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1077740303 20910 127.0.0.1 (25 Feb 2004 20:18: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:6434


"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1it80$hmq$1@news.Stanford.EDU...
>
> >In TCP, one can piggyback data onto the final ACK (and also the SYN-ACK?)
of
> >the 3 way handshake.  Does the BSD socket interface support this?  This
> >would seem like an important thing in things like HTTP where the client
can
> >normally send his entire HTTP request in a single packet.
>
> Not that I know of.  In principle, there doesn't seem to be a good reason
> why an HTTP request couldn't be sent in one packet, SYN+FIN+data.  Stevens
> had a modified version of TCP called T/TCP (TCP for transactions, I
> think--he might even talk about it in one of his books) that supported
> something like this.  In practice, most web clients don't open a new
> connection for every request, instead issuing multiple requests over one
> connection to a server, so this is less of an issue from HTTP/1.1 onwards
> (which supports HTTP pipelining).
>
Wow, SYN+FIN+data.  I never even thought of that.  Cool.

> BTW, piggybacking on the final ACK of the SYN/SYN-ACK handshake might be
> implicitly supported by delayed ACKs in TCP.  If you do a connect()
> and then write() immediately, it's possible that data from the write
> could be piggybacked on the ACK for the passive side's SYN-ACK.  It
> depends on how quickly the active side ACKs the SYN-ACK.
>

Thanks.  This is a good point. Now that I think about this again, I guess
there is no benefit real benefit in the client sending the data as part of
his ACK of the 3way HS.  He does save an extra packet but he can send the
data right after the ACK anyway.  SYN + data is the real winner, as you
pointed out above.



> Piggybacking on the passive side is unlikely, because the TCP
> connection is established for a socket on which listen() has been called.
> The application has no way of accessing this until it calls accept(),
> which dequeues an already established connection.
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: stcp_wait_for_event
Date: Wed, 25 Feb 2004 12:26:40 -0800
Lines: 38
Distribution: su
Message-ID: <c1j0e6$kst$1@news.Stanford.EDU>
References: <c1it9p$hng$1@news.Stanford.EDU> <c1itcv$hqf$1@news.Stanford.EDU> <c1itme$i3l$1@news.Stanford.EDU> <c1ivmo$k3u$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc407.stanford.edu
X-Trace: news.Stanford.EDU 1077740806 21405 128.12.196.7 (25 Feb 2004 20: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:6435

I understand, but the problem I am encountering is when the app has
completely filled my send buffer but still has more data to send (I am
waiting on an ack and am therefore not accepting more data), and my timeout
is in the past.  In this case, stcp_wait_for_event is returning APP_DATA,
but I need it to return TIMEOUT in order for me to send a retransmission.

-Justin



"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1ivmo$k3u$1@news.Stanford.EDU...
>
> Well, TIMEOUT isn't intended as a bit flag in the same way that the
> others are--instead, if no bits are set, the function timed out with
> no 'interesting' events happening.  But I should have looked at my code
> before I answered before--if the wait returns with a timeout, no bits will
> be set (the moral of the story is to trust the source we give you rather
> than the TA).
>
> For your original question, stcp_wait_for_event() checks for
> any pending events before it goes into the wait.  So even if
> you specify a timeout, if there's already an event of interest, it
> will be returned immediately.  (If an 'interesting' event during the
> wait, that will be returned, interrupting the timeout interval).
> And if the timeout was in the past, the wait just returns immediately,
with
> zero or more flags set depending on what events have been queued.
>
>
> >How can multiple bits be set... if TIMEOUT = 0 and I do:
>
> >event & TIMEOUT == 0
>
> >that will always be true so all events would also be timeouts.  What am I
> >not understanding?


.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: stcp_wait_for_event
Date: Wed, 25 Feb 2004 12:31:31 -0800
Lines: 39
Distribution: su
Message-ID: <c1j0na$l86$1@news.Stanford.EDU>
References: <c1it9p$hng$1@news.Stanford.EDU> <c1itcv$hqf$1@news.Stanford.EDU> <c1itme$i3l$1@news.Stanford.EDU> <c1ivmo$k3u$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc407.stanford.edu
X-Trace: news.Stanford.EDU 1077741098 21766 128.12.196.7 (25 Feb 2004 20:31: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:6436

Basically, what I am saying that from the comment and because it cannot
return a timeout with any other event, a TIMEOUT event needs to take
priority over any other event to avoid this situation.

Therefore if a timeout has occurred, the fn will return TIMEOUT even if the
app is still trying to push data down to the TCP layer.

Thanks,

Justin

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1ivmo$k3u$1@news.Stanford.EDU...
>
> Well, TIMEOUT isn't intended as a bit flag in the same way that the
> others are--instead, if no bits are set, the function timed out with
> no 'interesting' events happening.  But I should have looked at my code
> before I answered before--if the wait returns with a timeout, no bits will
> be set (the moral of the story is to trust the source we give you rather
> than the TA).
>
> For your original question, stcp_wait_for_event() checks for
> any pending events before it goes into the wait.  So even if
> you specify a timeout, if there's already an event of interest, it
> will be returned immediately.  (If an 'interesting' event during the
> wait, that will be returned, interrupting the timeout interval).
> And if the timeout was in the past, the wait just returns immediately,
with
> zero or more flags set depending on what events have been queued.
>
>
> >How can multiple bits be set... if TIMEOUT = 0 and I do:
>
> >event & TIMEOUT == 0
>
> >that will always be true so all events would also be timeouts.  What am I
> >not understanding?


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: stcp_wait_for_event
Date: Wed, 25 Feb 2004 12:36:40 -0800
Lines: 18
Distribution: su
Message-ID: <c1j10v$lfu$1@news.Stanford.EDU>
References: <c1it9p$hng$1@news.Stanford.EDU> <c1itcv$hqf$1@news.Stanford.EDU> <c1itme$i3l$1@news.Stanford.EDU> <c1ivmo$k3u$1@news.Stanford.EDU> <c1j0na$l86$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1077741407 22014 128.12.61.97 (25 Feb 2004 20:36: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:6437

Alternately, you could always check manually if a timeout should have
occurred, even when APP_DATA etc. are set.

Oded

> Basically, what I am saying that from the comment and because it cannot
> return a timeout with any other event, a TIMEOUT event needs to take
> priority over any other event to avoid this situation.
>
> Therefore if a timeout has occurred, the fn will return TIMEOUT even if
the
> app is still trying to push data down to the TCP layer.
>
> Thanks,
>
> Justin


.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: stcp_wait_for_event
Date: Wed, 25 Feb 2004 12:53:59 -0800
Lines: 26
Distribution: su
Message-ID: <c1j21c$mkp$1@news.Stanford.EDU>
References: <c1it9p$hng$1@news.Stanford.EDU> <c1itcv$hqf$1@news.Stanford.EDU> <c1itme$i3l$1@news.Stanford.EDU> <c1ivmo$k3u$1@news.Stanford.EDU> <c1j0na$l86$1@news.Stanford.EDU> <c1j10v$lfu$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab4087df.stanford.edu
X-Trace: news.Stanford.EDU 1077742444 23193 171.64.135.223 (25 Feb 2004 20:54: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:6438

Yeah, that was going to be my next step.  It just seems very hacky.

-Justin

"Oded Wurman" <owurman@stanford.edu> wrote in message
news:c1j10v$lfu$1@news.Stanford.EDU...
> Alternately, you could always check manually if a timeout should have
> occurred, even when APP_DATA etc. are set.
>
> Oded
>
> > Basically, what I am saying that from the comment and because it cannot
> > return a timeout with any other event, a TIMEOUT event needs to take
> > priority over any other event to avoid this situation.
> >
> > Therefore if a timeout has occurred, the fn will return TIMEOUT even if
> the
> > app is still trying to push data down to the TCP layer.
> >
> > Thanks,
> >
> > Justin
>
>


.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: stcp_wait_for_event
Date: Wed, 25 Feb 2004 21:01:08 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c1j2ek$n5g$1@news.Stanford.EDU>
References: <c1it9p$hng$1@news.Stanford.EDU> <c1itcv$hqf$1@news.Stanford.EDU> <c1itme$i3l$1@news.Stanford.EDU> <c1ivmo$k3u$1@news.Stanford.EDU> <c1j0e6$kst$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
X-Trace: news.Stanford.EDU 1077742868 23728 171.64.15.100 (25 Feb 2004 21:01:08 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6439


>I understand, but the problem I am encountering is when the app has
>completely filled my send buffer but still has more data to send (I am
>waiting on an ack and am therefore not accepting more data), and my timeout
>is in the past.  In this case, stcp_wait_for_event is returning APP_DATA,
>but I need it to return TIMEOUT in order for me to send a retransmission.

Why are you waiting for an application data event if you don't care about
it?  Just don't specify this as an event of interest in the flags you pass
in...

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: stcp_wait_for_event
Date: Wed, 25 Feb 2004 21:08:19 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <c1j2s3$ni3$1@news.Stanford.EDU>
References: <c1it9p$hng$1@news.Stanford.EDU> <c1itcv$hqf$1@news.Stanford.EDU> <c1itme$i3l$1@news.Stanford.EDU> <c1ivmo$k3u$1@news.Stanford.EDU> <c1j0na$l86$1@news.Stanford.EDU> <c1j10v$lfu$1@news.Stanford.EDU> <c1j21c$mkp$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
X-Trace: news.Stanford.EDU 1077743299 24131 171.64.15.100 (25 Feb 2004 21:08:19 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6440


>Yeah, that was going to be my next step.  It just seems very hacky.

Well, you probably need to check the timeout yourself, anyway--if the
peer sends you random packets, you could keep waking up without a timeout
being signaled by stcp_wait_for_event(), even though a timeout should
have expired for an outstanding segment.  wait_for_event() can't possibly
handle such a case.

Basically, all the 'timeout' argument to stcp_wait_for_event() dictates is
that the function must return after that time (+ some scheduling delta);
how you use that to implement your timeout is up to you.  This isn't a
hack, there's just no way that a lower-layer function like that can (or
should) handle the full timeout semantics that you implement.

You shouldn't busy loop on application data being ready when your
sender window is full.

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Keep-alive mechanism, required?
Date: Wed, 25 Feb 2004 16:32:32 -0800
Lines: 4
Distribution: su
Message-ID: <Pine.GSO.4.44.0402251630450.2836-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 1077755555 8978 171.64.15.118 (26 Feb 2004 00:32:35 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6441


Are we required to implement the keep-alive mechanism? or termination
after long period of idleness?

.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ctx->blocking
Date: Wed, 25 Feb 2004 16:38:46 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.GSO.4.44.0402251635550.24600-100000@elaine26.Stanford.EDU>
References: <Pine.GSO.4.44.0402251022300.896-100000@elaine22.Stanford.EDU>
 <c1ir1m$f82$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077755928 9333 171.64.15.101 (26 Feb 2004 00:38:48 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c1ir1m$f82$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6442

Oh so this could be caused by calling stcp_unblock_application() twice. So
i think i read something saying we can use this call to tell application
connection refused or so. So if i am on established state already and i
retransmitted 5 times and it still time out, should I call
stcp_unblock_application() with errno set or i just exit?

Thanks

Lin

On Wed, 25 Feb 2004, Matthew Jonathan Holliman wrote:

>
> >I seems to get a lot of assertion on ctx->blocking. What does that mean?
> >OR what would have caused that assertion?
>
> I only see one such assert in the code, in stcp_unblock_application().
> 'ctx->blocking' is true while the connection is being established; it's
> used so that myconnect() or myaccept() on the socket will block until the
> connection's established.  Once 'ctx->blocking' is set to false, passive
> sockets are moved from the pending to established connection queue, and
> myconnect()/myaccept() are allowed to return.
>
> I've never seen the assert fire.  Possible causes might be calling
> stcp_unblock_application() with the wrong mysocket descriptor, or
> calling stcp_unblock_application() twice or more for the same descriptor.
>
>

.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: General question about socket api
Date: Wed, 25 Feb 2004 16:49:19 -0800
Lines: 57
Distribution: su
Message-ID: <Pine.GSO.4.44.0402251647230.24600-100000@elaine26.Stanford.EDU>
References: <c1isai$glv$1@news.Stanford.EDU> <c1it80$hmq$1@news.Stanford.EDU>
 <c1ivuf$kde$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077756560 9929 171.64.15.101 (26 Feb 2004 00:49:20 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c1ivuf$kde$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6443

So you mean even the SYN packet could have data appended to it? And we
should store this data and send out the SYNACK? so when the next ACK come
back, we unblock the application and immediately pass up data? Is that
right?

Thanks

Lin

On Wed, 25 Feb 2004, jsilver wrote:

>
> "Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
> news:c1it80$hmq$1@news.Stanford.EDU...
> >
> > >In TCP, one can piggyback data onto the final ACK (and also the SYN-ACK?)
> of
> > >the 3 way handshake.  Does the BSD socket interface support this?  This
> > >would seem like an important thing in things like HTTP where the client
> can
> > >normally send his entire HTTP request in a single packet.
> >
> > Not that I know of.  In principle, there doesn't seem to be a good reason
> > why an HTTP request couldn't be sent in one packet, SYN+FIN+data.  Stevens
> > had a modified version of TCP called T/TCP (TCP for transactions, I
> > think--he might even talk about it in one of his books) that supported
> > something like this.  In practice, most web clients don't open a new
> > connection for every request, instead issuing multiple requests over one
> > connection to a server, so this is less of an issue from HTTP/1.1 onwards
> > (which supports HTTP pipelining).
> >
> Wow, SYN+FIN+data.  I never even thought of that.  Cool.
>
> > BTW, piggybacking on the final ACK of the SYN/SYN-ACK handshake might be
> > implicitly supported by delayed ACKs in TCP.  If you do a connect()
> > and then write() immediately, it's possible that data from the write
> > could be piggybacked on the ACK for the passive side's SYN-ACK.  It
> > depends on how quickly the active side ACKs the SYN-ACK.
> >
>
> Thanks.  This is a good point. Now that I think about this again, I guess
> there is no benefit real benefit in the client sending the data as part of
> his ACK of the 3way HS.  He does save an extra packet but he can send the
> data right after the ACK anyway.  SYN + data is the real winner, as you
> pointed out above.
>
>
>
> > Piggybacking on the passive side is unlikely, because the TCP
> > connection is established for a socket on which listen() has been called.
> > The application has no way of accessing this until it calls accept(),
> > which dequeues an already established connection.
> >
>
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ctx->blocking
Date: Wed, 25 Feb 2004 16:49:18 -0800
Lines: 44
Distribution: su
Message-ID: <c1jfqo$9mu$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402251022300.896-100000@elaine22.Stanford.EDU> <c1ir1m$f82$1@news.Stanford.EDU> <Pine.GSO.4.44.0402251635550.24600-100000@elaine26.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1077756568 9950 128.12.44.20 (26 Feb 2004 00:49: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:6444

The only time that the application blocks in that way is during a call to
myaccept or myconnect, I believe. Once you've reached the established state,
you really should never call stcp_unblock_application() again.

I think. :P

- Sean

"Lin Chan" <linchan@stanford.edu> wrote in message
news:Pine.GSO.4.44.0402251635550.24600-100000@elaine26.Stanford.EDU...
> Oh so this could be caused by calling stcp_unblock_application() twice. So
> i think i read something saying we can use this call to tell application
> connection refused or so. So if i am on established state already and i
> retransmitted 5 times and it still time out, should I call
> stcp_unblock_application() with errno set or i just exit?
>
> Thanks
>
> Lin
>
> On Wed, 25 Feb 2004, Matthew Jonathan Holliman wrote:
>
> >
> > >I seems to get a lot of assertion on ctx->blocking. What does that
mean?
> > >OR what would have caused that assertion?
> >
> > I only see one such assert in the code, in stcp_unblock_application().
> > 'ctx->blocking' is true while the connection is being established; it's
> > used so that myconnect() or myaccept() on the socket will block until
the
> > connection's established.  Once 'ctx->blocking' is set to false, passive
> > sockets are moved from the pending to established connection queue, and
> > myconnect()/myaccept() are allowed to return.
> >
> > I've never seen the assert fire.  Possible causes might be calling
> > stcp_unblock_application() with the wrong mysocket descriptor, or
> > calling stcp_unblock_application() twice or more for the same
descriptor.
> >
> >
>


.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: last ACK
Date: Wed, 25 Feb 2004 17:30:28 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.GSO.4.44.0402251724590.25171-100000@elaine26.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077759030 13787 171.64.15.101 (26 Feb 2004 01:30:30 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6445

Consider the following situation

Client sends a FIN to server
Then server send back an ACK and then a FIN and go to LAST_ACK state.
Client go the ACK and FIN, so it sends a final ACK and terminate

Assume the final ACK is lost, server will have a timeout and will try to
retransmit right? But i think stcp_network_send will return -1 if it try
to send and the other side has already dead. Should we consider a -1 from
retransmit in LAST_ACK state a sign of the other side has got our FIN
andis actually closed? So server should not exit but should stop
retransmit and go to CLOSE state?

Thanks

Lin

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: last ACK
Date: Thu, 26 Feb 2004 09:52:12 +0800
Lines: 27
Distribution: su
Message-ID: <403D514C.D862D1E5@leland.stanford.edu>
References: <Pine.GSO.4.44.0402251724590.25171-100000@elaine26.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077760499 15397 128.12.196.85 (26 Feb 2004 01:54:59 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6446

I think the easiest way is just to ignore the -1 returned by
stcp_network_send. After all STCP does not assume reliable delivery of
packets in the network layer. So it makes no difference to STCP whether
stcp_network_send returns 0 or -1. STCP still assumes that delivery can be
unreliable.

Jimmy

Lin Chan wrote:

> Consider the following situation
>
> Client sends a FIN to server
> Then server send back an ACK and then a FIN and go to LAST_ACK state.
> Client go the ACK and FIN, so it sends a final ACK and terminate
>
> Assume the final ACK is lost, server will have a timeout and will try to
> retransmit right? But i think stcp_network_send will return -1 if it try
> to send and the other side has already dead. Should we consider a -1 from
> retransmit in LAST_ACK state a sign of the other side has got our FIN
> andis actually closed? So server should not exit but should stop
> retransmit and go to CLOSE state?
>
> Thanks
>
> Lin

.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: General question about socket api
Date: Wed, 25 Feb 2004 19:16:18 -0800
Lines: 95
Distribution: su
Message-ID: <c1joe1$n19$1@news.Stanford.EDU>
References: <c1isai$glv$1@news.Stanford.EDU> <c1it80$hmq$1@news.Stanford.EDU> <c1ivuf$kde$1@news.Stanford.EDU> <Pine.GSO.4.44.0402251647230.24600-100000@elaine26.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1077765377 23593 128.12.173.169 (26 Feb 2004 03:16: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:6447

I do not understand. If a SYN packet can contain data, this would mean that
we should be able to process the data even when we are in the LISTEN state.
This clearly seems opposite to what RFC 793 says. Is this another of the
situations where STCP differs from RFC 793, and hence we need to handle this
case?

This part of my question is not specific to STCP, but to TCP implementations
in general. As Matthew said, the HTTP request could be sent in one packet -
SYN+FIN+data. But if we are in the LISTEN state, the RFC 793 tells us to
completely ignore the data when we receive a SYN packet. So doesn't that
mean that any TCP stack that faithfully implements RFC 793 will always
ignore this data coming with SYN packet? If yes, then shouldn't this imply
that data should not be sent in a SYN packet because it is bound to be
ignored anyway? And if no, then I am totally confused as to why the RFC is
there at all...I mean if TCP stacks can make arbitrary decisions in these
situations, what common standard do we rely on?

Thanks

Kumar


"Lin Chan" <linchan@stanford.edu> wrote in message
news:Pine.GSO.4.44.0402251647230.24600-100000@elaine26.Stanford.EDU...
> So you mean even the SYN packet could have data appended to it? And we
> should store this data and send out the SYNACK? so when the next ACK come
> back, we unblock the application and immediately pass up data? Is that
> right?
>
> Thanks
>
> Lin
>
> On Wed, 25 Feb 2004, jsilver wrote:
>
> >
> > "Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
> > news:c1it80$hmq$1@news.Stanford.EDU...
> > >
> > > >In TCP, one can piggyback data onto the final ACK (and also the
SYN-ACK?)
> > of
> > > >the 3 way handshake.  Does the BSD socket interface support this?
This
> > > >would seem like an important thing in things like HTTP where the
client
> > can
> > > >normally send his entire HTTP request in a single packet.
> > >
> > > Not that I know of.  In principle, there doesn't seem to be a good
reason
> > > why an HTTP request couldn't be sent in one packet, SYN+FIN+data.
Stevens
> > > had a modified version of TCP called T/TCP (TCP for transactions, I
> > > think--he might even talk about it in one of his books) that supported
> > > something like this.  In practice, most web clients don't open a new
> > > connection for every request, instead issuing multiple requests over
one
> > > connection to a server, so this is less of an issue from HTTP/1.1
onwards
> > > (which supports HTTP pipelining).
> > >
> > Wow, SYN+FIN+data.  I never even thought of that.  Cool.
> >
> > > BTW, piggybacking on the final ACK of the SYN/SYN-ACK handshake might
be
> > > implicitly supported by delayed ACKs in TCP.  If you do a connect()
> > > and then write() immediately, it's possible that data from the write
> > > could be piggybacked on the ACK for the passive side's SYN-ACK.  It
> > > depends on how quickly the active side ACKs the SYN-ACK.
> > >
> >
> > Thanks.  This is a good point. Now that I think about this again, I
guess
> > there is no benefit real benefit in the client sending the data as part
of
> > his ACK of the 3way HS.  He does save an extra packet but he can send
the
> > data right after the ACK anyway.  SYN + data is the real winner, as you
> > pointed out above.
> >
> >
> >
> > > Piggybacking on the passive side is unlikely, because the TCP
> > > connection is established for a socket on which listen() has been
called.
> > > The application has no way of accessing this until it calls accept(),
> > > which dequeues an already established connection.
> > >
> >
> >
> >
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Overlapping segment
Date: Wed, 25 Feb 2004 19:39:34 -0800
Lines: 22
Distribution: su
Message-ID: <c1jppl$q1r$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402250144180.10759-100000@elaine43.Stanford.EDU> <403C72AC.25924C14@leland.stanford.edu> <403C747F.69DBD259@leland.stanford.edu> <c1im83$8o1$1@news.Stanford.EDU> <c1ioe2$br2$1@news.Stanford.EDU> <c1iqa4$e8e$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1077766773 26683 128.12.173.169 (26 Feb 2004 03:39: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:6448

What about out of order data? It does make a difference there, isnt it? If
there is overlap there, should we keep the first copy then? In other words,
if two packets contain data that is out of order and there is overlap
between the sequence numbers of these out of order data, we should not be
overwriting the out of order data that we already have in the buffer?

Thanks

Kumar

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1iqa4$e8e$1@news.Stanford.EDU...
>
> >So are we free to choose whether to keep the first copy of the data or
the
> >last copy of the data?
>
> As long as you pass data up to the app as soon as you can, it shouldn't
> make a difference.
>


.

Path: shelby.stanford.edu!not-for-mail
From: Murali Kumar <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: last ACK
Date: Wed, 25 Feb 2004 20:16:07 -0800
Lines: 21
Distribution: su
Message-ID: <c1jru7$sk9$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402251724590.25171-100000@elaine26.Stanford.EDU> <403D514C.D862D1E5@leland.stanford.edu>
NNTP-Posting-Host: elaine2.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077768967 29321 171.64.15.67 (26 Feb 2004 04:16:07 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.1) Gecko/20020827
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6449

I thought that -1 returned by any stcp_X method is a fatal error and we 
must always quit. I looked at network.c and it doesnt seem to me that 
when a packet is dropped (when the mode is unreliable), it returns 
-1...seems that -1 is returned only when a fatal error occurs, not when 
the delivery is unreliable, and hence we should definitely check if 
stcp_network_send returns -1. Can someone confirm this?

Thanks

Kumar

Jimmy Pang wrote:
> I think the easiest way is just to ignore the -1 returned by
> stcp_network_send. After all STCP does not assume reliable delivery of
> packets in the network layer. So it makes no difference to STCP whether
> stcp_network_send returns 0 or -1. STCP still assumes that delivery can be
> unreliable.
> 
> Jimmy
> 

.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: General question about socket api
Date: Thu, 26 Feb 2004 04:16:51 +0000 (UTC)
Lines: 37
Distribution: su
Message-ID: <c1jrvj$spv$1@news.Stanford.EDU>
References: <c1isai$glv$1@news.Stanford.EDU> <c1it80$hmq$1@news.Stanford.EDU> <c1ivuf$kde$1@news.Stanford.EDU> <Pine.GSO.4.44.0402251647230.24600-100000@elaine26.Stanford.EDU> <c1joe1$n19$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1077769011 29503 171.64.15.98 (26 Feb 2004 04:16:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6450


>This part of my question is not specific to STCP, but to TCP implementations
>in general. As Matthew said, the HTTP request could be sent in one packet -
>SYN+FIN+data. But if we are in the LISTEN state, the RFC 793 tells us to
>completely ignore the data when we receive a SYN packet. So doesn't that
>mean that any TCP stack that faithfully implements RFC 793 will always
>ignore this data coming with SYN packet? If yes, then shouldn't this imply
>that data should not be sent in a SYN packet because it is bound to be
>ignored anyway? And if no, then I am totally confused as to why the RFC is
>there at all...I mean if TCP stacks can make arbitrary decisions in these
>situations, what common standard do we rely on?


Please re-read my response a bit more carefully.  There's a very important
phrase at the beginning of the statement:  "In principle."  I did *not*
say that an HTTP request can be sent in one packet, only that there doesn't
really seem to be a good reason why this couldn't be supported.  (Or
perhaps there is, since this isn't permitted by the RFC, and I'm just
overlooking what it could be).

As defined by the RFC, TCP does not support this, and the socket API
definitely does not support it.  You will not encounter such cases, and are
definitely not required to support them.

But, *in principle*, one could conceive of an HTTP request being sent
in one packet--the overhead of the three-way handshake plus another
packet just for a GET request is a bit unnecessary.  You could even
imagine how this might be implemented on top of the current TCP/socket
API without changing the existing interfaces/breaking existing stacks--
a setsockopt() could pass in data before the connect(), and the
data to be included in the SYN packet could be included as a TCP
option.  A stack that understood that option could process the data,
while one that didn't would just ignore it.

This is all hypothetical, though--no such option exists, and so no TCP
stack would really process such data.

.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Overlapping segment
Date: Thu, 26 Feb 2004 04:23:33 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c1jsc5$t91$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402250144180.10759-100000@elaine43.Stanford.EDU> <403C72AC.25924C14@leland.stanford.edu> <403C747F.69DBD259@leland.stanford.edu> <c1im83$8o1$1@news.Stanford.EDU> <c1ioe2$br2$1@news.Stanford.EDU> <c1iqa4$e8e$1@news.Stanford.EDU> <c1jppl$q1r$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1077769413 29985 171.64.15.98 (26 Feb 2004 04:23:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6451


>What about out of order data? It does make a difference there, isnt it? If
>there is overlap there, should we keep the first copy then? In other words,
>if two packets contain data that is out of order and there is overlap
>between the sequence numbers of these out of order data, we should not be
>overwriting the out of order data that we already have in the buffer?

As long as you pass data up to the app as soon as you can, it shouldn't
matter--the test cases should produce the same result.  I took out
the case that covers the situation you describe.

.

Path: shelby.stanford.edu!not-for-mail
From: "jsilver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Go back N and retransmissions.
Date: Wed, 25 Feb 2004 20:59:31 -0800
Lines: 57
Distribution: su
Message-ID: <c1jufq$2am$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221708330.5427-100000@epic6.Stanford.EDU> <c1bkhc$7ui$1@news.Stanford.EDU> <c1c1gu$oi7$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1077771579 2390 127.0.0.1 (26 Feb 2004 04:59: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:6452


"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1c1gu$oi7$1@news.Stanford.EDU...
>
> >What happens if while waiting for a timeout the peer advertises a
receiver
> >window size smaller than the data in your first packet?  You'd have to
break
> >it up.  I keep a queue of unsent _data_, and when my ACK times out, I
> >repackage the data into a new packet and send it again, counting that as
a
> >retransmission.  Thus if the window size changes, I'm resending the
> >appropriate amount of data.
>
> Yes--
> The RFC says that TCP implementations "shouldn't" shrink their advertised
> window.  We won't be checking this case, so you can assume that if the
> data was sent on its initial transmission, it can just be resent on
> subsequent transmissions without regard to the advertised receiver window.
> (i.e. you only need to worry about sender window on initial transmission
> for STCP)
>
> Of course, if you can implement your solution to always obey th_win,
> that's even better.  You probably won't actually see a difference in this
> assignment, since it's highly unlikely that any real TCP implementation
> would advertise th_win < 3072 anyway...
>
> Whether or not you choose to implement the 'correct' way, you should
> think about how real TCP would do it anyway :-)
>

Matthew,

Can you clarify this one more time.  I'm failing test 2.K:

Test 2.K [out of 2.5]
Checks that Tx enforces 5 retransmissions.

Results:  NOT OK

Retransmission count of 5 not enforced
(Your code retransmitted sequence number 4369 up to 6 times)
Client output:


My implementation repackages the outgoing packets each time to make sure we
minimize the number of packets while staying within the window constraints.
Even though the receiver's window stays constant, the advertised window will
change depending on how many bytes are in flight.  Therefore, when a packet
fails, I don't necessarily have a guarantee that the retransmitted packets
will have the same byte boundaries.  So, I've been only counting the
retransmits on the first packet (of the Go-Back-N).

What is the test script doing?  Is it looking at every byte sent and making
sure no byte is sent more than 6 times?


.

Path: shelby.stanford.edu!not-for-mail
From: Myles Barrett Williams <mylesw@saga14.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS 3-3
Date: 25 Feb 2004 21:04:01 -0800
Organization: Stanford University, CA, USA
Lines: 5
Distribution: su
Message-ID: <tl4d682ig8u.fsf_-_@saga14.Stanford.EDU>
NNTP-Posting-Host: saga14.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077771841 2149 171.64.15.144 (26 Feb 2004 05:04:01 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:6453


Is it acceptable for the new TRANSP formula to include the distance to the
receiving host?

Myles
.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Go back N and retransmissions.
Date: Thu, 26 Feb 2004 05:15:14 +0000 (UTC)
Lines: 38
Distribution: su
Message-ID: <c1jvd2$3jt$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221708330.5427-100000@epic6.Stanford.EDU> <c1bkhc$7ui$1@news.Stanford.EDU> <c1c1gu$oi7$1@news.Stanford.EDU> <c1jufq$2am$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1077772514 3709 171.64.15.84 (26 Feb 2004 05:15:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6454



>My implementation repackages the outgoing packets each time to make sure we
>minimize the number of packets while staying within the window constraints.
>Even though the receiver's window stays constant, the advertised window will
>change depending on how many bytes are in flight.  Therefore, when a packet
>fails, I don't necessarily have a guarantee that the retransmitted packets
>will have the same byte boundaries.  So, I've been only counting the
>retransmits on the first packet (of the Go-Back-N).

I'm still not sure why the advertised window would change--
Suppose I'm expecting th_seq=1000 onwards, and I'm willing to accept
2000 bytes from there.  Now if you send me th_seq=1500, say (e.g. if
th_seq=1000 was dropped), I'll ACK with th_ack=1000, th_win=2000.  This
makes sense, as I can't pass any data up to the app yet, and I'm not
shrinking the range of sequence numbers I'm willing to accept from you.
And if you keep on sending th_seq=2000, th_seq=2500, ..., I'll still keep
on ACKing that, same th_ack, same th_win (i.e. I'm willing to accept
anything from th_seq=1000 to th_seq=2999, inclusive).  Eventually, the
first packet will time out and you'll retransmit everything as part of
Go-back N.  I'm still willing to accept the same number of outstanding
bytes as I was when you first transmitted.

So where and why does the advertised window change in this scenario?

In real TCP, th_win would decrease if you sent me th_seq=1000, and
my app didn't read it.  In that case, since I said above that I'd accept up
to th_seq=2999 (inclusive), and I ack with, say, th_ack=1500, my th_win
might go down to 1500 (to keep this same guarantee).  And then if the
app read those 500 bytes, assuming I have a 2000 byte buffer in the kernel
which is what limited my advertised window above, I could bump th_win back
up to 2000.

>What is the test script doing?  Is it looking at every byte sent and making
>sure no byte is sent more than 6 times?

Yes, because it doesn't know how the data will be repacketised.

.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS 3-3
Date: Thu, 26 Feb 2004 05:17:27 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c1jvh7$3os$1@news.Stanford.EDU>
References: <tl4d682ig8u.fsf_-_@saga14.Stanford.EDU>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1077772647 3868 171.64.15.84 (26 Feb 2004 05:17:27 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6455



>Is it acceptable for the new TRANSP formula to include the distance to the
>receiving host?

If you feel you need that in your answer, you can include it.

.

Path: shelby.stanford.edu!not-for-mail
From: "jsilver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Go back N and retransmissions.
Date: Wed, 25 Feb 2004 21:24:23 -0800
Lines: 57
Distribution: su
Message-ID: <c1jvuj$4d0$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221708330.5427-100000@epic6.Stanford.EDU> <c1bkhc$7ui$1@news.Stanford.EDU> <c1c1gu$oi7$1@news.Stanford.EDU> <c1jufq$2am$1@news.Stanford.EDU> <c1jvd2$3jt$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1077773077 4512 127.0.0.1 (26 Feb 2004 05:24: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:6456


"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1jvd2$3jt$1@news.Stanford.EDU...
>
>
> >My implementation repackages the outgoing packets each time to make sure
we
> >minimize the number of packets while staying within the window
constraints.
> >Even though the receiver's window stays constant, the advertised window
will
> >change depending on how many bytes are in flight.  Therefore, when a
packet
> >fails, I don't necessarily have a guarantee that the retransmitted
packets
> >will have the same byte boundaries.  So, I've been only counting the
> >retransmits on the first packet (of the Go-Back-N).
>
> I'm still not sure why the advertised window would change--
> Suppose I'm expecting th_seq=1000 onwards, and I'm willing to accept
> 2000 bytes from there.  Now if you send me th_seq=1500, say (e.g. if
> th_seq=1000 was dropped), I'll ACK with th_ack=1000, th_win=2000.  This
> makes sense, as I can't pass any data up to the app yet, and I'm not
> shrinking the range of sequence numbers I'm willing to accept from you.
> And if you keep on sending th_seq=2000, th_seq=2500, ..., I'll still keep
> on ACKing that, same th_ack, same th_win (i.e. I'm willing to accept
> anything from th_seq=1000 to th_seq=2999, inclusive).  Eventually, the
> first packet will time out and you'll retransmit everything as part of
> Go-back N.  I'm still willing to accept the same number of outstanding
> bytes as I was when you first transmitted.
>
> So where and why does the advertised window change in this scenario?
>

It doesn't in that scenario, but it does if window size is a not a multiple
of MSS.  Consider MSS of 10 and window size of 15.  I send you two packets
with bytes 1-10 and 11-15, respectively.   If 11-15 is not acked, I send you
two packets with bytes 11-20, 21-25.  It gets even more complicated with a
MSS of 536 and a window size of 3072.

> In real TCP, th_win would decrease if you sent me th_seq=1000, and
> my app didn't read it.  In that case, since I said above that I'd accept
up
> to th_seq=2999 (inclusive), and I ack with, say, th_ack=1500, my th_win
> might go down to 1500 (to keep this same guarantee).  And then if the
> app read those 500 bytes, assuming I have a 2000 byte buffer in the kernel
> which is what limited my advertised window above, I could bump th_win back
> up to 2000.
>
> >What is the test script doing?  Is it looking at every byte sent and
making
> >sure no byte is sent more than 6 times?
>
> Yes, because it doesn't know how the data will be repacketised.
>


.

Path: shelby.stanford.edu!not-for-mail
From: "jsilver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Go back N and retransmissions.
Date: Wed, 25 Feb 2004 21:27:19 -0800
Lines: 70
Distribution: su
Message-ID: <c1k03t$4jc$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221708330.5427-100000@epic6.Stanford.EDU> <c1bkhc$7ui$1@news.Stanford.EDU> <c1c1gu$oi7$1@news.Stanford.EDU> <c1jufq$2am$1@news.Stanford.EDU> <c1jvd2$3jt$1@news.Stanford.EDU> <c1jvuj$4d0$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1077773246 4716 127.0.0.1 (26 Feb 2004 05:27: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:6457

I think I can hack around this by not repacket-izing packets that have
already been sent.

"jsilver" <jmsilver@stanford.edu> wrote in message
news:c1jvuj$4d0$1@news.Stanford.EDU...
>
> "Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
> news:c1jvd2$3jt$1@news.Stanford.EDU...
> >
> >
> > >My implementation repackages the outgoing packets each time to make
sure
> we
> > >minimize the number of packets while staying within the window
> constraints.
> > >Even though the receiver's window stays constant, the advertised window
> will
> > >change depending on how many bytes are in flight.  Therefore, when a
> packet
> > >fails, I don't necessarily have a guarantee that the retransmitted
> packets
> > >will have the same byte boundaries.  So, I've been only counting the
> > >retransmits on the first packet (of the Go-Back-N).
> >
> > I'm still not sure why the advertised window would change--
> > Suppose I'm expecting th_seq=1000 onwards, and I'm willing to accept
> > 2000 bytes from there.  Now if you send me th_seq=1500, say (e.g. if
> > th_seq=1000 was dropped), I'll ACK with th_ack=1000, th_win=2000.  This
> > makes sense, as I can't pass any data up to the app yet, and I'm not
> > shrinking the range of sequence numbers I'm willing to accept from you.
> > And if you keep on sending th_seq=2000, th_seq=2500, ..., I'll still
keep
> > on ACKing that, same th_ack, same th_win (i.e. I'm willing to accept
> > anything from th_seq=1000 to th_seq=2999, inclusive).  Eventually, the
> > first packet will time out and you'll retransmit everything as part of
> > Go-back N.  I'm still willing to accept the same number of outstanding
> > bytes as I was when you first transmitted.
> >
> > So where and why does the advertised window change in this scenario?
> >
>
> It doesn't in that scenario, but it does if window size is a not a
multiple
> of MSS.  Consider MSS of 10 and window size of 15.  I send you two packets
> with bytes 1-10 and 11-15, respectively.   If 11-15 is not acked, I send
you
> two packets with bytes 11-20, 21-25.  It gets even more complicated with a
> MSS of 536 and a window size of 3072.
>
> > In real TCP, th_win would decrease if you sent me th_seq=1000, and
> > my app didn't read it.  In that case, since I said above that I'd accept
> up
> > to th_seq=2999 (inclusive), and I ack with, say, th_ack=1500, my th_win
> > might go down to 1500 (to keep this same guarantee).  And then if the
> > app read those 500 bytes, assuming I have a 2000 byte buffer in the
kernel
> > which is what limited my advertised window above, I could bump th_win
back
> > up to 2000.
> >
> > >What is the test script doing?  Is it looking at every byte sent and
> making
> > >sure no byte is sent more than 6 times?
> >
> > Yes, because it doesn't know how the data will be repacketised.
> >
>
>


.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Go back N and retransmissions.
Date: Thu, 26 Feb 2004 05:36:35 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c1k0l3$5ce$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221708330.5427-100000@epic6.Stanford.EDU> <c1bkhc$7ui$1@news.Stanford.EDU> <c1c1gu$oi7$1@news.Stanford.EDU> <c1jufq$2am$1@news.Stanford.EDU> <c1jvd2$3jt$1@news.Stanford.EDU> <c1jvuj$4d0$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1077773795 5518 171.64.15.84 (26 Feb 2004 05:36:35 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6458



>It doesn't in that scenario, but it does if window size is a not a multiple
>of MSS.  Consider MSS of 10 and window size of 15.  I send you two packets
>with bytes 1-10 and 11-15, respectively.   If 11-15 is not acked, I send you
>two packets with bytes 11-20, 21-25.  It gets even more complicated with a
>MSS of 536 and a window size of 3072.

Okay, but I still don't see why the number of outstanding bytes you're
permitted to send (and thus my advertised window) changes in your example.
Whether or not you receive the ack for 11-15, I'm still willing to accept,
say, 11-25, i.e. th_ack=11, th_win=15.  Can you clarify your example?
Thanks.

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: last ACK
Date: Thu, 26 Feb 2004 13:58:29 +0800
Lines: 30
Distribution: su
Message-ID: <403D8B04.5C2B992@leland.stanford.edu>
References: <Pine.GSO.4.44.0402251724590.25171-100000@elaine26.Stanford.EDU> <403D514C.D862D1E5@leland.stanford.edu> <c1jru7$sk9$1@news.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077775285 7729 128.12.196.85 (26 Feb 2004 06:01:25 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6459

I know. But fatal errors (like the network is down) can be treated the same way
as packet losses. STCP will timeout and close and set the appropriate errno. My
point is - if we let STCP deal with it as a packet loss the application layer
above us cannot tell the difference. Or am I wrong?

Jimmy

Murali Kumar wrote:

> I thought that -1 returned by any stcp_X method is a fatal error and we
> must always quit. I looked at network.c and it doesnt seem to me that
> when a packet is dropped (when the mode is unreliable), it returns
> -1...seems that -1 is returned only when a fatal error occurs, not when
> the delivery is unreliable, and hence we should definitely check if
> stcp_network_send returns -1. Can someone confirm this?
>
> Thanks
>
> Kumar
>
> Jimmy Pang wrote:
> > I think the easiest way is just to ignore the -1 returned by
> > stcp_network_send. After all STCP does not assume reliable delivery of
> > packets in the network layer. So it makes no difference to STCP whether
> > stcp_network_send returns 0 or -1. STCP still assumes that delivery can be
> > unreliable.
> >
> > Jimmy
> >

.

Path: shelby.stanford.edu!not-for-mail
From: "jsilver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Go back N and retransmissions.
Date: Wed, 25 Feb 2004 22:18:16 -0800
Lines: 33
Distribution: su
Message-ID: <c1k33o$9dc$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221708330.5427-100000@epic6.Stanford.EDU> <c1bkhc$7ui$1@news.Stanford.EDU> <c1c1gu$oi7$1@news.Stanford.EDU> <c1jufq$2am$1@news.Stanford.EDU> <c1jvd2$3jt$1@news.Stanford.EDU> <c1jvuj$4d0$1@news.Stanford.EDU> <c1k0l3$5ce$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1077776313 9644 127.0.0.1 (26 Feb 2004 06:18: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:6460


"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1k0l3$5ce$1@news.Stanford.EDU...
>
>
> >It doesn't in that scenario, but it does if window size is a not a
multiple
> >of MSS.  Consider MSS of 10 and window size of 15.  I send you two
packets
> >with bytes 1-10 and 11-15, respectively.   If 11-15 is not acked, I send
you
> >two packets with bytes 11-20, 21-25.  It gets even more complicated with
a
> >MSS of 536 and a window size of 3072.
>
> Okay, but I still don't see why the number of outstanding bytes you're
> permitted to send (and thus my advertised window) changes in your example.
> Whether or not you receive the ack for 11-15, I'm still willing to accept,
> say, 11-25, i.e. th_ack=11, th_win=15.  Can you clarify your example?
> Thanks.
>

Ok.  I just reread the thread and I see screwed up my terms, and you're
right that the advertised window never changes.  My point (and my original
problem) was that if the sending algorithm always tries to maximize its
outgoing packet size, then the resent packets could get realigned on
different byte boundaries.  This makes counting retransmissions complicated.
That's what my example was trying to show.

But again, I think I now understand that if I just don't repacketize packets
that are being retransmitted, then everything will be ok.


.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Go back N and retransmissions.
Date: Thu, 26 Feb 2004 06:21:05 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c1k38h$9m2$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402221708330.5427-100000@epic6.Stanford.EDU> <c1bkhc$7ui$1@news.Stanford.EDU> <c1c1gu$oi7$1@news.Stanford.EDU> <c1jufq$2am$1@news.Stanford.EDU> <c1jvd2$3jt$1@news.Stanford.EDU> <c1jvuj$4d0$1@news.Stanford.EDU> <c1k0l3$5ce$1@news.Stanford.EDU> <c1k33o$9dc$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1077776465 9922 171.64.15.84 (26 Feb 2004 06:21:05 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6461



>Ok.  I just reread the thread and I see screwed up my terms, and you're
>right that the advertised window never changes.  My point (and my original
>problem) was that if the sending algorithm always tries to maximize its
>outgoing packet size, then the resent packets could get realigned on
>different byte boundaries.  This makes counting retransmissions complicated.

Okay--I agree! :-)
.

Path: shelby.stanford.edu!not-for-mail
From: "Ayaz" <ayaz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: threads and alarm clock
Date: Wed, 25 Feb 2004 22:57:40 -0800
Lines: 13
Distribution: su
Message-ID: <c1k5d7$cs7$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1077778664 13191 127.0.0.1 (26 Feb 2004 06:57:44 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
Xref: shelby.stanford.edu su.class.cs244a:6462

I am using a seperate thread to handle retransmissions. When the connection
is finished, I wait for my retransmission thread to clean up and exit (the
main thread calls usleep() until the retransmission thread sets a flag in
the context object saying im done). However, when the thread exits, it
causes a SIGALRM. Well, Im not sure why, but on the console, "Alarm clock"
is printed and both my client and server exit right away. Is there some code
in the stub that is bailing out on this signal? How do I get around this?

Thanks
Ayaz



.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS 3-3
Date: Wed, 25 Feb 2004 23:39:04 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.LNX.4.44.0402252337250.15615-100000@Xenon.Stanford.EDU>
References: <tl4d682ig8u.fsf_-_@saga14.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077781146 16491 171.64.66.201 (26 Feb 2004 07:39:06 GMT)
X-Complaints-To: news@news.stanford.edu
To: Myles Barrett Williams <mylesw@saga14.Stanford.EDU>
In-Reply-To: <tl4d682ig8u.fsf_-_@saga14.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6463



 No, your formula has to be general for any constructed topology where you only
 know PROPmin.

 .m

> 
> Is it acceptable for the new TRANSP formula to include the distance to the
> receiving host?
> 
> Myles
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Keep-alive mechanism, required?
Date: Thu, 26 Feb 2004 17:40:30 +0800
Lines: 7
Distribution: su
Message-ID: <403DBF0E.4B63A419@leland.stanford.edu>
References: <Pine.GSO.4.44.0402251630450.2836-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077788620 26631 128.12.196.85 (26 Feb 2004 09:43:40 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6464

No. I asked this earlier and the TA said no.

Xiaohua Fang wrote:

> Are we required to implement the keep-alive mechanism? or termination
> after long period of idleness?

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: threads and alarm clock
Date: Thu, 26 Feb 2004 18:24:05 +0000 (UTC)
Lines: 20
Distribution: su
Message-ID: <c1ldk5$12s$1@news.Stanford.EDU>
References: <c1k5d7$cs7$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077819845 1116 171.64.15.116 (26 Feb 2004 18:24:05 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6465


>I am using a seperate thread to handle retransmissions. When the connection
>is finished, I wait for my retransmission thread to clean up and exit (the
>main thread calls usleep() until the retransmission thread sets a flag in
>the context object saying im done). However, when the thread exits, it
>causes a SIGALRM. Well, Im not sure why, but on the console, "Alarm clock"
>is printed and both my client and server exit right away. Is there some code
>in the stub that is bailing out on this signal? How do I get around this?

This sounds like a really convoluted design--why do you need a second
thread?

If you don't catch SIGALRM, the process is killed.  (The default signal
handler just prints "Alarm clock" and quits).

As to why the alarm is being raised, I really don't know.  You could
install a signal handler that just ignores this, but this seems like
a hack around weird behaviour; better is to try and figure out what's
causing the signal in the first place.

.

Path: shelby.stanford.edu!not-for-mail
From: Tony Hsieh <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: FIN_WAIT_1 state
Date: Thu, 26 Feb 2004 10:33:20 -0800
Lines: 9
Distribution: su
Message-ID: <403E3BF0.5040208@stanford.edu>
NNTP-Posting-Host: perch.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077820340 1937 171.64.75.22 (26 Feb 2004 18:32:20 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6466

Is it the case that when I am in the FIN_WAIT_1 state, I do not know if 
the ACK I sent out for the last data packet was received by the passive 
peer until I receive an ACK back for the FIN I sent out?

If a timeout occurs while in FIN_WAIT_1, do I resend both the FIN and 
the ACK for the last data packet received?  b/c otherwise how do I know 
if the passive peer did not receive the ACK or the FIN?  I don't know 
which one the passive peer did not receive.

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: FIN_WAIT_1 state
Date: Thu, 26 Feb 2004 19:51:04 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <c1lin8$77v$1@news.Stanford.EDU>
References: <403E3BF0.5040208@stanford.edu>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1077825064 7423 171.64.15.116 (26 Feb 2004 19:51:04 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6467


>Is it the case that when I am in the FIN_WAIT_1 state, I do not know if 
>the ACK I sent out for the last data packet was received by the passive 
>peer until I receive an ACK back for the FIN I sent out?

Not necessarily.  If the ACK was dropped, the other side may retransmit
the data before it ACKs the FIN.  And the other side can continue
sending data while you're in FIN_WAIT_1.

>If a timeout occurs while in FIN_WAIT_1, do I resend both the FIN and 
>the ACK for the last data packet received?  b/c otherwise how do I know 
>if the passive peer did not receive the ACK or the FIN?  I don't know 
>which one the passive peer did not receive.

You keep a timeout for your FIN, so you know if the other side's ACKed
it or not.  Keeping track of whether you've ACKed the last data packet
is the other side's responsibility.  You don't keep a timeout for ACKs.

.

Path: shelby.stanford.edu!elaine8.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: SYN resend
Date: Thu, 26 Feb 2004 15:04:33 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.GSO.4.44.0402261459240.24993-100000@elaine8.Stanford.EDU>
NNTP-Posting-Host: elaine8.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077836674 22936 171.64.15.73 (26 Feb 2004 23:04:34 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6468

consider the following case,
client send a SYN, and the server replied a SYNACK, but the SYNACK is
lost. Then the client resend SYN, should the server immediately reply a
SYNACK, or it can wait until the timeout for its SYNACK to resend?

Both should work normally, but if the client has a timeout much shorter
than server, if the server does not send SYNACK immediately, it could
happen that Client has send the SYN 6 times but still get no reply from
server. So is sending the SYNACK immediately on resent SYN a better
solution?

Thanks

Lin

.

Path: shelby.stanford.edu!elaine8.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: SYNACK with data
Date: Thu, 26 Feb 2004 15:10:14 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.GSO.4.44.0402261509400.24993-100000@elaine8.Stanford.EDU>
NNTP-Posting-Host: elaine8.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077837015 23429 171.64.15.73 (26 Feb 2004 23:10:15 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6469

Can data be appended to SYNACK packet? is this valid?
Thanks

Lin

.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: SYN resend
Date: Thu, 26 Feb 2004 17:23:45 -0800
Lines: 28
Distribution: su
Message-ID: <c1m66v$3vc$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402261459240.24993-100000@elaine8.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1077845023 4076 128.12.173.169 (27 Feb 2004 01:23: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:6470

A follow up question. If it is the case that a SYNACK should be sent
immediately on a retransmitted SYN, should we count this SYNACK as a
retransmission on our side(ie, increment retransmission count of this packet
by 1) even though our previously sent SYNACK has not timed out as of yet? It
seems a little weird to me to do this, but I do not see any other way out if
the answer to the question asked is yes.

Kumar

"Lin Chan" <linchan@stanford.edu> wrote in message
news:Pine.GSO.4.44.0402261459240.24993-100000@elaine8.Stanford.EDU...
> consider the following case,
> client send a SYN, and the server replied a SYNACK, but the SYNACK is
> lost. Then the client resend SYN, should the server immediately reply a
> SYNACK, or it can wait until the timeout for its SYNACK to resend?
>
> Both should work normally, but if the client has a timeout much shorter
> than server, if the server does not send SYNACK immediately, it could
> happen that Client has send the SYN 6 times but still get no reply from
> server. So is sending the SYNACK immediately on resent SYN a better
> solution?
>
> Thanks
>
> Lin
>


.

Path: shelby.stanford.edu!not-for-mail
From: Tony Hsieh <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: passive side closes before active side receives ACK to its FIN
Date: Thu, 26 Feb 2004 18:53:47 -0800
Lines: 6
Distribution: su
Message-ID: <403EB13B.8090506@stanford.edu>
NNTP-Posting-Host: perch.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077850366 11568 171.64.75.22 (27 Feb 2004 02:52:46 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6471

I was wondering what we do when my active side sends a FIN, passive 
sends an ACK back, passive sends a FIN, active sends an ACK back.  If 
the first ACK was never received by the active peer and the passive peer 
has already closed down, what do we do?  The active side will be waiting 
indefinitely for the ACK to the FIN it originally sent.

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: passive side closes before active side receives ACK to its FIN
Date: Thu, 26 Feb 2004 19:30:48 -0800
Lines: 11
Distribution: su
Message-ID: <c1mdl9$sjo$1@news.Stanford.EDU>
References: <403EB13B.8090506@stanford.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077852649 29304 127.0.0.1 (27 Feb 2004 03:30:49 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (X11/20040209)
X-Accept-Language: en-us, en
In-Reply-To: <403EB13B.8090506@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:6472

Can this scenario happen?  Shouldn't an ACK always accompany anything 
other than the first SYN?  So even if the passive's ACK gets dropped, it 
should send a FIN+ACK, thereby going from FIN_WAIT_1 to TIME_WAIT.

Tony Hsieh wrote:
> I was wondering what we do when my active side sends a FIN, passive 
> sends an ACK back, passive sends a FIN, active sends an ACK back.  If 
> the first ACK was never received by the active peer and the passive peer 
> has already closed down, what do we do?  The active side will be waiting 
> indefinitely for the ACK to the FIN it originally sent.
> 
.

Path: shelby.stanford.edu!elaine17.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS3 Q4
Date: Thu, 26 Feb 2004 19:40:22 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.GSO.4.44.0402261939430.571-100000@elaine17.Stanford.EDU>
References: <Pine.GSO.4.44.0402231859580.13016-100000@elaine43.Stanford.EDU>
 <c1eu7g$oog$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine17.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077853223 14893 171.64.15.82 (27 Feb 2004 03:40:23 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c1eu7g$oog$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6473

Can anyone follow up on this? So should the labels in the diagram be
changed?

Thanks

Lin

On Tue, 24 Feb 2004, Matthew Jonathan Holliman wrote:

>
> >In the packet evolution diagram, I have a question on the labels.  It
> >would make more sense to me if (A) was labeled with 2W + (W/2) - 2 and (B)
> >with 3W - 1.  If this is not correct, can anyone explain why?
>
> Looking at this now (with a caveat that I'm quite tired), I agree--and it
> sounds like you understand the diagram fine...
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Tony Hsieh <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test 2.E 2.F
Date: Thu, 26 Feb 2004 20:18:53 -0800
Lines: 4
Distribution: su
Message-ID: <403EC52D.9080404@stanford.edu>
NNTP-Posting-Host: perch.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077855471 17759 171.64.75.22 (27 Feb 2004 04:17:51 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6474

When I run Test 2.E and 2.F I get "Unexpected exit status 10" and 
"Unexpected exit status 11."  Both program outputs are blank.  Do you 
have any idea what this means?  Thanks.

.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test 2B
Date: Thu, 26 Feb 2004 20:43:32 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.GSO.4.44.0402262039380.17588-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 1077857015 20364 171.64.15.106 (27 Feb 2004 04:43:35 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6475


I'm getting the following error on Test 2.B for hw3b testing

Test 2.B [out of 20]
Checks student Tx (server) against reference Rx (client).

Results:  NOT OK

Unexpected exit status -1.  Program output:
***Timeout expired during grading
Program output:
server: TESTDATA.1,299328,Ok


Is it possible that this is caused by setting my constant RTO too high.
Currently, I have set it to 1.1 seconds (just a random guess on my part)
Would that possibly cause this test case to timeout?

Also, if we try to 'guess' at a constant RTO...what if the network
during the day of grading is really slow for some reason..would that mess
up some of the test cases?

--vishal

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Network Problem
Date: Thu, 26 Feb 2004 21:10:16 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.LNX.4.44.0402262105210.14662-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 1077858617 22444 171.64.66.201 (27 Feb 2004 05:10:17 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6476


 FYI

 It looks like part of the network is down here in Gates which may limit the
 availability of VNS (seems to be OK at the moment however).  I'm not sure what
 is going on but it is affecting all/many of our group computers.

 .martin

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test 2.E 2.F
Date: Fri, 27 Feb 2004 06:13:51 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c1mn6v$sd1$1@news.Stanford.EDU>
References: <403EC52D.9080404@stanford.edu>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1077862431 29089 171.64.15.111 (27 Feb 2004 06:13:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6477


>When I run Test 2.E and 2.F I get "Unexpected exit status 10" and 
>"Unexpected exit status 11."  Both program outputs are blank.  Do you 
>have any idea what this means?  Thanks.

Your program died with waitpid exit status 10 and 11, respectively.
That indicates your process died from signal 10 and signal 11, i.e. a bus
error and a segmentation violation, respectively.

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test 2B
Date: Fri, 27 Feb 2004 06:19:04 +0000 (UTC)
Lines: 25
Distribution: su
Message-ID: <c1mngo$snp$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402262039380.17588-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1077862744 29433 171.64.15.111 (27 Feb 2004 06:19:04 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6478



>Is it possible that this is caused by setting my constant RTO too high.
>Currently, I have set it to 1.1 seconds (just a random guess on my part)
>Would that possibly cause this test case to timeout?

If you run your client and server in unreliable mode together, how long
do they take to download a 300 KB file?  If it's longer than 60s, they'll
almost certainly fail this test.

If your pair downloads reasonably quickly together, you might check your
advertised window.  Some people have had problems with timeouts in the
script if they got this wrong.

>Also, if we try to 'guess' at a constant RTO...what if the network
>during the day of grading is really slow for some reason..would that mess
>up some of the test cases?

If you choose a really poor RTO, sure, you could fail the scripts.  You
might conclude that using a constant RTO probably isn't a great idea.

Since we test client and server on the same machine for HW3, it's highly
unlikely that we'll run into network problems that cause test cases to
fail.

.

Path: shelby.stanford.edu!not-for-mail
From: "Tony Hsieh" <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test 2.C
Date: Thu, 26 Feb 2004 22:53:03 -0800
Lines: 8
Distribution: su
Message-ID: <c1mpgj$2ov$1@news.Stanford.EDU>
NNTP-Posting-Host: aca14332.ipt.aol.com
X-Trace: news.Stanford.EDU 1077864789 2847 172.161.67.50 (27 Feb 2004 06:53: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:6479

When Test 2.C runs on TESTDATA.1, the network keeps sending me data even
after it has already sent 299328 bytes.  Shouldn't the file be closed on the
server now?  Why is it still sending me data?  Also I never receive a FIN
from the server.  Therefore my client keeps receiving data until the test
times out even though well over 299328 bytes have been received.  Any help
would be greatly appreciated.  Thanks.


.

Path: shelby.stanford.edu!not-for-mail
From: sumeet shendrikar <sumeets@stanford.edu>
Newsgroups: su.class.cs244a
Subject: hw3.c - question about using supplied binaries
Date: Thu, 26 Feb 2004 23:55:51 -0800
Lines: 14
Distribution: su
Message-ID: <c1mt68$7lf$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-60149.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077868552 7855 128.12.197.131 (27 Feb 2004 07:55:52 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6480

for part c, we are supposed to modify our hw1 solution to get it to work 
   using STCP, but it says alternatively, we could use your object files.
does this mean if i can get your ftp client to work on my implementation 
of (unreliable) STCP, I don't have to modify my hw1 solution?
unfortunately i used MSG_PEEK in my implentation and don't want to 
re-design my original solution (which could take a bit of time).

i also understand that for hw4, we're allowed to use only one binary 
penalty free... i take it if we use your supplied ftp binary for hw3, it 
counts as the one binary for hw4?

thanks,
sumeet

.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: max retransmissions
Date: Fri, 27 Feb 2004 00:35:59 -0800
Lines: 8
Distribution: su
Message-ID: <c1mvhi$bei$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc406.stanford.edu
X-Trace: news.Stanford.EDU 1077870962 11730 128.12.196.6 (27 Feb 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:6481

how are we supposed to signal to the application that the max number of
retransmissions is reached?

Thanks,

Justin


.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test 1.I for hw3a
Date: Fri, 27 Feb 2004 00:39:11 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.GSO.4.44.0402270033400.5783-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 1077871153 11974 171.64.15.100 (27 Feb 2004 08:39:13 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6482


For some reason, I'm failing this test after updating my code for hw3b (
it was working w/ my old hw3a code :(

Test 1.I [out of 5]
Checks that FIN is correctly ACKed.

Results:  NOT OK

No ACK for FIN with sequence number 110330


I looked through all my code paths, and it seems unlikely that I'm not
sending an ack for a FIN that comes in sequence... I also ran w/ my
server/client w/ a similar sized file and the ACK comes back for both the
client and servers' fins...is this test testing some strange case?

Has anyone else ran into this problem?

--vishal

.

Path: shelby.stanford.edu!not-for-mail
From: "Ayaz" <ayaz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: unreliable mode for client
Date: Fri, 27 Feb 2004 01:12:12 -0800
Lines: 13
Distribution: su
Message-ID: <c1n1lg$dsf$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1077873137 14223 127.0.0.1 (27 Feb 2004 09:12:17 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
Xref: shelby.stanford.edu su.class.cs244a:6483

When I use the "-U" flag for the client...and as soon as I send the first
packet to the server, the server bails out with this assertion:
Assertion failed: len <= 0 ||
_mysock_verify_checksum(_mysock_get_context(sd), dst, len), file stcp_api.c,
line 159

why is this happening?

Thanks
Ayaz



.

Path: shelby.stanford.edu!not-for-mail
From: "Michael Lyubomirskiy" <lyubomir@stanford.edu>
Newsgroups: su.class.cs244a
Subject: can we use inefficient sorted linked list to handle packet buffering?
Date: Fri, 27 Feb 2004 04:17:51 -0800
Lines: 9
Distribution: su
Message-ID: <c1nchi$quu$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-50491.stanford.edu
X-Trace: news.Stanford.EDU 1077884274 27614 128.12.51.110 (27 Feb 2004 12:17: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:6484

I think that to implement handling of 'gaps' in packets waiting to be acked,
it is convenient to keep the packets sorted in the buffer. That way, if an
ack comes in for an unacked packet that is the first entry in the sorted
list, we can go through the later, consecutive packets and drop those that
are already acked. Now, is it appropriate to use the linked list structure
(which implies an O(n^2) behavior on insertion) or should we go ahead with
some efficient BST?


.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test 2.C
Date: Fri, 27 Feb 2004 04:29:03 -0800
Lines: 18
Distribution: su
Message-ID: <c1nd6i$rfc$1@news.Stanford.EDU>
References: <c1mpgj$2ov$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 1077884946 28140 128.12.194.74 (27 Feb 2004 12:29:06 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: <c1mpgj$2ov$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6485

assuming you've alread passed 299328 bytes up to the client app, I think 
   it's the client's side that initiates the 4-way-fin-handshake.  (and 
so the client side has to send it's FIN first before waiting for the 
server's FIN).

Paul E.


Tony Hsieh wrote:
> When Test 2.C runs on TESTDATA.1, the network keeps sending me data even
> after it has already sent 299328 bytes.  Shouldn't the file be closed on the
> server now?  Why is it still sending me data?  Also I never receive a FIN
> from the server.  Therefore my client keeps receiving data until the test
> times out even though well over 299328 bytes have been received.  Any help
> would be greatly appreciated.  Thanks.
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Timeout
Date: Fri, 27 Feb 2004 04:30:02 -0800
Lines: 8
Distribution: su
Message-ID: <c1nd8a$ri3$1@news.Stanford.EDU>
NNTP-Posting-Host: firebird5.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1077885002 28227 171.64.15.18 (27 Feb 2004 12:30:02 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:6486

The network event value for a timeout is 0. However, what if we still 
have app_data (we haven't read it all). Then, if a timeout occurs the 
number will be zero. We can handle the case by reading everything from 
the application or keeping track of the time on our own (and then 
reapply the appropriate timeout number).  Is there a way to recognize 
when an event includes a timeout or is it only possible to recognize 
this when there is only a timeout?

.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: last ACK
Date: Fri, 27 Feb 2004 07:49:11 -0800
Lines: 43
Distribution: su
Message-ID: <c1notm$9ms$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402251724590.25171-100000@elaine26.Stanford.EDU> <403D514C.D862D1E5@leland.stanford.edu> <c1jru7$sk9$1@news.Stanford.EDU> <403D8B04.5C2B992@leland.stanford.edu>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1077896950 9948 128.12.173.169 (27 Feb 2004 15:49: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:6487

Could a TA please reply to this question thread. Thanks.

Kumar

"Jimmy Pang" <hcpang@leland.stanford.edu> wrote in message
news:403D8B04.5C2B992@leland.stanford.edu...
> I know. But fatal errors (like the network is down) can be treated the
same way
> as packet losses. STCP will timeout and close and set the appropriate
errno. My
> point is - if we let STCP deal with it as a packet loss the application
layer
> above us cannot tell the difference. Or am I wrong?
>
> Jimmy
>
> Murali Kumar wrote:
>
> > I thought that -1 returned by any stcp_X method is a fatal error and we
> > must always quit. I looked at network.c and it doesnt seem to me that
> > when a packet is dropped (when the mode is unreliable), it returns
> > -1...seems that -1 is returned only when a fatal error occurs, not when
> > the delivery is unreliable, and hence we should definitely check if
> > stcp_network_send returns -1. Can someone confirm this?
> >
> > Thanks
> >
> > Kumar
> >
> > Jimmy Pang wrote:
> > > I think the easiest way is just to ignore the -1 returned by
> > > stcp_network_send. After all STCP does not assume reliable delivery of
> > > packets in the network layer. So it makes no difference to STCP
whether
> > > stcp_network_send returns 0 or -1. STCP still assumes that delivery
can be
> > > unreliable.
> > >
> > > Jimmy
> > >
>


.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: overlapped data
Date: Fri, 27 Feb 2004 08:51:16 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.GSO.4.44.0402270848000.28140-100000@elaine19.Stanford.EDU>
NNTP-Posting-Host: elaine19.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077900677 13870 171.64.15.84 (27 Feb 2004 16:51:17 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6488

so what is current rule on overlapped data? Is overwrite previously
written data ok?

also if we first get a packet of seq no 45 with 10 bytes data and then we
receive another packet of seq 45 with 20 bytes of data, what should we do?
since I have already passed the first 10 bytes when the first packet
arrive, should I simple record the last 10 bytes and then pass them up?

Thanks

Lin

.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: error handle
Date: Fri, 27 Feb 2004 09:13:19 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0402270911350.28140-100000@elaine19.Stanford.EDU>
NNTP-Posting-Host: elaine19.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077902000 16044 171.64.15.84 (27 Feb 2004 17:13:20 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6489

Just want to clarify, whenever we have an error at our layer(network_send
return -1 or 6 resend timeout) should we exit(1) or should we simply
change the done flag to TRUE and close the connection?

Thanks

Lin

.

Path: shelby.stanford.edu!not-for-mail
From: "Tony Hsieh" <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test 2.C
Date: Fri, 27 Feb 2004 09:46:26 -0800
Lines: 36
Distribution: su
Message-ID: <c1nvpp$i4s$1@news.Stanford.EDU>
References: <c1mpgj$2ov$1@news.Stanford.EDU> <c1nd6i$rfc$1@news.Stanford.EDU>
NNTP-Posting-Host: ac9f1067.ipt.aol.com
X-Trace: news.Stanford.EDU 1077903994 18588 172.159.16.103 (27 Feb 2004 17:46:34 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:6490

Yup, in my output, my client does send its FIN to the server and receives an
ACK back for it.  However, the server never sends a FIN and continually
sends data.

Also currently in my output it looks like the server puts out at least a
sender window's worth of bytes past 299328 before my client sends its FIN.
Looking at server.c, it seems like read should stop once the length of the
file has been reached and mywrite()'s should no longer be called.  Why do I
receive data past 299328 bytes?

"Paul E." <ignatius@stanford.edu> wrote in message
news:c1nd6i$rfc$1@news.Stanford.EDU...
> assuming you've alread passed 299328 bytes up to the client app, I think
>    it's the client's side that initiates the 4-way-fin-handshake.  (and
> so the client side has to send it's FIN first before waiting for the
> server's FIN).
>
> Paul E.
>
>
> Tony Hsieh wrote:
> > When Test 2.C runs on TESTDATA.1, the network keeps sending me data even
> > after it has already sent 299328 bytes.  Shouldn't the file be closed on
the
> > server now?  Why is it still sending me data?  Also I never receive a
FIN
> > from the server.  Therefore my client keeps receiving data until the
test
> > times out even though well over 299328 bytes have been received.  Any
help
> > would be greatly appreciated.  Thanks.
> >
> >
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: VNS update
Date: Fri, 27 Feb 2004 10:02:47 -0800
Lines: 6
Distribution: su
Message-ID: <Pine.LNX.4.44.0402270959380.24002-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 1077904969 19732 171.64.66.201 (27 Feb 2004 18:02:49 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6491


 Network is back up and everything seems to be working OK! Let me know if you
 have problems.

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine7.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: max retransmissions
Date: 27 Feb 2004 11:50:04 -0800
Organization: Stanford University, CA, USA
Lines: 12
Distribution: su
Message-ID: <snnptc0s3o3.fsf@elaine7.Stanford.EDU>
References: <c1mvhi$bei$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077911404 27462 171.64.15.72 (27 Feb 2004 19:50: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:6492

the transport layer shuts down.

Susan

"Justin" <justinfw@stanford.edu> writes:

> how are we supposed to signal to the application that the max number of
> retransmissions is reached?
> 
> Thanks,
> 
> Justin
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine7.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Test 1.I for hw3a
Date: 27 Feb 2004 12:08:10 -0800
Organization: Stanford University, CA, USA
Lines: 28
Distribution: su
Message-ID: <snnllmos2tx.fsf@elaine7.Stanford.EDU>
References: <Pine.GSO.4.44.0402270033400.5783-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077912490 27462 171.64.15.72 (27 Feb 2004 20:08: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:6493

It doesn't look like we're doing anything particularly tricky here, so you
must just be missing a bug somewhere. I would try several diffferent
files.  I would also go through your code paths once more, really trying
not to assume anything.

Susan

Vishal Patel <vishalp@stanford.edu> writes:

> For some reason, I'm failing this test after updating my code for hw3b (
> it was working w/ my old hw3a code :(
> 
> Test 1.I [out of 5]
> Checks that FIN is correctly ACKed.
> 
> Results:  NOT OK
> 
> No ACK for FIN with sequence number 110330
> 
> 
> I looked through all my code paths, and it seems unlikely that I'm not
> sending an ack for a FIN that comes in sequence... I also ran w/ my
> server/client w/ a similar sized file and the ACK comes back for both the
> client and servers' fins...is this test testing some strange case?
> 
> Has anyone else ran into this problem?
> 
> --vishal
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine7.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: hw3.c - question about using supplied binaries
Date: 27 Feb 2004 12:09:08 -0800
Organization: Stanford University, CA, USA
Lines: 21
Distribution: su
Message-ID: <snnhdxcs2sb.fsf@elaine7.Stanford.EDU>
References: <c1mt68$7lf$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077912548 27462 171.64.15.72 (27 Feb 2004 20:09:08 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:6494

Yes and no.  If you implement hw4 using our ftpcopy, then yes, that's your
free binary.  Alternatively, you could go back and get your ftpcopy to
work with hw4 and use a different binary for hw4.

Susan

sumeet shendrikar <sumeets@stanford.edu> writes:

> for part c, we are supposed to modify our hw1 solution to get it to work
> using STCP, but it says alternatively, we could use your object files.
> does this mean if i can get your ftp client to work on my implementation
> of (unreliable) STCP, I don't have to modify my hw1 solution?
> unfortunately i used MSG_PEEK in my implentation and don't want to
> re-design my original solution (which could take a bit of time).
> 
> i also understand that for hw4, we're allowed to use only one binary
> penalty free... i take it if we use your supplied ftp binary for hw3, it
> counts as the one binary for hw4?
> 
> thanks,
> sumeet
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine7.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: unreliable mode for client
Date: 27 Feb 2004 12:20:28 -0800
Organization: Stanford University, CA, USA
Lines: 26
Distribution: su
Message-ID: <snnbrnks29f.fsf@elaine7.Stanford.EDU>
References: <c1n1lg$dsf$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077913228 27462 171.64.15.72 (27 Feb 2004 20:20:28 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:6495

Well, I doubt this is the answer you're looking for, but obviously the tcp
checksum must not be correct for the packet.  It's hard to say why it's
happening without knowing a little more about the packet you're sending
from the client.  Since we provided the code the checksum (and do it for
you), it should be working correctly.

You can look at network.c to see what -U does: basically it either drops
or duplicates a packet, neither of which should casuse a bad checksum.

I'd recommend running the client through gdb to see what the first packet
looks like.

Susan

"Ayaz" <ayaz@stanford.edu> writes:

> When I use the "-U" flag for the client...and as soon as I send the first
> packet to the server, the server bails out with this assertion:
> Assertion failed: len <= 0 ||
> _mysock_verify_checksum(_mysock_get_context(sd), dst, len), file stcp_api.c,
> line 159
> 
> why is this happening?
> 
> Thanks
> Ayaz
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine7.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: can we use inefficient sorted linked list to handle packet buffering?
Date: 27 Feb 2004 12:27:04 -0800
Organization: Stanford University, CA, USA
Lines: 20
Distribution: su
Message-ID: <snn7jy8s1yf.fsf@elaine7.Stanford.EDU>
References: <c1nchi$quu$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077913624 27462 171.64.15.72 (27 Feb 2004 20:27: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:6496

Well, think about the max window size and min packet size (and that the network
is inherently much slower than a computer processor) and make a reasonable
choice.  Is building a red-black tree, for instance, likely to make much
of a performance difference in this application versus a linked list,
given the constraints?

(and finally, in case you are still stumped, remember that the focus of
this project isn't how to build a super-cool data structure)

susan

"Michael Lyubomirskiy" <lyubomir@stanford.edu> writes:

> I think that to implement handling of 'gaps' in packets waiting to be acked,
> it is convenient to keep the packets sorted in the buffer. That way, if an
> ack comes in for an unacked packet that is the first entry in the sorted
> list, we can go through the later, consecutive packets and drop those that
> are already acked. Now, is it appropriate to use the linked list structure
> (which implies an O(n^2) behavior on insertion) or should we go ahead with
> some efficient BST?
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine7.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: overlapped data
Date: 27 Feb 2004 12:29:51 -0800
Organization: Stanford University, CA, USA
Lines: 17
Distribution: su
Message-ID: <snn3c8ws1ts.fsf@elaine7.Stanford.EDU>
References: <Pine.GSO.4.44.0402270848000.28140-100000@elaine19.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077913791 27462 171.64.15.72 (27 Feb 2004 20:29:51 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:6497

I would discard any duplicate data, keeping just the new bytes.

Susan

Lin Chan <linchan@stanford.edu> writes:

> so what is current rule on overlapped data? Is overwrite previously
> written data ok?
> 
> also if we first get a packet of seq no 45 with 10 bytes data and then we
> receive another packet of seq 45 with 20 bytes of data, what should we do?
> since I have already passed the first 10 bytes when the first packet
> arrive, should I simple record the last 10 bytes and then pass them up?
> 
> Thanks
> 
> Lin
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine7.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3 Q4
Date: 27 Feb 2004 12:58:17 -0800
Organization: Stanford University, CA, USA
Lines: 24
Distribution: su
Message-ID: <snny8qoqlxy.fsf@elaine7.Stanford.EDU>
References: <Pine.GSO.4.44.0402231859580.13016-100000@elaine43.Stanford.EDU> <c1eu7g$oog$1@news.Stanford.EDU> <Pine.GSO.4.44.0402261939430.571-100000@elaine17.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077915497 27462 171.64.15.72 (27 Feb 2004 20:58: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:6498

Yes, please use 2W + (W/2) -2 for A and 3W-1 for (B)

Susan

Lin Chan <linchan@stanford.edu> writes:

> Can anyone follow up on this? So should the labels in the diagram be
> changed?
> 
> Thanks
> 
> Lin
> 
> On Tue, 24 Feb 2004, Matthew Jonathan Holliman wrote:
> 
> >
> > >In the packet evolution diagram, I have a question on the labels.  It
> > >would make more sense to me if (A) was labeled with 2W + (W/2) - 2 and (B)
> > >with 3W - 1.  If this is not correct, can anyone explain why?
> >
> > Looking at this now (with a caveat that I'm quite tired), I agree--and it
> > sounds like you understand the diagram fine...
> >
> >
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine7.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: error handle
Date: 27 Feb 2004 13:05:12 -0800
Organization: Stanford University, CA, USA
Lines: 16
Distribution: su
Message-ID: <snnr7wgqlmf.fsf@elaine7.Stanford.EDU>
References: <Pine.GSO.4.44.0402270911350.28140-100000@elaine19.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077915912 3496 171.64.15.72 (27 Feb 2004 21:05:12 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:6499

This has already been addressed in the newsgroup but I will add that
having your layer exit is a little harsh--it doesn't give the application
any chance to shut itself down gracefully and network errors aren't that
uncommon.

Susan

Lin Chan <linchan@stanford.edu> writes:

> Just want to clarify, whenever we have an error at our layer(network_send
> return -1 or 6 resend timeout) should we exit(1) or should we simply
> change the done flag to TRUE and close the connection?
> 
> Thanks
> 
> Lin
.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine7.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Timeout
Date: 27 Feb 2004 13:16:51 -0800
Organization: Stanford University, CA, USA
Lines: 20
Distribution: su
Message-ID: <snnllmoql30.fsf@elaine7.Stanford.EDU>
References: <c1nd8a$ri3$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1077916611 3496 171.64.15.72 (27 Feb 2004 21:16:51 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:6500

If you read stcp_api.c, you can see that you only get the TIMEOUT event if
you timed out.  ie. If the application is done sending data forever, you
will get a different event.  So you should just keep checking for data
until the app tells you it's done sending.

Maybe I don't understand what you're asking.  the stcp TIMEOUT event only
tells you that we timed out waiting for data from out application, it has
*nothing* to do with the packet retransmissions.

Susan

Ryan <ryan05@stanford.edu> writes:

> The network event value for a timeout is 0. However, what if we still have
> app_data (we haven't read it all). Then, if a timeout occurs the number
> will be zero. We can handle the case by reading everything from the
> application or keeping track of the time on our own (and then reapply the
> appropriate timeout number).  Is there a way to recognize when an event
> includes a timeout or is it only possible to recognize this when there is
> only a timeout?
.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: overlapped data (conflicting info)
Date: Fri, 27 Feb 2004 13:52:03 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.GSO.4.44.0402271350280.10651-100000@elaine31.Stanford.EDU>
References: <Pine.GSO.4.44.0402270848000.28140-100000@elaine19.Stanford.EDU>
 <snn3c8ws1ts.fsf@elaine7.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077918724 7422 171.64.15.106 (27 Feb 2004 21:52:04 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <snn3c8ws1ts.fsf@elaine7.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6501


I thought in a previous newsgroup posting, Matthew said we were
free to choose whichever approach (am I wront Matthew?)
....I've already made my code to overwrite existing data...please
advise...

--vishal

On 27 Feb 2004, Susan Noreen Shepard wrote:

> I would discard any duplicate data, keeping just the new bytes.
>
> Susan
>
> Lin Chan <linchan@stanford.edu> writes:
>
> > so what is current rule on overlapped data? Is overwrite previously
> > written data ok?
> >
> > also if we first get a packet of seq no 45 with 10 bytes data and then we
> > receive another packet of seq 45 with 20 bytes of data, what should we do?
> > since I have already passed the first 10 bytes when the first packet
> > arrive, should I simple record the last 10 bytes and then pass them up?
> >
> > Thanks
> >
> > Lin
>

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: pthread_exit
Date: Fri, 27 Feb 2004 14:03:30 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0402271402120.23886-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 1077919414 8308 171.64.15.100 (27 Feb 2004 22:03:34 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6502


Susan: "I will add that having your layer exit is a little harsh"

What if we use pthread_exit instead with some sort of error status, that
should give the layers above a chance to recover, correct?

--vishal

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: overlapped data (conflicting info)
Date: Fri, 27 Feb 2004 22:11:30 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c1ofai$8mu$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402270848000.28140-100000@elaine19.Stanford.EDU>  <snn3c8ws1ts.fsf@elaine7.Stanford.EDU> <Pine.GSO.4.44.0402271350280.10651-100000@elaine31.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1077919890 8926 171.64.15.111 (27 Feb 2004 22:11:30 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6503



>I thought in a previous newsgroup posting, Matthew said we were
>free to choose whichever approach (am I wront Matthew?)
>...I've already made my code to overwrite existing data...please
>advise...

As I said previously, it shouldn't matter which approach you choose,
as long as you pass data up to the app as soon as you can (i.e. once
you've assembled a contiguous byte stream).

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: last ACK
Date: Fri, 27 Feb 2004 22:16:01 +0000 (UTC)
Lines: 17
Distribution: su
Message-ID: <c1ofj1$95h$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402251724590.25171-100000@elaine26.Stanford.EDU> <403D514C.D862D1E5@leland.stanford.edu> <c1jru7$sk9$1@news.Stanford.EDU> <403D8B04.5C2B992@leland.stanford.edu> <c1notm$9ms$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1077920161 9393 171.64.15.111 (27 Feb 2004 22:16:01 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6504


>Could a TA please reply to this question thread. Thanks.

I'll answer this in one of two ways.

(1) This question has been answered previously on the newsgroup.

(2) I'll quote from the programming project guidelines (and not for the
    first time):

"At times there will be ambiguities in the assignment specifications, or
multiple ways an assignment can be implemented. As CS244a is an engineering
class, we expect you to make reasonable design decisions in these cases.
Base your decisions on what you know of the assignment as a whole. The TA's
may give you advice on the tradeoffs of these decisions, but will not make
them for you."

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: last ACK (TA)
Date: Fri, 27 Feb 2004 14:16:40 -0800
Lines: 53
Distribution: su
Message-ID: <Pine.GSO.4.44.0402271415300.23926-100000@elaine25.Stanford.EDU>
References: <Pine.GSO.4.44.0402251724590.25171-100000@elaine26.Stanford.EDU>
 <403D514C.D862D1E5@leland.stanford.edu> <c1jru7$sk9$1@news.Stanford.EDU>
 <403D8B04.5C2B992@leland.stanford.edu> <c1notm$9ms$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077920202 9439 171.64.15.100 (27 Feb 2004 22:16:42 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c1notm$9ms$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6505


I don't think we ever got an answer to this issue from a TA...can a TA
give their thoughts on this

--vishal

On Fri, 27 Feb 2004, Murali Kumar wrote:

> Could a TA please reply to this question thread. Thanks.
>
> Kumar
>
> "Jimmy Pang" <hcpang@leland.stanford.edu> wrote in message
> news:403D8B04.5C2B992@leland.stanford.edu...
> > I know. But fatal errors (like the network is down) can be treated the
> same way
> > as packet losses. STCP will timeout and close and set the appropriate
> errno. My
> > point is - if we let STCP deal with it as a packet loss the application
> layer
> > above us cannot tell the difference. Or am I wrong?
> >
> > Jimmy
> >
> > Murali Kumar wrote:
> >
> > > I thought that -1 returned by any stcp_X method is a fatal error and we
> > > must always quit. I looked at network.c and it doesnt seem to me that
> > > when a packet is dropped (when the mode is unreliable), it returns
> > > -1...seems that -1 is returned only when a fatal error occurs, not when
> > > the delivery is unreliable, and hence we should definitely check if
> > > stcp_network_send returns -1. Can someone confirm this?
> > >
> > > Thanks
> > >
> > > Kumar
> > >
> > > Jimmy Pang wrote:
> > > > I think the easiest way is just to ignore the -1 returned by
> > > > stcp_network_send. After all STCP does not assume reliable delivery of
> > > > packets in the network layer. So it makes no difference to STCP
> whether
> > > > stcp_network_send returns 0 or -1. STCP still assumes that delivery
> can be
> > > > unreliable.
> > > >
> > > > Jimmy
> > > >
> >
>
>
>

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: SYNACK with data
Date: Fri, 27 Feb 2004 22:18:55 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c1ofof$9dc$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402261509400.24993-100000@elaine8.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1077920335 9644 171.64.15.111 (27 Feb 2004 22:18:55 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6506


>Can data be appended to SYNACK packet? is this valid?

Per the TCP specs, data can be included in SYN/SYN-ACK packets (I was
wrong on this previously).  But the socket interface doesn't support
this, the mysocket interface certainly doesn't, so you don't need to
worry about this case.  (Your code shouldn't die on such packets, but
you can drop the data and wait for it to be retransmitted.  This case
is highly unlikely to occur in practice).

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: passive side closes before active side receives ACK to its FIN
Date: Fri, 27 Feb 2004 22:19:41 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c1ofpt$9fn$1@news.Stanford.EDU>
References: <403EB13B.8090506@stanford.edu>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1077920381 9719 171.64.15.111 (27 Feb 2004 22:19:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6507


>I was wondering what we do when my active side sends a FIN, passive 
>sends an ACK back, passive sends a FIN, active sends an ACK back.  If 
>the first ACK was never received by the active peer and the passive peer 
>has already closed down, what do we do?  The active side will be waiting 
>indefinitely for the ACK to the FIN it originally sent.

Why does the active side wait "indefinitely"?

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: SYN resend
Date: Fri, 27 Feb 2004 22:21:31 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c1oftb$9n5$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402261459240.24993-100000@elaine8.Stanford.EDU> <c1m66v$3vc$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1077920491 9957 171.64.15.111 (27 Feb 2004 22:21:31 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6508


From the programming project guidelines:

"At times there will be ambiguities in the assignment specifications, or
multiple ways an assignment can be implemented. As CS244a is an engineering
class, we expect you to make reasonable design decisions in these cases.
Base your decisions on what you know of the assignment as a whole. The TA's
may give you advice on the tradeoffs of these decisions, but will not make
them for you."

And as for the follow-up question, what makes sense?  What would be
consistent with the other semantics in your code?

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: pthread_exit
Date: Fri, 27 Feb 2004 22:25:16 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c1og4c$a00$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402271402120.23886-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1077920716 10240 171.64.15.111 (27 Feb 2004 22:25:16 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6509



>What if we use pthread_exit instead with some sort of error status, that
>should give the layers above a chance to recover, correct?

This would actually cause more problems if you don't explicitly call
something like stcp_fin_received() (and calling it would be a bit confusing
in this case, since no FIN was received)--if you kill the thread, the
final clean up code in mysock.c won't get called, which ensures that
the app would eventually read 0 bytes from myread().

Why not just return from transport_init()?

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: SYN resend
Date: Fri, 27 Feb 2004 15:45:30 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0402271544570.17252-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402261459240.24993-100000@elaine8.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077925531 16881 171.64.66.201 (27 Feb 2004 23:45:31 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402261459240.24993-100000@elaine8.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6510

On Thu, 26 Feb 2004, Lin Chan wrote:

> consider the following case,
> client send a SYN, and the server replied a SYNACK, but the SYNACK is
> lost. Then the client resend SYN, should the server immediately reply a
> SYNACK, or it can wait until the timeout for its SYNACK to resend?
> 

reply immediately with a synack

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: SYNACK with data
Date: Fri, 27 Feb 2004 16:06:19 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.LNX.4.44.0402271559070.17252-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402261509400.24993-100000@elaine8.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1077926780 18372 171.64.66.201 (28 Feb 2004 00:06:20 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402261509400.24993-100000@elaine8.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6511



On Thu, 26 Feb 2004, Lin Chan wrote:

> Can data be appended to SYNACK packet? is this valid?
> Thanks
> 
> Lin
> 

According to the TCP spec, this seems valid. See the following excerpt 
from the RFC:

  "Several examples of connection initiation follow.  Although these
  examples do not show connection synchronization using data-carrying
  segments, this is perfectly legitimate, so long as the receiving TCP
  doesn't deliver the data to the user until it is clear the data is
  valid (i.e., the data must be buffered at the receiver until the
  connection reaches the ESTABLISHED state)."

Shankar 


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: SYNACK with data
Date: Fri, 27 Feb 2004 16:09:03 -0800
Lines: 31
Distribution: su
Message-ID: <Pine.LNX.4.44.0402271607260.934-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402261509400.24993-100000@elaine8.Stanford.EDU>
 <Pine.LNX.4.44.0402271559070.17252-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 1077926944 18655 171.64.66.201 (28 Feb 2004 00:09:04 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0402271559070.17252-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6512


On Fri, 27 Feb 2004, Shankar Ponnekanti wrote:

> 
> 
> On Thu, 26 Feb 2004, Lin Chan wrote:
> 
> > Can data be appended to SYNACK packet? is this valid?
> > Thanks
> > 
> > Lin
> > 
> 
> According to the TCP spec, this seems valid. See the following excerpt 
> from the RFC:
> 
>   "Several examples of connection initiation follow.  Although these
>   examples do not show connection synchronization using data-carrying
>   segments, this is perfectly legitimate, so long as the receiving TCP
>   doesn't deliver the data to the user until it is clear the data is
>   valid (i.e., the data must be buffered at the receiver until the
>   connection reaches the ESTABLISHED state)."
> 
> Shankar 

Sorry I didn't see Matt's response. His response overrides mine. (Although 
they don't contradict. The same goes for my post on SYN resend, which I 
answered without noticing that Matt had answered it already.)

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: SYN resend
Date: Fri, 27 Feb 2004 16:10:08 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.LNX.4.44.0402271609290.1283-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402261459240.24993-100000@elaine8.Stanford.EDU>
 <Pine.LNX.4.44.0402271544570.17252-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 1077927010 18806 171.64.66.201 (28 Feb 2004 00:10:10 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0402271544570.17252-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6513

On Fri, 27 Feb 2004, Shankar Ponnekanti wrote:

> On Thu, 26 Feb 2004, Lin Chan wrote:
> 
> > consider the following case,
> > client send a SYN, and the server replied a SYNACK, but the SYNACK is
> > lost. Then the client resend SYN, should the server immediately reply a
> > SYNACK, or it can wait until the timeout for its SYNACK to resend?
> > 
> 
> reply immediately with a synack
> 

See Matt's previous post on this. Sorry I didn't notice that before 
posting the above. 

Shankar

.

Path: shelby.stanford.edu!not-for-mail
From: "Ursula Chen" <urse@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3 Q3
Date: Fri, 27 Feb 2004 17:11:41 -0800
Lines: 10
Distribution: su
Message-ID: <c1opse$mfq$1@news.Stanford.EDU>
NNTP-Posting-Host: urse.stanford.edu
X-Trace: news.Stanford.EDU 1077930702 23034 128.12.185.104 (28 Feb 2004 01:11: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:6514

Is this question implying that in this case, unlike CSMA/CD, a transmitting
station does *not* have to detect a collision before it completes
transmission?  Can the transmitting station perform some sort of calculation
to determine that a collision must have occurred?  Or does the collision
still have to happen during transmission?

Thanks,
Ursula


.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Milestone 3 Test I Failed
Date: Sat, 28 Feb 2004 03:32:16 +0000 (UTC)
Lines: 16
Distribution: su
Message-ID: <c1p240$2lf$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine22.stanford.edu
X-Trace: news.Stanford.EDU 1077939136 2735 171.64.15.87 (28 Feb 2004 03:32:16 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:6515

I am using the provided ftpcopy binaries and I'm failing Milestone 3 Test 
I:

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

Results:  NOT OK (passed only 0 out of 1 subtests)

Program output (localhost, expected "OK: sez bytes copied":
***Timeout expired during grading

I believe this should be printed in the reference ftpcopy. Can TAs please 
fix this?

Thanks
Jason
.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Editing of makefile.
Date: Fri, 27 Feb 2004 19:42:00 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.GSO.4.44.0402271939590.20796-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 1077939721 3409 171.64.15.39 (28 Feb 2004 03:42:01 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6516

Assignment states that we can not modify makefile for milestone B.
I want to use clock_gettime function to get current time filled in
struct timespec.  This requires linking with -lrt.

Can I use this function or do I have to follow the assignment spec
and hence find an alternative function.  If so, what's the alternative?

Thanks.

.

Path: shelby.stanford.edu!elaine26.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Milestone 3 Test I Failed
Date: Sat, 28 Feb 2004 06:55:38 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c1pe1a$gj1$1@news.Stanford.EDU>
References: <c1p240$2lf$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
X-Trace: news.Stanford.EDU 1077951338 16993 171.64.15.101 (28 Feb 2004 06:55:38 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6517


>I am using the provided ftpcopy binaries and I'm failing Milestone 3 Test 
>I:

The test case fails because the client doesn't print "OK: ..."--because
it timed out for some reason.  This works for me with the ref transport
layer, so there's presumably something weird going on in yours that
breaks ftpcopy.

.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Editing of makefile.
Date: Fri, 27 Feb 2004 23:09:07 -0800
Lines: 112
Distribution: su
Message-ID: <c1peqk$h5u$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402271939590.20796-100000@epic6.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 1077952148 17598 128.12.194.74 (28 Feb 2004 07:09:08 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.0402271939590.20796-100000@epic6.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6518

 From a previous post:

I used clock_gettime() in hw2, but that is not an option for hw3a,
unfortunately -- it requires linking with librt (-lrt), which means
changing the Makefile, and that is not an option for this assignment.

It is simple enough to use gettimeofday and convert the timeval to a
timespec:

   struct timeval tv = { 0, 0 };
   gettimeofday ( &tv, 0 );
   struct timespec ts = { tv.tv_sec, tv.tv_usec*1000 };


Jeremy



 >> On Sat, 21 Feb 2004, Xiaohua Fang wrote:
 >>
 >
 >>> > What is the routine to get the current time in timespec?
 >>> >
 >>> > I found the following routine:
 >>> > extern void gethrestime(timespec_t *);
 >>> >
 >>> > However, I could not "man" it, neither could I compile with this 
function.
 >>> >
 >>> > Are we supposed to use the gettimeofday() and then fill in timespec
 >>> > structure?  This doesn't soun very elegant.
 >>> >
 >>> >
 >>> >
 >>> > On Wed, 18 Feb 2004, Martin Casado wrote:
 >>> >
 >>
 >>>> > >
 >>>> > >  timespec uses a nanosecond field instead of microseconds 
which timeval uses.
 >>>> > >
 >>>> > > struct timespec
 >>>> > >   {
 >>>> > >     time_t tv_sec;        /* Seconds.  */
 >>>> > >     long int tv_nsec;       /* Nanoseconds.  */
 >>>> > >   };
 >>>> > >
 >>>> > > struct timeval {
 >>>> > >     time_t      tv_sec;     /* seconds */
 >>>> > >     long    tv_usec;    /* and microseconds */
 >>>> > > };
 >>>> > >
 >>>> > >
 >>>> > >
 >>>> > > sys/time.h (on linux) defines the following
 >>>> > >
 >>>> > > /* Macros for converting between `struct timeval' and `struct 
timespec'.  */
 >>>> > > # define TIMEVAL_TO_TIMESPEC(tv, ts) { 
            \
 >>>> > >         (ts)->tv_sec = (tv)->tv_sec; 
           \
 >>>> > >         (ts)->tv_nsec = (tv)->tv_usec * 1000; 
           \
 >>>> > > }
 >>>> > > # define TIMESPEC_TO_TIMEVAL(tv, ts) { 
            \
 >>>> > >         (tv)->tv_sec = (ts)->tv_sec; 
           \
 >>>> > >         (tv)->tv_usec = (ts)->tv_nsec / 1000; 
           \
 >>>> > > }
 >>>> > >
 >>>> > > I'm not sure if solaris has an equivalent set of macros
 >>>> > >
 >>>> > > .m
 >>>> > >
 >>>
 >>>>> > > > The stcp_wait_for_event take a struct timespec as input, 
however time()
 >>>>> > > > returns time_t and gettimeofday() returns struct timeval. 
Are these struct
 >>>>> > > > the same thing? Or we have to explicitly convert them 
ourselves?
 >>>>> > > >
 >>>>> > > > Thanks
 >>>>> > > >
 >>>>> > > > Lin
 >>>>> > > >
 >>>>> > > >
 >>>
 >>>> > >
 >>>> > >
 >>
 >>> >
 >>> >
 >
 >>


-- Jeremy Slade jeremy@jkslade.net
Boris Senderzon wrote:
> Assignment states that we can not modify makefile for milestone B.
> I want to use clock_gettime function to get current time filled in
> struct timespec.  This requires linking with -lrt.
> 
> Can I use this function or do I have to follow the assignment spec
> and hence find an alternative function.  If so, what's the alternative?
> 
> Thanks.
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftp client
Date: Sat, 28 Feb 2004 01:07:47 -0800
Lines: 7
Distribution: su
Message-ID: <c1plpa$pj4$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc406.stanford.edu
X-Trace: news.Stanford.EDU 1077959274 26212 128.12.196.6 (28 Feb 2004 09:07: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:6519

I have shutdown calls in my original ftp client, which i believe were needed
when talking to slac's ftp server.  Can i just delete them since mysock.h
does not have an equivalent?

-Justin


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3 Q3
Date: Sat, 28 Feb 2004 03:10:54 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0402280308080.31196-100000@Xenon.Stanford.EDU>
References: <c1opse$mfq$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 1077966655 4072 171.64.66.201 (28 Feb 2004 11:10:55 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c1opse$mfq$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6520


On Fri, 27 Feb 2004, Ursula Chen wrote:

> Is this question implying that in this case, unlike CSMA/CD, a transmitting
> station does *not* have to detect a collision before it completes
> transmission?  Can the transmitting station perform some sort of calculation
> to determine that a collision must have occurred?  Or does the collision
> still have to happen during transmission?
> 

You are thinking along the right lines, please continue your thought 
process :-) I can't elaborate more because that will give away the 
solution.

Shankar

.

Path: shelby.stanford.edu!saga9.Stanford.EDU!rameshk
From: Ramesh Kumar <rameshk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: assertion failed stcp_api.c, line 100
Date: Sat, 28 Feb 2004 13:02:42 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.GSO.4.44.0402281301420.15385-100000@saga9.Stanford.EDU>
NNTP-Posting-Host: saga9.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078002163 8918 171.64.15.139 (28 Feb 2004 21:02:43 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6521


I am getting an
Assertion failed :0 file stcp_api.c, line 100

I get this intermittenly, not every time.

It occurs after I do

struct timeval tval = {0,0};
gettimeofday(&tval,0);
struct timespec ts = {tval.tv_sec, tval.tv_usec * 1000 + RTO};
event = stcp_wait_for_event(sd,NETWORK_DATA|TIMEOUT,&ts);

where RTO is 300 * 1000000 (300msec in nsec)

for example, when the assert occured
ts.tv_nsec = 1097229000.

I saw in stcp_api.c it is an EINVAL error and it occurs if abs time is
invalid. I don't understand why its invalid.

any ideas, how I can rectify it.

Thanks,
Ramesh.




.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: test 2.G
Date: Sat, 28 Feb 2004 13:21:48 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.GSO.4.44.0402281317580.9825-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 1078003309 10111 171.64.15.42 (28 Feb 2004 21:21:49 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6522

Under grading guidlines, test 2.G for milestone 2 states that

Failure to send a SYN_ACK after SYN .

I takt this to mean that my program did not send SYN/ACK in
response to SYN from active side.  If my understanding is
correct, then what does this output from test 2.G mean

SYN-ACK with sequence number 159 without matching SYN.

Does it state that I sent SYN/ACK without ever receiving a SYN?

BTW, how come test script does not provide any program output
for this test run?

Thanks.

.

Path: shelby.stanford.edu!not-for-mail
From: Jeremy Slade <jeremy@jkslade.net>
Newsgroups: su.class.cs244a
Subject: Expected throughput?
Date: 28 Feb 2004 14:24:05 -0700
Lines: 24
Sender: jeremy@dad.jkslade.net
Distribution: su
Message-ID: <m3brni7v9m.fsf@dad.jkslade.net>
NNTP-Posting-Host: elaine36.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1078003339 8321 171.64.15.111 (28 Feb 2004 21:22:19 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)
Xref: shelby.stanford.edu su.class.cs244a:6523

What kind of effective datarate should we expect to achieve in
unreliable mode?  In reliable mode, the theoretical max throughput (no
retransmits, stalls) should be
        
        3072 bytes
        ---------- = 30720 bytes/sec
        100 ms

So, TESTDATA.1 (~300000 bytes) should transfer in ~10 sec.  In
_reliable_ mode, I am seeing that file transfer in ~25 sec, with an
average RTO of 289ms, with the client and server on the same host.
I'm not sure why the RTO is so high, it seems like it should hit the
floor of 100ms on the local host.

In _unreliable_ mode, it usually takes 45-50 sec, which an average RTO
of ~400 ms.  It seems like that is getting pretty close to the 60sec
limit for the grading script.  Does it seem like my numbers are in the
right range?  What kinds of numbers are other people seeing?


Jeremy
-- 
Jeremy Slade
jeremy@jkslade.net
.

Path: shelby.stanford.edu!saga9.Stanford.EDU!rameshk
From: Ramesh Kumar <rameshk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: assertion failed stcp_api.c, line 100
Date: Sat, 28 Feb 2004 13:45:50 -0800
Lines: 42
Distribution: su
Message-ID: <Pine.GSO.4.44.0402281344150.17695-100000@saga9.Stanford.EDU>
References: <Pine.GSO.4.44.0402281301420.15385-100000@saga9.Stanford.EDU>
NNTP-Posting-Host: saga9.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078004752 11467 171.64.15.139 (28 Feb 2004 21:45:52 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402281301420.15385-100000@saga9.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6524


Forget the question. I found the mistake.
I wasn't updating the sec field when I added RTO. so nsec
field had to be wrapped.

Ramesh.

On Sat, 28 Feb 2004, Ramesh Kumar wrote:

>
> I am getting an
> Assertion failed :0 file stcp_api.c, line 100
>
> I get this intermittenly, not every time.
>
> It occurs after I do
>
> struct timeval tval = {0,0};
> gettimeofday(&tval,0);
> struct timespec ts = {tval.tv_sec, tval.tv_usec * 1000 + RTO};
> event = stcp_wait_for_event(sd,NETWORK_DATA|TIMEOUT,&ts);
>
> where RTO is 300 * 1000000 (300msec in nsec)
>
> for example, when the assert occured
> ts.tv_nsec = 1097229000.
>
> I saw in stcp_api.c it is an EINVAL error and it occurs if abs time is
> invalid. I don't understand why its invalid.
>
> any ideas, how I can rectify it.
>
> Thanks,
> Ramesh.
>
>
>
>
>



.

Path: shelby.stanford.edu!not-for-mail
From: Tony Hsieh <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: libftpcopy.a
Date: Sat, 28 Feb 2004 14:26:44 -0800
Lines: 10
Distribution: su
Message-ID: <404115A4.4030603@stanford.edu>
NNTP-Posting-Host: perch.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078007141 13859 171.64.75.22 (28 Feb 2004 22:25:41 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6525

I am confused as to what we need to do for HW3c.  If I decide to use the 
provided object files, do I need to copy the 3 *.a files into my current 
  working directory.  I thought the Makefile right now already makes 
ftpcopy_tcp.  This ftpcopy_tcp program that currently gets made is the 
ftp client we should be running with the ftp server daemon right?

Also I just want to make sure that we don't lose any points for using 
the provided object files.  We only need to modify our ftpcopy files if 
we want a way to debug ftpcopy over our transport layer?

.

Path: shelby.stanford.edu!not-for-mail
From: "Ayaz" <ayaz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test 2.D failed
Date: Sat, 28 Feb 2004 15:39:01 -0800
Lines: 20
Distribution: su
Message-ID: <c1r8qq$hsh$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078011548 18321 127.0.0.1 (28 Feb 2004 23:39:08 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
Xref: shelby.stanford.edu su.class.cs244a:6526

Test 2.D fails, however, I am buffering data in my recv window. What is this
test actually doing?

Here is the test failure.......
Test 2.D [out of 2.5]
Checks that receiver buffers data in receiver window.

Results:  NOT OK

File size differs for
/usr/class/cs244a/grading_script/hw3/net_instruct_resend_same_info.out!
(You downloaded 0 byte(s), expected 20).
Client output:


Thanks
Ayaz



.

Path: shelby.stanford.edu!not-for-mail
From: Jeremy Slade <jeremy@jkslade.net>
Newsgroups: su.class.cs244a
Subject: test against reference client/server
Date: 28 Feb 2004 16:44:37 -0700
Lines: 21
Sender: jeremy@dad.jkslade.net
Distribution: su
Message-ID: <m365dq7ore.fsf@dad.jkslade.net>
NNTP-Posting-Host: elaine36.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1078011769 16682 171.64.15.111 (28 Feb 2004 23:42:49 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)
Xref: shelby.stanford.edu su.class.cs244a:6527

I'm getting the following failure:

Test 2.B [out of 20]
Checks student Tx (server) against reference Rx (client).

Results:  NOT OK

Unexpected exit status -1.  Program output:
***Timeout expired during grading
Program output:
server: TESTDATA.0,110230,Ok


How would I go about testing with the reference client outside the
test script?  I believe I've seen other references to people doing
this, but I can't find anything about it in the assignment description
or faq.

-- 
Jeremy Slade
jeremy@jkslade.net
.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: test against reference client/server
Date: Sat, 28 Feb 2004 17:04:55 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.GSO.4.44.0402281702480.18715-100000@epic9.Stanford.EDU>
References: <m365dq7ore.fsf@dad.jkslade.net>
NNTP-Posting-Host: epic9.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078016697 26278 171.64.15.42 (29 Feb 2004 01:04:57 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jeremy Slade <jeremy@jkslade.net>
In-Reply-To: <m365dq7ore.fsf@dad.jkslade.net>
Xref: shelby.stanford.edu su.class.cs244a:6528

This happens to me intermittenly.  Sometimes it does,
sometimes it does not and this is with 100 ms timeout.

On 28 Feb 2004, Jeremy Slade wrote:

> I'm getting the following failure:
>
> Test 2.B [out of 20]
> Checks student Tx (server) against reference Rx (client).
>
> Results:  NOT OK
>
> Unexpected exit status -1.  Program output:
> ***Timeout expired during grading
> Program output:
> server: TESTDATA.0,110230,Ok
>
>
> How would I go about testing with the reference client outside the
> test script?  I believe I've seen other references to people doing
> this, but I can't find anything about it in the assignment description
> or faq.
>
> --
> Jeremy Slade
> jeremy@jkslade.net
>

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Timeouts
Date: Sun, 29 Feb 2004 02:36:42 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c1rj7q$1vv$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine34.stanford.edu
X-Trace: news.Stanford.EDU 1078022202 2047 171.64.15.109 (29 Feb 2004 02:36: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:6529

I am finding a timeout of 100 ms to be untenable.  Nor does this appear to 
be a problem with my code; running ping on elaine34 gives an average RTT 
of 256 ms.  The top command shows the CPU 99 percent idle and more than 1 
GB of free memory, so machine overload isn't the reason.

Is there any reason the timeout can't be fixed at a much higher level (say 
300 ms)?  Or is something else wrong?

Tyrone

.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: weird stcp in ftpd_tcp
Date: Sat, 28 Feb 2004 18:40:42 -0800
Lines: 16
Distribution: su
Message-ID: <c1rjfc$2k8$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 1078022444 2696 128.12.194.74 (29 Feb 2004 02:40:44 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:6530

Hi,

I'm getting some wierd behaviour from the ftpd_tcp generated from 'make'.

If I do a 'make', I get an stcp ftp daemon running with my stcp 
implementation.  I used that to test my ftpcopy and my LIST command just 
hangs (I use the active data mode).  When I look at my ftpd_tcp 
debugging output, it tells me it opens an active connection, unblocks 
the application, but isn't getting any data from the application.

My ftpcopy works fine with the reference ftpd_tcp and the hw3c tests 
don't seem to mind the aforementioned bug, but just to make sure, will 
this thing come back to haunt me in hw4 if I don't fix it?

Paul E.

.

Path: shelby.stanford.edu!not-for-mail
From: Jeremy Slade <jeremy@jkslade.net>
Newsgroups: su.class.cs244a
Subject: Re: Timeouts
Date: 28 Feb 2004 19:43:21 -0700
Lines: 19
Sender: jeremy@dad.jkslade.net
Distribution: su
Message-ID: <m31xoe7ghi.fsf@dad.jkslade.net>
References: <c1rj7q$1vv$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1078022492 2688 171.64.15.111 (29 Feb 2004 02:41:32 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)
Xref: shelby.stanford.edu su.class.cs244a:6531

Timeout isn't supposed to be fixed at 100ms, that is a lower bound.


Tyrone Nicholas <tyronen@Stanford.EDU> writes:

> I am finding a timeout of 100 ms to be untenable.  Nor does this appear to 
> be a problem with my code; running ping on elaine34 gives an average RTT 
> of 256 ms.  The top command shows the CPU 99 percent idle and more than 1 
> GB of free memory, so machine overload isn't the reason.
> 
> Is there any reason the timeout can't be fixed at a much higher level (say 
> 300 ms)?  Or is something else wrong?
> 
> Tyrone
> 

-- 
Jeremy Slade
jeremy@jkslade.net
.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: After 5 attempts
Date: Sun, 29 Feb 2004 03:45:49 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c1rn9c$5uj$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine34.stanford.edu
X-Trace: news.Stanford.EDU 1078026349 6099 171.64.15.109 (29 Feb 2004 03:45:49 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:6532

Suppose one side makes the 5 attempts to send a packet and gets no ack.  
It then exits the transport_init function and terminates its TCP thread.

The other side, however, will be stuck in control_loop forever, waiting 
for data from the other side which has terminated.  Is this acceptable?  
Or should it terminate if it receives nothing from either network or 
application for a specified period?

Tyrone
.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Timeouts
Date: Sat, 28 Feb 2004 20:26:12 -0800
Lines: 25
Distribution: su
Message-ID: <c1rpl5$8fe$1@news.Stanford.EDU>
References: <c1rj7q$1vv$1@news.Stanford.EDU> <m31xoe7ghi.fsf@dad.jkslade.net>
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 1078028774 8686 128.12.194.74 (29 Feb 2004 04:26:14 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: <m31xoe7ghi.fsf@dad.jkslade.net>
Xref: shelby.stanford.edu su.class.cs244a:6533

Will we get penalized for using a fixed timeout, even if our code works?

Paul E.

Jeremy Slade wrote:

> Timeout isn't supposed to be fixed at 100ms, that is a lower bound.
> 
> 
> Tyrone Nicholas <tyronen@Stanford.EDU> writes:
> 
> 
>>I am finding a timeout of 100 ms to be untenable.  Nor does this appear to 
>>be a problem with my code; running ping on elaine34 gives an average RTT 
>>of 256 ms.  The top command shows the CPU 99 percent idle and more than 1 
>>GB of free memory, so machine overload isn't the reason.
>>
>>Is there any reason the timeout can't be fixed at a much higher level (say 
>>300 ms)?  Or is something else wrong?
>>
>>Tyrone
>>
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Closing
Date: Sat, 28 Feb 2004 21:16:48 -0800
Lines: 19
Distribution: su
Message-ID: <c1rsk1$b8v$1@news.Stanford.EDU>
NNTP-Posting-Host: firebird5.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078031809 11551 171.64.15.18 (29 Feb 2004 05:16:49 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:6534

The purpose of TIME_WAIT is to allow the program to kind of sit around 
while the other program is closing.  Example scenario:

TCP 1 sends a fin
TCP 2 receives fin sends ack, ACK lost

TCP 1 resends fin
TCP 2 is in TIME_WAIT and able to ACK fin

TCP 1 receives fin, able to also close


Since we do not have TIME_WAIT what happens in this case is that TCP 2 
exits on error (unable to resend fin as other application has close 
connection)

Is this allowable or is there some other way we are supposed to handle 
this scenario?

.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Expected throughput?
Date: Sun, 29 Feb 2004 05:46:08 +0000 (UTC)
Lines: 23
Distribution: su
Message-ID: <c1rub0$d05$1@news.Stanford.EDU>
References: <m3brni7v9m.fsf@dad.jkslade.net>
NNTP-Posting-Host: elaine5.stanford.edu
X-Trace: news.Stanford.EDU 1078033568 13317 171.64.15.70 (29 Feb 2004 05:46:08 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6535


>What kind of effective datarate should we expect to achieve in
>unreliable mode?  In reliable mode, the theoretical max throughput (no
>retransmits, stalls) should be
>        
>        3072 bytes
>        ---------- = 30720 bytes/sec
>        100 ms

100ms is a suggestion for clamping the minimum RTO--not the expected RTT.
So your throughput would be expected to be higher in the ideal case.

With both client and server running in reliable mode, I transfer
TESTDATA.1 in ~1s.  With both running in unreliable mode, I transfer
TESTDATA.1 in ~14s.

The timeout of 60s seems like it should be sufficient (if it weren't, I'd
hit timeouts, but I've never seen this when testing my code).  I'm not sure
why your reliable mode is ~25x slower than mine, but obviously something
weird's going on.  Are you sure you advertise the correct window?  Some
people were timing out because they'd send th_win=0, and then the reference
implementation will only send 1-byte segments in that case.

.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ftp client
Date: Sun, 29 Feb 2004 05:50:49 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c1rujp$dab$1@news.Stanford.EDU>
References: <c1plpa$pj4$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine5.stanford.edu
X-Trace: news.Stanford.EDU 1078033849 13643 171.64.15.70 (29 Feb 2004 05:50:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6537


>I have shutdown calls in my original ftp client, which i believe were needed
>when talking to slac's ftp server.  Can i just delete them since mysock.h
>does not have an equivalent?

for HW3 that's fine, for HW4 you'll probably want to verify that your client
still works as expected even without this call.  (for SLAC, you should be
able to close the socket and have the same effect--a shutdown shouldn't be
necessary)
.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: test 2.G
Date: Sun, 29 Feb 2004 05:58:45 +0000 (UTC)
Lines: 17
Distribution: su
Message-ID: <c1rv2l$dlq$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402281317580.9825-100000@epic9.Stanford.EDU>
NNTP-Posting-Host: elaine5.stanford.edu
X-Trace: news.Stanford.EDU 1078034325 14010 171.64.15.70 (29 Feb 2004 05:58:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6538



>SYN-ACK with sequence number 159 without matching SYN.

>Does it state that I sent SYN/ACK without ever receiving a SYN?

This should trigger if you send a SYN-ACK with th_ack=X but there was
no SYN seen with th_seq=X-1.  (It should say ack number, not sequence
number in the output).

>BTW, how come test script does not provide any program output
>for this test run?

it's pretty meaningless for these test cases (it doesn't help with
figuring out where any problems might lie the way it does for test
cases B or C).

.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: libftpcopy.a
Date: Sun, 29 Feb 2004 06:01:17 +0000 (UTC)
Lines: 19
Distribution: su
Message-ID: <c1rv7d$dsn$1@news.Stanford.EDU>
References: <404115A4.4030603@stanford.edu>
NNTP-Posting-Host: elaine5.stanford.edu
X-Trace: news.Stanford.EDU 1078034477 14231 171.64.15.70 (29 Feb 2004 06:01:17 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6539


>I am confused as to what we need to do for HW3c.  If I decide to use the 
>provided object files, do I need to copy the 3 *.a files into my current 
>  working directory.  I thought the Makefile right now already makes 
>ftpcopy_tcp.  This ftpcopy_tcp program that currently gets made is the 
>ftp client we should be running with the ftp server daemon right?

No, the Makefile looks for the libraries somewhere in the class directory.
No need to copy them over.  And yes, ftpcopy_tcp will run against our
ftpd_tcp--if you don't change the Makefile at all, that ftpcopy_tcp
will use our ftpcopy library.

>Also I just want to make sure that we don't lose any points for using 
>the provided object files.  We only need to modify our ftpcopy files if 
>we want a way to debug ftpcopy over our transport layer?

Correct.  This should work for you as-is if your transport layer's
implemented correctly.

.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test 2.D failed
Date: Sun, 29 Feb 2004 06:04:30 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c1rvde$e0b$1@news.Stanford.EDU>
References: <c1r8qq$hsh$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine5.stanford.edu
X-Trace: news.Stanford.EDU 1078034670 14347 171.64.15.70 (29 Feb 2004 06:04:30 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6540


>Test 2.D fails, however, I am buffering data in my recv window. What is this
>test actually doing?

That particular test would probably be better included with 2.E, bad sender.
It's similar to the other such tests, making sure that you pass data up to
the app as you get it, not passing up bogus data, etc.

.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Timeouts
Date: Sun, 29 Feb 2004 06:06:33 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c1rvh9$e5j$1@news.Stanford.EDU>
References: <c1rj7q$1vv$1@news.Stanford.EDU> <m31xoe7ghi.fsf@dad.jkslade.net> <c1rpl5$8fe$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine5.stanford.edu
X-Trace: news.Stanford.EDU 1078034793 14515 171.64.15.70 (29 Feb 2004 06:06:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6541


>Will we get penalized for using a fixed timeout, even if our code works?

no, whatever works for you.  you can use a higher or lower timeout,
a better RTO estimation strategy, whatever gives you the best results.

.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: weird stcp in ftpd_tcp
Date: Sun, 29 Feb 2004 06:10:30 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <c1rvom$edb$1@news.Stanford.EDU>
References: <c1rjfc$2k8$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine5.stanford.edu
X-Trace: news.Stanford.EDU 1078035030 14763 171.64.15.70 (29 Feb 2004 06:10:30 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6542


>If I do a 'make', I get an stcp ftp daemon running with my stcp 
>implementation.  I used that to test my ftpcopy and my LIST command just 
>hangs (I use the active data mode).  When I look at my ftpd_tcp 
>debugging output, it tells me it opens an active connection, unblocks 
>the application, but isn't getting any data from the application.

>My ftpcopy works fine with the reference ftpd_tcp and the hw3c tests 
>don't seem to mind the aforementioned bug, but just to make sure, will 
>this thing come back to haunt me in hw4 if I don't fix it?

I don't know, but in my experience, bugs tend to have a habit of coming
back to haunt you.  As to whether it will impact HW4?  If your ftpcopy
works over the simulated network later in HW3, chances are it should work
over the VNS-based IP layer in HW4.  But there's no guarantee of this, and
no guarantee that other ftpds will behave like the STCP-speaking ftpd
provided.

.

Path: shelby.stanford.edu!not-for-mail
From: Adam Lee Berger <addaon@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Grading Script abend; cannot do anything
Date: Sun, 29 Feb 2004 06:52:25 +0000 (UTC)
Lines: 22
Distribution: su
Message-ID: <c1s279$g07$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1078037545 16391 171.64.15.108 (29 Feb 2004 06:52: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:6543

I've been having serious problems during the grading script. I get the following error:

Server started
Starting client: ./testclient  -p .server_port -f net_instruct_resend_same_info foo
Warning: unable to close filehandle KID_TO_READ properly.
connected to 171.64.15.104 at port 53550
Out of memory during request for 132 bytes, total sbrk() is 2171972248 bytes!
couldn't submit code for testing

The grading script then terminates without giving me any useful output. This tends to be
after my program prints out a large amount of output, although this does not always seem
to be the case. My leland quota has more than 100MB unused. This happens in both the hw3a
and hw3b tests, identically (actual byte values and ports vary, of course). It counts
the use of the grading script against me. As a result, I have used all of my grading script
runs for both parts a and b without actually getting output. And, of course, without output
I can't figure out what's going on to fix it.

What should I do?

Desperate,
Adam

.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS 3 #1b
Date: Sat, 28 Feb 2004 23:04:57 -0800
Organization: CS Masters Program
Lines: 11
Distribution: su
Message-ID: <c1s2us$hcq$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078038301 17818 127.0.0.1 (29 Feb 2004 07:05: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:6544

Hello,

Problem Set 3, Question 1(b) states that the WFQ scheduler serves each flow
at a fixed rate rho. Can we assume that this rho is the same rho we found in
part 1(a)?

Thanks,

Greg


.

Path: shelby.stanford.edu!not-for-mail
From: Jeremy Slade <jeremy@jkslade.net>
Newsgroups: su.class.cs244a
Subject: Re: Expected throughput?
Date: 29 Feb 2004 00:23:04 -0700
Lines: 34
Sender: jeremy@dad.jkslade.net
Distribution: su
Message-ID: <m3smgu5oyv.fsf@dad.jkslade.net>
References: <m3brni7v9m.fsf@dad.jkslade.net> <c1rub0$d05$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1078039272 18032 171.64.15.111 (29 Feb 2004 07:21:12 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)
Xref: shelby.stanford.edu su.class.cs244a:6545

holliman@Stanford.EDU (Matthew Jonathan Holliman) writes:

> >What kind of effective datarate should we expect to achieve in
> >unreliable mode?  In reliable mode, the theoretical max throughput (no
> >retransmits, stalls) should be
> >        
> >        3072 bytes
> >        ---------- = 30720 bytes/sec
> >        100 ms
> 
> 100ms is a suggestion for clamping the minimum RTO--not the expected RTT.
> So your throughput would be expected to be higher in the ideal case.

Ah, yes, thanks for pointing that out.  It's getting late, I've been
staring at all this for too long now.
 
> With both client and server running in reliable mode, I transfer
> TESTDATA.1 in ~1s.  With both running in unreliable mode, I transfer
> TESTDATA.1 in ~14s.
> 
> The timeout of 60s seems like it should be sufficient (if it weren't, I'd
> hit timeouts, but I've never seen this when testing my code).  I'm not sure
> why your reliable mode is ~25x slower than mine, but obviously something
> weird's going on.

Something weird indeed: I'm seeing an average SampleRTT of ~170ms,
which I think indicates a problem.  No network latency in this case,
so it must all be in my transport code.  Thanks for the feedback.

Jeremy

-- 
Jeremy Slade
jeremy@jkslade.net
.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: bytes / sec -- Timeouts
Date: Sun, 29 Feb 2004 00:56:44 -0800
Lines: 12
Distribution: su
Message-ID: <c1s9gj$o9m$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc408.stanford.edu
X-Trace: news.Stanford.EDU 1078045011 24886 128.12.196.8 (29 Feb 2004 08:56: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:6546

What kind of speeds are we expected to achieve with our implementation?  I
ask because I am taking too long on 2.B and causing a timeout.  However, the
file is still continuing to grow so it is not as if I am blocking
indefinitely or something.  At the moment, it takes me around 30 sec to
transfer TESTDATA.1 (~300k).  Is that really slow?  What are some common
ways to improve speed?

Thanks,

Justin


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: After 5 attempts
Date: Sun, 29 Feb 2004 02:15:20 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0402290213410.18701-100000@Xenon.Stanford.EDU>
References: <c1rn9c$5uj$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 1078049722 23 171.64.66.201 (29 Feb 2004 10:15:22 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c1rn9c$5uj$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6547


On Sun, 29 Feb 2004, Tyrone Nicholas wrote:

> Suppose one side makes the 5 attempts to send a packet and gets no ack.  
> It then exits the transport_init function and terminates its TCP thread.
> 
> The other side, however, will be stuck in control_loop forever, waiting 
> for data from the other side which has terminated.  Is this acceptable?  
> Or should it terminate if it receives nothing from either network or 
> application for a specified period?
> 

To deal with this issue, some TCP implementations send keep-alive 
probes, but you are not required to implement this feature.

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Closing
Date: Sun, 29 Feb 2004 02:17:09 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.LNX.4.44.0402290215520.18701-100000@Xenon.Stanford.EDU>
References: <c1rsk1$b8v$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 1078049831 144 171.64.66.201 (29 Feb 2004 10:17:11 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c1rsk1$b8v$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6548

On Sat, 28 Feb 2004, Ryan wrote:

> The purpose of TIME_WAIT is to allow the program to kind of sit around 
> while the other program is closing.  Example scenario:
> 
> TCP 1 sends a fin
> TCP 2 receives fin sends ack, ACK lost
> 
> TCP 1 resends fin
> TCP 2 is in TIME_WAIT and able to ACK fin
> 
> TCP 1 receives fin, able to also close
> 
> 
> Since we do not have TIME_WAIT what happens in this case is that TCP 2 
> exits on error (unable to resend fin as other application has close 
> connection)
> 
> Is this allowable or is there some other way we are supposed to handle 
> this scenario?
> 

The assignment spec addresses this issue: "If no ACK for the FIN is  ever 
received, as per the rules for retransmission, it terminates its end of 
the connection anyway."

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: bytes / sec -- Timeouts
Date: Sun, 29 Feb 2004 02:19:36 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.LNX.4.44.0402290218390.18701-100000@Xenon.Stanford.EDU>
References: <c1s9gj$o9m$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 1078049979 230 171.64.66.201 (29 Feb 2004 10:19:39 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c1s9gj$o9m$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6549


On Sun, 29 Feb 2004, Justin wrote:

> What kind of speeds are we expected to achieve with our implementation?  I
> ask because I am taking too long on 2.B and causing a timeout.  However, the
> file is still continuing to grow so it is not as if I am blocking
> indefinitely or something.  At the moment, it takes me around 30 sec to
> transfer TESTDATA.1 (~300k).  Is that really slow?  What are some common
> ways to improve speed?
> 

My guess is that you didn't look at the thread "Expected thru'put". 

Shankar

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3 Q1(c)
Date: Sun, 29 Feb 2004 02:25:05 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.GSO.4.44.0402290222370.24373-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 1078050308 520 171.64.15.118 (29 Feb 2004 10:25:08 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6550


"WFQ scheduler now servers on packet at a time ..."

Is this same as what is specified on handout 9 (page. 10)?

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS 3 #1b
Date: Sun, 29 Feb 2004 02:32:56 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.LNX.4.44.0402290232230.18701-100000@Xenon.Stanford.EDU>
References: <c1s2us$hcq$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 1078050777 924 171.64.66.201 (29 Feb 2004 10:32:57 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c1s2us$hcq$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6551


On Sat, 28 Feb 2004, Greg Friedman wrote:

> Hello,
> 
> Problem Set 3, Question 1(b) states that the WFQ scheduler serves each flow
> at a fixed rate rho. Can we assume that this rho is the same rho we found in
> part 1(a)?
> 

yes.

Shankar


.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!jsalcedo
From: Jonathan Salcedo <jsalcedo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test 2.C
Date: Sun, 29 Feb 2004 04:09:14 -0800
Lines: 193
Distribution: su
Message-ID: <Pine.GSO.4.44.0402290302140.3831-100000@elaine2.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078056556 6800 171.64.15.67 (29 Feb 2004 12:09:16 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6552

I have consistently been failing only test 2.C on TESTDATA.0 for a while
now and I have no idea what I can do to fix it. The error I get from the
grading script is:

Test 2.C [out of 20]
Checks reference Tx (server) against student Rx (client).

Results:  NOT OK

Unexpected exit status -1.  Program output:
***Timeout expired during grading
Program output:
server: TESTDATA.0,110230,Ok

I have thoroughly examined my client's interaction with the reference
server and I have determined that I am sending all the correct ACK's,
buffering all the data, and advertising the correct window. The problem
that I see is that the reference server sends data in the worst possible
way and seems to completely ignore my ACK's and advertised window. For
example, if I'm acking sequence number 3000, and advertising a window of,
say, 300, the server will continually send me sequence numbers higher than
3000, in 1 byte increments, including sending sequence numbers that are
outside the upper bound of my window, then it will start sending data with
sequence numbers below 3000, so basically I'm just sitting there waiting
for the server to actually send the correct sequence number, and all this
waiting  leads me to exceed the 60 second timeout.

I completely changed my data structures to try to make receiving data
quicker, but there is only so much I can do if the server just refuses to
send the correct data. Basically, what I'm saying is that the server is
not actually transmitting all the data within the 60 seconds. Any
suggestions??

-Jonathan Salcedo

Some output:

Trying to insert 536 bytes starting with 7337 into window of
lowestACCEPT:7337, highestACCEPT:10408
536 bytes are within our window
We have SEQ:7337-7872
We got data in window, and now our highest consecutive byte is 7872
Sending 536 bytes to app
sending header only packet with ACK , seq # 211, ack: 7873
Advertising window of 3072 bytes:(lastByteRcvd:7872)(lastByteToApp:7872)

EVENT = NETWORK_DATA
received packet with ACK , seq_start#8193, seq_end#8728 ack: 211
536 bytes of this packet is data
Trying to insert 536 bytes starting with 8193 into window of
lowestACCEPT:7873, highestACCEPT:10944
536 bytes are within our window
We have SEQ:8193-8728
We got data in window, and now our highest consecutive byte is 7872
sending header only packet with ACK , seq # 211, ack: 7873
Advertising window of 2216 bytes:(lastByteRcvd:8728)(lastByteToApp:7872)

EVENT = NETWORK_DATA
received packet with ACK , seq_start#8729, seq_end#9264 ack: 211
536 bytes of this packet is data
Trying to insert 536 bytes starting with 8729 into window of
lowestACCEPT:7873, highestACCEPT:10944
536 bytes are within our window
We have SEQ:8193-9264
We got data in window, and now our highest consecutive byte is 7872
sending header only packet with ACK , seq # 211, ack: 7873
Advertising window of 1680 bytes:(lastByteRcvd:9264)(lastByteToApp:7872)

EVENT = NETWORK_DATA
received packet with ACK , seq_start#9265, seq_end#9314 ack: 211
50 bytes of this packet is data
Trying to insert 50 bytes starting with 9265 into window of
lowestACCEPT:7873, highestACCEPT:10944
50 bytes are within our window
We have SEQ:8193-9314
We got data in window, and now our highest consecutive byte is 7872
sending header only packet with ACK , seq # 211, ack: 7873
Advertising window of 1630 bytes:(lastByteRcvd:9314)(lastByteToApp:7872)

EVENT = NETWORK_DATA
received packet with ACK , seq_start#9315, seq_end#9336 ack: 211
22 bytes of this packet is data
Trying to insert 22 bytes starting with 9315 into window of
lowestACCEPT:7873, highestACCEPT:10944
22 bytes are within our window
We have SEQ:8193-9336
We got data in window, and now our highest consecutive byte is 7872
sending header only packet with ACK , seq # 211, ack: 7873
Advertising window of 1608 bytes:(lastByteRcvd:9336)(lastByteToApp:7872)

EVENT = NETWORK_DATA
received packet with ACK , seq_start#9337, seq_end#9872 ack: 211
536 bytes of this packet is data
Trying to insert 536 bytes starting with 9337 into window of
lowestACCEPT:7873, highestACCEPT:10944
536 bytes are within our window
We have SEQ:8193-9872
We got data in window, and now our highest consecutive byte is 7872
sending header only packet with ACK , seq # 211, ack: 7873
Advertising window of 1072 bytes:(lastByteRcvd:9872)(lastByteToApp:7872)

EVENT = NETWORK_DATA
received packet with ACK , seq_start#9873, seq_end#10120 ack: 211
248 bytes of this packet is data
Trying to insert 248 bytes starting with 9873 into window of
lowestACCEPT:7873, highestACCEPT:10944
248 bytes are within our window
We have SEQ:8193-10120
We got data in window, and now our highest consecutive byte is 7872
sending header only packet with ACK , seq # 211, ack: 7873
Advertising window of 824 bytes:(lastByteRcvd:10120)(lastByteToApp:7872)

EVENT = NETWORK_DATA
received packet with ACK , seq_start#10121, seq_end#10121 ack: 211
1 bytes of this packet is data
Trying to insert 1 bytes starting with 10121 into window of
lowestACCEPT:7873, highestACCEPT:10944
1 bytes are within our window
We have SEQ:8193-10121
We got data in window, and now our highest consecutive byte is 7872
sending header only packet with ACK , seq # 211, ack: 7873
Advertising window of 823 bytes:(lastByteRcvd:10121)(lastByteToApp:7872)

EVENT = NETWORK_DATA
received packet with ACK , seq_start#10122, seq_end#10122 ack: 211
1 bytes of this packet is data
Trying to insert 1 bytes starting with 10122 into window of
lowestACCEPT:7873, highestACCEPT:10944
1 bytes are within our window
We have SEQ:8193-10122
We got data in window, and now our highest consecutive byte is 7872
sending header only packet with ACK , seq # 211, ack: 7873
Advertising window of 822 bytes:(lastByteRcvd:10122)(lastByteToApp:7872)

EVENT = NETWORK_DATA
received packet with ACK , seq_start#10123, seq_end#10123
ack: 211
1 bytes of this packet is data
Trying to insert 1 bytes starting with 10123 into window of
lowestACCEPT:7873, highestACCEPT:10944
1 bytes are within our window
We have SEQ:8193-10123
We got data in window, and now our highest consecutive byte is 7872
sending header only packet with ACK , seq # 211, ack: 7873
Advertising window of 821 bytes:(lastByteRcvd:10123)(lastByteToApp:7872)

EVENT = NETWORK_DATA
received packet with ACK , seq_start#7337, seq_end#7872 ack: 211
536 bytes of this packet is data
Trying to insert 536 bytes starting with 7337 into window of
lowestACCEPT:7873, highestACCEPT:10944
sending header only packet with ACK , seq # 211, ack: 7873
Advertising window of 821 bytes:(lastByteRcvd:10123)(lastByteToApp:7872)

EVENT = NETWORK_DATA
received packet with ACK , seq_start#10125, seq_end#10125 ack: 211
1 bytes of this packet is data
Trying to insert 1 bytes starting with 10125 into window of
lowestACCEPT:7873, highestACCEPT:10944
1 bytes are within our window
We have SEQ:8193-10123 10125-10125
We got data in window, and now our highest consecutive byte is 7872
sending header only packet with ACK , seq # 211, ack: 7873
Advertising window of 819 bytes:(lastByteRcvd:10125)(lastByteToApp:7872)

EVENT = NETWORK_DATA
received packet with ACK , seq_start#10127, seq_end#10127 ack: 211
1 bytes of this packet is data
Trying to insert 1 bytes starting with 10127 into window of
lowestACCEPT:7873, highestACCEPT:10944
1 bytes are within our window
We have SEQ:8193-10123 10125-10125 10127-10127
We got data in window, and now our highest consecutive byte is 7872
sending header only packet with ACK , seq # 211, ack: 7873
Advertising window of 817 bytes:(lastByteRcvd:10127)(lastByteToApp:7872)

EVENT = NETWORK_DATA
received packet with ACK , seq_start#10129, seq_end#10129 ack: 211
1 bytes of this packet is data
Trying to insert 1 bytes starting with 10129 into window of
lowestACCEPT:7873, highestACCEPT:10944
1 bytes are within our window
We have SEQ:8193-10123 10125-10125 10127-10127 10129-10129
We got data in window, and now our highest consecutive byte is 7872
sending header only packet with ACK , seq # 211, ack: 7873
Advertising window of 815 bytes:(lastByteRcvd:10129)(lastByteToApp:7872)

************ OBVIOUSLY I WANT SEQUENCE NUM 7873!!!! *********************
The server then keeps sending one byte packets, skipping a sequence number
every now and then, then it will proceed to send sequence numbers above
10944, the highest sequence number I would actually want, all while I am
consistently ACKing 7873 and my advertised window continues to shrink.

.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: test 2.G
Date: Sun, 29 Feb 2004 07:18:57 -0800
Lines: 54
Distribution: su
Message-ID: <Pine.GSO.4.44.0402290710090.29415-100000@epic9.Stanford.EDU>
References: <Pine.GSO.4.44.0402281317580.9825-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 1078067939 17344 171.64.15.42 (29 Feb 2004 15:18:59 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402281317580.9825-100000@epic9.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6553

Matthew,

The problem that I have with this script is that my SIN_ACK
gets to the peer bit peer's ACK is lost.

My first attempt to solve this was not accepting data from
the peer and keep sending SYN_ACK hoping for an ACK.
The peer was not cooperating and keep trying to send its
data to me which I consistently rejected.  After 4 retransmissions
of SYN_ACK, I finally get desired ACK and now ready to accept
packets.  However, by this time the peer sent me data 6 times
already and the peer timed out causing script failure.

I then decided to follow RFC and to buffer data and keep sending
ACKs to the server for the data.  In the meanwhile, I would time
out for my original SYN_ACK and keep sending it.  However, since
I already received some data from the server the th_ack field
was not the same as when I sent the packet the first time.
This causes the test script to indicate that I send SYN-ACK
without ever getting a matching SYN.

I've got two more options to consider

a). Assume that ACK was lost and simply proceed into
ESTABLISHED state.  This however violates RFC since 3-way
handshake was never properly established.

b). Fix my 2nd solution by accepting data but during
retransmission send original ACK received from the peer.

What is it that you expect in the script for this case.


On Sat, 28 Feb 2004, Boris Senderzon wrote:

> Under grading guidlines, test 2.G for milestone 2 states that
>
> Failure to send a SYN_ACK after SYN .
>
> I takt this to mean that my program did not send SYN/ACK in
> response to SYN from active side.  If my understanding is
> correct, then what does this output from test 2.G mean
>
> SYN-ACK with sequence number 159 without matching SYN.
>
> Does it state that I sent SYN/ACK without ever receiving a SYN?
>
> BTW, how come test script does not provide any program output
> for this test run?
>
> Thanks.
>
>

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3, Q4(g)
Date: Sun, 29 Feb 2004 10:58:23 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.GSO.4.44.0402291055540.29141-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 1078081106 586 171.64.15.118 (29 Feb 2004 18:58:26 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6554


What does it mean by "sent at the same frequency as they were in the
previous window"?  What is the previous window? What variable can we use
for the expression?

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3 1a
Date: Sun, 29 Feb 2004 11:16:17 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0402291114400.7286-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 1078082178 1737 171.64.15.100 (29 Feb 2004 19:16:18 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6555


Does the question mean that 11000 bits are transmitted by EACH flow in
10 seconds...or that total for ALL N flows, there is 11000 bits in
10 seconds

--vishal

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS3, Q4(g)
Date: Sun, 29 Feb 2004 11:22:20 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0402291121530.29470-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0402291055540.29141-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 1078082544 2192 171.64.15.118 (29 Feb 2004 19:22:24 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402291055540.29141-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6556

Never mind the question.  I think I figured it out.

On Sun, 29 Feb 2004, Xiaohua Fang wrote:

>
> What does it mean by "sent at the same frequency as they were in the
> previous window"?  What is the previous window? What variable can we use
> for the expression?
>
>

.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3, Q4, parts a and b.
Date: Sun, 29 Feb 2004 11:27:18 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.GSO.4.44.0402291120570.928-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 1078082839 2486 171.64.15.42 (29 Feb 2004 19:27:19 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6557

I've had trouble understanding what the questions ask.

Does "how long it is" refers to size of the buffer or does
it refer to how much time passes from when next packet
starts to be transmitted on link b?

If it's the size of the buffer
that is asked, then why aksing about length from start of one
packet to the start of next.  That's just the lenght of one fixed
size packet.

Thanks.

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Handout 7, Page 14
Date: Sun, 29 Feb 2004 12:21:53 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.GSO.4.44.0402291219350.578-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 1078086115 5748 171.64.15.118 (29 Feb 2004 20:21:55 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6558


Why does the buffer occupancy drops to 0 as soon as the window size drop
by half?  I thought that it takes time for the windown to drain.  How can
it be so fast?

.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Question about test 2.M in grading script for hw #3b (Go-back-N)
Date: Sun, 29 Feb 2004 12:28:08 -0800
Organization: CS Masters Program
Lines: 189
Distribution: su
Message-ID: <c1ti0o$5tr$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078086489 6075 127.0.0.1 (29 Feb 2004 20:28: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:6559

I'm failing test 2.M (Go-Back-N), and I'm trying to understand if the
problem is in my implementation, or in the test itself.

The failure I get is:
   Results:  NOT OK

   Go-back N not enforced (retransmitted only up until 3219 rather than
3777)

When I look at the server output trace, it appears what happened is that the
packet ending in byte #3218 times out first, so I resend the 5 packets
containing bytes 705 - 3218. Then, about 30 ms later, the packet ending in
byte #3776 times out, so I resend the 6 packets with bytes 705 - 3776. As
far as I can tell, this is correct behavior.

Is the test failing because the first retransmission only sends bytes
705-3218, even though packet 3219-3776 has already been sent? If this is the
case, isn't this a problem with the test, because the test doesn't know the
sender's timeout value? I do resend the whole she-bang 30 ms later when
packet 3219-3776 times out. Does the test not detect this?

Or, is there something wrong with my implementation?

Is anyone else getting a similar problem?

I've attached the .server.output log for reference.

Thanks,

Greg



begin 666 server.output
M;&]G.B!N971W;W)K7W)E8W8Z(&$@4UE.('!A8VME="!W:71H('-E<3TQ-#8-
M"FQO9SH@;F5T=V]R:U]S96YD.B!A(%-93BU!0TL@<&%C:V5T('=I=&@@<V5Q
M/3$T-B!A;F0@86-K/3$T-R!A;F0@=&EM97-T86UP/30R-C U-C@-"FQO9SH@
M;F5T=V]R:U]R96-V.B!A;B!!0TL@<&%C:V5T('=I=&@@<V5Q/3$T-RP@;&5N
M/3 @86YD(&%C:STQ-#<@86YD('1I;65S=&%M<#TT,C8P-C8T#0IL;V<Z(&YE
M='=O<FM?<F5C=CH@86X@04-+('!A8VME="!W:71H('-E<3TQ-#<L(&QE;CTQ
M,B!A;F0@86-K/3$T-R!A;F0@=&EM97-T86UP/30R-C V-C4-"D=214<Z('!R
M;V-E<W-?;F5T=V]R:U]D871A(&9O<B!S97$@(R=S(#$T-R M(#$U. T*1U)%
M1SH@;F\@<&%C:V5T<R!T;R!C;VYS;VQI9&%T90T*;&]G.B!N971W;W)K7W-E
M;F0Z(&%N($%#2R!P86-K970@=VET:"!S97$],30W+"!L96X],"!A;F0@86-K
M/3$U.2!A;F0@=&EM97-T86UP/30R-C V-C4-"D=214<Z(%-E;F1I;F<@9&%T
M82!W:71H('-E<2 C)W,@,30W("T@,34X('1O(&%P< T*;&]G.B!N971W;W)K
M7W-E;F0Z(&%N($%#2R!P86-K970@=VET:"!S97$],30W+"!L96X],C(@86YD
M(&%C:STQ-3D@86YD('1I;65S=&%M<#TT,C8P-C<Q#0IL;V<Z(&YE='=O<FM?
M<V5N9#H@86X@04-+('!A8VME="!W:71H('-E<3TQ-CDL(&QE;CTU,S8@86YD
M(&%C:STQ-3D@86YD('1I;65S=&%M<#TT,C8P-C<R#0IL;V<Z(&YE='=O<FM?
M<V5N9#H@86X@04-+('!A8VME="!W:71H('-E<3TW,#4L(&QE;CTU,S8@86YD
M(&%C:STQ-3D@86YD('1I;65S=&%M<#TT,C8P-C<S#0IL;V<Z(&YE='=O<FM?
M<V5N9#H@86X@04-+('!A8VME="!W:71H('-E<3TQ,C0Q+"!L96X]-3,V(&%N
M9"!A8VL],34Y(&%N9"!T:6UE<W1A;7 ]-#(V,#8W,PT*;&]G.B!N971W;W)K
M7W-E;F0Z(&%N($%#2R!P86-K970@=VET:"!S97$],3<W-RP@;&5N/34S-B!A
M;F0@86-K/3$U.2!A;F0@=&EM97-T86UP/30R-C V-S,-"FQO9SH@;F5T=V]R
M:U]S96YD.B!A;B!!0TL@<&%C:V5T('=I=&@@<V5Q/3(S,3,L(&QE;CTU,S8@
M86YD(&%C:STQ-3D@86YD('1I;65S=&%M<#TT,C8P-C<T#0IL;V<Z(&YE='=O
M<FM?<V5N9#H@86X@04-+('!A8VME="!W:71H('-E<3TR.#0Y+"!L96X],S<P
M(&%N9"!A8VL],34Y(&%N9"!T:6UE<W1A;7 ]-#(V,#8W- T*;&]G.B!N971W
M;W)K7W)E8W8Z(&%N($%#2R!P86-K970@=VET:"!S97$],30W+"!L96X],3(@
M86YD(&%C:STQ-#<@86YD('1I;65S=&%M<#TT,C8P-CDU#0I'4D5'.B!P<F]C
M97-S7VYE='=O<FM?9&%T82!F;W(@<V5Q(",G<R Q-#<@+2 Q-3@-"D=214<Z
M(%)E8V5I=F5D('!A8VME="!W:71H('-E<2 C,30W(#T@(S$U.#L@;F5X="!E
M>'!E8W1E9"!I<R C,34Y+B!$:7-C87)D:6YG(&)U="!A8VMI;F<N#0IL;V<Z
M(&YE='=O<FM?<V5N9#H@86X@04-+('!A8VME="!W:71H('-E<3TS,C$Y+"!L
M96X],"!A;F0@86-K/3$U.2!A;F0@=&EM97-T86UP/30R-C V.34-"FQO9SH@
M;F5T=V]R:U]R96-V.B!A;B!!0TL@<&%C:V5T('=I=&@@<V5Q/3$U.2P@;&5N
M/3 @86YD(&%C:STQ-CD@86YD('1I;65S=&%M<#TT,C8P-CDV#0IL;V<Z(&YE
M='=O<FM?<V5N9#H@86X@04-+('!A8VME="!W:71H('-E<3TS,C$Y+"!L96X]
M,C(@86YD(&%C:STQ-3D@86YD('1I;65S=&%M<#TT,C8P-CDY#0IL;V<Z(&YE
M='=O<FM?<F5C=CH@86X@04-+('!A8VME="!W:71H('-E<3TQ-3DL(&QE;CTP
M(&%N9"!A8VL]-S U(&%N9"!T:6UE<W1A;7 ]-#(V,#8Y.0T*;&]G.B!N971W
M;W)K7W-E;F0Z(&%N($%#2R!P86-K970@=VET:"!S97$],S(T,2P@;&5N/34S
M-B!A;F0@86-K/3$U.2!A;F0@=&EM97-T86UP/30R-C W,# -"D=214<Z(%!A
M8VME="!W:71H('-E<2 C)W,@,C@T.2 M(#,R,3@@:&%S('1I;65D(&]U="X-
M"B @("!'4D5'.B!297-E;F1I;F<@<&%C:V5T('=I=&@@<V5Q("-S(#<P-2 M
M(#$R-# -"FQO9SH@;F5T=V]R:U]S96YD.B!A;B!!0TL@<&%C:V5T('=I=&@@
M<V5Q/3<P-2P@;&5N/34S-B!A;F0@86-K/3$U.2!A;F0@=&EM97-T86UP/30R
M-C W.34-"B @("!'4D5'.B!297-E;F1I;F<@<&%C:V5T('=I=&@@<V5Q("-S
M(#$R-#$@+2 Q-S<V#0IL;V<Z(&YE='=O<FM?<V5N9#H@86X@04-+('!A8VME
M="!W:71H('-E<3TQ,C0Q+"!L96X]-3,V(&%N9"!A8VL],34Y(&%N9"!T:6UE
M<W1A;7 ]-#(V,#<Y-0T*(" @($=214<Z(%)E<V5N9&EN9R!P86-K970@=VET
M:"!S97$@(W,@,3<W-R M(#(S,3(-"FQO9SH@;F5T=V]R:U]S96YD.B!A;B!!
M0TL@<&%C:V5T('=I=&@@<V5Q/3$W-S<L(&QE;CTU,S8@86YD(&%C:STQ-3D@
M86YD('1I;65S=&%M<#TT,C8P-SDU#0H@(" @1U)%1SH@4F5S96YD:6YG('!A
M8VME="!W:71H('-E<2 C<R R,S$S("T@,C@T. T*;&]G.B!N971W;W)K7W-E
M;F0Z(&%N($%#2R!P86-K970@=VET:"!S97$],C,Q,RP@;&5N/34S-B!A;F0@
M86-K/3$U.2!A;F0@=&EM97-T86UP/30R-C W.38-"B @("!'4D5'.B!297-E
M;F1I;F<@<&%C:V5T('=I=&@@<V5Q("-S(#(X-#D@+2 S,C$X#0IL;V<Z(&YE
M='=O<FM?<V5N9#H@86X@04-+('!A8VME="!W:71H('-E<3TR.#0Y+"!L96X]
M,S<P(&%N9"!A8VL],34Y(&%N9"!T:6UE<W1A;7 ]-#(V,#<Y-@T*1U)%1SH@
M4&%C:V5T('=I=&@@<V5Q(",G<R S,C0Q("T@,S<W-B!H87,@=&EM960@;W5T
M+@T*(" @($=214<Z(%)E<V5N9&EN9R!P86-K970@=VET:"!S97$@(W,@-S U
M("T@,3(T, T*;&]G.B!N971W;W)K7W-E;F0Z(&%N($%#2R!P86-K970@=VET
M:"!S97$]-S U+"!L96X]-3,V(&%N9"!A8VL],34Y(&%N9"!T:6UE<W1A;7 ]
M-#(V,#@R-0T*(" @($=214<Z(%)E<V5N9&EN9R!P86-K970@=VET:"!S97$@
M(W,@,3(T,2 M(#$W-S8-"FQO9SH@;F5T=V]R:U]S96YD.B!A;B!!0TL@<&%C
M:V5T('=I=&@@<V5Q/3$R-#$L(&QE;CTU,S8@86YD(&%C:STQ-3D@86YD('1I
M;65S=&%M<#TT,C8P.#(U#0H@(" @1U)%1SH@4F5S96YD:6YG('!A8VME="!W
M:71H('-E<2 C<R Q-S<W("T@,C,Q,@T*;&]G.B!N971W;W)K7W-E;F0Z(&%N
M($%#2R!P86-K970@=VET:"!S97$],3<W-RP@;&5N/34S-B!A;F0@86-K/3$U
M.2!A;F0@=&EM97-T86UP/30R-C X,C4-"B @("!'4D5'.B!297-E;F1I;F<@
M<&%C:V5T('=I=&@@<V5Q("-S(#(S,3,@+2 R.#0X#0IL;V<Z(&YE='=O<FM?
M<V5N9#H@86X@04-+('!A8VME="!W:71H('-E<3TR,S$S+"!L96X]-3,V(&%N
M9"!A8VL],34Y(&%N9"!T:6UE<W1A;7 ]-#(V,#@R-@T*(" @($=214<Z(%)E
M<V5N9&EN9R!P86-K970@=VET:"!S97$@(W,@,C@T.2 M(#,R,3@-"FQO9SH@
M;F5T=V]R:U]S96YD.B!A;B!!0TL@<&%C:V5T('=I=&@@<V5Q/3(X-#DL(&QE
M;CTS-S @86YD(&%C:STQ-3D@86YD('1I;65S=&%M<#TT,C8P.#(V#0H@(" @
M1U)%1SH@4F5S96YD:6YG('!A8VME="!W:71H('-E<2 C<R S,C$Y("T@,S(T
M, T*;&]G.B!N971W;W)K7W-E;F0Z(&%N($%#2R!P86-K970@=VET:"!S97$]
M,S(Q.2P@;&5N/3(R(&%N9"!A8VL],34Y(&%N9"!T:6UE<W1A;7 ]-#(V,#@R
M-PT*(" @($=214<Z(%)E<V5N9&EN9R!P86-K970@=VET:"!S97$@(W,@,S(T
M,2 M(#,W-S8-"FQO9SH@;F5T=V]R:U]S96YD.B!A;B!!0TL@<&%C:V5T('=I
M=&@@<V5Q/3,R-#$L(&QE;CTU,S8@86YD(&%C:STQ-3D@86YD('1I;65S=&%M
M<#TT,C8P.#(W#0I'4D5'.B!086-K970@=VET:"!S97$@(R=S(#,R-#$@+2 S
M-S<V(&AA<R!T:6UE9"!O=70N#0H@(" @1U)%1SH@4F5S96YD:6YG('!A8VME
M="!W:71H('-E<2 C<R W,#4@+2 Q,C0P#0IL;V<Z(&YE='=O<FM?<V5N9#H@
M86X@04-+('!A8VME="!W:71H('-E<3TW,#4L(&QE;CTU,S8@86YD(&%C:STQ
M-3D@86YD('1I;65S=&%M<#TT,C8P.30T#0H@(" @1U)%1SH@4F5S96YD:6YG
M('!A8VME="!W:71H('-E<2 C<R Q,C0Q("T@,3<W-@T*;&]G.B!N971W;W)K
M7W-E;F0Z(&%N($%#2R!P86-K970@=VET:"!S97$],3(T,2P@;&5N/34S-B!A
M;F0@86-K/3$U.2!A;F0@=&EM97-T86UP/30R-C Y-#4-"B @("!'4D5'.B!2
M97-E;F1I;F<@<&%C:V5T('=I=&@@<V5Q("-S(#$W-S<@+2 R,S$R#0IL;V<Z
M(&YE='=O<FM?<V5N9#H@86X@04-+('!A8VME="!W:71H('-E<3TQ-S<W+"!L
M96X]-3,V(&%N9"!A8VL],34Y(&%N9"!T:6UE<W1A;7 ]-#(V,#DT-0T*(" @
M($=214<Z(%)E<V5N9&EN9R!P86-K970@=VET:"!S97$@(W,@,C,Q,R M(#(X
M-#@-"FQO9SH@;F5T=V]R:U]S96YD.B!A;B!!0TL@<&%C:V5T('=I=&@@<V5Q
M/3(S,3,L(&QE;CTU,S8@86YD(&%C:STQ-3D@86YD('1I;65S=&%M<#TT,C8P
M.30U#0H@(" @1U)%1SH@4F5S96YD:6YG('!A8VME="!W:71H('-E<2 C<R R
M.#0Y("T@,S(Q. T*;&]G.B!N971W;W)K7W-E;F0Z(&%N($%#2R!P86-K970@
M=VET:"!S97$],C@T.2P@;&5N/3,W,"!A;F0@86-K/3$U.2!A;F0@=&EM97-T
M86UP/30R-C Y-#8-"B @("!'4D5'.B!297-E;F1I;F<@<&%C:V5T('=I=&@@
M<V5Q("-S(#,R,3D@+2 S,C0P#0IL;V<Z(&YE='=O<FM?<V5N9#H@86X@04-+
M('!A8VME="!W:71H('-E<3TS,C$Y+"!L96X],C(@86YD(&%C:STQ-3D@86YD
M('1I;65S=&%M<#TT,C8P.30V#0H@(" @1U)%1SH@4F5S96YD:6YG('!A8VME
M="!W:71H('-E<2 C<R S,C0Q("T@,S<W-@T*;&]G.B!N971W;W)K7W-E;F0Z
M(&%N($%#2R!P86-K970@=VET:"!S97$],S(T,2P@;&5N/34S-B!A;F0@86-K
M/3$U.2!A;F0@=&EM97-T86UP/30R-C Y-#8-"D=214<Z(%!A8VME="!W:71H
M('-E<2 C)W,@,S(T,2 M(#,W-S8@:&%S('1I;65D(&]U="X-"B @("!'4D5'
M.B!297-E;F1I;F<@<&%C:V5T('=I=&@@<V5Q("-S(#<P-2 M(#$R-# -"FQO
M9SH@;F5T=V]R:U]S96YD.B!A;B!!0TL@<&%C:V5T('=I=&@@<V5Q/3<P-2P@
M;&5N/34S-B!A;F0@86-K/3$U.2!A;F0@=&EM97-T86UP/30R-C$P-C0-"B @
M("!'4D5'.B!297-E;F1I;F<@<&%C:V5T('=I=&@@<V5Q("-S(#$R-#$@+2 Q
M-S<V#0IL;V<Z(&YE='=O<FM?<V5N9#H@86X@04-+('!A8VME="!W:71H('-E
M<3TQ,C0Q+"!L96X]-3,V(&%N9"!A8VL],34Y(&%N9"!T:6UE<W1A;7 ]-#(V
M,3 V-0T*(" @($=214<Z(%)E<V5N9&EN9R!P86-K970@=VET:"!S97$@(W,@
M,3<W-R M(#(S,3(-"FQO9SH@;F5T=V]R:U]S96YD.B!A;B!!0TL@<&%C:V5T
M('=I=&@@<V5Q/3$W-S<L(&QE;CTU,S8@86YD(&%C:STQ-3D@86YD('1I;65S
M=&%M<#TT,C8Q,#8U#0H@(" @1U)%1SH@4F5S96YD:6YG('!A8VME="!W:71H
M('-E<2 C<R R,S$S("T@,C@T. T*;&]G.B!N971W;W)K7W-E;F0Z(&%N($%#
M2R!P86-K970@=VET:"!S97$],C,Q,RP@;&5N/34S-B!A;F0@86-K/3$U.2!A
M;F0@=&EM97-T86UP/30R-C$P-C8-"B @("!'4D5'.B!297-E;F1I;F<@<&%C
M:V5T('=I=&@@<V5Q("-S(#(X-#D@+2 S,C$X#0IL;V<Z(&YE='=O<FM?<V5N
M9#H@86X@04-+('!A8VME="!W:71H('-E<3TR.#0Y+"!L96X],S<P(&%N9"!A
M8VL],34Y(&%N9"!T:6UE<W1A;7 ]-#(V,3 V-@T*(" @($=214<Z(%)E<V5N
M9&EN9R!P86-K970@=VET:"!S97$@(W,@,S(Q.2 M(#,R-# -"FQO9SH@;F5T
M=V]R:U]S96YD.B!A;B!!0TL@<&%C:V5T('=I=&@@<V5Q/3,R,3DL(&QE;CTR
M,B!A;F0@86-K/3$U.2!A;F0@=&EM97-T86UP/30R-C$P-C8-"B @("!'4D5'
M.B!297-E;F1I;F<@<&%C:V5T('=I=&@@<V5Q("-S(#,R-#$@+2 S-S<V#0IL
M;V<Z(&YE='=O<FM?<V5N9#H@86X@04-+('!A8VME="!W:71H('-E<3TS,C0Q
M+"!L96X]-3,V(&%N9"!A8VL],34Y(&%N9"!T:6UE<W1A;7 ]-#(V,3 V-@T*
M1U)%1SH@4&%C:V5T('=I=&@@<V5Q(",G<R S,C0Q("T@,S<W-B!H87,@=&EM
M960@;W5T+@T*(" @($=214<Z(%)E<V5N9&EN9R!P86-K970@=VET:"!S97$@
M(W,@-S U("T@,3(T, T*;&]G.B!N971W;W)K7W-E;F0Z(&%N($%#2R!P86-K
M970@=VET:"!S97$]-S U+"!L96X]-3,V(&%N9"!A8VL],34Y(&%N9"!T:6UE
M<W1A;7 ]-#(V,3$X- T*(" @($=214<Z(%)E<V5N9&EN9R!P86-K970@=VET
M:"!S97$@(W,@,3(T,2 M(#$W-S8-"FQO9SH@;F5T=V]R:U]S96YD.B!A;B!!
M0TL@<&%C:V5T('=I=&@@<V5Q/3$R-#$L(&QE;CTU,S8@86YD(&%C:STQ-3D@
M86YD('1I;65S=&%M<#TT,C8Q,3@U#0H@(" @1U)%1SH@4F5S96YD:6YG('!A
M8VME="!W:71H('-E<2 C<R Q-S<W("T@,C,Q,@T*;&]G.B!N971W;W)K7W-E
M;F0Z(&%N($%#2R!P86-K970@=VET:"!S97$],3<W-RP@;&5N/34S-B!A;F0@
M86-K/3$U.2!A;F0@=&EM97-T86UP/30R-C$Q.#4-"B @("!'4D5'.B!297-E
M;F1I;F<@<&%C:V5T('=I=&@@<V5Q("-S(#(S,3,@+2 R.#0X#0IL;V<Z(&YE
M='=O<FM?<V5N9#H@86X@04-+('!A8VME="!W:71H('-E<3TR,S$S+"!L96X]
M-3,V(&%N9"!A8VL],34Y(&%N9"!T:6UE<W1A;7 ]-#(V,3$X-0T*(" @($=2
M14<Z(%)E<V5N9&EN9R!P86-K970@=VET:"!S97$@(W,@,C@T.2 M(#,R,3@-
M"FQO9SH@;F5T=V]R:U]S96YD.B!A;B!!0TL@<&%C:V5T('=I=&@@<V5Q/3(X
M-#DL(&QE;CTS-S @86YD(&%C:STQ-3D@86YD('1I;65S=&%M<#TT,C8Q,3@V
M#0H@(" @1U)%1SH@4F5S96YD:6YG('!A8VME="!W:71H('-E<2 C<R S,C$Y
M("T@,S(T, T*;&]G.B!N971W;W)K7W-E;F0Z(&%N($%#2R!P86-K970@=VET
M:"!S97$],S(Q.2P@;&5N/3(R(&%N9"!A8VL],34Y(&%N9"!T:6UE<W1A;7 ]
M-#(V,3$X-@T*(" @($=214<Z(%)E<V5N9&EN9R!P86-K970@=VET:"!S97$@
M(W,@,S(T,2 M(#,W-S8-"FQO9SH@;F5T=V]R:U]S96YD.B!A;B!!0TL@<&%C
M:V5T('=I=&@@<V5Q/3,R-#$L(&QE;CTU,S8@86YD(&%C:STQ-3D@86YD('1I
1;65S=&%M<#TT,C8Q,3@V#0H`
`
end

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3, Q4(d) and Q4(e)
Date: Sun, 29 Feb 2004 12:31:27 -0800
Lines: 4
Distribution: su
Message-ID: <Pine.GSO.4.44.0402291230160.982-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 1078086689 6320 171.64.15.118 (29 Feb 2004 20:31:29 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6560


Does the "outstanding packets in the network" include both the data on the
link and the data in the buffer?

.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question about test 2.M in grading script for hw #3b (Go-back-N)
Date: Sun, 29 Feb 2004 12:37:05 -0800
Organization: CS Masters Program
Lines: 56
Distribution: su
Message-ID: <c1tihk$6hk$1@news.Stanford.EDU>
References: <c1ti0o$5tr$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078087028 6708 127.0.0.1 (29 Feb 2004 20:37: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:6561

A bit more information that might (or might not) be useful:

The amount of time I tell stcp_wait_for_event() to wait is a fraction of the
packet timeout value. For example, if the packet timeout is 100 ms, I tell
stcp_wait_for_event() to wake up in 25 ms. I do this because other
previously sent packets might be almost at their time-out, so I  don't want
to wait the full 100 ms to detect this.

I'm wondering if the test assumes the sender tells stcp_wait_for_event() to
wait for the duration of a full timeout. I haven't yet tried running a test
with this configuration.

Thanks,
Greg

"Greg Friedman" <gregory.friedman@cs.stanford.edu> wrote in message
news:c1ti0o$5tr$1@news.Stanford.EDU...
> I'm failing test 2.M (Go-Back-N), and I'm trying to understand if the
> problem is in my implementation, or in the test itself.
>
> The failure I get is:
>    Results:  NOT OK
>
>    Go-back N not enforced (retransmitted only up until 3219 rather than
> 3777)
>
> When I look at the server output trace, it appears what happened is that
the
> packet ending in byte #3218 times out first, so I resend the 5 packets
> containing bytes 705 - 3218. Then, about 30 ms later, the packet ending in
> byte #3776 times out, so I resend the 6 packets with bytes 705 - 3776. As
> far as I can tell, this is correct behavior.
>
> Is the test failing because the first retransmission only sends bytes
> 705-3218, even though packet 3219-3776 has already been sent? If this is
the
> case, isn't this a problem with the test, because the test doesn't know
the
> sender's timeout value? I do resend the whole she-bang 30 ms later when
> packet 3219-3776 times out. Does the test not detect this?
>
> Or, is there something wrong with my implementation?
>
> Is anyone else getting a similar problem?
>
> I've attached the .server.output log for reference.
>
> Thanks,
>
> Greg
>
>
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: milstone C tests - timeout expired during grading
Date: Sun, 29 Feb 2004 12:46:35 -0800
Lines: 31
Distribution: su
Message-ID: <c1tj3c$767$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1078087596 7367 128.12.173.169 (29 Feb 2004 20:46:36 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:6562


Hi,

I am getting NOT OKs for 6 tests(C,D,L.1,L.2,L.3,L.4) of the grading script
for milestone C with the message "***Timeout expired during grading"
following. I am using my ftpcopy.c.  I passed all tests in milestone B and
my ftpcopy.c also passed everything during the first programming assignment.
So I am kind of at a loss to where start debugging to find my errors.
Specifically, for test L.1 I get the following resut

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:

But when I myself run ftpcopy with ftpd_tcp as the server, I am able to
transfer 0 byte files correctly, when running the underlying stcp in
unreliable mode (providing -U option to ftpcopy). So I am confused as to
what is causing the problem in the testing script then.

Any help would be greatly appreciated.

Thanks

Kumar


.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS3, Q4(d) and Q4(e) (more question)
Date: Sun, 29 Feb 2004 12:47:20 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0402291236190.1034-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0402291230160.982-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 1078087642 7396 171.64.15.118 (29 Feb 2004 20:47:22 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402291230160.982-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6563


Is it a good assumption that for both Q4(d) and Q4(e), the window-based
congestion control is in place on the source?
On Sun, 29 Feb 2004, Xiaohua Fang wrote:

>
> Does the "outstanding packets in the network" include both the data on the
> link and the data in the buffer?
>
>

.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3, prob 3b.
Date: Sun, 29 Feb 2004 13:03:20 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0402291301490.1529-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 1078088601 8325 171.64.15.42 (29 Feb 2004 21:03:21 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6564

Does minimum propagation delay between adjacent nodes mean that
somewhere in the network exists two nodes and propagation delay
between them is PROP(min)?  For all other adjacent nodes, propagation
delay is >= PROP(min).  Is this correct?

Thanks.

.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: milstone C tests - timeout expired during grading
Date: Sun, 29 Feb 2004 13:13:10 -0800
Lines: 55
Distribution: su
Message-ID: <c1tkl7$8na$1@news.Stanford.EDU>
References: <c1tj3c$767$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1078089191 8938 128.12.173.169 (29 Feb 2004 21:13: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:6565

So I ran the provided ftpcopy binaries along with my transport.c and I ended
up passing all tests for milestone C. So I am even more confused now. From
this I can conclude to a safe measure that my transport.c works fine(can
I?), so the bug must be with ftpcopy.c. I thought my ftpcopy.c worked
absolutely fine judging from the results of my first programming assignment.
And I have looked over my modified ftpcopy.c and the only changes I have
made is to substitute the socket, read, write, connect, etc calls with
mysocket, myread, mywrite, etc. Other than that, it is exactly the same as
my original one. So it is very weird that I am failing the 8 milestone C
test cases with my ftpcopy.c but not with the provided binaries.

Again, any pointer to the right direction as to where and how to find the
bug would be really great.

Thanks a lot

Kumar

"Murali Kumar" <kumarm@stanford.edu> wrote in message
news:c1tj3c$767$1@news.Stanford.EDU...
>
> Hi,
>
> I am getting NOT OKs for 6 tests(C,D,L.1,L.2,L.3,L.4) of the grading
script
> for milestone C with the message "***Timeout expired during grading"
> following. I am using my ftpcopy.c.  I passed all tests in milestone B and
> my ftpcopy.c also passed everything during the first programming
assignment.
> So I am kind of at a loss to where start debugging to find my errors.
> Specifically, for test L.1 I get the following resut
>
> 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:
>
> But when I myself run ftpcopy with ftpd_tcp as the server, I am able to
> transfer 0 byte files correctly, when running the underlying stcp in
> unreliable mode (providing -U option to ftpcopy). So I am confused as to
> what is causing the problem in the testing script then.
>
> Any help would be greatly appreciated.
>
> Thanks
>
> Kumar
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: testclient
Date: Sun, 29 Feb 2004 13:33:26 -0800
Lines: 22
Distribution: su
Message-ID: <c1tlqi$9tf$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1078090386 10159 128.12.189.163 (29 Feb 2004 21:33: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:6566

Hi,
I get this when I run the test script
Test 2.D [out of 2.5]
Checks that receiver buffers data in receiver window.

Results:  NOT OK

Unexpected exit status 11.  Program output:
***************************************
I was tryin to manually check my server with the testclient.I discovered
that both the server and client change states correctly but then loop in the
control loop as they never get data from the application ie APP_DATA never
occurs.I do unblock my application correctly.
why should I never get app_data?
I do not believe this is a mistake of the transport layer then ?What do we
do if such a thing happens?
But if I test with my own client and server, I do seem to get APP_DATA.
Does the testclient do something different?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!not-for-mail
From: "Lei Zhang" <lei.zhang@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test 2.H
Date: Sun, 29 Feb 2004 13:59:58 -0800
Lines: 52
Distribution: su
Message-ID: <c1tnd3$bjn$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078092004 11895 127.0.0.1 (29 Feb 2004 22:00: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:6567

My test 2.H failed with following message:

Results:  NOT OK

No FIN sent!

I manually run the tests as following (and supposed this was what the test
script had done):
server:
/afs/ir.stanford.edu/users/l/e/lezhang/courses/cs244a/hw3/grading_src/build/
../server.log -U
client:
/afs/ir.stanford.edu/users/l/e/lezhang/courses/cs244a/hw3/grading_src/build/
../client.log -U -f TESTDATA.0 elaine33:39892

File retrieved is identical to TESTDATA.0, and here is the last portion of
the log:

server:
log: network_recv: an ACK packet with seq=144, len=0 and ack=110384 and
timestamp=54508948
log: network_recv: a FIN packet with seq=144, len=0 and timestamp=54509657
log: network_send: an ACK packet with seq=110384, len=0 and ack=145 and
timestamp=54509658
log: network_send: a FIN packet with seq=110384, len=0 and
timestamp=54509659
log: network_recv: an ACK packet with seq=145, len=0 and ack=110385 and
timestamp=54509857

client:
log: network_recv: a DATA packet with seq=110370, len=14 and
timestamp=54508770
log: network_send: an ACK packet with seq=144, len=0 and ack=110384 and
timestamp=54508770
log: network_send: a FIN packet with seq=144, len=0 and timestamp=54509566
log: network_recv: an ACK packet with seq=110384, len=0 and ack=145 and
timestamp=54509758
log: network_recv: a FIN packet with seq=110384, len=0 and
timestamp=54509758
log: network_send: an ACK packet with seq=145, len=0 and ack=110385 and
timestamp=54509759

The log looks alright to me. And I guess the test script greps the log for
FIN, etc.

Does the above result suggest my code is working right, so that I can assume
it was some enironment glitches  that disturbed the test script?

Thanks,
Lei


.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS1c - Queue departure
Date: Sun, 29 Feb 2004 14:10:59 -0800
Lines: 12
Distribution: su
Message-ID: <c1to1q$561$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078092666 5313 127.0.0.1 (29 Feb 2004 22:11:06 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (X11/20040209)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6568

Hi, I have a general question about the size of the queue when the 
packet is being transmitted in packetized WFQ.  When a queue's turn 
comes around to transmit a packet, when does the queue shrink?  Do we 
start shrinking it continuously as each bit of the packet gets sent out, 
or do we wait for the whole packet to be transmitted and then we just 
shrink the queue by the size of that packet?
My understanding is the former, once a queue gets its turn to transmit, 
it continuously depletes the bits of the packet from the queue until the 
packet has been transmitted.  Is this correct?

Thanks,
William
.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question about test 2.M in grading script for hw #3b (Go-back-N)
Date: Sun, 29 Feb 2004 14:41:46 -0800
Organization: CS Masters Program
Lines: 75
Distribution: su
Message-ID: <c1tpre$ear$1@news.Stanford.EDU>
References: <c1ti0o$5tr$1@news.Stanford.EDU> <c1tihk$6hk$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078094512 14683 127.0.0.1 (29 Feb 2004 22:41: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:6569

Update: I ran the grading script with the stcp_wait_for_event() wait time
equal to the packet timeout value, and the test passed.

So, to students who don't understand why they're failing test 2.M: If the
amount of time you tell stcp_wait_for_event() to wait is less than your
packet timeout value, try setting these two values to be the same.

Greg

"Greg Friedman" <gregory.friedman@cs.stanford.edu> wrote in message
news:c1tihk$6hk$1@news.Stanford.EDU...
> A bit more information that might (or might not) be useful:
>
> The amount of time I tell stcp_wait_for_event() to wait is a fraction of
the
> packet timeout value. For example, if the packet timeout is 100 ms, I tell
> stcp_wait_for_event() to wake up in 25 ms. I do this because other
> previously sent packets might be almost at their time-out, so I  don't
want
> to wait the full 100 ms to detect this.
>
> I'm wondering if the test assumes the sender tells stcp_wait_for_event()
to
> wait for the duration of a full timeout. I haven't yet tried running a
test
> with this configuration.
>
> Thanks,
> Greg
>
> "Greg Friedman" <gregory.friedman@cs.stanford.edu> wrote in message
> news:c1ti0o$5tr$1@news.Stanford.EDU...
> > I'm failing test 2.M (Go-Back-N), and I'm trying to understand if the
> > problem is in my implementation, or in the test itself.
> >
> > The failure I get is:
> >    Results:  NOT OK
> >
> >    Go-back N not enforced (retransmitted only up until 3219 rather than
> > 3777)
> >
> > When I look at the server output trace, it appears what happened is that
> the
> > packet ending in byte #3218 times out first, so I resend the 5 packets
> > containing bytes 705 - 3218. Then, about 30 ms later, the packet ending
in
> > byte #3776 times out, so I resend the 6 packets with bytes 705 - 3776.
As
> > far as I can tell, this is correct behavior.
> >
> > Is the test failing because the first retransmission only sends bytes
> > 705-3218, even though packet 3219-3776 has already been sent? If this is
> the
> > case, isn't this a problem with the test, because the test doesn't know
> the
> > sender's timeout value? I do resend the whole she-bang 30 ms later when
> > packet 3219-3776 times out. Does the test not detect this?
> >
> > Or, is there something wrong with my implementation?
> >
> > Is anyone else getting a similar problem?
> >
> > I've attached the .server.output log for reference.
> >
> > Thanks,
> >
> > Greg
> >
> >
> >
> >
>
>


.

Path: shelby.stanford.edu!elaine33.Stanford.EDU!kayvonf
From: Kayvon Fatahalian <kayvonf@elaine17.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Warning: unable to close filehandle KID_TO_READ properly.
Date: Sun, 29 Feb 2004 15:23:50 -0800
Lines: 9
Sender: kayvonf@elaine33.Stanford.EDU
Distribution: su
Message-ID: <Pine.GSO.4.44.0402252055170.8240-100000@elaine17.Stanford.EDU>
References: <Pine.LNX.4.44.0312301505380.16978-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078097036 17204 171.64.15.108 (29 Feb 2004 23:23:56 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0312301505380.16978-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6570


Pass all tests but see this error in the script output.  What is the
origin of this message?

Warning: unable to close filehandle KID_TO_READ properly.

Thank you,
Kayvon

.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: milstone C tests - timeout expired during grading
Date: Sun, 29 Feb 2004 15:25:29 -0800
Lines: 75
Distribution: su
Message-ID: <c1tsda$grb$1@news.Stanford.EDU>
References: <c1tj3c$767$1@news.Stanford.EDU> <c1tkl7$8na$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 1078097130 17259 128.12.194.74 (29 Feb 2004 23:25:30 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: <c1tkl7$8na$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6571

I'm not sure this will help but, I ran into timeout issues when my my 
programs took too long to run.  It turned out that I was printing 
debugging information, and all this I/O was slowing down my program and 
so several tests timed out.  When I stopped doing all my debugging I/O, 
my code ran a bit faster and I stopped having timeouts from the tests.

My guess is your ftpcopy just needs to transfer files faster and you 
should be ok.

Hope that helps.

Paul E.

Murali Kumar wrote:
> So I ran the provided ftpcopy binaries along with my transport.c and I ended
> up passing all tests for milestone C. So I am even more confused now. From
> this I can conclude to a safe measure that my transport.c works fine(can
> I?), so the bug must be with ftpcopy.c. I thought my ftpcopy.c worked
> absolutely fine judging from the results of my first programming assignment.
> And I have looked over my modified ftpcopy.c and the only changes I have
> made is to substitute the socket, read, write, connect, etc calls with
> mysocket, myread, mywrite, etc. Other than that, it is exactly the same as
> my original one. So it is very weird that I am failing the 8 milestone C
> test cases with my ftpcopy.c but not with the provided binaries.
> 
> Again, any pointer to the right direction as to where and how to find the
> bug would be really great.
> 
> Thanks a lot
> 
> Kumar
> 
> "Murali Kumar" <kumarm@stanford.edu> wrote in message
> news:c1tj3c$767$1@news.Stanford.EDU...
> 
>>Hi,
>>
>>I am getting NOT OKs for 6 tests(C,D,L.1,L.2,L.3,L.4) of the grading
> 
> script
> 
>>for milestone C with the message "***Timeout expired during grading"
>>following. I am using my ftpcopy.c.  I passed all tests in milestone B and
>>my ftpcopy.c also passed everything during the first programming
> 
> assignment.
> 
>>So I am kind of at a loss to where start debugging to find my errors.
>>Specifically, for test L.1 I get the following resut
>>
>>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:
>>
>>But when I myself run ftpcopy with ftpd_tcp as the server, I am able to
>>transfer 0 byte files correctly, when running the underlying stcp in
>>unreliable mode (providing -U option to ftpcopy). So I am confused as to
>>what is causing the problem in the testing script then.
>>
>>Any help would be greatly appreciated.
>>
>>Thanks
>>
>>Kumar
>>
>>
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Throughput
Date: Sun, 29 Feb 2004 23:40:50 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <c1tta2$het$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine11.stanford.edu
X-Trace: news.Stanford.EDU 1078098050 17885 171.64.15.76 (29 Feb 2004 23:40:50 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:6572

Earlier it was stated that transferring TESTDATA.1 with the reference 
implementation took 1 s in reliable mode and 14 s in unreliable.

Is that referring to real time or CPU time?  For real time, I'm getting
about 25 s for reliable and 34 s for unreliable mode, but for CPU time, I 
get 0.03 s for both.  This is on an elaine where another user is taking up 
50 percent of the CPU for Matlab.

On a related note, has anyone been able to get useful information out of 
gprof?  All it tells me is that the polling functions take up nearly 100 
percent of the time.


Tyrone

.

Path: shelby.stanford.edu!not-for-mail
From: "Lei Zhang" <lei.zhang@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test 2.M
Date: Sun, 29 Feb 2004 15:48:06 -0800
Lines: 16
Distribution: su
Message-ID: <c1ttns$i7o$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078098493 18680 127.0.0.1 (29 Feb 2004 23:48: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:6573

I passed this test earlier and it is failing now with following error:

Go-back N not enforced (retransmitted only up until 2298 rather than 3226)

I looked into .network_log.retrans.server.TESTDATA.0, it appears that the
largest sent seq is 2834. How can it retransmit 3226?

I manually run client.retrans to talk to my server. I did retransmit up
until 3906 (and include 3226).

Is this a regress of an earlier post?

Thanks,
Lei


.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3, Q3
Date: Sun, 29 Feb 2004 15:54:00 -0800
Lines: 6
Distribution: su
Message-ID: <Pine.GSO.4.44.0402291551290.5601-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 1078098843 18995 171.64.15.118 (29 Feb 2004 23:54:03 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6574


Is it correct to say "attemps to decrease the minumum packet size, without
expanding the network"?  I thought, in order to decrease the minimum
packet size, we need to make the PROP smaller, hence "shrinking the
network".

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS3, Q3
Date: Sun, 29 Feb 2004 15:57:43 -0800
Lines: 8
Distribution: su
Message-ID: <c1tu9h$561$2@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402291551290.5601-100000@elaine43.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078099058 5313 127.0.0.1 (29 Feb 2004 23:57:38 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (X11/20040209)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0402291551290.5601-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6575

I agree.

Xiaohua Fang wrote:
> Is it correct to say "attemps to decrease the minumum packet size, without
> expanding the network"?  I thought, in order to decrease the minimum
> packet size, we need to make the PROP smaller, hence "shrinking the
> network".
> 
.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: hw3.c - question about using supplied binaries
Date: Sun, 29 Feb 2004 16:08:07 -0800
Lines: 35
Distribution: su
Message-ID: <Pine.GSO.4.44.0402291606180.18647-100000@elaine4.Stanford.EDU>
References: <c1mt68$7lf$1@news.Stanford.EDU> <snnhdxcs2sb.fsf@elaine7.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078099690 19895 171.64.15.69 (1 Mar 2004 00:08:10 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <snnhdxcs2sb.fsf@elaine7.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6576

So does that mean if we use your ftp for part C of hw3, it will neither
affect my hw3 grade and the free quota on hw4?

If i use your ftpcopy object for this project, I can still choose to use a
different free quota on hw4 right?

Thanks

Lin

On 27 Feb 2004, Susan Noreen Shepard wrote:

> Yes and no.  If you implement hw4 using our ftpcopy, then yes, that's your
> free binary.  Alternatively, you could go back and get your ftpcopy to
> work with hw4 and use a different binary for hw4.
>
> Susan
>
> sumeet shendrikar <sumeets@stanford.edu> writes:
>
> > for part c, we are supposed to modify our hw1 solution to get it to work
> > using STCP, but it says alternatively, we could use your object files.
> > does this mean if i can get your ftp client to work on my implementation
> > of (unreliable) STCP, I don't have to modify my hw1 solution?
> > unfortunately i used MSG_PEEK in my implentation and don't want to
> > re-design my original solution (which could take a bit of time).
> >
> > i also understand that for hw4, we're allowed to use only one binary
> > penalty free... i take it if we use your supplied ftp binary for hw3, it
> > counts as the one binary for hw4?
> >
> > thanks,
> > sumeet
>

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test 2.C
Date: Mon, 1 Mar 2004 00:09:48 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <c1tv0c$ji2$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402290302140.3831-100000@elaine2.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1078099788 20034 171.64.15.111 (1 Mar 2004 00:09:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6577


>I have thoroughly examined my client's interaction with the reference
>server and I have determined that I am sending all the correct ACK's,
>buffering all the data, and advertising the correct window. The problem
>that I see is that the reference server sends data in the worst possible
>way and seems to completely ignore my ACK's and advertised window. For
>example, if I'm acking sequence number 3000, and advertising a window of,
>say, 300, the server will continually send me sequence numbers higher than
>3000, in 1 byte increments, including sending sequence numbers that are
>outside the upper bound of my window, then it will start sending data with
>sequence numbers below 3000, so basically I'm just sitting there waiting
>for the server to actually send the correct sequence number, and all this
>waiting  leads me to exceed the 60 second timeout.

Can you mail me your transport.c?

And why would you advertise a window of only 300 bytes?

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test 2.C
Date: Mon, 1 Mar 2004 00:14:47 +0000 (UTC)
Lines: 16
Distribution: su
Message-ID: <c1tv9n$jru$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402290302140.3831-100000@elaine2.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1078100087 20350 171.64.15.111 (1 Mar 2004 00:14:47 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6578


>I have consistently been failing only test 2.C on TESTDATA.0 for a while
>now and I have no idea what I can do to fix it. The error I get from the
>grading script is:

Nevermind, I just saw that you included some output.

You say you accept data beginning with th_seq=7337, but that th_win=784, say.
Since the server has new packets to send from the app, but it can't send
these within your window, it sends only 1 byte (as TCP does)--without
proper flow control, it doesn't know to stop sending.  Presumably seq #7337
hasn't timed out yet, which is why it keeps sending these small packets.

Basically, your advertised window size is wrong, and you should read the
previous posts on the newsgroup about this.

.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: weird stcp in ftpd_tcp
Date: Sun, 29 Feb 2004 16:16:49 -0800
Lines: 32
Distribution: su
Message-ID: <c1tvdh$k12$1@news.Stanford.EDU>
References: <c1rjfc$2k8$1@news.Stanford.EDU> <c1rvom$edb$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 1078100209 20514 128.12.194.74 (1 Mar 2004 00:16:49 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: <c1rvom$edb$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6579

This is weird.  I'm getting the Heisenberg effect in my code--if I just 
add a printf() statement the moment before I send app data over the 
wire, all the programs work all fine and dandy.  This looks suspiciously 
like a multi-threading issue, and am totally lost as to where to start 
debugging. :(.  If anybody has had similar issues, any help would be 
much appreciated.

Paul E.


Matthew Jonathan Holliman wrote:

>>If I do a 'make', I get an stcp ftp daemon running with my stcp 
>>implementation.  I used that to test my ftpcopy and my LIST command just 
>>hangs (I use the active data mode).  When I look at my ftpd_tcp 
>>debugging output, it tells me it opens an active connection, unblocks 
>>the application, but isn't getting any data from the application.
> 
> 
>>My ftpcopy works fine with the reference ftpd_tcp and the hw3c tests 
>>don't seem to mind the aforementioned bug, but just to make sure, will 
>>this thing come back to haunt me in hw4 if I don't fix it?
> 
> 
> I don't know, but in my experience, bugs tend to have a habit of coming
> back to haunt you.  As to whether it will impact HW4?  If your ftpcopy
> works over the simulated network later in HW3, chances are it should work
> over the VNS-based IP layer in HW4.  But there's no guarantee of this, and
> no guarantee that other ftpds will behave like the STCP-speaking ftpd
> provided.
> 

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS3 Q3
Date: Sun, 29 Feb 2004 16:20:10 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.GSO.4.44.0402291617090.6643-100000@elaine43.Stanford.EDU>
References: <c1opse$mfq$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0402280308080.31196-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 1078100412 20715 171.64.15.118 (1 Mar 2004 00:20:12 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0402280308080.31196-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6580


In this problem, are we still assuming that the collsion detection can
only happen when the packet sent by C reaches A?  Is there anything B is
doing for A was not specified in the question?  I really can not figure
out why would a PROPmin help reduce the TRANSP.  I am sure the PROPmin
always exists in an Ethernet network.  Why wasn't this "alternative"
utilized so far?

On Sat, 28 Feb 2004, Shankar Ponnekanti wrote:

>
> On Fri, 27 Feb 2004, Ursula Chen wrote:
>
> > Is this question implying that in this case, unlike CSMA/CD, a transmitting
> > station does *not* have to detect a collision before it completes
> > transmission?  Can the transmitting station perform some sort of calculation
> > to determine that a collision must have occurred?  Or does the collision
> > still have to happen during transmission?
> >
>
> You are thinking along the right lines, please continue your thought
> process :-) I can't elaborate more because that will give away the
> solution.
>
> Shankar
>
>

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: test 2.G
Date: Mon, 1 Mar 2004 00:23:41 +0000 (UTC)
Lines: 39
Distribution: su
Message-ID: <c1tvqd$kbf$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402281317580.9825-100000@epic9.Stanford.EDU> <Pine.GSO.4.44.0402290710090.29415-100000@epic9.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1078100621 20847 171.64.15.111 (1 Mar 2004 00:23:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6581

Boris Senderzon <senderzo@stanford.edu> writes:

>Matthew,

>The problem that I have with this script is that my SIN_ACK
>gets to the peer bit peer's ACK is lost.

>My first attempt to solve this was not accepting data from
>the peer and keep sending SYN_ACK hoping for an ACK.
>The peer was not cooperating and keep trying to send its
>data to me which I consistently rejected.  After 4 retransmissions
>of SYN_ACK, I finally get desired ACK and now ready to accept
>packets.  However, by this time the peer sent me data 6 times
>already and the peer timed out causing script failure.

>I then decided to follow RFC and to buffer data and keep sending
>ACKs to the server for the data.  In the meanwhile, I would time
>out for my original SYN_ACK and keep sending it.  However, since
>I already received some data from the server the th_ack field
>was not the same as when I sent the packet the first time.
>This causes the test script to indicate that I send SYN-ACK
>without ever getting a matching SYN.

>I've got two more options to consider

>a). Assume that ACK was lost and simply proceed into
>ESTABLISHED state.  This however violates RFC since 3-way
>handshake was never properly established.

>b). Fix my 2nd solution by accepting data but during
>retransmission send original ACK received from the peer.

>What is it that you expect in the script for this case.

I see--the 2nd would work around the behaviour you see.  But there seems
something a bit fishy about this whole problem, and such a hack shouldn't
be necessary (needing to retransmit SYN-ACK 4 times for the ACK doesn't
make any sense, for example)--can you mail me your transport.c?  Thanks.

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Question about test 2.M in grading script for hw #3b (Go-back-N)
Date: Mon, 1 Mar 2004 00:25:09 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c1tvt5$kdr$1@news.Stanford.EDU>
References: <c1ti0o$5tr$1@news.Stanford.EDU> <c1tihk$6hk$1@news.Stanford.EDU> <c1tpre$ear$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1078100709 20923 171.64.15.111 (1 Mar 2004 00:25:09 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6582


>Update: I ran the grading script with the stcp_wait_for_event() wait time
>equal to the packet timeout value, and the test passed.

>So, to students who don't understand why they're failing test 2.M: If the
>amount of time you tell stcp_wait_for_event() to wait is less than your
>packet timeout value, try setting these two values to be the same.

The test shouldn't make any such assumption, and your first example of
sending A..B, A..B+536 should have been accepted.  Can you mail me a
version of your transport.c that would (erroneously?) fail the test?
Thanks.

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: testclient
Date: Mon, 1 Mar 2004 00:30:32 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <c1u078$kpi$1@news.Stanford.EDU>
References: <c1tlqi$9tf$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1078101032 21298 171.64.15.111 (1 Mar 2004 00:30:32 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6583


>why should I never get app_data?
>I do not believe this is a mistake of the transport layer then ?What do we
>do if such a thing happens?
>But if I test with my own client and server, I do seem to get APP_DATA.
>Does the testclient do something different?

testclient is run against a special server, it doesn't behave exactly
like a regular client, i.e. it doesn't wait for data to send from the
application layer.  The exit status 11 means that your transport layer
segfaulted.  I *do* believe this is a mistake of the transport layer.

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test 2.H
Date: Mon, 1 Mar 2004 00:32:19 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c1u0aj$ks8$1@news.Stanford.EDU>
References: <c1tnd3$bjn$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1078101139 21384 171.64.15.111 (1 Mar 2004 00:32:19 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6584


>Does the above result suggest my code is working right, so that I can assume
>it was some enironment glitches  that disturbed the test script?

This doesn't make much sense to me, as this is a pretty simple test.
Does the error happen consistently for you, or intermittently?
If it happens again, but the logs seem to be correct, can you mail me your
transport.c?

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Warning: unable to close filehandle KID_TO_READ properly.
Date: Mon, 1 Mar 2004 00:33:07 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c1u0c3$ktk$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0312301505380.16978-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0402252055170.8240-100000@elaine17.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1078101187 21428 171.64.15.111 (1 Mar 2004 00:33:07 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6585


>Pass all tests but see this error in the script output.  What is the
>origin of this message?

The script kills a child process from which it was reading.  You can
disregard the message.

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Throughput
Date: Mon, 1 Mar 2004 00:34:42 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c1u0f2$l1i$1@news.Stanford.EDU>
References: <c1tta2$het$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1078101282 21554 171.64.15.111 (1 Mar 2004 00:34:42 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6586


>Is that referring to real time or CPU time?  For real time, I'm getting
>about 25 s for reliable and 34 s for unreliable mode, but for CPU time, I 
>get 0.03 s for both.  This is on an elaine where another user is taking up 
>50 percent of the CPU for Matlab.

Real time.

>On a related note, has anyone been able to get useful information out of 
>gprof?  All it tells me is that the polling functions take up nearly 100 
>percent of the time.

I haven't tried it, but are you busy looping?

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test 2.M
Date: Mon, 1 Mar 2004 00:36:36 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c1u0ik$l3i$1@news.Stanford.EDU>
References: <c1ttns$i7o$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1078101396 21618 171.64.15.111 (1 Mar 2004 00:36:36 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6587


>Go-back N not enforced (retransmitted only up until 2298 rather than 3226)

>I looked into .network_log.retrans.server.TESTDATA.0, it appears that the
>largest sent seq is 2834. How can it retransmit 3226?

presumably that was th_seq=2834 plus some packet payload?

>I manually run client.retrans to talk to my server. I did retransmit up
>until 3906 (and include 3226).

If you fail this test, but the logs look correct, can you mail me your
transport.c?

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: hw3.c - question about using supplied binaries
Date: Mon, 1 Mar 2004 00:38:23 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c1u0lv$l7o$1@news.Stanford.EDU>
References: <c1mt68$7lf$1@news.Stanford.EDU> <snnhdxcs2sb.fsf@elaine7.Stanford.EDU> <Pine.GSO.4.44.0402291606180.18647-100000@elaine4.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1078101503 21752 171.64.15.111 (1 Mar 2004 00:38:23 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6588


>So does that mean if we use your ftp for part C of hw3, it will neither
>affect my hw3 grade and the free quota on hw4?

correct.

>If i use your ftpcopy object for this project, I can still choose to use a
>different free quota on hw4 right?

sure.

but we really encourage you to try and get all three components working for
hw4.  you'll feel more satisfaction, and you won't be subject to our bugs
too. :-)
.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: milstone C tests - timeout expired during grading
Date: Sun, 29 Feb 2004 16:38:20 -0800
Lines: 100
Distribution: su
Message-ID: <c1u0lv$l7p$1@news.Stanford.EDU>
References: <c1tj3c$767$1@news.Stanford.EDU> <c1tkl7$8na$1@news.Stanford.EDU> <c1tsda$grb$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1078101503 21753 128.12.173.169 (1 Mar 2004 00:38: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:6589

I understand your point, but if my ftpcopy was really slow (i do not have
any debugging stmts anywhere), wouldn't it have created problems in the
first programming assignment's test script itself? Why would it manifest all
of a sudden in the 3rd assignment? Maybe it is because it's running on a
stcp layer designed by me which in itself be slow, and that is compounding
the effect? But then again, I got no timeout errors during my milestone B
test cases. I am just a little lost as to what to correct in my code (either
in ftpcopy.c or transport.c) that will make sure i pass test cases with my
ftpcopy.c, because it seems that by themselves, both ftpcopy and my
transport layer work fine, as evinced by no timeout related issues either in
the first programming assignment or in milestone B test cases.

Kumar


"Paul E." <ignatius@stanford.edu> wrote in message
news:c1tsda$grb$1@news.Stanford.EDU...
> I'm not sure this will help but, I ran into timeout issues when my my
> programs took too long to run.  It turned out that I was printing
> debugging information, and all this I/O was slowing down my program and
> so several tests timed out.  When I stopped doing all my debugging I/O,
> my code ran a bit faster and I stopped having timeouts from the tests.
>
> My guess is your ftpcopy just needs to transfer files faster and you
> should be ok.
>
> Hope that helps.
>
> Paul E.
>
> Murali Kumar wrote:
> > So I ran the provided ftpcopy binaries along with my transport.c and I
ended
> > up passing all tests for milestone C. So I am even more confused now.
From
> > this I can conclude to a safe measure that my transport.c works fine(can
> > I?), so the bug must be with ftpcopy.c. I thought my ftpcopy.c worked
> > absolutely fine judging from the results of my first programming
assignment.
> > And I have looked over my modified ftpcopy.c and the only changes I have
> > made is to substitute the socket, read, write, connect, etc calls with
> > mysocket, myread, mywrite, etc. Other than that, it is exactly the same
as
> > my original one. So it is very weird that I am failing the 8 milestone C
> > test cases with my ftpcopy.c but not with the provided binaries.
> >
> > Again, any pointer to the right direction as to where and how to find
the
> > bug would be really great.
> >
> > Thanks a lot
> >
> > Kumar
> >
> > "Murali Kumar" <kumarm@stanford.edu> wrote in message
> > news:c1tj3c$767$1@news.Stanford.EDU...
> >
> >>Hi,
> >>
> >>I am getting NOT OKs for 6 tests(C,D,L.1,L.2,L.3,L.4) of the grading
> >
> > script
> >
> >>for milestone C with the message "***Timeout expired during grading"
> >>following. I am using my ftpcopy.c.  I passed all tests in milestone B
and
> >>my ftpcopy.c also passed everything during the first programming
> >
> > assignment.
> >
> >>So I am kind of at a loss to where start debugging to find my errors.
> >>Specifically, for test L.1 I get the following resut
> >>
> >>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:
> >>
> >>But when I myself run ftpcopy with ftpd_tcp as the server, I am able to
> >>transfer 0 byte files correctly, when running the underlying stcp in
> >>unreliable mode (providing -U option to ftpcopy). So I am confused as to
> >>what is causing the problem in the testing script then.
> >>
> >>Any help would be greatly appreciated.
> >>
> >>Thanks
> >>
> >>Kumar
> >>
> >>
> >
> >
> >
>


.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: milstone C tests - timeout expired during grading
Date: Mon, 1 Mar 2004 00:40:31 +0000 (UTC)
Lines: 20
Distribution: su
Message-ID: <c1u0pv$li0$1@news.Stanford.EDU>
References: <c1tj3c$767$1@news.Stanford.EDU> <c1tkl7$8na$1@news.Stanford.EDU> <c1tsda$grb$1@news.Stanford.EDU> <c1u0lv$l7p$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1078101631 22080 171.64.15.111 (1 Mar 2004 00:40:31 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6590


>I understand your point, but if my ftpcopy was really slow (i do not have
>any debugging stmts anywhere), wouldn't it have created problems in the
>first programming assignment's test script itself? Why would it manifest all
>of a sudden in the 3rd assignment? Maybe it is because it's running on a
>stcp layer designed by me which in itself be slow, and that is compounding
>the effect? But then again, I got no timeout errors during my milestone B
>test cases. I am just a little lost as to what to correct in my code (either
>in ftpcopy.c or transport.c) that will make sure i pass test cases with my
>ftpcopy.c, because it seems that by themselves, both ftpcopy and my
>transport layer work fine, as evinced by no timeout related issues either in
>the first programming assignment or in milestone B test cases.

I tend to doubt that the mysocket layer and STCP have been tuned as well as
Solaris' network stack...

How large are the reads/writes you do in your app?  If you download
files with the provided ftpd, roughly how long does it take?
What's the approximate throughput?

.

Path: shelby.stanford.edu!not-for-mail
From: "Cynthia Lau" <cindabin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftpcopy and recv
Date: Sun, 29 Feb 2004 16:48:51 -0800
Lines: 10
Distribution: su
Message-ID: <c1u19l$m7r$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-36725.stanford.edu
X-Trace: news.Stanford.EDU 1078102133 22779 128.12.196.60 (1 Mar 2004 00:48: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:6591

Hello,

I noticed that the mysock interface doesn't include an equivalent to the
recv function, which I used with the MSG_PEEK option for hw1.  Just to make
sure I'm not missing something, can someone confirm that in order to use our
own ftpcopy for hw3/4, we have to rewrite our hw1 to avoid using recv?

-Cynthia


.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ftpcopy and recv
Date: Mon, 1 Mar 2004 00:56:37 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c1u1o5$mqs$1@news.Stanford.EDU>
References: <c1u19l$m7r$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1078102597 23388 171.64.15.111 (1 Mar 2004 00:56:37 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6592


>I noticed that the mysock interface doesn't include an equivalent to the
>recv function, which I used with the MSG_PEEK option for hw1.  Just to make
>sure I'm not missing something, can someone confirm that in order to use our
>own ftpcopy for hw3/4, we have to rewrite our hw1 to avoid using recv?

yeah, sorry about this--but the change to use myread() should be pretty
small (at least if your code is structured reasonably...)

.

Path: shelby.stanford.edu!elaine37.Stanford.EDU!jsalcedo
From: Jonathan Salcedo <jsalcedo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test 2.C
Date: Sun, 29 Feb 2004 17:08:22 -0800
Lines: 35
Distribution: su
Message-ID: <Pine.GSO.4.44.0402291700070.17041-100000@elaine37.Stanford.EDU>
References: <Pine.GSO.4.44.0402290302140.3831-100000@elaine2.Stanford.EDU>
 <c1tv9n$jru$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine37.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078103342 24384 171.64.15.112 (1 Mar 2004 01:09:02 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c1tv9n$jru$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6593

According to our textbook, on page 385, (in edition 2)

AdvertisedWindow = MaxRcvBuffer - (LastByteRcvd - LastByteRead)

I saw Matthew's previous post where he said our advertised window should
always be 3072, but this does not agree with the book. In my situation, I
am expecting byte sequence 7873, but that packet got dropped and I am
getting sequences 8193 and higher, therefore my LastByteRcvd value keeps
increasing as the server sends packets, while my LastByteRead remains at
7872, therefore shrinking my advertised window. I believe there is
something seriously wrong with the reference server implementaion if it
can't handle this. Please confirm.

-Jonathan Salcedo

On Mon, 1 Mar 2004, Matthew Jonathan Holliman wrote:

>
> >I have consistently been failing only test 2.C on TESTDATA.0 for a while
> >now and I have no idea what I can do to fix it. The error I get from the
> >grading script is:
>
> Nevermind, I just saw that you included some output.
>
> You say you accept data beginning with th_seq=7337, but that th_win=784, say.
> Since the server has new packets to send from the app, but it can't send
> these within your window, it sends only 1 byte (as TCP does)--without
> proper flow control, it doesn't know to stop sending.  Presumably seq #7337
> hasn't timed out yet, which is why it keeps sending these small packets.
>
> Basically, your advertised window size is wrong, and you should read the
> previous posts on the newsgroup about this.
>
>

.

Path: shelby.stanford.edu!elaine30.Stanford.EDU!linchan
From: Lin Chan <linchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: milstone C tests - timeout expired during grading
Date: Sun, 29 Feb 2004 17:26:18 -0800
Lines: 60
Distribution: su
Message-ID: <Pine.GSO.4.44.0402291723140.25906-100000@elaine30.Stanford.EDU>
References: <c1tj3c$767$1@news.Stanford.EDU> <c1tkl7$8na$1@news.Stanford.EDU>
 <c1tsda$grb$1@news.Stanford.EDU> <c1u0lv$l7p$1@news.Stanford.EDU>
 <c1u0pv$li0$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 1078104379 25753 171.64.15.105 (1 Mar 2004 01:26:19 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c1u0pv$li0$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6594

I used the your binaries for milestone C and I still got Timeout expired
on most cases.

Report are like below. Is that error on my stcp layer?

Thanks

Lin

Test L.4 [out of 0.5]
Checks that ftpcopy does not erroneously create dir containing only empty
subdir
s.

Results:  NOT OK

Incorrect program status code -1 (exit code 16777215).  Program output:
***Timeout expired during grading
Program output:

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

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

Results:  NOT OK

Exit status (16777215) incorrect.  Program output:

***Timeout expired during grading
Program output:
ERROR: Could not access the requested file or directory (-4)




On Mon, 1 Mar 2004, Matthew Jonathan Holliman wrote:

>
> >I understand your point, but if my ftpcopy was really slow (i do not have
> >any debugging stmts anywhere), wouldn't it have created problems in the
> >first programming assignment's test script itself? Why would it manifest all
> >of a sudden in the 3rd assignment? Maybe it is because it's running on a
> >stcp layer designed by me which in itself be slow, and that is compounding
> >the effect? But then again, I got no timeout errors during my milestone B
> >test cases. I am just a little lost as to what to correct in my code (either
> >in ftpcopy.c or transport.c) that will make sure i pass test cases with my
> >ftpcopy.c, because it seems that by themselves, both ftpcopy and my
> >transport layer work fine, as evinced by no timeout related issues either in
> >the first programming assignment or in milestone B test cases.
>
> I tend to doubt that the mysocket layer and STCP have been tuned as well as
> Solaris' network stack...
>
> How large are the reads/writes you do in your app?  If you download
> files with the provided ftpd, roughly how long does it take?
> What's the approximate throughput?
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: milstone C tests - timeout expired during grading
Date: Sun, 29 Feb 2004 17:42:54 -0800
Lines: 37
Distribution: su
Message-ID: <c1u4f0$qbg$1@news.Stanford.EDU>
References: <c1tj3c$767$1@news.Stanford.EDU> <c1tkl7$8na$1@news.Stanford.EDU> <c1tsda$grb$1@news.Stanford.EDU> <c1u0lv$l7p$1@news.Stanford.EDU> <c1u0pv$li0$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1078105376 26992 128.12.173.169 (1 Mar 2004 01:42: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:6595


"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1u0pv$li0$1@news.Stanford.EDU...

> I tend to doubt that the mysocket layer and STCP have been tuned as well
as
> Solaris' network stack...
>
> How large are the reads/writes you do in your app?  If you download
> files with the provided ftpd, roughly how long does it take?
> What's the approximate throughput?


When you say how large are the reads/writes you do in your app, do you mean
how many bytes at a time do I read from the socket in my ftpcopy.c
implementation? If that's the question, then I read 1024 bytes at a time
from the socket and write it to the file at the local directory.

I ran my ftpcopy using -U flag with my transport.c using the ftpd_tcp
provided, and here is the statistic I have:

OK:37631 bytes copied
Time: ~11 seconds

OK: 2580480 bytes copied
Time: ~40 seconds

Does that seem reasonable? By reading/writing more bytes at a time in my
ftpcopy.c, is there a chance I can pass those tests in milestone C using my
ftpcopy.c? I have only 1 attempt left today for milestone C test cases, so I
want to be a little careful before I use that.

thanks a lot

Kumar


.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3, Q4 (I)
Date: Sun, 29 Feb 2004 18:03:21 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.GSO.4.44.0402291800380.9086-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 1078106603 28196 171.64.15.118 (1 Mar 2004 02:03:23 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6596


Is it really ture that between A and B source pauses and sends no packets?
I thought the go-back-N retransmission will resend packet (2W - 1) through
packet (3W-2) after the Timeout.

.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test 2.C
Date: Sun, 29 Feb 2004 18:19:59 -0800
Lines: 23
Distribution: su
Message-ID: <c1u6kh$sjm$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0402290302140.3831-100000@elaine2.Stanford.EDU> <c1tv9n$jru$1@news.Stanford.EDU> <Pine.GSO.4.44.0402291700070.17041-100000@elaine37.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1078107601 29302 128.12.173.169 (1 Mar 2004 02:20: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:6597


"Jonathan Salcedo" <jsalcedo@stanford.edu> wrote in message
news:Pine.GSO.4.44.0402291700070.17041-100000@elaine37.Stanford.EDU...
> According to our textbook, on page 385, (in edition 2)
>
> AdvertisedWindow = MaxRcvBuffer - (LastByteRcvd - LastByteRead)
>

I was using the same equation from my 2nd edition book, until I saw the 3rd
edition with my friend, and there the equation is:

AdvertisedWindow = MaxRcvBuffer - ((NextByteExpected -1) - LastByteRead)

So now you can see why the adv window stays constant even if you receive out
of order data with higher sequeunce numbers that the next byte expected. I
think there is a typo in 2nd edition....I was lucky enough to spot it before
I started on milestone B.

Hope this helps

Kumar


.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3 - Q4.k
Date: Sun, 29 Feb 2004 19:48:35 -0800
Lines: 6
Distribution: su
Message-ID: <c1ubqi$4lg$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 1078112914 4784 128.12.194.74 (1 Mar 2004 03:48:34 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:6598

Since we changed A to 2W+(W/2)-2 and B to 3W-1, shouldn't the buffer 
size B need to be larger than PROP*C + 1 (and not just PROP*C) for it 
not to go empty?

Paul E.

.

Path: shelby.stanford.edu!not-for-mail
From: "Paul E." <ignatius@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS3 - Q4.k
Date: Sun, 29 Feb 2004 20:11:11 -0800
Lines: 11
Distribution: su
Message-ID: <c1ud4v$6da$1@news.Stanford.EDU>
References: <c1ubqi$4lg$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 1078114272 6570 128.12.194.74 (1 Mar 2004 04:11:12 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: <c1ubqi$4lg$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6599

Make that B > PROP*C + 2.

Paul E. wrote:

> Since we changed A to 2W+(W/2)-2 and B to 3W-1, shouldn't the buffer 
> size B need to be larger than PROP*C + 1 (and not just PROP*C) for it 
> not to go empty?
> 
> Paul E.
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Cynthia Lau" <cindabin@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3 Q3b assumptions
Date: Sun, 29 Feb 2004 20:20:26 -0800
Lines: 16
Distribution: su
Message-ID: <c1udmc$72g$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-36725.stanford.edu
X-Trace: news.Stanford.EDU 1078114828 7248 128.12.196.60 (1 Mar 2004 04:20: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:6600

Hi,

When we lower the value of TRANSP in part b of problem 3, it becomes
necessary to be able to attribute a collision to a packet even after that
packet has finished transmitting.  Thus, it may be possible for a second
packet to begin transmitting before a collision for the first one is
detected.  In this case, we can conclude that both packets need to be
retransmitted, right?  For instance, if host A transmits packet 1 to host B,
but then while some later packet n is transmitting, it receives a packet
from host B that is determined to be a collision for packet 1, then it must
also be true that the packet from host B collided with all packets 1 through
n.  Is that correct?

-Cynthia


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3, prob 3b.
Date: Sun, 29 Feb 2004 20:45:02 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0402292044370.3701-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402291301490.1529-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 1078116303 8904 171.64.66.201 (1 Mar 2004 04:45:03 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402291301490.1529-100000@epic9.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6601


On Sun, 29 Feb 2004, Boris Senderzon wrote:

> Does minimum propagation delay between adjacent nodes mean that
> somewhere in the network exists two nodes and propagation delay
> between them is PROP(min)?  For all other adjacent nodes, propagation
> delay is >= PROP(min).  Is this correct?
> 

yes. 

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3, Q3
Date: Sun, 29 Feb 2004 20:50:08 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.LNX.4.44.0402292046550.3701-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402291551290.5601-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 1078116609 9317 171.64.66.201 (1 Mar 2004 04:50:09 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402291551290.5601-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6602


On Sun, 29 Feb 2004, Xiaohua Fang wrote:

> 
> Is it correct to say "attemps to decrease the minumum packet size, without
> expanding the network"?  I thought, in order to decrease the minimum
> packet size, we need to make the PROP smaller, hence "shrinking the
> network".
> 

you're right on this one.

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3 Q3
Date: Sun, 29 Feb 2004 20:53:21 -0800
Lines: 49
Distribution: su
Message-ID: <Pine.LNX.4.44.0402292050360.3701-100000@Xenon.Stanford.EDU>
References: <c1opse$mfq$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0402280308080.31196-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402291617090.6643-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 1078116802 9510 171.64.66.201 (1 Mar 2004 04:53:22 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402291617090.6643-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6603

On Sun, 29 Feb 2004, Xiaohua Fang wrote:

> 
> In this problem, are we still assuming that the collsion detection can
> only happen when the packet sent by C reaches A?  Is there anything B is
> doing for A was not specified in the question?  I really can not figure
> out why would a PROPmin help reduce the TRANSP.  I am sure the PROPmin
> always exists in an Ethernet network.  Why wasn't this "alternative"
> utilized so far?
 
B has no covert deals with A :-) PROPmin always exists in an ethernet 
network, but you can't make use of it unless you know its value. So, one 
way of looking at the question is: if i knew the value of PROPmin, how 
would I exploit it?

Shankar

> On Sat, 28 Feb 2004, Shankar Ponnekanti wrote:
> 
> >
> > On Fri, 27 Feb 2004, Ursula Chen wrote:
> >
> > > Is this question implying that in this case, unlike CSMA/CD, a transmitting
> > > station does *not* have to detect a collision before it completes
> > > transmission?  Can the transmitting station perform some sort of calculation
> > > to determine that a collision must have occurred?  Or does the collision
> > > still have to happen during transmission?
> > >
> >
> > You are thinking along the right lines, please continue your thought
> > process :-) I can't elaborate more because that will give away the
> > solution.
> >
> > 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: PS3 Q3b assumptions
Date: Sun, 29 Feb 2004 21:09:38 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.LNX.4.44.0402292056160.3701-100000@Xenon.Stanford.EDU>
References: <c1udmc$72g$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 1078117778 10676 171.64.66.201 (1 Mar 2004 05:09:38 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c1udmc$72g$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6604

On Sun, 29 Feb 2004, Cynthia Lau wrote:

> Hi,
> 
> When we lower the value of TRANSP in part b of problem 3, it becomes
> necessary to be able to attribute a collision to a packet even after that
> packet has finished transmitting.  Thus, it may be possible for a second
> packet to begin transmitting before a collision for the first one is
> detected.  

You may assume that a host will not transmit a second packet until it has 
detected if its previous packet has collided.

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3, Q4(g)
Date: Sun, 29 Feb 2004 21:16:05 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0402292112490.13938-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402291055540.29141-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 1078118165 11169 171.64.66.201 (1 Mar 2004 05:16:05 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402291055540.29141-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6605

On Sun, 29 Feb 2004, Xiaohua Fang wrote:

> 
> What does it mean by "sent at the same frequency as they were in the
> previous window"?  What is the previous window? What variable can we use
> for the expression?
> 

The rate of the previous window here refers to the rate at which bytes 
[W,2W-1] were transmitted before the drop.

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3, Q4, parts a and b.
Date: Sun, 29 Feb 2004 21:17:22 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.LNX.4.44.0402292116520.13938-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402291120570.928-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 1078118242 11277 171.64.66.201 (1 Mar 2004 05:17:22 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402291120570.928-100000@epic9.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6606


On Sun, 29 Feb 2004, Boris Senderzon wrote:

> I've had trouble understanding what the questions ask.
> 
> Does "how long it is" refers to size of the buffer or does
> it refer to how much time passes from when next packet
> starts to be transmitted on link b?

it refers to time

Shankar

> 
> If it's the size of the buffer
> that is asked, then why aksing about length from start of one
> packet to the start of next.  That's just the lenght of one fixed
> size packet.
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3, Q4(d) and Q4(e)
Date: Sun, 29 Feb 2004 21:18:39 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0402292118000.13938-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402291230160.982-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 1078118320 11348 171.64.66.201 (1 Mar 2004 05:18:40 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402291230160.982-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6607


On Sun, 29 Feb 2004, Xiaohua Fang wrote:

> 
> Does the "outstanding packets in the network" include both the data on the
> link and the data in the buffer?
> 

outstanding packets refers to packets sent but not yet acked

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3, Q4(d) and Q4(e) (more question)
Date: Sun, 29 Feb 2004 21:20:35 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.LNX.4.44.0402292119001.13938-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402291230160.982-100000@elaine43.Stanford.EDU>
 <Pine.GSO.4.44.0402291236190.1034-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 1078118437 11707 171.64.66.201 (1 Mar 2004 05:20:37 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402291236190.1034-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6608

On Sun, 29 Feb 2004, Xiaohua Fang wrote:

> 
> Is it a good assumption that for both Q4(d) and Q4(e), the window-based
> congestion control is in place on the source?

yes, as indicated by the second figure in the question.

Shankar

> On Sun, 29 Feb 2004, Xiaohua Fang wrote:
> 
> >
> > Does the "outstanding packets in the network" include both the data on the
> > link and the data in the buffer?
> >
> >
> 
> 

-- 

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: PS3, Q4 (I)
Date: Sun, 29 Feb 2004 21:23:06 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0402292121590.13938-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402291800380.9086-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 1078118587 11934 171.64.66.201 (1 Mar 2004 05:23:07 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402291800380.9086-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6609


On Sun, 29 Feb 2004, Xiaohua Fang wrote:

> 
> Is it really ture that between A and B source pauses and sends no packets?
> I thought the go-back-N retransmission will resend packet (2W - 1) through
> packet (3W-2) after the Timeout.
> 

It is really really true, and 4(F) asks you to explain why

Shankar

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: milstone C tests - timeout expired during grading
Date: Mon, 1 Mar 2004 05:31:27 +0000 (UTC)
Lines: 20
Distribution: su
Message-ID: <c1uhrf$c3e$1@news.Stanford.EDU>
References: <c1tj3c$767$1@news.Stanford.EDU> <c1tkl7$8na$1@news.Stanford.EDU> <c1tsda$grb$1@news.Stanford.EDU> <c1u0lv$l7p$1@news.Stanford.EDU> <c1u0pv$li0$1@news.Stanford.EDU> <c1u4f0$qbg$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1078119087 12398 171.64.15.111 (1 Mar 2004 05: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:6610



>Does that seem reasonable? By reading/writing more bytes at a time in my
>ftpcopy.c, is there a chance I can pass those tests in milestone C using my
>ftpcopy.c? I have only 1 attempt left today for milestone C test cases, so I
>want to be a little careful before I use that.

Certainly seems reasonable.

Keep in mind when running the script that since we run entirely in
user space, CPU-intensive processes running on the same machine can
cause havoc with our performance.  The client-server download that
took 1s for me yesterday takes 20s on this machine now, with someone
running ns.  This could easily cause the timeout issues you see--if
so, retest on a more lightly loaded machine (remember that you can
submit a new test without penalty if you haven't changed the code).

When we grade, of course, we make sure we aren't doing so when someone's
running matlab or ns...

.

Path: shelby.stanford.edu!not-for-mail
From: Adam Lee Berger <addaon@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Nagle's algorithm and HW3 scope
Date: Mon, 1 Mar 2004 05:41:27 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c1uie7$cmk$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1078119687 13012 171.64.15.116 (1 Mar 2004 05:41:27 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:6611

So everything is passing beautifully, except for hw3a test 1.c and hw3b test 2.c. These are both tests where my own client is running against your server. In both cases, I time out. Running my own server and client on a file of similar size takes about 40 seconds. Looking at the trace running against your server, there's serious silly window syndrome. That is, I'm getting 528 bytes, then 8, or 535, then 1, or various other interesting combinations. Essentially, twice as many packets are being sent as neede
d.

This seems to me to be primarily the server's choice, not coalescing packets. The only thing the client can do is implement Nagle's algorithm. Are we supposed to do this? I know other people are passing without it, but looking at relative traces it's not entirely clear why. My server, for reference, does some coalescing of sends, avoiding silly window syndrome that way; as a result, my client is much faster.

What advice can you give on this? Is a one minute timeout really appropriate for that test?

Adam
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3 1a
Date: Sun, 29 Feb 2004 22:01:02 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0402292200020.26143-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402291114400.7286-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 1078120862 14212 171.64.66.201 (1 Mar 2004 06:01:02 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402291114400.7286-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6612

On Sun, 29 Feb 2004, Vishal Patel wrote:

> 
> Does the question mean that 11000 bits are transmitted by EACH flow in
> 10 seconds...or that total for ALL N flows, there is 11000 bits in
> 10 seconds
> 

It is for each flow

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3 Q1(c)
Date: Sun, 29 Feb 2004 22:03:49 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0402292203420.26143-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402290222370.24373-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 1078121030 14325 171.64.66.201 (1 Mar 2004 06:03:50 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402290222370.24373-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6613


On Sun, 29 Feb 2004, Xiaohua Fang wrote:

> 
> "WFQ scheduler now servers on packet at a time ..."
> 
> Is this same as what is specified on handout 9 (page. 10)?
> 

yes

Shankar

.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine11.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: 2/27 Friday Section was late
Date: 29 Feb 2004 22:13:41 -0800
Organization: Stanford University, CA, USA
Lines: 8
Distribution: su
Message-ID: <snn8yilp016.fsf@elaine11.Stanford.EDU>
NNTP-Posting-Host: elaine11.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1078121621 14250 171.64.15.76 (1 Mar 2004 06:13:41 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:6614

I wanted to apologize for appearing so late for Friday's section--I did
eventually show up and we had a very short section.  I went over parts a
through g of the handout.   It was extra practice on calculating
efficiencies for different link layers.  The video should be available,
but I'll also post the answers to *all* the parts (a through i) sometime
on Monday in case that's easier to review.

Susan
.

Path: shelby.stanford.edu!elaine37.Stanford.EDU!jsalcedo
From: Jonathan Salcedo <jsalcedo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test 2.C
Date: Sun, 29 Feb 2004 22:00:41 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.GSO.4.44.0402292200190.18813-100000@elaine37.Stanford.EDU>
References: <Pine.GSO.4.44.0402290302140.3831-100000@elaine2.Stanford.EDU>
 <c1tv9n$jru$1@news.Stanford.EDU> <Pine.GSO.4.44.0402291700070.17041-100000@elaine37.Stanford.EDU>
 <c1u6kh$sjm$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine37.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078122076 15506 171.64.15.112 (1 Mar 2004 06:21:16 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c1u6kh$sjm$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6615

Thanks Murali, that definitely fixes the problem.

On Sun, 29 Feb 2004, Murali Kumar wrote:

>
> "Jonathan Salcedo" <jsalcedo@stanford.edu> wrote in message
> news:Pine.GSO.4.44.0402291700070.17041-100000@elaine37.Stanford.EDU...
> > According to our textbook, on page 385, (in edition 2)
> >
> > AdvertisedWindow = MaxRcvBuffer - (LastByteRcvd - LastByteRead)
> >
>
> I was using the same equation from my 2nd edition book, until I saw the 3rd
> edition with my friend, and there the equation is:
>
> AdvertisedWindow = MaxRcvBuffer - ((NextByteExpected -1) - LastByteRead)
>
> So now you can see why the adv window stays constant even if you receive out
> of order data with higher sequeunce numbers that the next byte expected. I
> think there is a typo in 2nd edition....I was lucky enough to spot it before
> I started on milestone B.
>
> Hope this helps
>
> Kumar
>
>
>

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS3, Q4 (I)
Date: Sun, 29 Feb 2004 22:36:52 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.GSO.4.44.0402292235190.15702-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0402291800380.9086-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0402292121590.13938-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 1078123106 16550 171.64.15.118 (1 Mar 2004 06:38:26 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0402292121590.13938-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6616

Actually, Q4(f) stated "doen't send any new packets".  I thought the
re-transmission packets are not counted as new packets.  Is that correct?

On Sun, 29 Feb 2004, Shankar Ponnekanti wrote:

>
> On Sun, 29 Feb 2004, Xiaohua Fang wrote:
>
> >
> > Is it really ture that between A and B source pauses and sends no packets?
> > I thought the go-back-N retransmission will resend packet (2W - 1) through
> > packet (3W-2) after the Timeout.
> >
>
> It is really really true, and 4(F) asks you to explain why
>
> Shankar
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question about test 2.M in grading script for hw #3b (Go-back-N)
Date: Sun, 29 Feb 2004 22:40:57 -0800
Organization: CS Masters Program
Lines: 40
Distribution: su
Message-ID: <c1ultv$gb6$1@news.Stanford.EDU>
References: <c1ti0o$5tr$1@news.Stanford.EDU> <c1tihk$6hk$1@news.Stanford.EDU> <c1tpre$ear$1@news.Stanford.EDU> <c1tvt5$kdr$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078123264 16742 127.0.0.1 (1 Mar 2004 06:41: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:6617

It turns out I misunderstood the semantics of Go-Back-N. Matt helped clear
this up for me. Thanks Matt!

The last part of our email conversation is below:

   (Matt wrote:)
yes, since the first segment or so is dropped, you retransmit all
segments starting from this point onwards.  the rationale is (presumably)
that it's likely that others were lost as well, and since loss is assumed
to happen due to congestion, you may as well resend them before they time
out...
  (Greg wrote:)
> It sounds like my problem is that I misunderstood the semantics of
Go-Back-N. I
> thought Go-Back-N meant that just the outstanding packets up to the
timed-out
> packet were sent. But apparently, it means ALL outstanding packets are
resent
> when ANY packet times out.
>
> Can you confirm that this is correct?


"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1tvt5$kdr$1@news.Stanford.EDU...
>
> >Update: I ran the grading script with the stcp_wait_for_event() wait time
> >equal to the packet timeout value, and the test passed.
>
> >So, to students who don't understand why they're failing test 2.M: If the
> >amount of time you tell stcp_wait_for_event() to wait is less than your
> >packet timeout value, try setting these two values to be the same.
>
> The test shouldn't make any such assumption, and your first example of
> sending A..B, A..B+536 should have been accepted.  Can you mail me a
> version of your transport.c that would (erroneously?) fail the test?
> Thanks.
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3, Q4 (I)
Date: Sun, 29 Feb 2004 23:11:15 -0800
Lines: 40
Distribution: su
Message-ID: <Pine.LNX.4.44.0402292304130.19997-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402291800380.9086-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0402292121590.13938-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402292235190.15702-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 1078125077 18554 171.64.66.201 (1 Mar 2004 07:11:17 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0402292235190.15702-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6618

On Sun, 29 Feb 2004, Xiaohua Fang wrote:

> Actually, Q4(f) stated "doen't send any new packets".  I thought the
> re-transmission packets are not counted as new packets.  Is that correct?

F can be restated as "No packets are sent between (A) and (B) - explain 
why?"

Shankar

> 
> On Sun, 29 Feb 2004, Shankar Ponnekanti wrote:
> 
> >
> > On Sun, 29 Feb 2004, Xiaohua Fang wrote:
> >
> > >
> > > Is it really ture that between A and B source pauses and sends no packets?
> > > I thought the go-back-N retransmission will resend packet (2W - 1) through
> > > packet (3W-2) after the Timeout.
> > >
> >
> > It is really really true, and 4(F) asks you to explain why
> >
> > 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!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3, Q4 (I)
Date: Sun, 29 Feb 2004 23:23:54 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.LNX.4.44.0402292312080.23551-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402291800380.9086-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0402292121590.13938-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402292235190.15702-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 1078125835 19295 171.64.66.201 (1 Mar 2004 07:23:55 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402292235190.15702-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6619


> Actually, Q4(f) stated "doen't send any new packets".  I thought the
> re-transmission packets are not counted as new packets.  Is that correct?

 I can see why you might be a bit confused.  Retransmissions may be considered
 new packets.

 .m
 
> On Sun, 29 Feb 2004, Shankar Ponnekanti wrote:
> 
> >
> > On Sun, 29 Feb 2004, Xiaohua Fang wrote:
> >
> > >
> > > Is it really ture that between A and B source pauses and sends no packets?
> > > I thought the go-back-N retransmission will resend packet (2W - 1) through
> > > packet (3W-2) after the Timeout.
> > >
> >
> > It is really really true, and 4(F) asks you to explain why
> >
> > Shankar
> >
> >
> 
> 

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS3, Q4 (I)
Date: Sun, 29 Feb 2004 23:26:31 -0800
Lines: 50
Distribution: su
Message-ID: <Pine.GSO.4.44.0402292321160.16837-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0402291800380.9086-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0402292121590.13938-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402292235190.15702-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0402292304130.19997-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 1078125995 19426 171.64.15.118 (1 Mar 2004 07:26:35 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0402292304130.19997-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6620

Sorry for more question again.

I thought for the STCP we are implementing, the go-back-N retransmission
does not check not the sender window.  Does real TCP checks the sender
window for before re-transmission?

On Sun, 29 Feb 2004, Shankar Ponnekanti wrote:

> On Sun, 29 Feb 2004, Xiaohua Fang wrote:
>
> > Actually, Q4(f) stated "doen't send any new packets".  I thought the
> > re-transmission packets are not counted as new packets.  Is that correct?
>
> F can be restated as "No packets are sent between (A) and (B) - explain
> why?"
>
> Shankar
>
> >
> > On Sun, 29 Feb 2004, Shankar Ponnekanti wrote:
> >
> > >
> > > On Sun, 29 Feb 2004, Xiaohua Fang wrote:
> > >
> > > >
> > > > Is it really ture that between A and B source pauses and sends no packets?
> > > > I thought the go-back-N retransmission will resend packet (2W - 1) through
> > > > packet (3W-2) after the Timeout.
> > > >
> > >
> > > It is really really true, and 4(F) asks you to explain why
> > >
> > > 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!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3, Q4 (I)
Date: Sun, 29 Feb 2004 23:31:16 -0800
Lines: 59
Distribution: su
Message-ID: <Pine.LNX.4.44.0402292328290.27953-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0402291800380.9086-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0402292121590.13938-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402292235190.15702-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0402292304130.19997-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0402292321160.16837-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 1078126277 19818 171.64.66.201 (1 Mar 2004 07:31:17 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0402292321160.16837-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6621



 This should be fairly straightforward to look up (and yes it is significant to
 answering this portion of the question)

 .m

> Sorry for more question again.
> 
> I thought for the STCP we are implementing, the go-back-N retransmission
> does not check not the sender window.  Does real TCP checks the sender
> window for before re-transmission?
> 
> On Sun, 29 Feb 2004, Shankar Ponnekanti wrote:
> 
> > On Sun, 29 Feb 2004, Xiaohua Fang wrote:
> >
> > > Actually, Q4(f) stated "doen't send any new packets".  I thought the
> > > re-transmission packets are not counted as new packets.  Is that correct?
> >
> > F can be restated as "No packets are sent between (A) and (B) - explain
> > why?"
> >
> > Shankar
> >
> > >
> > > On Sun, 29 Feb 2004, Shankar Ponnekanti wrote:
> > >
> > > >
> > > > On Sun, 29 Feb 2004, Xiaohua Fang wrote:
> > > >
> > > > >
> > > > > Is it really ture that between A and B source pauses and sends no packets?
> > > > > I thought the go-back-N retransmission will resend packet (2W - 1) through
> > > > > packet (3W-2) after the Timeout.
> > > > >
> > > >
> > > > It is really really true, and 4(F) asks you to explain why
> > > >
> > > > 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!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3 - Q4.k
Date: Sun, 29 Feb 2004 23:40:03 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.LNX.4.44.0402292333410.27953-100000@Xenon.Stanford.EDU>
References: <c1ubqi$4lg$1@news.Stanford.EDU> <c1ud4v$6da$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 1078126805 20325 171.64.66.201 (1 Mar 2004 07:40:05 GMT)
X-Complaints-To: news@news.stanford.edu
To: "Paul E." <ignatius@stanford.edu>
In-Reply-To: <c1ud4v$6da$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6622



 Yes, looks like it, however you may answer the question assuming the original
 values of A and B if you'd like.

 .m

> Make that B > PROP*C + 2.
> 
> Paul E. wrote:
> 
> > Since we changed A to 2W+(W/2)-2 and B to 3W-1, shouldn't the buffer 
> > size B need to be larger than PROP*C + 1 (and not just PROP*C) for it 
> > not to go empty?
> > 
> > Paul E.
> > 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Nagle's algorithm and HW3 scope
Date: Sun, 29 Feb 2004 23:53:28 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.LNX.4.44.0402292351270.1278-100000@Xenon.Stanford.EDU>
References: <c1uie7$cmk$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 1078127610 21128 171.64.66.201 (1 Mar 2004 07:53:30 GMT)
X-Complaints-To: news@news.stanford.edu
To: Adam Lee Berger <addaon@Stanford.EDU>
In-Reply-To: <c1uie7$cmk$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6623


 I've worked with a few other students who have had the same problem and in
 every case that I've followed through to solution it was an error in the
 students implementation.  You do not need the Nagle algorithm to pass the 1
 minute test and the timeout period is not unnecessarily stringent.

 .martin


> So everything is passing beautifully, except for hw3a test 1.c and hw3b test 2.c. These are both tests where my own client is running against your server. In both cases, I time out. Running my own server and client on a file of similar size takes about 40 seconds. Looking at the trace running against your server, there's serious silly window syndrome. That is, I'm getting 528 bytes, then 8, or 535, then 1, or various other interesting combinations. Essentially, twice as many packets are being sent as neede
> d.
> 
> This seems to me to be primarily the server's choice, not coalescing packets. The only thing the client can do is implement Nagle's algorithm. Are we supposed to do this? I know other people are passing without it, but looking at relative traces it's not entirely clear why. My server, for reference, does some coalescing of sends, avoiding silly window syndrome that way; as a result, my client is much faster.
> 
> What advice can you give on this? Is a one minute timeout really appropriate for that test?
> 
> Adam
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: TCP RFC 793 and PS#3
Date: Mon, 1 Mar 2004 00:24:39 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0403010020400.10806-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 1078129483 24148 171.64.66.201 (1 Mar 2004 08:24:43 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6624


  Hi,

    You shouldn't use rfc793 as strict reference for the behaviour of TCP.
    rfc793 was written before many features where added to TCP (such
    as congestion control which was not published until '88, 7 years
    after the original rfc was written).  I suggest using your class
    textbook instead.

    .martin

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: weird stcp in ftpd_tcp
Date: Mon, 1 Mar 2004 00:44:12 -0800
Lines: 16
Distribution: su
Message-ID: <c1ut44$onq$1@news.Stanford.EDU>
References: <c1rjfc$2k8$1@news.Stanford.EDU> <c1rvom$edb$1@news.Stanford.EDU> <c1tvdh$k12$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078130628 25338 128.12.61.97 (1 Mar 2004 08:43: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:6625

Paul,
When I've run into similar problems in the past, they have often turned out
to be memory issues.  I suggest running purify, see if that helps.

Oded

> This is weird.  I'm getting the Heisenberg effect in my code--if I just
> add a printf() statement the moment before I send app data over the
> wire, all the programs work all fine and dandy.  This looks suspiciously
> like a multi-threading issue, and am totally lost as to where to start
> debugging. :(.  If anybody has had similar issues, any help would be
> much appreciated.
>
> Paul E.


.

Path: shelby.stanford.edu!elaine33.Stanford.EDU!hendra
From: Hendra Tjahayadi <hendra@elaine33.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: milestone c ftpd
Date: Mon, 1 Mar 2004 01:09:09 -0800
Lines: 25
Distribution: su
Message-ID: <Pine.GSO.4.44.0403010105130.21657-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 1078132162 27340 171.64.15.108 (1 Mar 2004 09:09:22 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6626

i got a weird error from ftpd that created by the grading script.
the output is something like this :

Starting local ftpd
Working dir:
/afs/ir.stanford.edu/users/h/e/hendra/cs244a/pro3/milestonec/ver2/grading_src/build
Starting local ftpd: cd /usr/class/cs244a/WWW/homeworks/hw3/ftpd_src;
//afs/ir.stanford.edu/users/h/e/hendra/cs244a/pro3/milestonec/ver2/grading_src/build/ftpd_tcp
-U 2>
/afs/ir.stanford.edu/users/h/e/hendra/cs244a/pro3/milestonec/ver2/grading_src/build/.ftpd_port&
ftpd running on port 42439
Downloading files:  ./ftpcopy_tcp  -U c 3 42439@localhost localhost_c_3_0
src
warning:  ftpcopy failed with exit code 1 (waitpid status 256)
program output:
ERROR: 200 Type set to I. (-5)


i tried also running another ftpd manually , and it didnt give me this
error, only the ftpd from the grading script gave me this error.

any ideas?
thank you
(hendra)

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: segfault in ftpd_tcp
Date: Mon, 1 Mar 2004 02:32:48 -0800
Lines: 18
Distribution: su
Message-ID: <c1v3fm$2g2$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078137142 2562 128.12.61.97 (1 Mar 2004 10:32: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:6627

I keep getting a segfault in ftpd_tcp, whether I run with the provided
binaries or my own modified binaries.
The backtrace I get is:
#0  0x0001c514 in main (arc=0, argv=0xffbef78c, envp=0xffbef794)
    at
/afs/ir/users/h/o/holliman/cs244a/grading_script/src/scripts/cs244a/stcp_ref
_soln/ftpd_src/src/ftpd.c:586

That's all it gives me, and I'm a bit stumped since as I understand,
ftpd_tcp doesn't use any code that we wrote.  Any thoughts?

I thought something like this had come up in the newsgroup before, but
couldn't find it.

Thanks,
Oded


.

Path: shelby.stanford.edu!elaine28.Stanford.EDU!bahaa
From: Bahaa Eldin Yehia Fahim <bahaa@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test 2.G
Date: Mon, 1 Mar 2004 04:11:31 -0800
Lines: 35
Distribution: su
Message-ID: <Pine.GSO.4.44.0403010359001.19658-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 1078143094 8303 171.64.15.103 (1 Mar 2004 12:11:34 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6628


My code fails only 2.G. I've been trying desperatly to understand why is
it complaining for many hours.

I get a message like this :

Test 2.G [out of 5]
Checks that SYN is correctly ACKed.

Results:  NOT OK

No ACK for SYN-ACK with sequence number 1

I find this message confusing. The way I interpret it, is that I'm not
sending an ACK for a SYN-ACK that the active end has received. If that's
really what it's saying, why is it complaining about the sequence number?
The sequence number should be sent always to the next "acceptable" seq
number that the rx is willing to look at, and in ack packets, the sequence
number is not really meaningful.

But then again, for my code, when I get a synack, I always send an ack
with the seq_num_advertised+1. Is it a requirement to set the sequence #
to 1 ?

Looking at the logs, I normally set this to 2 ( the advertised seq # being
1) and so I ack 1+1 = 2 , and the next acceptable seq number is 2, so I
set this as my SEQ number in the pure ack packet. Is this wrong ?

Or is it saying that I'm not sending a SYN-ACK correctly ?

Any help is appreciated... I've pretty much ran out of ideas here

Thanks,
Bahaa

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS3 Q3b assumptions
Date: Mon, 1 Mar 2004 09:29:02 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.GSO.4.44.0403010924480.23847-100000@elaine43.Stanford.EDU>
References: <c1udmc$72g$1@news.Stanford.EDU> <Pine.LNX.4.44.0402292056160.3701-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 1078162145 28330 171.64.15.118 (1 Mar 2004 17:29:05 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0402292056160.3701-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6629

If what the TA stated is true, then the collison detection has nothing to
do with the TRANSP, since the sender will wait (after transmission) "until
it has detected if its previous packet has collided."  During the wait
time, there is no transmission at all.  So in that sense, you can have as
small a packet as possible.  The sender will transmit that, and then wait
in idle until it makes sure that the previous packet did not collide.  Am
I on the right track? or a complete wrong direction?



On Sun, 29 Feb 2004, Shankar Ponnekanti wrote:

> On Sun, 29 Feb 2004, Cynthia Lau wrote:
>
> > Hi,
> >
> > When we lower the value of TRANSP in part b of problem 3, it becomes
> > necessary to be able to attribute a collision to a packet even after that
> > packet has finished transmitting.  Thus, it may be possible for a second
> > packet to begin transmitting before a collision for the first one is
> > detected.
>
> You may assume that a host will not transmit a second packet until it has
> detected if its previous packet has collided.
>
> Shankar
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Kirk Shimano <kshimano@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Timeout on 2.B
Date: Mon, 01 Mar 2004 09:37:45 -0800
Lines: 27
Distribution: su
Message-ID: <c1vsdo$s8v$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 1078162680 28959 128.12.41.60 (1 Mar 2004 17:38:00 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:6630

On milestone 2.B, I've maanged to get different results with the exact 
same build of my program. Around half of the time, it passes the test 
fine. The other half, I get this message:

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

Test 2.B [out of 20]
Checks student Tx (server) against reference Rx (client).

Results:  NOT OK

Unexpected exit status -1.  Program output:
***Timeout expired during grading
Program output:
server: TESTDATA.1,299328,Ok

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

Is it possible that my algorithm for calculating the timeout is just too 
conservative for the test script? Currently, I have an implementation of 
  the Karn/Partridge algorithm that sets the timeout to be twice the 
estimated RTT. Originally, it used an exponential back-off when packets 
were dropped (as described in the book). Now, any retransmitted packet 
is just set to be 1.2 times the current RTT.

-Kirk

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3 Q3b assumptions
Date: Mon, 1 Mar 2004 09:51:39 -0800
Lines: 51
Distribution: su
Message-ID: <Pine.LNX.4.44.0403010939010.2772-100000@Xenon.Stanford.EDU>
References: <c1udmc$72g$1@news.Stanford.EDU> <Pine.LNX.4.44.0402292056160.3701-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0403010924480.23847-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 1078163501 51 171.64.66.201 (1 Mar 2004 17:51:41 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0403010924480.23847-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6631


On Mon, 1 Mar 2004, Xiaohua Fang wrote:

> If what the TA stated is true, then the collison detection has nothing to
> do with the TRANSP, since the sender will wait (after transmission) "until
> it has detected if its previous packet has collided."  During the wait
> time, there is no transmission at all.  So in that sense, you can have as
> small a packet as possible.  The sender will transmit that, and then wait
> in idle until it makes sure that the previous packet did not collide.  Am
> I on the right track? or a complete wrong direction?

you appear to be on the right track, but still miss an important insight 
that will lead to the solution. i am reluctant to give out any more hints 
on this question.

Shankar

> 
> 
> 
> On Sun, 29 Feb 2004, Shankar Ponnekanti wrote:
> 
> > On Sun, 29 Feb 2004, Cynthia Lau wrote:
> >
> > > Hi,
> > >
> > > When we lower the value of TRANSP in part b of problem 3, it becomes
> > > necessary to be able to attribute a collision to a packet even after that
> > > packet has finished transmitting.  Thus, it may be possible for a second
> > > packet to begin transmitting before a collision for the first one is
> > > detected.
> >
> > You may assume that a host will not transmit a second packet until it has
> > detected if its previous packet has collided.
> >
> > 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: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: UMR client.c, line 215
Date: Mon, 01 Mar 2004 09:52:40 -0800
Lines: 3
Distribution: su
Message-ID: <40437867.E25308FA@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078163561 78 128.12.21.88 (1 Mar 2004 17:52:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6632

What causes this UMR?  I can't seem to figure out what is causing this
uinitailzed memory read.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: UMR client.c, line 215
Date: Mon, 1 Mar 2004 10:20:03 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.LNX.4.44.0403011019500.14647-100000@Xenon.Stanford.EDU>
References: <40437867.E25308FA@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078165206 2355 171.64.66.201 (1 Mar 2004 18:20:06 GMT)
X-Complaints-To: news@news.stanford.edu
To: Ryan <ryan05@stanford.edu>
In-Reply-To: <40437867.E25308FA@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:6633


 Did you forget to paste the code?

 .m

> What causes this UMR?  I can't seem to figure out what is causing this
> uinitailzed memory read.
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: UMR client.c, line 215
Date: Mon, 01 Mar 2004 10:25:49 -0800
Lines: 29
Distribution: su
Message-ID: <c1vv7d$2p0$1@news.Stanford.EDU>
References: <40437867.E25308FA@stanford.edu> <Pine.LNX.4.44.0403011019500.14647-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: firebird11.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078165550 2848 171.64.15.162 (1 Mar 2004 18:25:50 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:6634

             if (!quiet_opt)
             {
                 while (0 == fwrite(line, 1, to_read, file))
                 {
                     if (errno != EINTR)
                     {
                         perror("fwrite");
                         errcnd = 1;
                         break;
                     }
                 }

The UMR is on the line:   while (0 == fwrite(line, 1, to_read, file))
(This in client.c)


Martin Casado wrote:
>  Did you forget to paste the code?
> 
>  .m
> 
> 
>>What causes this UMR?  I can't seem to figure out what is causing this
>>uinitailzed memory read.
>>
>>
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Nicolas Pombourcq" <nicolas.pombourcq@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Timeout on 2.B
Date: Mon, 1 Mar 2004 10:56:15 -0800
Lines: 5
Distribution: su
Message-ID: <c2012o$518$1@news.Stanford.EDU>
References: <c1vsdo$s8v$1@news.Stanford.EDU>
NNTP-Posting-Host: mummy.stanford.edu
X-Trace: news.Stanford.EDU 1078167448 5160 128.12.188.73 (1 Mar 2004 18:57: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:6635

My program fails only on test 2.B, but the test script only gives me the
reference client output, whereas I need the server output to be able to do
any debugging. How could I get it ?


.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: milestone c ftpd
Date: Mon, 1 Mar 2004 19:07:35 +0000 (UTC)
Lines: 3
Distribution: su
Message-ID: <c201ln$5pb$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403010105130.21657-100000@elaine33.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078168055 5931 171.64.15.69 (1 Mar 2004 19:07:35 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6636


Did you run both ftpcopy and ftpd in unreliable mode?  Same arguments?

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: segfault in ftpd_tcp
Date: Mon, 1 Mar 2004 11:10:42 -0800
Lines: 26
Distribution: su
Message-ID: <c201qm$65b$1@news.Stanford.EDU>
References: <c1v3fm$2g2$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078168214 6315 128.12.61.97 (1 Mar 2004 19:10: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:6637

Additional info I just noticed... gdb also says :No such file or directory"
for the ftpd.c file listed below.

Oded

> I keep getting a segfault in ftpd_tcp, whether I run with the provided
> binaries or my own modified binaries.
> The backtrace I get is:
> #0  0x0001c514 in main (arc=0, argv=0xffbef78c, envp=0xffbef794)
>     at
>
/afs/ir/users/h/o/holliman/cs244a/grading_script/src/scripts/cs244a/stcp_ref
> _soln/ftpd_src/src/ftpd.c:586
>
> That's all it gives me, and I'm a bit stumped since as I understand,
> ftpd_tcp doesn't use any code that we wrote.  Any thoughts?
>
> I thought something like this had come up in the newsgroup before, but
> couldn't find it.
>
> Thanks,
> Oded
>
>


.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: segfault in ftpd_tcp
Date: Mon, 1 Mar 2004 19:10:47 +0000 (UTC)
Lines: 20
Distribution: su
Message-ID: <c201rn$65r$1@news.Stanford.EDU>
References: <c1v3fm$2g2$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078168247 6331 171.64.15.69 (1 Mar 2004 19:10:47 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6638


>I keep getting a segfault in ftpd_tcp, whether I run with the provided
>binaries or my own modified binaries.

You mean, if you run /usr/class/cs244a/WWW/homeworks/hw3/ftpd_src/ftpd_tcp?
Does ftpd_tcp.debug show anything useful?

>The backtrace I get is:
>#0  0x0001c514 in main (arc=0, argv=0xffbef78c, envp=0xffbef794)
>    at
>/afs/ir/users/h/o/holliman/cs244a/grading_script/src/scripts/cs244a/stcp_ref
>_soln/ftpd_src/src/ftpd.c:586

That line of code is really innocuous--it sets a local variable to zero.

>I thought something like this had come up in the newsgroup before, but
>couldn't find it.

This is the first I've ever heard of this error.

.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: UMR client.c, line 215
Date: Mon, 1 Mar 2004 19:15:34 +0000 (UTC)
Lines: 24
Distribution: su
Message-ID: <c2024m$6d5$1@news.Stanford.EDU>
References: <40437867.E25308FA@stanford.edu> <Pine.LNX.4.44.0403011019500.14647-100000@Xenon.Stanford.EDU> <c1vv7d$2p0$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078168534 6565 171.64.15.69 (1 Mar 2004 19:15:34 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6639

>             if (!quiet_opt)
>             {
>                 while (0 == fwrite(line, 1, to_read, file))
>                 {
>                     if (errno != EINTR)
>                     {
>                         perror("fwrite");
>                         errcnd = 1;
>                         break;
>                     }
>                 }

>The UMR is on the line:   while (0 == fwrite(line, 1, to_read, file))
>(This in client.c)

Line 215 is something completely different in the client.c in
WWW/homeworks/hw3.  Does the error happen for all downloads, or
just particular ones?  (e.g. if you download a file that's a multiple
of sizeof(line) bytes long, does it happen still?)

I haven't seen this before, and the client/server pair were purified
(a couple of months ago, but not a lot's really changed in the code
since then).

.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Timeout on 2.B
Date: Mon, 1 Mar 2004 19:21:21 +0000 (UTC)
Lines: 23
Distribution: su
Message-ID: <c202fh$6s3$1@news.Stanford.EDU>
References: <c1vsdo$s8v$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078168881 7043 171.64.15.69 (1 Mar 2004 19:21:21 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6640


>Is it possible that my algorithm for calculating the timeout is just too 
>conservative for the test script? Currently, I have an implementation of 
>  the Karn/Partridge algorithm that sets the timeout to be twice the 
>estimated RTT. Originally, it used an exponential back-off when packets 
>were dropped (as described in the book). Now, any retransmitted packet 
>is just set to be 1.2 times the current RTT.

I don't think so; the ref soln does exactly the same thing (but with the
RTO=2*RTT, with a clamped 100ms minimum RTT estimate).

Most of the timeout issues I've seen have been due to th_win problems
(probably not the case here since it's your server), or mishandling of the
connection teardown in some way.  Another possibility is that you're
running on a very heavily loaded machine; does the test consistently run to
completion on a lightly loaded system?  (The ref soln passes consistently
even under heavy load, so this would be only a partial explanation).

Are you logging sent/received packets to a file (or stdout)?  This can
often cause timeouts, too.  If you aren't, you might want to try this
though, as it might help you pinpoint why you're running into issues
in the first place.

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: UMR client.c, line 215
Date: Mon, 01 Mar 2004 11:21:44 -0800
Lines: 29
Distribution: su
Message-ID: <40438D48.600A2B4D@stanford.edu>
References: <40437867.E25308FA@stanford.edu> <Pine.LNX.4.44.0403011019500.14647-100000@Xenon.Stanford.EDU> <c1vv7d$2p0$1@news.Stanford.EDU> <c2024m$6d5$1@news.Stanford.EDU>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078168905 7026 128.12.21.88 (1 Mar 2004 19:21:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6641

Sorry line 250 and it happens for basically any downloads larger than
about 50k (each point it happens causes data curroption too in rcvd file)

Matthew Jonathan Holliman wrote:

> >             if (!quiet_opt)
> >             {
> >                 while (0 == fwrite(line, 1, to_read, file))
> >                 {
> >                     if (errno != EINTR)
> >                     {
> >                         perror("fwrite");
> >                         errcnd = 1;
> >                         break;
> >                     }
> >                 }
>
> >The UMR is on the line:   while (0 == fwrite(line, 1, to_read, file))
> >(This in client.c)
>
> Line 215 is something completely different in the client.c in
> WWW/homeworks/hw3.  Does the error happen for all downloads, or
> just particular ones?  (e.g. if you download a file that's a multiple
> of sizeof(line) bytes long, does it happen still?)
>
> I haven't seen this before, and the client/server pair were purified
> (a couple of months ago, but not a lot's really changed in the code
> since then).

.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Timeout on 2.B
Date: Mon, 1 Mar 2004 19:22:12 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c202h4$6te$1@news.Stanford.EDU>
References: <c1vsdo$s8v$1@news.Stanford.EDU> <c2012o$518$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078168932 7086 171.64.15.69 (1 Mar 2004 19:22:12 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6642


>My program fails only on test 2.B, but the test script only gives me the
>reference client output, whereas I need the server output to be able to do
>any debugging. How could I get it ?

Please see my previous reply in this thread for debugging this case.
The client output already gives you some clues anyway.
.

Path: shelby.stanford.edu!not-for-mail
From: "Nicolas Pombourcq" <nicolas.pombourcq@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Timeout on 2.B
Date: Mon, 1 Mar 2004 11:23:45 -0800
Lines: 17
Distribution: su
Message-ID: <c202mc$737$1@news.Stanford.EDU>
References: <c1vsdo$s8v$1@news.Stanford.EDU> <c2012o$518$1@news.Stanford.EDU> <c202h4$6te$1@news.Stanford.EDU>
NNTP-Posting-Host: mummy.stanford.edu
X-Trace: news.Stanford.EDU 1078169100 7271 128.12.188.73 (1 Mar 2004 19:25:00 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:6643

Is this supposed to be an helpfull clue ?:

Test 2.B [out of 20]
Checks student Tx (server) against reference Rx (client).

Results:  NOT OK

Unexpected exit status -1.  Program output:
***Timeout expired during grading
Program output:
server: TESTDATA.1,299328,Ok

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

Anyway, I'll try to log to a file


.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: UMR client.c, line 215
Date: Mon, 1 Mar 2004 19:25:27 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c202n7$73i$1@news.Stanford.EDU>
References: <40437867.E25308FA@stanford.edu> <Pine.LNX.4.44.0403011019500.14647-100000@Xenon.Stanford.EDU> <c1vv7d$2p0$1@news.Stanford.EDU> <c2024m$6d5$1@news.Stanford.EDU> <40438D48.600A2B4D@stanford.edu>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078169127 7282 171.64.15.69 (1 Mar 2004 19:25:27 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6644


>Sorry line 250 and it happens for basically any downloads larger than
>about 50k (each point it happens causes data curroption too in rcvd file)

Does the downloaded rcvd have the correct file length?  If so, does cmp
indicate where the error might be, and how does it correspond to the
segments you send out?  Does this happen in both reliable and unreliable
modes, on both server and client?

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: UMR client.c, line 215
Date: Mon, 01 Mar 2004 11:27:15 -0800
Lines: 15
Distribution: su
Message-ID: <40438E93.D6A8166F@stanford.edu>
References: <40437867.E25308FA@stanford.edu> <Pine.LNX.4.44.0403011019500.14647-100000@Xenon.Stanford.EDU> <c1vv7d$2p0$1@news.Stanford.EDU> <c2024m$6d5$1@news.Stanford.EDU> <40438D48.600A2B4D@stanford.edu> <c202n7$73i$1@news.Stanford.EDU>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078169237 7328 128.12.21.88 (1 Mar 2004 19:27:17 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6645

Happens to the client on unreliable mode.  File lenth is correct. At each
point of correction (usually around 2 per 150000 bytes), what should be in
file gets replace with ascii and machine name:
eg:   @@@@elaine9@@@

Matthew Jonathan Holliman wrote:

> >Sorry line 250 and it happens for basically any downloads larger than
> >about 50k (each point it happens causes data curroption too in rcvd file)
>
> Does the downloaded rcvd have the correct file length?  If so, does cmp
> indicate where the error might be, and how does it correspond to the
> segments you send out?  Does this happen in both reliable and unreliable
> modes, on both server and client?

.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Timeout on 2.B
Date: Mon, 1 Mar 2004 19:29:57 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <c202vl$7d2$1@news.Stanford.EDU>
References: <c1vsdo$s8v$1@news.Stanford.EDU> <c2012o$518$1@news.Stanford.EDU> <c202h4$6te$1@news.Stanford.EDU> <c202mc$737$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078169397 7586 171.64.15.69 (1 Mar 2004 19:29:57 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6646


>Is this supposed to be an helpfull clue ?:

Let's see--
It tells you that our client connected against your server.
It tells you that your server sent back a data packet, describing the
file.
So we know connection setup and at least the first packet exchange
were done correctly.  This is a "clue."  The server output would
be the same--unless you include extra debugging stuff, which can go
to a file.

And since the grading script is described as a black box on the class
web pages, I don't know what more you'd really expect from it...

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: UMR client.c, line 215
Date: Mon, 1 Mar 2004 11:32:04 -0800
Lines: 28
Distribution: su
Message-ID: <c2032p$7ie$1@news.Stanford.EDU>
References: <40437867.E25308FA@stanford.edu> <Pine.LNX.4.44.0403011019500.14647-100000@Xenon.Stanford.EDU> <c1vv7d$2p0$1@news.Stanford.EDU> <c2024m$6d5$1@news.Stanford.EDU> <40438D48.600A2B4D@stanford.edu> <c202n7$73i$1@news.Stanford.EDU> <40438E93.D6A8166F@stanford.edu>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078169497 7758 128.12.61.97 (1 Mar 2004 19:31: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:6647

Ryan,
I had a similar issue and as I can recall, it was actually a result of me
retransmitting too fast (wasn't resetting the timeout appropriately).  The
premature termination caused the file to be truncated and corrupted.

Hope that might help, but it sounds like you have a memory problem going
that might be responsible.

Oded

> Happens to the client on unreliable mode.  File lenth is correct. At each
> point of correction (usually around 2 per 150000 bytes), what should be in
> file gets replace with ascii and machine name:
> eg:   @@@@elaine9@@@
>
> Matthew Jonathan Holliman wrote:
>
> > >Sorry line 250 and it happens for basically any downloads larger than
> > >about 50k (each point it happens causes data curroption too in rcvd
file)
> >
> > Does the downloaded rcvd have the correct file length?  If so, does cmp
> > indicate where the error might be, and how does it correspond to the
> > segments you send out?  Does this happen in both reliable and unreliable
> > modes, on both server and client?
>


.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test 2.G
Date: Mon, 1 Mar 2004 19:37:51 +0000 (UTC)
Lines: 24
Distribution: su
Message-ID: <c203ef$7ud$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403010359001.19658-100000@elaine28.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078169871 8141 171.64.15.69 (1 Mar 2004 19:37:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6648



>I find this message confusing. The way I interpret it, is that I'm not
>sending an ACK for a SYN-ACK that the active end has received. If that's
>really what it's saying, why is it complaining about the sequence number?
>The sequence number should be sent always to the next "acceptable" seq
>number that the rx is willing to look at, and in ack packets, the sequence
>number is not really meaningful.

The script didn't find an ACK with th_ack=X+1 for a SYN-ACK with th_seq=X.

>But then again, for my code, when I get a synack, I always send an ack
>with the seq_num_advertised+1. Is it a requirement to set the sequence #
>to 1 ?

No.

>Looking at the logs, I normally set this to 2 ( the advertised seq # being
>1) and so I ack 1+1 = 2 , and the next acceptable seq number is 2, so I
>set this as my SEQ number in the pure ack packet. Is this wrong ?

This sounds fine.  Please send me your transport.c so I can see if there's
anything weird going on.

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: UMR client.c, line 215
Date: Mon, 01 Mar 2004 11:38:15 -0800
Lines: 32
Distribution: su
Message-ID: <40439127.ED8AFFA1@stanford.edu>
References: <40437867.E25308FA@stanford.edu> <Pine.LNX.4.44.0403011019500.14647-100000@Xenon.Stanford.EDU> <c1vv7d$2p0$1@news.Stanford.EDU> <c2024m$6d5$1@news.Stanford.EDU> <40438D48.600A2B4D@stanford.edu> <c202n7$73i$1@news.Stanford.EDU> <40438E93.D6A8166F@stanford.edu> <c2032p$7ie$1@news.Stanford.EDU>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078169896 8134 128.12.21.88 (1 Mar 2004 19:38:16 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6649

Interestingly... if I make my effectiveWindow smaller, the problem seems to go
away.  Any ideas?  (Making timeout larger does not help)

Oded Wurman wrote:

> Ryan,
> I had a similar issue and as I can recall, it was actually a result of me
> retransmitting too fast (wasn't resetting the timeout appropriately).  The
> premature termination caused the file to be truncated and corrupted.
>
> Hope that might help, but it sounds like you have a memory problem going
> that might be responsible.
>
> Oded
>
> > Happens to the client on unreliable mode.  File lenth is correct. At each
> > point of correction (usually around 2 per 150000 bytes), what should be in
> > file gets replace with ascii and machine name:
> > eg:   @@@@elaine9@@@
> >
> > Matthew Jonathan Holliman wrote:
> >
> > > >Sorry line 250 and it happens for basically any downloads larger than
> > > >about 50k (each point it happens causes data curroption too in rcvd
> file)
> > >
> > > Does the downloaded rcvd have the correct file length?  If so, does cmp
> > > indicate where the error might be, and how does it correspond to the
> > > segments you send out?  Does this happen in both reliable and unreliable
> > > modes, on both server and client?
> >

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: segfault in ftpd_tcp
Date: Mon, 1 Mar 2004 11:41:49 -0800
Lines: 11
Distribution: su
Message-ID: <c203l1$883$1@news.Stanford.EDU>
References: <c1v3fm$2g2$1@news.Stanford.EDU> <c201rn$65r$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078170081 8451 128.12.61.97 (1 Mar 2004 19:41: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:6650

The provided ftpcopy works when using your ftpd_tcp/.debug.
The segfault when using the version compiled with my transport layer occurs
on this call:

(unsigned int) event = stcp_wait_for_event( 0, 7, NULL );

That's the farthest I've been able to narrow it.

Oded


.

Path: shelby.stanford.edu!not-for-mail
From: "jsilver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: UMR client.c, line 215
Date: Mon, 1 Mar 2004 11:55:04 -0800
Lines: 52
Distribution: su
Message-ID: <c204et$909$1@news.Stanford.EDU>
References: <40437867.E25308FA@stanford.edu> <Pine.LNX.4.44.0403011019500.14647-100000@Xenon.Stanford.EDU> <c1vv7d$2p0$1@news.Stanford.EDU> <c2024m$6d5$1@news.Stanford.EDU> <40438D48.600A2B4D@stanford.edu> <c202n7$73i$1@news.Stanford.EDU> <40438E93.D6A8166F@stanford.edu> <c2032p$7ie$1@news.Stanford.EDU> <40439127.ED8AFFA1@stanford.edu>
X-Trace: news.Stanford.EDU 1078170910 9225 127.0.0.1 (1 Mar 2004 19:55: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:6651

Ryan,

You might try running gdb with your purified binary and put a breakpoint at
"purify_stop_here".  This will cause gdb to break at exactly the point you
are accessing unitialized memory.  Then you can poke around and see what's
going on.


"Ryan" <ryan05@stanford.edu> wrote in message
news:40439127.ED8AFFA1@stanford.edu...
> Interestingly... if I make my effectiveWindow smaller, the problem seems
to go
> away.  Any ideas?  (Making timeout larger does not help)
>
> Oded Wurman wrote:
>
> > Ryan,
> > I had a similar issue and as I can recall, it was actually a result of
me
> > retransmitting too fast (wasn't resetting the timeout appropriately).
The
> > premature termination caused the file to be truncated and corrupted.
> >
> > Hope that might help, but it sounds like you have a memory problem going
> > that might be responsible.
> >
> > Oded
> >
> > > Happens to the client on unreliable mode.  File lenth is correct. At
each
> > > point of correction (usually around 2 per 150000 bytes), what should
be in
> > > file gets replace with ascii and machine name:
> > > eg:   @@@@elaine9@@@
> > >
> > > Matthew Jonathan Holliman wrote:
> > >
> > > > >Sorry line 250 and it happens for basically any downloads larger
than
> > > > >about 50k (each point it happens causes data curroption too in rcvd
> > file)
> > > >
> > > > Does the downloaded rcvd have the correct file length?  If so, does
cmp
> > > > indicate where the error might be, and how does it correspond to the
> > > > segments you send out?  Does this happen in both reliable and
unreliable
> > > > modes, on both server and client?
> > >
>


.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: UMR client.c, line 215
Date: Mon, 01 Mar 2004 11:58:03 -0800
Lines: 56
Distribution: su
Message-ID: <404395CA.F5EB706B@stanford.edu>
References: <40437867.E25308FA@stanford.edu> <Pine.LNX.4.44.0403011019500.14647-100000@Xenon.Stanford.EDU> <c1vv7d$2p0$1@news.Stanford.EDU> <c2024m$6d5$1@news.Stanford.EDU> <40438D48.600A2B4D@stanford.edu> <c202n7$73i$1@news.Stanford.EDU> <40438E93.D6A8166F@stanford.edu> <c2032p$7ie$1@news.Stanford.EDU> <40439127.ED8AFFA1@stanford.edu> <c204et$909$1@news.Stanford.EDU>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078171084 9318 128.12.21.88 (1 Mar 2004 19:58:04 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6652

Oh got it!!!  Wow this one took me a while. I copied unintialized memory to a
point where it was later copied to a point where it was later read.  So, it was
hard to track down why it was uninitalized!  Thanks for all your help everyone.

jsilver wrote:

> Ryan,
>
> You might try running gdb with your purified binary and put a breakpoint at
> "purify_stop_here".  This will cause gdb to break at exactly the point you
> are accessing unitialized memory.  Then you can poke around and see what's
> going on.
>
> "Ryan" <ryan05@stanford.edu> wrote in message
> news:40439127.ED8AFFA1@stanford.edu...
> > Interestingly... if I make my effectiveWindow smaller, the problem seems
> to go
> > away.  Any ideas?  (Making timeout larger does not help)
> >
> > Oded Wurman wrote:
> >
> > > Ryan,
> > > I had a similar issue and as I can recall, it was actually a result of
> me
> > > retransmitting too fast (wasn't resetting the timeout appropriately).
> The
> > > premature termination caused the file to be truncated and corrupted.
> > >
> > > Hope that might help, but it sounds like you have a memory problem going
> > > that might be responsible.
> > >
> > > Oded
> > >
> > > > Happens to the client on unreliable mode.  File lenth is correct. At
> each
> > > > point of correction (usually around 2 per 150000 bytes), what should
> be in
> > > > file gets replace with ascii and machine name:
> > > > eg:   @@@@elaine9@@@
> > > >
> > > > Matthew Jonathan Holliman wrote:
> > > >
> > > > > >Sorry line 250 and it happens for basically any downloads larger
> than
> > > > > >about 50k (each point it happens causes data curroption too in rcvd
> > > file)
> > > > >
> > > > > Does the downloaded rcvd have the correct file length?  If so, does
> cmp
> > > > > indicate where the error might be, and how does it correspond to the
> > > > > segments you send out?  Does this happen in both reliable and
> unreliable
> > > > > modes, on both server and client?
> > > >
> >

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Repeating old test case
Date: Mon, 01 Mar 2004 12:01:59 -0800
Lines: 3
Distribution: su
Message-ID: <c204rn$9fl$1@news.Stanford.EDU>
NNTP-Posting-Host: firebird11.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078171319 9717 171.64.15.162 (1 Mar 2004 20:01:59 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:6653

If I say no to genereate new test code, then it will reoutput my last 
test without taking away another test, right?

.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Repeating old test case
Date: Mon, 1 Mar 2004 20:06:12 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c2053k$9m9$1@news.Stanford.EDU>
References: <c204rn$9fl$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078171572 9929 171.64.15.69 (1 Mar 2004 20:06:12 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6654


>If I say no to genereate new test code, then it will reoutput my last 
>test without taking away another test, right?

If it asks you for whether to generate a new key, it will count as a
new test attempt--if you say no, the script will just quit.  You'll
have to make sure that your submitted code matches whatever you submitted
last time, so it matches the currently stored key.  In this case, the
script won't even ask you about a key, it'll just go ahead and run.

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: segfault in ftpd_tcp
Date: Mon, 1 Mar 2004 12:25:58 -0800
Lines: 25
Distribution: su
Message-ID: <c2067q$bdf$1@news.Stanford.EDU>
References: <c1v3fm$2g2$1@news.Stanford.EDU> <c201rn$65r$1@news.Stanford.EDU> <c203l1$883$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078172730 11695 128.12.61.97 (1 Mar 2004 20:25: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:6655

I copied stcp_api.c and managed to further pinpoint the segfault:

PTHREAD_CALL(pthread_cond_wait(&ctx->data_ready_cond,
                                      &ctx->data_ready_lock));

in stcp_api.c:111-112

According to gdb, ctx is not null.  I would really appreciate any help...

Oded

> The provided ftpcopy works when using your ftpd_tcp/.debug.
> The segfault when using the version compiled with my transport layer
occurs
> on this call:
>
> (unsigned int) event = stcp_wait_for_event( 0, 7, NULL );
>
> That's the farthest I've been able to narrow it.
>
> Oded
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3 questions #4c,d
Date: Mon, 1 Mar 2004 12:33:40 -0800
Organization: CS Masters Program
Lines: 9
Distribution: su
Message-ID: <c206n8$bvm$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078173226 12278 127.0.0.1 (1 Mar 2004 20:33: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:6656

Are we allowed to use R (the data rate of link (a)) in our answer? If not,
how can we acount for the transmission time of the packet from the source
(or can we ignore this)?

Thanks,

Greg


.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Grading Criteria 2.H
Date: Mon, 01 Mar 2004 12:45:40 -0800
Lines: 2
Distribution: su
Message-ID: <4043A0F4.36895069@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078173941 13182 128.12.21.88 (1 Mar 2004 20:45:41 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6657

Given sequence numbers, why is it necessary to send packets before fin?

.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Abort in ftpd_tcp.debug
Date: Mon, 1 Mar 2004 12:57:28 -0800
Lines: 99
Distribution: su
Message-ID: <Pine.GSO.4.44.0403011254490.18972-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 1078174650 14021 171.64.15.39 (1 Mar 2004 20:57:30 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6658

I tried to download files from
/usr/class/cs244a/WWW/homeworkds/hw3/ftpd_src but the ftpd_tcp.debug
aborts after establishing connection.

I'm using provided binaries for ftpcopy_tcp.  My output is

epic6:~/classes/cs244a/p3c> ./ftpcopy_tcp -U c 3 52490@epic6.Stanford.EDU
../temp
SENT seq=146 ack=1 len=0 flags=0x2
RCVD seq=191 ack=147 len=0 flags=0x12
SENT seq=147 ack=192 len=0 flags=0x10
RCVD seq=191 ack=147 len=0 flags=0x12
SENT seq=147 ack=192 len=0 flags=0x10

I established connection so did the ftpd_tcp.  The output from it
is below.  What caused it to abort?

epic6:/usr/class/cs244a/WWW/homeworks/hw3/ftpd_src> allocating connection
queue for local port 52490
ftpd wrapper running on 52490@epic6.Stanford.EDU

####Accepting a new connection at port# 52490#### (sd=0)
waiting for new connection...
started receive thread

epic6:/usr/class/cs244a/WWW/homeworks/hw3/ftpd_src> accepted from peer,
tmp_sd=6...
_network_recv_packet peer:  171.64.15.39:52491
establishing connection from 171.64.15.39:52491 for local port 52490
passed accepted socket 6 on to new context...
started receive thread
init_seq_num=191
control loop state (sd=1): LISTEN
  wait_for_event with infinite timeout
transport_sock_io windows (sd=1)
  send: last_byte_sent = 190, last_byte_acked = 190, last_byte_written =
190
  recv: next_byte_expected = 0, last_byte_read = 0, last_byte_received = 0
_recv_packet (sd=1) seq # 146 ack # 1: SYN  0 byte payload
_send_segment windows (sd=1)
  send: last_byte_sent = 190, last_byte_acked = 190, last_byte_written =
190
  recv: next_byte_expected = 147, last_byte_read = 146, last_byte_received
= 146
_send_segment transmission time:  (sd=1) 1078174232.815 ms
_send_packet (sd=1) seq # 191 ack # 147: SYN ACK  0 byte payload
_network_send_packet peer:  171.64.15.39:52491
queue (sd=1): 1 entries
  (sd=1) 1078174233.315 ms
  ***queue entry: seq # 191 (sd=1, 0 timeout(s), next timeout 500 ms)***

  current time:  (sd=1) 1078174232.816 ms
control loop state (sd=1): SYN_RCVD
  wait_for_event with timeout at 1078174233:315657000 secs
queue (sd=1): 1 entries
  (sd=1) 1078174233.315 ms
  ***queue entry: seq # 191 (sd=1, 0 timeout(s), next timeout 500 ms)***

  current time:  (sd=1) 1078174233.323 ms
  ***timed out: seq # 191 (sd=1, 0 timeout(s), next timeout 500 ms)***
  segment timer:  (sd=1) 1078174233.315 ms
****retransmitting segments****
cancel: -1 (heap size 0)
_send_segment windows (sd=1)
  send: last_byte_sent = 191, last_byte_acked = 190, last_byte_written =
191
  recv: next_byte_expected = 147, last_byte_read = 146, last_byte_received
= 146
_send_segment transmission time:  (sd=1) 1078174233.323 ms
_send_packet (sd=1) seq # 191 ack # 147: SYN ACK  0 byte payload
_network_send_packet peer:  171.64.15.39:52491
control loop state (sd=1): SYN_RCVD
  wait_for_event with timeout at 1078174233:823353000 secs
_network_recv_packet peer:  171.64.15.39:52491
transport_sock_io windows (sd=1)
  send: last_byte_sent = 191, last_byte_acked = 190, last_byte_written =
191
  recv: next_byte_expected = 147, last_byte_read = 146, last_byte_received
= 146
_recv_packet (sd=1) seq # 147 ack # 192: ACK  0 byte payload
completed SYN handshake
segment transmission count=2
cancel: 0 (heap size 1)
queue (sd=1): 0 entries

control loop state (sd=1): ESTABLISHED
  wait_for_event with infinite timeout
dequeueing established connection from 171.64.15.39:52491
***myaccept(0) returning new sd 1***
***myclose(0)***
stopping receive thread
stopped receive thread
socket network layer, closing socket 3
myclose(0) returning...
connected to 171.64.15.39 at port 52491
exiting on signal 27
[1]    Abort                         ./ftpd_tcp.debug


.

Path: shelby.stanford.edu!not-for-mail
From: "Nicolas Pombourcq" <nicolas.pombourcq@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Timeout on 2.B
Date: Mon, 1 Mar 2004 12:57:55 -0800
Lines: 5
Distribution: su
Message-ID: <c20875$dpc$1@news.Stanford.EDU>
References: <c1vsdo$s8v$1@news.Stanford.EDU> <c2012o$518$1@news.Stanford.EDU> <c202h4$6te$1@news.Stanford.EDU> <c202mc$737$1@news.Stanford.EDU> <c202vl$7d2$1@news.Stanford.EDU>
NNTP-Posting-Host: mummy.stanford.edu
X-Trace: news.Stanford.EDU 1078174757 14124 128.12.188.73 (1 Mar 2004 20:59: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:6659

I would just suggest that for future versions of this class you provide a
way of logging the traffic to a file as it is done in hw2 so that we can see
it with ethereal.


.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Timeout on 2.B
Date: Mon, 1 Mar 2004 21:01:24 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c208b4$e16$1@news.Stanford.EDU>
References: <c1vsdo$s8v$1@news.Stanford.EDU> <c2012o$518$1@news.Stanford.EDU> <c202h4$6te$1@news.Stanford.EDU> <c202mc$737$1@news.Stanford.EDU> <c202vl$7d2$1@news.Stanford.EDU> <c20875$dpc$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078174884 14374 171.64.15.69 (1 Mar 2004 21:01:24 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6660


>I would just suggest that for future versions of this class you provide a
>way of logging the traffic to a file as it is done in hw2 so that we can see
>it with ethereal.

You can already do this by using the VNS-based apps (stcp_echo_server,
stcp_echo_client), and testing against a standard TCP client/server.

.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS3 questions #4c,d
Date: Mon, 1 Mar 2004 21:02:58 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c208e2$e44$1@news.Stanford.EDU>
References: <c206n8$bvm$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078174978 14468 171.64.15.69 (1 Mar 2004 21:02:58 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6661


>Are we allowed to use R (the data rate of link (a)) in our answer? If not,
>how can we acount for the transmission time of the packet from the source
>(or can we ignore this)?

You can just ignore this (the problem is a bit of simplification to show
the intuition behind the rule of thumb for router buffer sizing).

.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Grading Criteria 2.H
Date: Mon, 1 Mar 2004 21:04:30 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c208gu$e7f$1@news.Stanford.EDU>
References: <4043A0F4.36895069@stanford.edu>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078175070 14575 171.64.15.69 (1 Mar 2004 21:04:30 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6662


>Given sequence numbers, why is it necessary to send packets before fin?

It isn't--this test just makes sure that all data is ACKed before the
connection is closed.  (Sending data and waiting for ACKs before sending
the FIN would be one way of doing this, of course).  That wording in the
grading guidelines remains from previous years, where FINs didn't have
sequence numbers.

.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Abort in ftpd_tcp.debug
Date: Mon, 1 Mar 2004 21:11:30 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c208u2$eo3$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403011254490.18972-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078175490 15107 171.64.15.69 (1 Mar 2004 21:11:30 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6663


I find the following in sys/iso/signal_iso.h:

#define SIGTTOU 27      /* background tty write attempted */                    


I haven't seen this--are you running ftpd_tcp in the background?
The description of SIGTTOU I find when googling suggests it might be
fixed by running instead as a usual foreground app...

.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: segfault in ftpd_tcp
Date: Mon, 1 Mar 2004 21:14:33 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <c2093o$etm$1@news.Stanford.EDU>
References: <c1v3fm$2g2$1@news.Stanford.EDU> <c201rn$65r$1@news.Stanford.EDU> <c203l1$883$1@news.Stanford.EDU> <c2067q$bdf$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078175673 15286 171.64.15.69 (1 Mar 2004 21:14:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6664


>According to gdb, ctx is not null.  I would really appreciate any help...

What did purify show?

.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS3 questions #4c,d
Date: Mon, 1 Mar 2004 13:26:55 -0800
Organization: CS Masters Program
Lines: 19
Distribution: su
Message-ID: <c209r3$frc$1@news.Stanford.EDU>
References: <c206n8$bvm$1@news.Stanford.EDU> <c208e2$e44$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078176420 16236 127.0.0.1 (1 Mar 2004 21:27:00 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:6665

Matt,

Thanks for your quick answer on my last-minute question.

Greg

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c208e2$e44$1@news.Stanford.EDU...
>
> >Are we allowed to use R (the data rate of link (a)) in our answer? If
not,
> >how can we acount for the transmission time of the packet from the source
> >(or can we ignore this)?
>
> You can just ignore this (the problem is a bit of simplification to show
> the intuition behind the rule of thumb for router buffer sizing).
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Milestone C
Date: Mon, 1 Mar 2004 13:37:53 -0800
Lines: 12
Distribution: su
Message-ID: <c20afo$gkt$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab4046c3.stanford.edu
X-Trace: news.Stanford.EDU 1078177080 17053 171.64.70.195 (1 Mar 2004 21:38:00 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:6666

On the assignment webpage it says that we have to work with the server:

/afs/ir/class/cs244a/WWW/homeworks/hw3/ftpd_src/src/ftpd_tcp

but that doesn't exist anymore.  What are we expected to test with?


Thanks,

Justin


.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Milestone C
Date: Mon, 1 Mar 2004 21:46:40 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <c20b00$h7g$1@news.Stanford.EDU>
References: <c20afo$gkt$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078177600 17648 171.64.15.69 (1 Mar 2004 21:46:40 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6667


>On the assignment webpage it says that we have to work with the server:

I've fixed the assignment.  ftpd_tcp is in ftpd_src, not ftpd_src/src

.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: myconnect errors
Date: Mon, 1 Mar 2004 14:29:32 -0800
Lines: 16
Distribution: su
Message-ID: <c20dgj$kem$1@news.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1078180179 20950 128.12.44.20 (1 Mar 2004 22:29: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:6668

I'm failing a few of the tests (2D, 2E, 2F, sometimes 2L) with:

Unexpected exit status 256. Program output:
myconnect: Connection refused

The only way that I can see this happening is if my Send function
returns -1, which would imply that either I'm trying to send a packet larger
than my effective window (which is fixed around 3072 during connection, so
that shouldn't be an issue), or that stcp_network_send returns -1. When we
have unreliable mode turned on, is it possible that it would make
stcp_network_send return -1? If not, how else could I get this return value?
Thanks.

- Sean


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: segfault in ftpd_tcp
Date: Mon, 1 Mar 2004 14:33:52 -0800
Lines: 11
Distribution: su
Message-ID: <c20dnj$kmo$1@news.Stanford.EDU>
References: <c1v3fm$2g2$1@news.Stanford.EDU> <c201rn$65r$1@news.Stanford.EDU> <c203l1$883$1@news.Stanford.EDU> <c2067q$bdf$1@news.Stanford.EDU> <c2093o$etm$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078180403 21208 128.12.61.97 (1 Mar 2004 22:33: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:6669

Is there a ftpd_tcp.purify?  Make all.purify didn't make one.  I'm confused
by a recent post to the newsgroup.  Are we supposed to test our ftpcopy
against the provided ftpd_tcp, or the one that's compiled using our
transport.c?

Oded

>
> What did purify show?


.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: segfault in ftpd_tcp
Date: Mon, 1 Mar 2004 22:36:26 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <c20dta$kqv$1@news.Stanford.EDU>
References: <c1v3fm$2g2$1@news.Stanford.EDU> <c201rn$65r$1@news.Stanford.EDU> <c203l1$883$1@news.Stanford.EDU> <c2067q$bdf$1@news.Stanford.EDU> <c2093o$etm$1@news.Stanford.EDU> <c20dnj$kmo$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078180586 21343 171.64.15.69 (1 Mar 2004 22:36:26 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6670


>Is there a ftpd_tcp.purify?  Make all.purify didn't make one.  I'm confused
>by a recent post to the newsgroup.  Are we supposed to test our ftpcopy
>against the provided ftpd_tcp, or the one that's compiled using our
>transport.c?

There is if you build one.  But you'll have to add the rule for this; the
Makefile doesn't build this as is.

Your ftpcopy should work against our ftpd_tcp, or your ftpd_tcp.  (If it
doesn't, something's broken).

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3 1c
Date: Mon, 1 Mar 2004 14:44:51 -0800
Lines: 10
Distribution: su
Message-ID: <c20ec5$lde$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078181061 21934 128.12.61.97 (1 Mar 2004 22:44: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:6671

What exactly is a "P bit time"?

"The WFQ scheduler now serves one packet at a time, instead of one bit at a
time, and ensures that each packet will depart within *P bit times* from
when it would depart if a bit-by-bit scheduler was used."

Thanks,
Oded


.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: myconnect errors
Date: Mon, 1 Mar 2004 22:45:00 +0000 (UTC)
Lines: 21
Distribution: su
Message-ID: <c20edc$lfm$1@news.Stanford.EDU>
References: <c20dgj$kem$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078181100 22006 171.64.15.69 (1 Mar 2004 22:45:00 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6672


>I'm failing a few of the tests (2D, 2E, 2F, sometimes 2L) with:

>Unexpected exit status 256. Program output:
>myconnect: Connection refused

>The only way that I can see this happening is if my Send function
>returns -1, which would imply that either I'm trying to send a packet larger
>than my effective window (which is fixed around 3072 during connection, so
>that shouldn't be an issue), or that stcp_network_send returns -1. When we
>have unreliable mode turned on, is it possible that it would make
>stcp_network_send return -1? If not, how else could I get this return value?

Unreliable mode shouldn't cause stcp_network_send() to return -1.  (It
would normally only return this if the underlying connection to the other
side died for some reason).  I would think the explanation lies elsewhere.

Most of these test cases use a special server, which assumes that you
use an ISN=1 in your client when FIXED_INITNUM is defined in transport.c.
Did you change this at all?

.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS3 1c
Date: Mon, 1 Mar 2004 22:59:58 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c20f9e$mkh$1@news.Stanford.EDU>
References: <c20ec5$lde$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078181998 23185 171.64.15.69 (1 Mar 2004 22:59:58 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6673


>What exactly is a "P bit time"?

Assume each bit takes n seconds to depart, then P bit times would be nP
seconds.

.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: myconnect errors
Date: Mon, 1 Mar 2004 15:01:41 -0800
Lines: 47
Distribution: su
Message-ID: <c20fd0$mr0$1@news.Stanford.EDU>
References: <c20dgj$kem$1@news.Stanford.EDU> <c20edc$lfm$1@news.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1078182112 23392 128.12.44.20 (1 Mar 2004 23:01: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:6674

No, the section

#ifdef FIXED_INITNUM
    /* please don't change this! */
    ctx->initial_sequence_num = 1;
#else
    /* you have to fill this up */
/*....my code...*/
#endif

is still intact. I'm able to transfer large files in unreliable mode fine
using the given client/server, and I'm fairly sure that I pass all the tests
for hw3a (running again, to be sure). I suppose that it would be possible
for the first SYN to get lost, though? I'll check to see if that could cause
any problems.

- Sean

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c20edc$lfm$1@news.Stanford.EDU...
>
> >I'm failing a few of the tests (2D, 2E, 2F, sometimes 2L) with:
>
> >Unexpected exit status 256. Program output:
> >myconnect: Connection refused
>
> >The only way that I can see this happening is if my Send function
> >returns -1, which would imply that either I'm trying to send a packet
larger
> >than my effective window (which is fixed around 3072 during connection,
so
> >that shouldn't be an issue), or that stcp_network_send returns -1. When
we
> >have unreliable mode turned on, is it possible that it would make
> >stcp_network_send return -1? If not, how else could I get this return
value?
>
> Unreliable mode shouldn't cause stcp_network_send() to return -1.  (It
> would normally only return this if the underlying connection to the other
> side died for some reason).  I would think the explanation lies elsewhere.
>
> Most of these test cases use a special server, which assumes that you
> use an ISN=1 in your client when FIXED_INITNUM is defined in transport.c.
> Did you change this at all?
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Ramesh Kumar" <rameshk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test 2.M
Date: Mon, 1 Mar 2004 16:38:18 -0800
Lines: 28
Distribution: su
Message-ID: <c20l22$qa$1@news.Stanford.EDU>
References: <c1ttns$i7o$1@news.Stanford.EDU> <c1u0ik$l3i$1@news.Stanford.EDU>
NNTP-Posting-Host: ayyappa.stanford.edu
X-Trace: news.Stanford.EDU 1078187906 842 128.12.131.94 (2 Mar 2004 00:38: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:6675

I am having the same problem. I fail with only (53 out of 4220) sent for
test M.
when I look into logs and ran client.retrans manually with my server, I send
upto 4220
seq num 6 times.

Ramesh.


"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1u0ik$l3i$1@news.Stanford.EDU...
>
> >Go-back N not enforced (retransmitted only up until 2298 rather than
3226)
>
> >I looked into .network_log.retrans.server.TESTDATA.0, it appears that the
> >largest sent seq is 2834. How can it retransmit 3226?
>
> presumably that was th_seq=2834 plus some packet payload?
>
> >I manually run client.retrans to talk to my server. I did retransmit up
> >until 3906 (and include 3226).
>
> If you fail this test, but the logs look correct, can you mail me your
> transport.c?
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: milstone C tests - timeout expired during grading
Date: Mon, 1 Mar 2004 17:14:03 -0800
Lines: 33
Distribution: su
Message-ID: <c20n4t$3ef$1@news.Stanford.EDU>
References: <c1tj3c$767$1@news.Stanford.EDU> <c1tkl7$8na$1@news.Stanford.EDU> <c1tsda$grb$1@news.Stanford.EDU> <c1u0lv$l7p$1@news.Stanford.EDU> <c1u0pv$li0$1@news.Stanford.EDU> <c1u4f0$qbg$1@news.Stanford.EDU> <c1uhrf$c3e$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1078190045 3535 128.12.173.169 (2 Mar 2004 01:14: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:6676


"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c1uhrf$c3e$1@news.Stanford.EDU...
>
> Keep in mind when running the script that since we run entirely in
> user space, CPU-intensive processes running on the same machine can
> cause havoc with our performance.  The client-server download that
> took 1s for me yesterday takes 20s on this machine now, with someone
> running ns.  This could easily cause the timeout issues you see--if
> so, retest on a more lightly loaded machine (remember that you can
> submit a new test without penalty if you haven't changed the code).

I am not so sure Matthew. Last night, when i finally got an elaine machine
that was very free, I again ran the test cases for part using my ftpcopy.c,
and the results were exactly the same - i got about 6 timeout errors and 2
errors which said that i had not been able to download all the files with
the specified extension. But when I ran with the reference ftpcopy,
everything was OK. I am out of wits as to debug this thing because i get no
errors when I run it locally - I have tried all combinations, like my
ftpcopy and the provided ftpd_tcp, your.ftpcopy and my ftpd_tcp and my
ftpcopy and my ftpd_tcp, and all run fine on the machine I am on, and even
download the same file in approximately the same time. I even tried
downloading about 20 files in 4 different levels and they all succeeded. So
I see no way to get an error so as to debug it. Since last evening, every
saga machine I have logged on has a ns program running taking up atleast 50%
of the cpu and its the same story today (it's been running for 26 hours now
i think), and the elaine machines have matlab and java running....so I do
not know if its worth giving the test cases for part C with my ftpcopy
another shot.

Kumar


.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: mysock equivalent to setsockopt
Date: Mon, 01 Mar 2004 17:16:18 -0800
Lines: 5
Distribution: su
Message-ID: <c20n93$gp8$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078190179 17192 127.0.0.1 (2 Mar 2004 01:16:19 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (X11/20040209)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6677

I use setsockopt in my ftpcopy client to allow reuse of a socket.  Is 
there an equivalent or should I just comment this out and ignore 
"address already in use" messages?

--William
.

Path: shelby.stanford.edu!not-for-mail
From: sumeet shendrikar <sumeets@stanford.edu>
Newsgroups: su.class.cs244a
Subject: hw4 - vns delivering ethernet packets of 54 bytes
Date: Mon, 01 Mar 2004 19:12:26 -0800
Lines: 14
Distribution: su
Message-ID: <c20u2r$c91$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-60149.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078197147 12577 128.12.197.131 (2 Mar 2004 03:12:27 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6678

do the rules from hw2 apply to hw4? specifically, i am getting ethernet 
packets of 54 bytes when I try to run (the supplied) ftpcopy through my 
router.  In hw2, the minimum size was 60 bytes, and the instructions 
were to discard packets of length less than 60 bytes (VNS was to pad 
data to get to the appropriate length, so a packet of less than 60 bytes 
was generally an error).

ping and traceroute work for my router, even when i connect my router 
using "-v vhost".


thanks,
sumeet

.

Path: shelby.stanford.edu!not-for-mail
From: Abhyudaya Sravanth Chodisetti <sravanth@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ERROR: 200 Type set to I. (-5)
Date: Mon, 01 Mar 2004 20:32:09 -0800
Lines: 29
Distribution: su
Message-ID: <40440E49.608FDB65@stanford.edu>
NNTP-Posting-Host: fable15.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078201929 17992 171.64.12.139 (2 Mar 2004 04:32:09 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:6679

Hi,

I have seen a posting earlier reporting the error below. I get the same
error.

Starting local ftpd
Working dir:
/afs/ir.stanford.edu/users/s/r/sravanth/class/cs244a/PA3/grading_src/build
Starting local ftpd: cd /usr/class/cs244a/WWW/homeworks/hw3/ftpd_src;
//afs/ir.stanford.edu/users/s/r/sravanth/class/cs244a/PA3/grading_src/build/ftpd_tcp
-U 2>
/afs/ir.stanford.edu/users/s/r/sravanth/class/cs244a/PA3/grading_src/build/.ftpd_port&
ftpd running on port 47064
Downloading files:  ./ftpcopy_tcp  -U c 3 47064@localhost
localhost_c_3_0 src
warning:  ftpcopy failed with exit code 1 (waitpid status 256)
program output:
ERROR: 200 Type set to I. (-5) 


When I run it manually(both ftpd and ftpcopy in unreliable modes and
same arguments), I see that all the files are transferred correcrtly but
the test script reports the error. 

Any suggestion on this?

Thanks,

Abhyudaya
.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Milestone C
Date: Mon, 1 Mar 2004 22:23:29 -0800
Lines: 11
Distribution: su
Message-ID: <c2199c$pjj$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc509.stanford.edu
X-Trace: news.Stanford.EDU 1078208620 26227 128.12.197.9 (2 Mar 2004 06:23:40 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:6680

On the assignment webpage it says that we have to work with the server:

/afs/ir/class/cs244a/WWW/homeworks/hw3/ftpd_src/src/ftpd_tcp

but that doesn't exist anymore.  What are we expected to work with?

Thanks,

Justin


.

Path: shelby.stanford.edu!not-for-mail
From: mikelain <mikelain@stanford.edu>
Newsgroups: su.class.cs244a
Subject: test 1.D questions
Date: Mon, 01 Mar 2004 23:05:13 -0800
Lines: 59
Distribution: su
Message-ID: <c21bn9$scf$1@news.Stanford.EDU>
NNTP-Posting-Host: firebird9.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078211113 29071 171.64.15.23 (2 Mar 2004 07:05:13 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:6681

I am getting the following error:

Test 1.D [out of 2.5]
Checks that Tx doesn't overflow receiver window.

Results:  NOT OK

Sender window not enforced
(110240 bytes were outstanding, but the window size is 3072 bytes)


I think 110240 is the size of the entire file it is transfering, isn't 
it? So i'm not sure how this can be possible to pass every other test 
but fail this one.

Can you let me know a little bit more about what this test is actually 
testing? I'd like to know:
-Is this using both my client and my server? Or your reference client 
with my server? Or my client with your reference server?
-Is it correct to say that failing this test means that my program is 
sending out more than 3072 bytes of unacknowledged data? (sending more 
data beyond the 3072 byte sender window before it recieves ACKs from 
previously sent packets?)
-Is there any way to go about debugging this? I tried looking at the log 
files, and my server log looks like this:

log: network_send: a DATA packet with seq=1, len=22 and timestamp=171997141
log: network_send: a DATA packet with seq=23, len=536 and 
timestamp=171997141
log: network_send: a DATA packet with seq=559, len=536 and 
timestamp=171997142
log: network_send: a DATA packet with seq=1095, len=536 and 
timestamp=171997142
log: network_send: a DATA packet with seq=1631, len=536 and 
timestamp=171997142
log: network_send: a DATA packet with seq=2167, len=536 and 
timestamp=171997143
log: network_send: a DATA packet with seq=2703, len=370 and 
timestamp=171997143
log: network_recv: an ACK packet with seq=23, len=0 and ack=23 and 
timestamp=171997330
log: network_send: a DATA packet with seq=3073, len=22 and 
timestamp=171997330
log: network_recv: an ACK packet with seq=559, len=0 and ack=559 and 
timestamp=171997331
log: network_send: a DATA packet with seq=3095, len=536 and 
timestamp=171997331
log: network_recv: an ACK packet with seq=1095, len=0 and ack=1095 and 
timestamp=171997331
log: network_send: a DATA packet with seq=3631, len=536 and 
timestamp=171997331
log: network_recv: an ACK packet with seq=1631, len=0 and ack=1631 and 
timestamp=171997332

 From this log, it looks to me like there are being ACKs sent before any 
more data is sent... is there something I'm missing here?

Thank you very much!

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: stcp_api.c:72
Date: Mon, 01 Mar 2004 23:14:31 -0800
Lines: 4
Distribution: su
Message-ID: <c21c8q$gp8$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078211674 17192 127.0.0.1 (2 Mar 2004 07:14:34 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (X11/20040209)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6682

Is there a reason why stcp_wait_for_event is not checking for a 
APP_CLOSE_REQUESTED flag before returning the event?

--William
.

Path: shelby.stanford.edu!elaine30.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: reference ftpcopy: never sends close req down after transport.c
 calls stcp_fin_received
Date: Tue, 2 Mar 2004 02:41:17 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.GSO.4.44.0403020234110.18132-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 1078224081 13449 171.64.15.105 (2 Mar 2004 10:41:21 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6683


I used the ftpcopy provided (my own ftpcopy uses recv(MSG_PEEK), I thought
it is easier to user the one provided.).  I noticed that for the data
connection created for listing the directory strutuer, when the server
sends FIN to the client, the transport.c code calls "stcp_fin_received",
but the ftpcopy never sends close_req down.  Hence the connection is
frozen.  What could be the reason for the ftpcopy not to send close req
down if it knowns that FIN has arrived from server?

.

Path: shelby.stanford.edu!not-for-mail
From: "Lei Zhang" <lei.zhang@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test F.1/F.2
Date: Tue, 2 Mar 2004 03:41:59 -0800
Lines: 27
Distribution: su
Message-ID: <c21ru9$gc8$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078227721 16776 127.0.0.1 (2 Mar 2004 11:42: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:6684

My tests F.1 and F.2 failed with following errors:

Result of diff between your output and solution (localhost)
(">" indicates files missing in your output):
1a2,15
> acl.c
> authenticate.c
> conversions.c
> extensions.c
> ftpcmd.c
> ftpcount.c
> ftpd.c
> ftpshut.c
> glob.c
> logwtmp.c
> popen.c
> private.c
> realpath.c
> vers.c

I thought my local dir was the working directory for ftpd. And those files
are no where in my directories...

Thanks,
Lei


.

Path: shelby.stanford.edu!saga15.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: mysock equivalent to setsockopt
Date: Tue, 2 Mar 2004 07:09:26 -0800
Lines: 26
Distribution: su
Message-ID: <Pine.GSO.4.44.0403020706020.19111-100000@saga15.Stanford.EDU>
References: <c20n93$gp8$1@news.Stanford.EDU>
NNTP-Posting-Host: saga15.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078240168 29561 171.64.15.145 (2 Mar 2004 15:09:28 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c20n93$gp8$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6685

I'm using setsockopt as well and my ftp client doesn't work without it:

setsockopt -: Socket operation on non-socket

Commenting out ths setsockopt doesn't seem to work for me.
How do we make this work with mysock?

Thanks,

Ed

On Mon, 1 Mar 2004, William Chan wrote:

> Date: Mon, 01 Mar 2004 17:16:18 -0800
> From: William Chan <chanman@stanford.edu>
> Newsgroups: su.class.cs244a
> Subject: mysock equivalent to setsockopt
>
> I use setsockopt in my ftpcopy client to allow reuse of a socket.  Is
> there an equivalent or should I just comment this out and ignore
> "address already in use" messages?
>
> --William
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test F.1/F.2
Date: Tue, 2 Mar 2004 07:43:27 -0800
Lines: 37
Distribution: su
Message-ID: <c22a31$15t$1@news.Stanford.EDU>
References: <c21ru9$gc8$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1078242210 1213 128.12.173.169 (2 Mar 2004 15:43: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:6686

I get exactly the same error for F.1 and F.2 when i run the milestone C
tests using my ftpcopy.c...but if I use the binaries provided by the course
staff, there are no errors reported.

Kumar

"Lei Zhang" <lei.zhang@cs.stanford.edu> wrote in message
news:c21ru9$gc8$1@news.Stanford.EDU...
> My tests F.1 and F.2 failed with following errors:
>
> Result of diff between your output and solution (localhost)
> (">" indicates files missing in your output):
> 1a2,15
> > acl.c
> > authenticate.c
> > conversions.c
> > extensions.c
> > ftpcmd.c
> > ftpcount.c
> > ftpd.c
> > ftpshut.c
> > glob.c
> > logwtmp.c
> > popen.c
> > private.c
> > realpath.c
> > vers.c
>
> I thought my local dir was the working directory for ftpd. And those files
> are no where in my directories...
>
> Thanks,
> Lei
>
>


.

Path: shelby.stanford.edu!elaine30.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: reference ftpcopy: never sends close req down after transport.c
 calls stcp_fin_received
Date: Tue, 2 Mar 2004 09:14:06 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.GSO.4.44.0403020912460.542-100000@elaine30.Stanford.EDU>
References: <Pine.GSO.4.44.0403020234110.18132-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 1078247649 6992 171.64.15.105 (2 Mar 2004 17:14:09 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0403020234110.18132-100000@elaine30.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6687


Never mind the quesion. I forgot to unblock the app!

On Tue, 2 Mar 2004, Xiaohua Fang wrote:

>
> I used the ftpcopy provided (my own ftpcopy uses recv(MSG_PEEK), I thought
> it is easier to user the one provided.).  I noticed that for the data
> connection created for listing the directory strutuer, when the server
> sends FIN to the client, the transport.c code calls "stcp_fin_received",
> but the ftpcopy never sends close_req down.  Hence the connection is
> frozen.  What could be the reason for the ftpcopy not to send close req
> down if it knowns that FIN has arrived from server?
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Debug directive
Date: Tue, 2 Mar 2004 17:30:34 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c22gbq$7mc$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine28.stanford.edu
X-Trace: news.Stanford.EDU 1078248634 7884 171.64.15.103 (2 Mar 2004 17:30:34 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:6688

Is the DEBUG preprocessor directive turned on in the makefile used for 
grading milestone B?

The reason I ask is I just discovered a compile error that only 
appears if this flag is turned on (it is turned off in the code file 
itself).

Tyrone

.

Path: shelby.stanford.edu!not-for-mail
From: mikelain <mikelain@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: test 1.D questions
Date: Tue, 02 Mar 2004 09:37:48 -0800
Lines: 6
Distribution: su
Message-ID: <c22gpc$845$1@news.Stanford.EDU>
References: <c21bn9$scf$1@news.Stanford.EDU>
NNTP-Posting-Host: firebird9.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078249068 8325 171.64.15.23 (2 Mar 2004 17:37:48 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:6689

hmm... i seem to have fixed it after implementing some more of milestone 
B... i think it may have had something to do with me not setting the 
th_seq in the ACK packets to be the next expected outgoing byte (I had 
only concerned myself with setting the th_ack of the ACK packet... how 
about that!)

.

Path: shelby.stanford.edu!elaine30.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Memory leak in the provided ftpcopy and ftpd
Date: Tue, 2 Mar 2004 10:45:03 -0800
Lines: 152
Distribution: su
Message-ID: <Pine.GSO.4.44.0403021034360.3327-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 1078253106 13094 171.64.15.105 (2 Mar 2004 18:45:06 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6690


When I ran purify against the ftpcopy (the libftpcopy.a provided by TA
linked with my STCP implementation) and ftpd (with my STCP), I found the
followin memory leak.  Is it a correct assumption that we are not
responsible for any memory leak occurred outside of the code we wrote?
Hence, I can just ignore these error messages, right?

====ftpcopy_tcp.purify==============
      Memory leaked: 16448 bytes (78.9%); potentially leaked: 0 bytes (0%)
         MLK: 4112 bytes leaked at 0xc0948
         This memory was allocated from:
               malloc         [rtlib.o]
               traverse_tree  [ftpclient.c:351]
               main           [ftpclient.c:271]
               _start         [crt1.o]
         MLK: 4112 bytes leaked at 0xc2a18
         This memory was allocated from:
               malloc         [rtlib.o]
               traverse_tree  [ftpclient.c:351]
               traverse_tree  [ftpclient.c:524]
               main           [ftpclient.c:271]
               _start         [crt1.o]
         MLK: 4112 bytes leaked at 0xc4a58
         This memory was allocated from:
               malloc         [rtlib.o]
               traverse_tree  [ftpclient.c:351]
               traverse_tree  [ftpclient.c:524]
               traverse_tree  [ftpclient.c:524]
               main           [ftpclient.c:271]
               _start         [crt1.o]
         MLK: 4112 bytes leaked at 0xc6b28
         This memory was allocated from:
               malloc         [rtlib.o]
               traverse_tree  [ftpclient.c:351]
               traverse_tree  [ftpclient.c:524]
               traverse_tree  [ftpclient.c:524]
               traverse_tree  [ftpclient.c:524]
               main           [ftpclient.c:271]
         Purify Heap Analysis (combining suppressed and unsuppressed
blocks)

====ftpd_tcp.purify==============
      UMR: Uninitialized memory read
      This is occurring while in:
            user           [ftpd.c:854]
            yyparse        [ftpcmd.y:148]
            main           [ftpd.c:676]
            _start         [crt1.o]
      Reading 4 bytes from 0xffbef1d8 on the stack.
      Address 0xffbef1d8 is        4 bytes past start of local variable
"cp" in function user.
      UMR: Uninitialized memory read
      This is occurring while in:
            _putmsg        [libc.so.1]
            putmsg         [libthread.so.1]
            clnt_dg_call   [clnt_dg.c]
            __rpcb_findaddr_timed [rpcb_clnt.c]
            clnt_tp_create_timed [clnt_generic.c]
            clnt_create_timed [clnt_generic.c]
      Reading 12 bytes from 0xffbee404 on the stack (4 bytes at 0xffbee404
uninit).
      Address 0xffbee404 is       60 bytes below frame pointer in function
clnt_dg_call.
      UMR: Uninitialized memory read
      This is occurring while in:
            pass           [ftpd.c:1148]
            yyparse        [ftpcmd.y:166]
            main           [ftpd.c:676]
            _start         [crt1.o]
      Reading 4 bytes from 0xffbef1c0 on the stack.
      Address 0xffbef1c0 is       48 bytes below frame pointer in function
pass.
      UMR: Uninitialized memory read (7 times)
      This is occurring while in:
            cwd            [ftpd.c:2189]
            yyparse        [ftpcmd.y:364]
            main           [ftpd.c:676]
            _start         [crt1.o]
      Reading 4 bytes from 0xffbef1d8 on the stack.
      Address 0xffbef1d8 is       24 bytes below frame pointer in function
cwd.
      Process 3219 about to exec /bin/ls as "/bin/ls".
      UMR: Uninitialized memory read (4 times)
      This is occurring while in:
            send_data      [ftpd.c:1834]
            retrieve       [ftpd.c:1374]
            yyparse        [ftpcmd.y:301]
            main           [ftpd.c:676]
            _start         [crt1.o]
      Reading 4 bytes from 0xffbee3c4 on the stack.
      Address 0xffbee3c4 is        4 bytes past start of local variable
"c" in function send_data.
      UMR: Uninitialized memory read (4 times)
      This is occurring while in:
            retrieve       [ftpd.c:1414]
            yyparse        [ftpcmd.y:301]
            main           [ftpd.c:676]
            _start         [crt1.o]
      Reading 4 bytes from 0xffbee49c on the stack.
      Address 0xffbee49c is     3412 bytes below frame pointer in function
retrieve.
      UMR: Uninitialized memory read (25 times)
      This is occurring while in:
            send_data      [ftpd.c:1834]
            retrieve       [ftpd.c:1374]
            yyparse        [ftpcmd.y:260]
            main           [ftpd.c:676]
            _start         [crt1.o]
      Reading 4 bytes from 0xffbee3c4 on the stack.
      Address 0xffbee3c4 is        4 bytes past start of local variable
"c" in function send_data.
      UMR: Uninitialized memory read (25 times)
      This is occurring while in:
            retrieve       [ftpd.c:1414]
            yyparse        [ftpcmd.y:260]
            main           [ftpd.c:676]
            _start         [crt1.o]
      Reading 4 bytes from 0xffbee49c on the stack.
      Address 0xffbee49c is     3412 bytes below frame pointer in function
retrieve.

      Memory leaked: 30720 bytes (15.2%); potentially leaked: 0 bytes (0%)
         MLK: 25600 bytes leaked in 25 blocks
         This memory was allocated from:
               malloc         [rtlib.o]
               send_data      [ftpd.c:1745]
               retrieve       [ftpd.c:1374]
               yyparse        [ftpcmd.y:260]
               main           [ftpd.c:676]
               _start         [crt1.o]
         Block of 1024 bytes (25 times); last block at 0xe8488
         MLK: 3072 bytes leaked in 3 blocks
         This memory was allocated from:
               malloc         [rtlib.o]
               send_data      [ftpd.c:1745]
               retrieve       [ftpd.c:1374]
               yyparse        [ftpcmd.y:301]
               main           [ftpd.c:676]
               _start         [crt1.o]
         Block of 1024 bytes (3 times); last block at 0xf78b8
         MLK: 2048 bytes leaked at 0x12b658
         This memory was allocated from:
               malloc         [rtlib.o]
               realloc        [rtlib.o]
               send_data      [ftpd.c:1765]
               retrieve       [ftpd.c:1374]
               yyparse        [ftpcmd.y:301]
               main           [ftpd.c:676]
         Purify Heap Analysis (combining suppressed and unsuppressed
blocks)


.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: broken pipe
Date: Tue, 2 Mar 2004 11:51:35 -0800
Lines: 42
Distribution: su
Message-ID: <Pine.GSO.4.44.0403021119270.6062-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 1078257096 17651 171.64.15.39 (2 Mar 2004 19:51:36 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6691

Using ftpd_tcp I'm failing in the case when the following
sequence occurrs.

ftpdcopy_tcp sends SYN
ftpd_tcp replies with SYN-ACK
ftpdcopy_tcp sends FIN-ACK
ftpd_tcp sees replies with ACK to the FIN.
Since both ACK and FIN were received, transport layer
at ftpd_tcp unblocks applications (connection established
due to ACK) and also calls app_fin_rcvd(...).
ftpd_tcp sends some data bytes.
ftpdcopy_tcp ACKs data bytes.
ftpd_tcp calls APP_CLOSE_REQUESTED
ftpd_tcp sends FIN/ACK
ftpdcopy_tcp replies with an ACK and exits.
ftpd_tcp wakes up due to timeout and sends FIN/ACK again.
Suddenly, ftpd_tcp decides to call APP_CLOSE_REQUESTED which I ignore.
ftpd_tcp wakes up again due to timeout and sends FIN/ACK 3rd time.

And then I get this from the gdb output due to broken pipe.
Stack points to Matthew's source code.  Matthew, could you
tell me what's going on.

Program received signal SIGPIPE, Broken pipe.
[Switching to LWP 4]
0xff0d91f0 in __sigprocmask () from /usr/lib/libthread.so.1
(gdb) backtrace
#0  0xff0d91f0 in __sigprocmask () from /usr/lib/libthread.so.1
#1  0xff0ce22c in __bounceself () from /usr/lib/libthread.so.1
#2  0xff0cda28 in _reap_wait_cancel () from /usr/lib/libthread.so.1
#3  0xff0cfca4 in _thrp_join () from /usr/lib/libthread.so.1
#4  0x000150c8 in myclose (sd=1) at mysock_api.c:179
#5  0x0002033c in dologout (status=0)
    at
/afs/ir/users/h/o/holliman/cs244a/grading_script/src/scripts/cs244a/stcp_ref_soln/ftpd_src/src/ftpd.c:2324
#6  0x0002171c in yylex () at
/hpn/home/holliman/stcp/ftpd_src/src/ftpcmd.y:974
#7  0x00026460 in yyparse () at y.tab.c:1996
#8  0x0001c16c in main (argc=0, argv=0xffbef86c, envp=0xffbef878)
    at
/afs/ir/users/h/o/holliman/cs244a/grading_script/src/scripts/cs244a/stcp_ref_soln/ftpd_src/src/ftpd.c:676

.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: broken pipe
Date: Tue, 2 Mar 2004 15:07:23 -0800
Lines: 66
Distribution: su
Message-ID: <Pine.GSO.4.44.0403021458570.8839-100000@epic6.Stanford.EDU>
References: <Pine.GSO.4.44.0403021119270.6062-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 1078268845 1206 171.64.15.39 (2 Mar 2004 23:07:25 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0403021119270.6062-100000@epic6.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6692

I found the problem with broken pipe.  I was unblocking application
earlier then setting errno.  As a result a socket descriptor was
non negative and Matt's program tried to send data.  So this brings
another question?  If we're in SYN_RCVD state and FIN-ACK arrives,
then

1).  Since we have an ACK set, then connection is established
and due to FIN immediately requested to be terminated.  This
results in broken pipe.

2). SYN/ACK is considered together and hence connection was never
established.  In this case, myaccept will return -1 and application
exits with status 1 rather than 0.  Will the script penalize for this?
I could try it out but don't want to waste  my run on this and comment
from TA would be appreciated.

Thanks.

is this considered a connection refusal or is it an

On Tue, 2 Mar 2004, Boris Senderzon wrote:

> Using ftpd_tcp I'm failing in the case when the following
> sequence occurrs.
>
> ftpdcopy_tcp sends SYN
> ftpd_tcp replies with SYN-ACK
> ftpdcopy_tcp sends FIN-ACK
> ftpd_tcp sees replies with ACK to the FIN.
> Since both ACK and FIN were received, transport layer
> at ftpd_tcp unblocks applications (connection established
> due to ACK) and also calls app_fin_rcvd(...).
> ftpd_tcp sends some data bytes.
> ftpdcopy_tcp ACKs data bytes.
> ftpd_tcp calls APP_CLOSE_REQUESTED
> ftpd_tcp sends FIN/ACK
> ftpdcopy_tcp replies with an ACK and exits.
> ftpd_tcp wakes up due to timeout and sends FIN/ACK again.
> Suddenly, ftpd_tcp decides to call APP_CLOSE_REQUESTED which I ignore.
> ftpd_tcp wakes up again due to timeout and sends FIN/ACK 3rd time.
>
> And then I get this from the gdb output due to broken pipe.
> Stack points to Matthew's source code.  Matthew, could you
> tell me what's going on.
>
> Program received signal SIGPIPE, Broken pipe.
> [Switching to LWP 4]
> 0xff0d91f0 in __sigprocmask () from /usr/lib/libthread.so.1
> (gdb) backtrace
> #0  0xff0d91f0 in __sigprocmask () from /usr/lib/libthread.so.1
> #1  0xff0ce22c in __bounceself () from /usr/lib/libthread.so.1
> #2  0xff0cda28 in _reap_wait_cancel () from /usr/lib/libthread.so.1
> #3  0xff0cfca4 in _thrp_join () from /usr/lib/libthread.so.1
> #4  0x000150c8 in myclose (sd=1) at mysock_api.c:179
> #5  0x0002033c in dologout (status=0)
>     at
> /afs/ir/users/h/o/holliman/cs244a/grading_script/src/scripts/cs244a/stcp_ref_soln/ftpd_src/src/ftpd.c:2324
> #6  0x0002171c in yylex () at
> /hpn/home/holliman/stcp/ftpd_src/src/ftpcmd.y:974
> #7  0x00026460 in yyparse () at y.tab.c:1996
> #8  0x0001c16c in main (argc=0, argv=0xffbef86c, envp=0xffbef878)
>     at
> /afs/ir/users/h/o/holliman/cs244a/grading_script/src/scripts/cs244a/stcp_ref_soln/ftpd_src/src/ftpd.c:676
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: mysock equivalent to setsockopt
Date: Tue, 2 Mar 2004 17:09:35 -0800
Lines: 18
Distribution: su
Message-ID: <c23b7c$9ol$1@news.Stanford.EDU>
References: <c20n93$gp8$1@news.Stanford.EDU> <Pine.GSO.4.44.0403020706020.19111-100000@saga15.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078276140 10005 128.12.61.97 (3 Mar 2004 01:09:00 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:6693

Same problem.
Except my setsockopt is accompanied by a comment saying "following Martin's
advice" =P

Oded

> I'm using setsockopt as well and my ftp client doesn't work without it:
>
> setsockopt -: Socket operation on non-socket
>
> Commenting out ths setsockopt doesn't seem to work for me.
> How do we make this work with mysock?
>
> Thanks,
>
> Ed


.

Path: shelby.stanford.edu!elaine12.Stanford.EDU!spathak
From: Sumedh Pathak <spathak@stanford.edu>
Newsgroups: su.class.cs244a
Subject: which ftpd?
Date: Tue, 2 Mar 2004 17:45:29 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0403021739030.21296-100000@elaine12.Stanford.EDU>
NNTP-Posting-Host: elaine12.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078278331 12847 171.64.15.77 (3 Mar 2004 01:45:31 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6694


Hi,

I run the ftpd_tcp provided in
/usr/class/cs244a/WWW/homeworks/hw3/ftpd_src/ftpd_tcp, and my client works
fine with that in -U mode.

However, when i run the tests, some thread in my client keeps timing out
with no data arriving. This same behaviour occurs when I used the ftpd_tcp
which was in the local directory.( which i got through gethw).

Also, if I diff the ftpd_tcp binary in grading_src/build (which is run
during the tests), and the one in the WWW directory, they are different.

So, shouldn't the tests be run against the one in the WWW dir?

Sumedh

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: which ftpd?
Date: Tue, 2 Mar 2004 17:50:40 -0800
Lines: 25
Distribution: su
Message-ID: <c23dkb$cqm$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403021739030.21296-100000@elaine12.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078278603 13142 128.12.61.97 (3 Mar 2004 01:50: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:6695

I believe that when you make, it recompiles ftpd_tcp using your transport
layer.  Am I wrong on this?

Oded

>
> Hi,
>
> I run the ftpd_tcp provided in
> /usr/class/cs244a/WWW/homeworks/hw3/ftpd_src/ftpd_tcp, and my client works
> fine with that in -U mode.
>
> However, when i run the tests, some thread in my client keeps timing out
> with no data arriving. This same behaviour occurs when I used the ftpd_tcp
> which was in the local directory.( which i got through gethw).
>
> Also, if I diff the ftpd_tcp binary in grading_src/build (which is run
> during the tests), and the one in the WWW directory, they are different.
>
> So, shouldn't the tests be run against the one in the WWW dir?
>
> Sumedh
>


.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: mysock equivalent to setsockopt
Date: Wed, 3 Mar 2004 01:54:14 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c23ds6$d4d$1@news.Stanford.EDU>
References: <c20n93$gp8$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1078278854 13453 171.64.15.74 (3 Mar 2004 01:54:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6696


>I use setsockopt in my ftpcopy client to allow reuse of a socket.  Is 
>there an equivalent or should I just comment this out and ignore 
>"address already in use" messages?

No, there's no equivalent in the mysock layer.  It's doubtful that you
could comment it out and have it work--if you could, there was no
reason to have the call in the first place.  There really isn't a need
to use this in ftpcopy, though...

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: behavior of ftpd daemon
Date: Tue, 2 Mar 2004 17:55:57 -0800
Lines: 10
Distribution: su
Message-ID: <c23du0$d5k$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1078278912 13492 128.12.189.163 (3 Mar 2004 01:55:12 GMT)
X-Complaints-To: news@news.stanford.edu
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:6697

Hi,
I had a question-if the daemon sends all the files and your transport layer
goes into CLOSED state, the daemon should not exit right?
I'm asking this coz my daemon transfers all files correctly but exits after
transferring all of them.
I should worry about this right?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: mysock equivalent to setsockopt
Date: Tue, 2 Mar 2004 17:56:50 -0800
Lines: 21
Distribution: su
Message-ID: <c23dvt$d7v$1@news.Stanford.EDU>
References: <c20n93$gp8$1@news.Stanford.EDU> <c23ds6$d4d$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078278973 13567 128.12.61.97 (3 Mar 2004 01:56: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:6698

As I recall, the use of this function was suggested by Martin at some point.
At least, that's what the comment in my code says.  So "really isn't a need"
isn't really fair to those of us who have to redo parts of ftpcopy to make
it work =/

Oded

P.S.  No offense Martin ;-)

>
> >I use setsockopt in my ftpcopy client to allow reuse of a socket.  Is
> >there an equivalent or should I just comment this out and ignore
> >"address already in use" messages?
>
> No, there's no equivalent in the mysock layer.  It's doubtful that you
> could comment it out and have it work--if you could, there was no
> reason to have the call in the first place.  There really isn't a need
> to use this in ftpcopy, though...
>


.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: test 1.D questions
Date: Wed, 3 Mar 2004 02:01:13 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c23e99$dn6$1@news.Stanford.EDU>
References: <c21bn9$scf$1@news.Stanford.EDU> <c22gpc$845$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1078279273 14054 171.64.15.74 (3 Mar 2004 02:01:13 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6699


>hmm... i seem to have fixed it after implementing some more of milestone 
>B... i think it may have had something to do with me not setting the 
>th_seq in the ACK packets to be the next expected outgoing byte (I had 
>only concerned myself with setting the th_ack of the ACK packet... how 
>about that!)

that test doesn't look at th_seq in ACK packets.  so I don't know why you'd
have failed, or what you did to fix it...

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: stcp_api.c:72
Date: Wed, 3 Mar 2004 02:06:36 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c23ejc$e1b$1@news.Stanford.EDU>
References: <c21c8q$gp8$2@news.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1078279596 14379 171.64.15.74 (3 Mar 2004 02:06:36 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6700


>Is there a reason why stcp_wait_for_event is not checking for a 
>APP_CLOSE_REQUESTED flag before returning the event?

no, not particularly--the network event flag could be handled the same way,
since this would always be set on input.  the reason is most likely that it
was written late at night...

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test F.1/F.2
Date: Wed, 3 Mar 2004 02:08:10 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c23ema$e6d$1@news.Stanford.EDU>
References: <c21ru9$gc8$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1078279690 14541 171.64.15.74 (3 Mar 2004 02: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:6701



>I thought my local dir was the working directory for ftpd. And those files
>are no where in my directories...

nope, ftpd is run inside the ftpd_src/src directory as I recall.

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Debug directive
Date: Wed, 3 Mar 2004 02:09:05 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c23eo1$e93$1@news.Stanford.EDU>
References: <c22gbq$7mc$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1078279745 14627 171.64.15.74 (3 Mar 2004 02:09:05 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6702


>Is the DEBUG preprocessor directive turned on in the makefile used for 
>grading milestone B?

No, debugging output is the last thing we want to see when grading...

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Memory leak in the provided ftpcopy and ftpd
Date: Wed, 3 Mar 2004 02:10:43 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c23er3$ef8$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403021034360.3327-100000@elaine30.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1078279843 14824 171.64.15.74 (3 Mar 2004 02:10:43 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6703



>When I ran purify against the ftpcopy (the libftpcopy.a provided by TA
>linked with my STCP implementation) and ftpd (with my STCP), I found the
>followin memory leak.  Is it a correct assumption that we are not
>responsible for any memory leak occurred outside of the code we wrote?

Yes, you can ignore the memory leaks in the provided code.  (And for
that matter, you aren't responsible in HW4 for being able to FTP to sites
for which the provided code fails, either).

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: broken pipe
Date: Wed, 3 Mar 2004 02:18:48 +0000 (UTC)
Lines: 19
Distribution: su
Message-ID: <c23fa8$f14$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403021119270.6062-100000@epic6.Stanford.EDU> <Pine.GSO.4.44.0403021458570.8839-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1078280328 15396 171.64.15.74 (3 Mar 2004 02:18:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6704


>1).  Since we have an ACK set, then connection is established
>and due to FIN immediately requested to be terminated.  This
>results in broken pipe.

The broken pipe should be ignored (see network_io_socket.c).
This would only be a problem in gdb, which will stop on the signal.
You can get around this by doing 'handle SIGPIPE nostop noprint pass'
in gdb, or by putting this in your .gdbinit

>2). SYN/ACK is considered together and hence connection was never
>established.  In this case, myaccept will return -1 and application
>exits with status 1 rather than 0.  Will the script penalize for this?

This seems like incorrect behaviour--assuming the ACK was valid for
the SYN-ACK, the connection was actually setup and then torn down
immediately.  So myaccept() would return a valid socket, and then
the first myread() would return 0 bytes.

.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: which ftpd?
Date: Tue, 2 Mar 2004 18:18:59 -0800
Lines: 27
Distribution: su
Message-ID: <Pine.GSO.4.44.0403021813140.13490-100000@epic6.Stanford.EDU>
References: <Pine.GSO.4.44.0403021739030.21296-100000@elaine12.Stanford.EDU>
NNTP-Posting-Host: epic6.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078280340 15411 171.64.15.39 (3 Mar 2004 02:19:00 GMT)
X-Complaints-To: news@news.stanford.edu
To: Sumedh Pathak <spathak@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403021739030.21296-100000@elaine12.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6705

The timeout (at least in my case) in the script is due to the need
to handle case when you get FIN-ACK while you're in SYN_RCVD state.

Boris.

On Tue, 2 Mar 2004, Sumedh Pathak wrote:

>
> Hi,
>
> I run the ftpd_tcp provided in
> /usr/class/cs244a/WWW/homeworks/hw3/ftpd_src/ftpd_tcp, and my client works
> fine with that in -U mode.
>
> However, when i run the tests, some thread in my client keeps timing out
> with no data arriving. This same behaviour occurs when I used the ftpd_tcp
> which was in the local directory.( which i got through gethw).
>
> Also, if I diff the ftpd_tcp binary in grading_src/build (which is run
> during the tests), and the one in the WWW directory, they are different.
>
> So, shouldn't the tests be run against the one in the WWW dir?
>
> Sumedh
>
>

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: which ftpd?
Date: Wed, 3 Mar 2004 02:21:17 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c23fet$fb2$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403021739030.21296-100000@elaine12.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1078280477 15714 171.64.15.74 (3 Mar 2004 02:21:17 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6706




>So, shouldn't the tests be run against the one in the WWW dir?

Your code should run against our ftpd (the one in the WWW dir), or
your ftpd (in your dir).  At the moment, the scripts use your ftpd.

Boris brings up a good point, which is that there are some edge
conditions you'll likely find with ftpcopy/ftpd that weren't covered
in previous test cases.  You should be able to run ftpd/ftpcopy
exactly as the script does, and debug these with gdb.

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: behavior of ftpd daemon
Date: Wed, 3 Mar 2004 02:22:04 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <c23fgc$fcg$1@news.Stanford.EDU>
References: <c23du0$d5k$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1078280524 15760 171.64.15.74 (3 Mar 2004 02:22:04 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6707


>I should worry about this right?

no.

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ERROR: 200 Type set to I. (-5)
Date: Wed, 3 Mar 2004 02:23:28 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c23fj0$ff2$1@news.Stanford.EDU>
References: <40440E49.608FDB65@stanford.edu>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1078280608 15842 171.64.15.74 (3 Mar 2004 02:23:28 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6708


>When I run it manually(both ftpd and ftpcopy in unreliable modes and
>same arguments), I see that all the files are transferred correcrtly but
>the test script reports the error. 

Can you show the exact commands and output you get when running at
the command line?  The reason I ask is that I've yet to see a case where
the identical commands work outside the script, but somehow fail inside...

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: mysock equivalent to setsockopt
Date: Tue, 2 Mar 2004 19:22:18 -0800
Lines: 15
Distribution: su
Message-ID: <c23j05$44j$1@news.Stanford.EDU>
References: <c20n93$gp8$1@news.Stanford.EDU> <c23ds6$d4d$1@news.Stanford.EDU> <c23dvt$d7v$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078284101 4243 128.12.61.97 (3 Mar 2004 03:21: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:6709

Btw, the post was in the newsgroup:
Re: problem with accepting new data connections

> As I recall, the use of this function was suggested by Martin at some
point.
> At least, that's what the comment in my code says.  So "really isn't a
need"
> isn't really fair to those of us who have to redo parts of ftpcopy to make
> it work =/
>
> Oded
>
> P.S.  No offense Martin ;-)


.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: broken pipe
Date: Tue, 2 Mar 2004 19:57:46 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.GSO.4.44.0403021956530.25677-100000@epic9.Stanford.EDU>
References: <Pine.GSO.4.44.0403021119270.6062-100000@epic6.Stanford.EDU>
 <Pine.GSO.4.44.0403021458570.8839-100000@epic6.Stanford.EDU>
 <c23fa8$f14$1@news.Stanford.EDU>
NNTP-Posting-Host: epic9.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078286267 6792 171.64.15.42 (3 Mar 2004 03:57:47 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
In-Reply-To: <c23fa8$f14$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6710

Broken pipe happens outside of gdb as well.
There are also two APP_CLOSE_REQUESTED for the same socket
prior to broken pipe.

Boris.

On Wed, 3 Mar 2004, Matthew Jonathan Holliman wrote:

>
> >1).  Since we have an ACK set, then connection is established
> >and due to FIN immediately requested to be terminated.  This
> >results in broken pipe.
>
> The broken pipe should be ignored (see network_io_socket.c).
> This would only be a problem in gdb, which will stop on the signal.
> You can get around this by doing 'handle SIGPIPE nostop noprint pass'
> in gdb, or by putting this in your .gdbinit
>
> >2). SYN/ACK is considered together and hence connection was never
> >established.  In this case, myaccept will return -1 and application
> >exits with status 1 rather than 0.  Will the script penalize for this?
>
> This seems like incorrect behaviour--assuming the ACK was valid for
> the SYN-ACK, the connection was actually setup and then torn down
> immediately.  So myaccept() would return a valid socket, and then
> the first myread() would return 0 bytes.
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Additional source files
Date: Wed, 3 Mar 2004 04:02:10 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c23lc2$6u6$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
X-Trace: news.Stanford.EDU 1078286530 7110 171.64.15.101 (3 Mar 2004 04:02: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:6711

Are we permitted to add additional source files to the submission for 
milestone C?  The assignment doc isn't clear on this.

My transport.c is over 1,000 lines long and getting increasingly tedious to 
wade through.

Tyrone

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: mysock equivalent to setsockopt
Date: Tue, 2 Mar 2004 20:10:53 -0800
Lines: 11
Distribution: su
Message-ID: <c23lr8$7km$1@news.Stanford.EDU>
References: <c20n93$gp8$1@news.Stanford.EDU> <c23ds6$d4d$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078287016 7830 128.12.61.97 (3 Mar 2004 04:10: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:6712

After all my bitching... commenting this line out doesn't seem to hurt my
ftpcopy at all.

Oded

> No, there's no equivalent in the mysock layer.  It's doubtful that you
> could comment it out and have it work--if you could, there was no
> reason to have the call in the first place.  There really isn't a need
> to use this in ftpcopy, though...


.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: mysock equivalent to setsockopt
Date: Wed, 3 Mar 2004 04:53:40 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c23ock$a8q$1@news.Stanford.EDU>
References: <c20n93$gp8$1@news.Stanford.EDU> <c23ds6$d4d$1@news.Stanford.EDU> <c23lr8$7km$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1078289620 10522 171.64.15.118 (3 Mar 2004 04:53:40 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6713


>After all my bitching... commenting this line out doesn't seem to hurt my
>ftpcopy at all.

Okay, I see the thread you refer to--I disagree with the posted example,
as it bypasses TIME_WAIT, and could potentially cause problems when running
against ftp servers that bind to a fixed port for data connections.

If you request an ephemeral port per data connection (as you should have
done anyway), you don't need to specify REUSE_ADDR.

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Additional source files
Date: Wed, 3 Mar 2004 04:58:44 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c23om4$afs$1@news.Stanford.EDU>
References: <c23lc2$6u6$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1078289924 10748 171.64.15.118 (3 Mar 2004 04:58:44 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6714


>Are we permitted to add additional source files to the submission for 
>milestone C?  The assignment doc isn't clear on this.

You can include additional source files.  This was intended for ftpcopy,
but since we use your Makefile for this milestone (and HW4), I suppose you
could split your STCP code into multiple files now if you wanted.  (But
we don't mind wading through a large transport.c when grading, either--it's
not great style, but this is kind of thrust upon us by milestones A and B).

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: provided ftpcopy behavior
Date: Tue, 02 Mar 2004 21:04:10 -0800
Lines: 261
Distribution: su
Message-ID: <c23p0b$ki$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: multipart/mixed;
 boundary="------------050707080208090608020705"
X-Trace: news.Stanford.EDU 1078290251 658 127.0.0.1 (3 Mar 2004 05:04:11 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (X11/20040209)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6715

This is a multi-part message in MIME format.
--------------050707080208090608020705
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I don't quite understand this output I got from the reference ftpcopy 
compiled with -DDEBUG

Here is the sequence of events after getting the dir listing:

myaccept a new socket for transferring a file
myclose the listening socket
myclose the control socket

I don't see why myclose isn't called on the data socket prior to being 
called on the control socket.  It's causing my client to hang, since the 
ftpd is waiting in myclose for the FIN back from the ftpcopy client.

I've attached the full debug output for ftpcopy

Any ideas?

Thanks,
William

--------------050707080208090608020705
Content-Type: text/plain;
 name="ftpcopylog"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ftpcopylog"


####Initiating a new connection to 171.64.15.99:56026#### (sd=0)
started receive thread
_network_send_packet peer:  171.64.15.99:56026
_tcp_connect (my_sd=0): connecting on socket 3...
_network_recv_packet peer:  171.64.15.99:56026
====>network_send:dropping the packet
_network_recv_packet peer:  171.64.15.99:56026
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
stcp_app_send(0):  sending 94 bytes up to app
_network_send_packet peer:  171.64.15.99:56026
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
stcp_app_send(0):  sending 68 bytes up to app
_network_send_packet peer:  171.64.15.99:56026
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_send_packet peer:  171.64.15.99:56026
stcp_app_send(0):  sending 48 bytes up to app
_network_send_packet peer:  171.64.15.99:56026
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_send_packet peer:  171.64.15.99:56026
stcp_app_send(0):  sending 29 bytes up to app
_network_send_packet peer:  171.64.15.99:56026
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
stcp_app_send(0):  sending 20 bytes up to app
_network_send_packet peer:  171.64.15.99:56026
allocating connection queue for local port 49984
started receive thread
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
stcp_app_send(0):  sending 30 bytes up to app
_network_send_packet peer:  171.64.15.99:56026
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
accepted from peer, tmp_sd=11...
_network_recv_packet peer:  171.64.15.99:56028
establishing connection from 171.64.15.99:56028 for local port 49984 
passed accepted socket 11 on to new context...
started receive thread
_network_send_packet peer:  171.64.15.99:56028
_network_recv_packet peer:  171.64.15.99:56028
_network_recv_packet peer:  171.64.15.99:56028
_network_recv_packet peer:  171.64.15.99:56028
stcp_app_send(2):  sending 536 bytes up to app
====>network_send:dropping the packet
stcp_app_send(2):  sending 536 bytes up to app
_network_recv_packet peer:  171.64.15.99:56028
_network_send_packet peer:  171.64.15.99:56028
_network_recv_packet peer:  171.64.15.99:56028
stcp_app_send(2):  sending 536 bytes up to app
_network_recv_packet peer:  171.64.15.99:56028
_network_send_packet peer:  171.64.15.99:56028
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56028
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56028
stcp_app_send(2):  sending 392 bytes up to app
_network_send_packet peer:  171.64.15.99:56028
_network_recv_packet peer:  171.64.15.99:56026
stcp_app_send(0):  sending 53 bytes up to app
_network_send_packet peer:  171.64.15.99:56026

####Accepting a new connection at port# 49984#### (sd=1)
waiting for new connection...
dequeueing established connection from 171.64.15.99:56028
***myaccept(1) returning new sd 2***
***myclose(1)***
stopping receive thread
stopped receive thread
socket network layer, closing socket 8
myclose(1) returning...
_network_recv_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
stcp_app_send(0):  sending 24 bytes up to app
====>network_send:keeping the packet in our queue
====>network_send:sending the packet stored in our queue
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56028
_network_recv_packet peer:  171.64.15.99:56028
_network_recv_packet peer:  171.64.15.99:56028
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56028
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56028
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56028
_network_recv_packet peer:  171.64.15.99:56028
_network_recv_packet peer:  171.64.15.99:56028
_network_recv_packet peer:  171.64.15.99:56028
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56028
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56028
stcp_app_send(2):  sending 392 bytes up to app
_network_send_packet peer:  171.64.15.99:56028
_network_recv_packet peer:  171.64.15.99:56028
_network_recv_packet peer:  171.64.15.99:56028
stcp_app_send(2):  sending 242 bytes up to app
_network_send_packet peer:  171.64.15.99:56028
_network_send_packet peer:  171.64.15.99:56028
stcp_fin_received(2):  setting eof flag
***myclose(2)***
_network_send_packet peer:  171.64.15.99:56028
_network_recv_packet peer:  171.64.15.99:56028
_network_send_packet peer:  171.64.15.99:56028
_network_recv_packet peer:  171.64.15.99:56028
_network_recv_packet peer:  171.64.15.99:56028
_network_send_packet peer:  171.64.15.99:56028
_tcp_io rc: -1
couldn't read packet: -1
_network_recv_packet interrupted, errno=131
_network_send_packet peer:  171.64.15.99:56028
_tcp_io rc: -1
stopping receive thread
stopped receive thread
socket network layer, closing socket 11
myclose(2) returning...
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
stcp_app_send(0):  sending 20 bytes up to app
_network_send_packet peer:  171.64.15.99:56026
allocating connection queue for local port 49985
started receive thread
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
stcp_app_send(0):  sending 30 bytes up to app
_network_send_packet peer:  171.64.15.99:56026
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
accepted from peer, tmp_sd=11...
_network_recv_packet peer:  171.64.15.99:56029
establishing connection from 171.64.15.99:56029 for local port 49985 
passed accepted socket 11 on to new context...
started receive thread
_network_send_packet peer:  171.64.15.99:56029
_network_recv_packet peer:  171.64.15.99:56029
_network_recv_packet peer:  171.64.15.99:56029
_network_recv_packet peer:  171.64.15.99:56029
stcp_app_send(2):  sending 536 bytes up to app
====>network_send:dropping the packet
stcp_app_send(2):  sending 488 bytes up to app
_network_send_packet peer:  171.64.15.99:56029
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56029
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56029
_network_recv_packet peer:  171.64.15.99:56029
_network_recv_packet peer:  171.64.15.99:56029
_network_recv_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026
stcp_app_send(0):  sending 68 bytes up to app
_network_send_packet peer:  171.64.15.99:56026
====>network_send:sending the packet stored in our queue
_network_send_packet peer:  171.64.15.99:56026
stcp_app_send(2):  sending 488 bytes up to app
_network_send_packet peer:  171.64.15.99:56029

####Accepting a new connection at port# stcp_app_send(2):  sending 536 bytes up to app
49985_network_send_packet peer:  171.64.15.99:56029
#### (sd=1)
stcp_app_send(2):  sending 488 bytes up to app
waiting for new connection...
_network_send_packet peer:  171.64.15.99:56029
dequeueing established connection from 171.64.15.99:56029
***myaccept(1) returning new sd 2***
***myclose(1)***
stopping receive thread
stopped receive thread
socket network layer, closing socket 8
myclose(1) returning...
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56029
_network_recv_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56029
_network_recv_packet peer:  171.64.15.99:56029
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56029
stcp_app_send(2):  sending 488 bytes up to app
_network_send_packet peer:  171.64.15.99:56029
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56029
_network_recv_packet peer:  171.64.15.99:56029
_network_recv_packet peer:  171.64.15.99:56029
_network_recv_packet peer:  171.64.15.99:56029
stcp_app_send(2):  sending 488 bytes up to app
_network_send_packet peer:  171.64.15.99:56029
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56029
_network_recv_packet peer:  171.64.15.99:56029
stcp_app_send(2):  sending 175 bytes up to app
_network_send_packet peer:  171.64.15.99:56029
_network_send_packet peer:  171.64.15.99:56029
stcp_fin_received(2):  setting eof flag
====>network_send:keeping the packet in our queue
_network_recv_packet peer:  171.64.15.99:56026
stcp_app_send(0):  sending 24 bytes up to app
_network_send_packet peer:  171.64.15.99:56026
***myclose(0)***
====>network_send:dropping the packet
_network_recv_packet peer:  171.64.15.99:56026
_network_send_packet peer:  171.64.15.99:56026
_network_send_packet peer:  171.64.15.99:56026
_network_recv_packet peer:  171.64.15.99:56026

--------------050707080208090608020705--
.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: myconnect errors
Date: Tue, 2 Mar 2004 21:05:34 -0800
Lines: 36
Distribution: su
Message-ID: <c23p4c$aua$1@news.Stanford.EDU>
References: <c20dgj$kem$1@news.Stanford.EDU> <c20edc$lfm$1@news.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1078290380 11210 128.12.44.20 (3 Mar 2004 05:06: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:6716

Ah. You were completely on the right track, though. :) The problem was that
I was unable to handle the case when initial_sequence_num = 0, probably
because I was setting my initial last_byte_sent value to a negative number.
Thank you for the help!

- Sean

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c20edc$lfm$1@news.Stanford.EDU...
>
> >I'm failing a few of the tests (2D, 2E, 2F, sometimes 2L) with:
>
> >Unexpected exit status 256. Program output:
> >myconnect: Connection refused
>
> >The only way that I can see this happening is if my Send function
> >returns -1, which would imply that either I'm trying to send a packet
larger
> >than my effective window (which is fixed around 3072 during connection,
so
> >that shouldn't be an issue), or that stcp_network_send returns -1. When
we
> >have unreliable mode turned on, is it possible that it would make
> >stcp_network_send return -1? If not, how else could I get this return
value?
>
> Unreliable mode shouldn't cause stcp_network_send() to return -1.  (It
> would normally only return this if the underlying connection to the other
> side died for some reason).  I would think the explanation lies elsewhere.
>
> Most of these test cases use a special server, which assumes that you
> use an ISN=1 in your client when FIXED_INITNUM is defined in transport.c.
> Did you change this at all?
>


.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Test L.1
Date: Wed, 3 Mar 2004 05:10:27 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c23pc3$b2t$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
X-Trace: news.Stanford.EDU 1078290627 11357 171.64.15.101 (3 Mar 2004 05:10:27 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:6717

What is the correct behavior for transferring empty files?  
Should a matching zero-byte file be created in the destination directory, or 
should it be skipped?

Tyrone

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: provided ftpcopy behavior
Date: Wed, 3 Mar 2004 05:38:48 +0000 (UTC)
Lines: 19
Distribution: su
Message-ID: <c23r18$d0i$1@news.Stanford.EDU>
References: <c23p0b$ki$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1078292328 13330 171.64.15.74 (3 Mar 2004 05:38:48 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6718



>I don't see why myclose isn't called on the data socket prior to being 
>called on the control socket.  It's causing my client to hang, since the 
>ftpd is waiting in myclose for the FIN back from the ftpcopy client.

I think I found the problem--in previous years, the mysock layer used
a TCP socket to communicate between parent/child process, and it was this
socket that was returned to the application by myconnect()/myaccept()...
so myclose(sd) was functionally equivalent to close(sd).

The ftpcopy was inherited from this older codebase, and there were a couple of
places in the ftpcopy code where a close() was being done on a mysocket
descriptor (it's really bad code).  That was broken with the new mysocket
layer this year, where a mysocket descriptor is no longer also a real
socket descriptor, so I've changed these to use myclose().  These cases
correspond to some error conditions that I guess you hit (e.g. you have an
errno=131, ECONNRESET, in your log for some reason).

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test L.1
Date: Wed, 3 Mar 2004 05:40:07 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c23r3n$d4u$1@news.Stanford.EDU>
References: <c23pc3$b2t$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1078292407 13470 171.64.15.74 (3 Mar 2004 05:40:07 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6719


>What is the correct behavior for transferring empty files?  
>Should a matching zero-byte file be created in the destination directory, or 
>should it be skipped?

same as it was in HW1.

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: bad ftpd_tcp behavior?
Date: Tue, 2 Mar 2004 21:45:52 -0800
Lines: 22
Distribution: su
Message-ID: <c23rda$dde$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078292714 13742 128.12.61.97 (3 Mar 2004 05:45: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:6720

Am I insane?  Here is debug from ftpcopy using your libraries and my
transport code, running with a bad remote filename:

control loop event 4 (this is the app close request)
Sending FIN 283
Receiving ack 284
Successfully sent FIN

control loop event 2 (network data)
BAD PACKET! ack = 283 expected 284


Does ftpd_tcp ACK the FIN correctly, then revert BACK to the old ACK
sequence?  Shouldn't all future data arrive on sequence 284?  I know that my
transport layer adds 1 to the peer sequence number being acknowledged when
it receives a FIN... is this not the proper behavior?  Are we supposed to
ACK 284 and then revert to 283 for all other data?

Thanks,
Oded


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: bad ftpd_tcp behavior?
Date: Tue, 2 Mar 2004 21:48:58 -0800
Lines: 5
Distribution: su
Message-ID: <c23rj4$dip$1@news.Stanford.EDU>
References: <c23rda$dde$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078292900 13913 128.12.61.97 (3 Mar 2004 05:48: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:6721

by filename i mean directory

> transport code, running with a bad remote filename:


.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: bad ftpd_tcp behavior?
Date: Wed, 3 Mar 2004 05:58:26 +0000 (UTC)
Lines: 25
Distribution: su
Message-ID: <c23s62$e62$1@news.Stanford.EDU>
References: <c23rda$dde$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine5.stanford.edu
X-Trace: news.Stanford.EDU 1078293506 14530 171.64.15.70 (3 Mar 2004 05:58:27 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6722


>Receiving ack 284
>Successfully sent FIN

>control loop event 2 (network data)
>BAD PACKET! ack = 283 expected 284


>Does ftpd_tcp ACK the FIN correctly, then revert BACK to the old ACK
>sequence?  Shouldn't all future data arrive on sequence 284?  I know that my
>transport layer adds 1 to the peer sequence number being acknowledged when
>it receives a FIN... is this not the proper behavior?  Are we supposed to
>ACK 284 and then revert to 283 for all other data?

no, your sender behaviour is okay.  the real explanation is that the 4-way
handshake, FIN sequence numbers etc. were retrofitted onto an existing STCP
implementation from before (when the protocol was quite different), so the
FIN ACKing is a bit of a kludge, derived partially from experimentation to
see what real TCP implementations expected.  btw, I've seen ACKs sent out
after the FIN with th_seq == FIN's th_seq, even though the FIN consumes 1
byte of sequence space.  I'm not sure that this really matters--it doesn't
seem like it should.  you don't really care about th_seq in ACK packets,
other than maybe making sure they aren't completely bogus (e.g. before
the peer's ISN, for example).  this was mentioned on the newsgroup before.

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: bad ftpd_tcp behavior?
Date: Tue, 2 Mar 2004 22:12:01 -0800
Lines: 23
Distribution: su
Message-ID: <c23sub$f72$1@news.Stanford.EDU>
References: <c23rda$dde$1@news.Stanford.EDU> <c23s62$e62$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078294283 15586 128.12.61.97 (3 Mar 2004 06:11: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:6723

I'm sorry, I got a bit lost.  Not much sleep.

So I shouldn't care if the ack of a packet is a bit old?  Is this only the
case after sending FIN?  Because normally, if the peer sends the wrong ack
(i.e. before a previously ack'd number, i.e. 283 before 284 from my
example), shouldn't I worry that it's expecting the wrong sequence number
from me?
Oded

> no, your sender behaviour is okay.  the real explanation is that the 4-way
> handshake, FIN sequence numbers etc. were retrofitted onto an existing
STCP
> implementation from before (when the protocol was quite different), so the
> FIN ACKing is a bit of a kludge, derived partially from experimentation to
> see what real TCP implementations expected.  btw, I've seen ACKs sent out
> after the FIN with th_seq == FIN's th_seq, even though the FIN consumes 1
> byte of sequence space.  I'm not sure that this really matters--it doesn't
> seem like it should.  you don't really care about th_seq in ACK packets,
> other than maybe making sure they aren't completely bogus (e.g. before
> the peer's ISN, for example).  this was mentioned on the newsgroup before.
>


.

Path: shelby.stanford.edu!not-for-mail
From: David Chan <dmchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: bad ftpd_tcp behavior?
Date: Tue, 02 Mar 2004 22:15:34 -0800
Lines: 64
Distribution: su
Message-ID: <c23t67$ffl$1@news.Stanford.EDU>
References: <c23rda$dde$1@news.Stanford.EDU> <c23s62$e62$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 1078294535 15861 128.12.57.21 (3 Mar 2004 06:15:35 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207)
X-Accept-Language: en-us, en
In-Reply-To: <c23s62$e62$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6724

I know STCP is not TCP and that we don't have to follow RFC 759 by the 
book, but I was using the SEGMENT ARRIVES section as a guideline for 
processing network data. In there, it insists on checking the sequence 
number first, even on ACK-only packets (when the segment length is 0).

I also experienced this behavior. It doesn't look like the reference 
implementation follow the STCP guidelines that "Both SYN and FIN 
indicators are associated with one byte of the sequence space" and "If 
the packet is a pure packet, the sequence number is set to the next 
sequence number."

Note the following output from ftpd_tcp:

--

   _send_packet (sd=1) seq # 718 ack # 294: FIN ACK  0 byte payload
....
   _send_packet (sd=1) seq # 718 ack # 295: ACK  0 byte payload

--

According to the STCP spec, that ACK's seq definitely should be 719.


In order to make this interoperate correctly, then, I will need to 
loosen the RFC759-derived constraints on pure ACK sequences, this is 
okay then?

Dave

P.S. I guess things happen alright, I mean, my side just retransmits 
until it tries to get a valid ACK, but it'll timeout anyway and drop the 
connection without too much delay.


Matthew Jonathan Holliman wrote:

>>Receiving ack 284
>>Successfully sent FIN
> 
> 
>>control loop event 2 (network data)
>>BAD PACKET! ack = 283 expected 284
> 
> 
> 
>>Does ftpd_tcp ACK the FIN correctly, then revert BACK to the old ACK
>>sequence?  Shouldn't all future data arrive on sequence 284?  I know that my
>>transport layer adds 1 to the peer sequence number being acknowledged when
>>it receives a FIN... is this not the proper behavior?  Are we supposed to
>>ACK 284 and then revert to 283 for all other data?
> 
> 
> no, your sender behaviour is okay.  the real explanation is that the 4-way
> handshake, FIN sequence numbers etc. were retrofitted onto an existing STCP
> implementation from before (when the protocol was quite different), so the
> FIN ACKing is a bit of a kludge, derived partially from experimentation to
> see what real TCP implementations expected.  btw, I've seen ACKs sent out
> after the FIN with th_seq == FIN's th_seq, even though the FIN consumes 1
> byte of sequence space.  I'm not sure that this really matters--it doesn't
> seem like it should.  you don't really care about th_seq in ACK packets,
> other than maybe making sure they aren't completely bogus (e.g. before
> the peer's ISN, for example).  this was mentioned on the newsgroup before.
> 
.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: bad ftpd_tcp behavior?
Date: Wed, 3 Mar 2004 06:43:12 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <c23uq0$h9k$1@news.Stanford.EDU>
References: <c23rda$dde$1@news.Stanford.EDU> <c23s62$e62$1@news.Stanford.EDU> <c23sub$f72$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine5.stanford.edu
X-Trace: news.Stanford.EDU 1078296192 17716 171.64.15.70 (3 Mar 2004 06:43:12 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6725



>So I shouldn't care if the ack of a packet is a bit old?  Is this only the
>case after sending FIN?  Because normally, if the peer sends the wrong ack
>(i.e. before a previously ack'd number, i.e. 283 before 284 from my
>example), shouldn't I worry that it's expecting the wrong sequence number
>from me?

If it's ACKed w/th_ack=784, but then you receive th_ack=783, you can
just disregard the second one (it's already been subsumed by the th_ack=784
anyway, since this implicitly acknowledges up through th_seq=782 as part
of its acknowledgement of th_seq=783)--e.g. it might arise from packet
reordering somewhere in the network.  So you don't have much choice in how
you process the packet.

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: provided ftpcopy behavior
Date: Tue, 02 Mar 2004 22:46:25 -0800
Lines: 301
Distribution: su
Message-ID: <c23v02$ki$2@news.Stanford.EDU>
References: <c23p0b$ki$1@news.Stanford.EDU> <c23r18$d0i$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: multipart/mixed;
 boundary="------------020800090803090001000208"
X-Trace: news.Stanford.EDU 1078296387 658 127.0.0.1 (3 Mar 2004 06:46:27 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (X11/20040209)
X-Accept-Language: en-us, en
In-Reply-To: <c23r18$d0i$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6726

This is a multi-part message in MIME format.
--------------020800090803090001000208
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Matthew Jonathan Holliman wrote:
>>I don't see why myclose isn't called on the data socket prior to being 
>>called on the control socket.  It's causing my client to hang, since the 
>>ftpd is waiting in myclose for the FIN back from the ftpcopy client.
> 
> 
> I think I found the problem--in previous years, the mysock layer used
> a TCP socket to communicate between parent/child process, and it was this
> socket that was returned to the application by myconnect()/myaccept()...
> so myclose(sd) was functionally equivalent to close(sd).
> 
> The ftpcopy was inherited from this older codebase, and there were a couple of
> places in the ftpcopy code where a close() was being done on a mysocket
> descriptor (it's really bad code).  That was broken with the new mysocket
> layer this year, where a mysocket descriptor is no longer also a real
> socket descriptor, so I've changed these to use myclose().  These cases
> correspond to some error conditions that I guess you hit (e.g. you have an
> errno=131, ECONNRESET, in your log for some reason).
> 

Is getting ECONNRESET necessarily bad?

Do you know what generates an ERROR: Permission denied (-1)?  I find it 
odd that my transport layer would cause such a thing.  I don't think 
it's a server permission error since my packet logs show a "226 Transfer 
complete" message after I downloaded a file, but then I get the ERROR: 
Permission denied which suggests to me that the file could not be 
created locally or something, which is odd.  Anyway, if you know what 
could cause this, I'd appreciate it =]

Thanks,
William

PS: Attached again the ftp log.

--------------020800090803090001000208
Content-Type: text/plain;
 name="ftpcopylog2"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ftpcopylog2"


####Initiating a new connection to 171.64.15.99:56288#### (sd=0)
started receive thread
_network_send_packet peer:  171.64.15.99:56288
_tcp_connect (my_sd=0): connecting on socket 3...
_network_recv_packet peer:  171.64.15.99:56288
====>network_send:dropping the packet
_network_recv_packet peer:  171.64.15.99:56288
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
stcp_app_send(0):  sending 94 bytes up to app
_network_send_packet peer:  171.64.15.99:56288
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
stcp_app_send(0):  sending 68 bytes up to app
_network_send_packet peer:  171.64.15.99:56288
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
_network_send_packet peer:  171.64.15.99:56288
stcp_app_send(0):  sending 48 bytes up to app
_network_send_packet peer:  171.64.15.99:56288
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
stcp_app_send(0):  sending 29 bytes up to app
_network_send_packet peer:  171.64.15.99:56288
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
stcp_app_send(0):  sending 20 bytes up to app
_network_send_packet peer:  171.64.15.99:56288
allocating connection queue for local port 50265
started receive thread
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
stcp_app_send(0):  sending 30 bytes up to app
_network_send_packet peer:  171.64.15.99:56288
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
accepted from peer, tmp_sd=11...
_network_recv_packet peer:  171.64.15.99:56294
establishing connection from 171.64.15.99:56294 for local port 50265 
passed accepted socket 11 on to new context...
started receive thread
_network_send_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
stcp_app_send(2):  sending 536 bytes up to app
====>network_send:dropping the packet
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56294
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56294
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56294
stcp_app_send(2):  sending 392 bytes up to app
_network_send_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
stcp_app_send(0):  sending 53 bytes up to app
_network_send_packet peer:  171.64.15.99:56288
stcp_app_send(0):  sending 24 bytes up to app
_network_send_packet peer:  171.64.15.99:56288

####Accepting a new connection at port# 50265#### (sd=1)
waiting for new connection...
dequeueing established connection from 171.64.15.99:56294
***myaccept(1) returning new sd 2***
***myclose(1)***
stopping receive thread
stopped receive thread
socket network layer, closing socket 8
myclose(1) returning...
_network_recv_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56288
====>network_send:keeping the packet in our queue
_network_recv_packet peer:  171.64.15.99:56294
stcp_app_send(2):  sending 536 bytes up to app
_network_recv_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
_network_send_packet peer:  171.64.15.99:56294
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56294
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56294
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56294
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56294
stcp_app_send(2):  sending 392 bytes up to app
_network_send_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
_network_send_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
_network_send_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
_network_send_packet peer:  171.64.15.99:56294
_network_send_packet peer:  171.64.15.99:56294
_network_send_packet peer:  171.64.15.99:56294
_network_send_packet peer:  171.64.15.99:56294
stcp_app_send(2):  sending 297 bytes up to app
_network_send_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
_network_send_packet peer:  171.64.15.99:56294
stcp_fin_received(2):  setting eof flag
***myclose(2)***
====>network_send:keeping the packet in our queue
====>network_send:sending the packet stored in our queue
_network_send_packet peer:  171.64.15.99:56294
_network_recv_packet peer:  171.64.15.99:56294
_network_send_packet peer:  171.64.15.99:56294
_tcp_io rc: -1
couldn't read packet: -1
_network_recv_packet interrupted, errno=131
_network_send_packet peer:  171.64.15.99:56294
_tcp_io rc: -1
stopping receive thread
stopped receive thread
socket network layer, closing socket 11
myclose(2) returning...
====>network_send:sending the packet stored in our queue
_network_send_packet peer:  171.64.15.99:56288
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
stcp_app_send(0):  sending 20 bytes up to app
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
allocating connection queue for local port 50266
started receive thread
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
stcp_app_send(0):  sending 30 bytes up to app
_network_send_packet peer:  171.64.15.99:56288
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
accepted from peer, tmp_sd=11...
_network_recv_packet peer:  171.64.15.99:56295
establishing connection from 171.64.15.99:56295 for local port 50266 
passed accepted socket 11 on to new context...
started receive thread
_network_send_packet peer:  171.64.15.99:56295
_network_recv_packet peer:  171.64.15.99:56295
_network_recv_packet peer:  171.64.15.99:56295
_network_recv_packet peer:  171.64.15.99:56295
stcp_app_send(2):  sending 536 bytes up to app
====>network_send:dropping the packet
stcp_app_send(2):  sending 488 bytes up to app
_network_recv_packet peer:  171.64.15.99:56295
_network_send_packet peer:  171.64.15.99:56295
_network_recv_packet peer:  171.64.15.99:56295
_network_recv_packet peer:  171.64.15.99:56295
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56295
stcp_app_send(2):  sending 488 bytes up to app
_network_send_packet peer:  171.64.15.99:56295
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56295
stcp_app_send(2):  sending 488 bytes up to app
_network_send_packet peer:  171.64.15.99:56295
_network_recv_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
stcp_app_send(0):  sending 68 bytes up to app

####Accepting a new connection at port# _network_send_packet peer:  171.64.15.99:56288
50266#### (sd=1)
stcp_app_send(0):  sending 24 bytes up to app
waiting for new connection...
dequeueing established connection from 171.64.15.99:56295
***myaccept(1) returning new sd 2***
***myclose(1)***
stopping receive thread
_network_send_packet peer:  171.64.15.99:56288
stopped receive thread
socket network layer, closing socket 8
myclose(1) returning...
***myclose(2)***
_network_send_packet peer:  171.64.15.99:56295
_network_recv_packet peer:  171.64.15.99:56295
_network_recv_packet peer:  171.64.15.99:56295
_network_recv_packet peer:  171.64.15.99:56295
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56295
stcp_app_send(2):  sending 488 bytes up to app
_network_send_packet peer:  171.64.15.99:56295
_network_recv_packet peer:  171.64.15.99:56295
stcp_app_send(2):  sending 536 bytes up to app
_network_recv_packet peer:  171.64.15.99:56295
_network_send_packet peer:  171.64.15.99:56295
_network_recv_packet peer:  171.64.15.99:56295
stcp_app_send(2):  sending 488 bytes up to app
_network_recv_packet peer:  171.64.15.99:56295
_network_send_packet peer:  171.64.15.99:56295
_network_recv_packet peer:  171.64.15.99:56295
stcp_app_send(2):  sending 536 bytes up to app
_network_send_packet peer:  171.64.15.99:56295
stcp_app_send(2):  sending 175 bytes up to app
_network_send_packet peer:  171.64.15.99:56295
_network_send_packet peer:  171.64.15.99:56295
stcp_fin_received(2):  setting eof flag
stopping receive thread
_network_recv_packet peer:  171.64.15.99:56288
stopped receive thread
socket network layer, closing socket 11
myclose(2) returning...
====>network_send:sending the packet stored in our queue
_network_send_packet peer:  171.64.15.99:56288
ERROR: Permission denied (-1) 
***myclose(0)***
_network_recv_packet peer:  171.64.15.99:56288
_network_send_packet peer:  171.64.15.99:56288
====>network_send:keeping the packet in our queue
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
====>network_send:dropping the packet
_network_send_packet peer:  171.64.15.99:56288
stcp_app_send(0):  sending 14 bytes up to app
_network_send_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
_network_recv_packet peer:  171.64.15.99:56288
_network_send_packet peer:  171.64.15.99:56288
stcp_fin_received(0):  setting eof flag
stopping receive thread
stopped receive thread
socket network layer, closing socket 3
myclose(0) returning...

--------------020800090803090001000208--
.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: bad ftpd_tcp behavior?
Date: Wed, 3 Mar 2004 06:47:20 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c23v1o$hgu$1@news.Stanford.EDU>
References: <c23rda$dde$1@news.Stanford.EDU> <c23s62$e62$1@news.Stanford.EDU> <c23t67$ffl$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine5.stanford.edu
X-Trace: news.Stanford.EDU 1078296440 17950 171.64.15.70 (3 Mar 2004 06: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:6727


>In order to make this interoperate correctly, then, I will need to 
>loosen the RFC759-derived constraints on pure ACK sequences, this is 
>okay then?

Sure.  As mentioned on here, I've seen real TCP generate the same behaviour
as the ref soln, so it's probably best not to be too picky anyway.

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: bad ftpd_tcp behavior?
Date: Tue, 2 Mar 2004 22:54:22 -0800
Lines: 29
Distribution: su
Message-ID: <c23vdp$i15$1@news.Stanford.EDU>
References: <c23rda$dde$1@news.Stanford.EDU> <c23s62$e62$1@news.Stanford.EDU> <c23sub$f72$1@news.Stanford.EDU> <c23uq0$h9k$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078296825 18469 128.12.61.97 (3 Mar 2004 06:53: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:6728

You mean disregard the second ACK, but not the data the might come with it,
right?

I think I finally get what you are saying, and this seems to agree with both
logs.

peer generates a FIN with ack #283
peer receives my FIN with seq #283
peer generates an ACK with ack #284
I never acknowledge the FIN my peer generated because I ignore ack #283, so
we have a problem...

Does it sound like I've got it?

Thanks
Oded


>
> If it's ACKed w/th_ack=784, but then you receive th_ack=783, you can
> just disregard the second one (it's already been subsumed by the
th_ack=784
> anyway, since this implicitly acknowledges up through th_seq=782 as part
> of its acknowledgement of th_seq=783)--e.g. it might arise from packet
> reordering somewhere in the network.  So you don't have much choice in how
> you process the packet.
>


.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: provided ftpcopy behavior
Date: Wed, 3 Mar 2004 06:56:51 +0000 (UTC)
Lines: 29
Distribution: su
Message-ID: <c23vjj$i5p$1@news.Stanford.EDU>
References: <c23p0b$ki$1@news.Stanford.EDU> <c23r18$d0i$1@news.Stanford.EDU> <c23v02$ki$2@news.Stanford.EDU>
NNTP-Posting-Host: elaine5.stanford.edu
X-Trace: news.Stanford.EDU 1078297011 18617 171.64.15.70 (3 Mar 2004 06:56:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6729

>Is getting ECONNRESET necessarily bad?

I'm not sure, but it doesn't necessarily seem good... although it could be
a red herring, I suppose.

>Do you know what generates an ERROR: Permission denied (-1)?  I find it 
>odd that my transport layer would cause such a thing.  I don't think 
>it's a server permission error since my packet logs show a "226 Transfer 
>complete" message after I downloaded a file, but then I get the ERROR: 
>Permission denied which suggests to me that the file could not be 
>created locally or something, which is odd.  Anyway, if you know what 
>could cause this, I'd appreciate it =]

hmm--
for some reason, the ftpcopy code downloads each file into "/tmp/tmp_file",
so I suppose if someone else is running the script on the same machine
(or this file otherwise exists, owned by someone else), the local open
could fail.  (I wasn't kidding when I said this is really, really bad
code).

if such a file doesn't exist, I'm not sure--I only see that one place
in the local file creation that would likely result in this error.

I've put another version of ftpcopy in the hw1obj directory, this one
using PASV (libftpcopy_pasv.a)

To use it, change your Makefile to instead of use '-lftpcopy',
use '-lftpcopy_pasv -lresolv'

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test L.1
Date: Tue, 02 Mar 2004 23:02:58 -0800
Lines: 15
Distribution: su
Message-ID: <c23vv2$ik4$1@news.Stanford.EDU>
References: <c23pc3$b2t$1@news.Stanford.EDU> <c23r3n$d4u$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078297378 19076 171.64.15.101 (3 Mar 2004 07:02:58 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.1) Gecko/20020827
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6730

Matthew Jonathan Holliman wrote:
>>What is the correct behavior for transferring empty files?  
>>Should a matching zero-byte file be created in the destination directory, or 
>>should it be skipped?
> 
> 
> same as it was in HW1.
> 

And what was that?  I don't see that point explicitly addressed in the 
hw1 descriptions (my own code failed that particular test in hw1, so no 
guide there).

Tyrone

.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: bad ftpd_tcp behavior?
Date: Wed, 3 Mar 2004 07:05:20 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c2403g$ioc$1@news.Stanford.EDU>
References: <c23rda$dde$1@news.Stanford.EDU> <c23s62$e62$1@news.Stanford.EDU> <c23sub$f72$1@news.Stanford.EDU> <c23uq0$h9k$1@news.Stanford.EDU> <c23vdp$i15$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine5.stanford.edu
X-Trace: news.Stanford.EDU 1078297520 19212 171.64.15.70 (3 Mar 2004 07:05:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6731


>You mean disregard the second ACK, but not the data the might come with it,
>right?

well, in practice there shouldn't be any data, since this only happens
after a FIN's been sent.  but if it arises before you receive a FIN,
has a valid th_seq, and there is data, yes, you can process it.

I couldn't follow your example, specifically, why you didn't acknowledge
the peer's FIN.  what does the ACK have to do with that?

.

Path: shelby.stanford.edu!elaine5.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test L.1
Date: Wed, 3 Mar 2004 07:06:19 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c2405b$iq0$1@news.Stanford.EDU>
References: <c23pc3$b2t$1@news.Stanford.EDU> <c23r3n$d4u$1@news.Stanford.EDU> <c23vv2$ik4$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine5.stanford.edu
X-Trace: news.Stanford.EDU 1078297579 19264 171.64.15.70 (3 Mar 2004 07:06:19 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6732

>And what was that?  I don't see that point explicitly addressed in the 
>hw1 descriptions (my own code failed that particular test in hw1, so no 
>guide there).

they're treated the same as any other file--you just create a 0-byte file
by the same name locally.

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: provided ftpcopy behavior
Date: Tue, 02 Mar 2004 23:12:50 -0800
Lines: 15
Distribution: su
Message-ID: <c240hk$ki$3@news.Stanford.EDU>
References: <c23p0b$ki$1@news.Stanford.EDU> <c23r18$d0i$1@news.Stanford.EDU> <c23v02$ki$2@news.Stanford.EDU> <c23vjj$i5p$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078297972 658 127.0.0.1 (3 Mar 2004 07:12:52 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (X11/20040209)
X-Accept-Language: en-us, en
In-Reply-To: <c23vjj$i5p$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6733

> hmm--
> for some reason, the ftpcopy code downloads each file into "/tmp/tmp_file",
> so I suppose if someone else is running the script on the same machine
> (or this file otherwise exists, owned by someone else), the local open
> could fail.  (I wasn't kidding when I said this is really, really bad
> code).


Oh f***ing a.

-rw-------    1 kshimano 37           7680 Mar  2 15:59 /tmp/tmp_file

You suck Kirk =P  Thanks for killing off 2 of my tests lol.

--William
.

Path: shelby.stanford.edu!not-for-mail
From: David Chan <dmchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: bad ftpd_tcp behavior?
Date: Tue, 02 Mar 2004 23:12:58 -0800
Lines: 46
Distribution: su
Message-ID: <c240hq$jnl$1@news.Stanford.EDU>
References: <c23rda$dde$1@news.Stanford.EDU> <c23s62$e62$1@news.Stanford.EDU> <c23sub$f72$1@news.Stanford.EDU> <c23uq0$h9k$1@news.Stanford.EDU> <c23vdp$i15$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 1078297978 20213 128.12.57.21 (3 Mar 2004 07:12:58 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207)
X-Accept-Language: en-us, en
In-Reply-To: <c23vdp$i15$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6734

I think you're actually confused a little bit. Here's a better example.

Peer sends a FIN with seq = 14, ack = 104
You send a FIN with seq = 104, ack = 15
Peer sends an ACK with seq = 14, ack = 105

The point is that the implementation doesn't treat its own FIN packets 
as taking up 1 byte in its sequence space when you do, so you expect to 
receive an ACK with seq=15.

Dave

Oded Wurman wrote:

> You mean disregard the second ACK, but not the data the might come with it,
> right?
> 
> I think I finally get what you are saying, and this seems to agree with both
> logs.
> 
> peer generates a FIN with ack #283
> peer receives my FIN with seq #283
> peer generates an ACK with ack #284
> I never acknowledge the FIN my peer generated because I ignore ack #283, so
> we have a problem...
> 
> Does it sound like I've got it?
> 
> Thanks
> Oded
> 
> 
> 
>>If it's ACKed w/th_ack=784, but then you receive th_ack=783, you can
>>just disregard the second one (it's already been subsumed by the
> 
> th_ack=784
> 
>>anyway, since this implicitly acknowledges up through th_seq=782 as part
>>of its acknowledgement of th_seq=783)--e.g. it might arise from packet
>>reordering somewhere in the network.  So you don't have much choice in how
>>you process the packet.
>>
> 
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: bad ftpd_tcp behavior?
Date: Tue, 2 Mar 2004 23:16:37 -0800
Lines: 35
Distribution: su
Message-ID: <c240ne$jrg$1@news.Stanford.EDU>
References: <c23rda$dde$1@news.Stanford.EDU> <c23s62$e62$1@news.Stanford.EDU> <c23sub$f72$1@news.Stanford.EDU> <c23uq0$h9k$1@news.Stanford.EDU> <c23vdp$i15$1@news.Stanford.EDU> <c2403g$ioc$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078298158 20336 128.12.61.97 (3 Mar 2004 07:15: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:6735

I used to ignore any packet whose th_ack field was less than my record of
the most recently ackd sequence number.  As a result, when my most recently
ackd sequence number was 284 and I received a FIN packet with ack 283, I
chucked the entire packet.

As for data, if I have two packets arrive out of order with different acks,
and the higher ack arrives first, I used to (again) chuck the entire lower
ack packet, and thus would never see its data.  If the sender tried
retransmitting that packet but wouldn't update the th_ack field, then I'd
always ignore the retransmissions as well.

I fixed that now, and it works better.  Now I'm getting broken pipes, and am
about to read the previous posts on those.

On a related note, when retransmitting a packet, should we update the th_ack
field to the most current value, or retransmit it with what the th_ack value
was at the time of initial transmission?

Thanks,
Oded

>
> >You mean disregard the second ACK, but not the data the might come with
it,
> >right?
>
> well, in practice there shouldn't be any data, since this only happens
> after a FIN's been sent.  but if it arises before you receive a FIN,
> has a valid th_seq, and there is data, yes, you can process it.
>
> I couldn't follow your example, specifically, why you didn't acknowledge
> the peer's FIN.  what does the ACK have to do with that?
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Dmitry Belogolovsky" <dbb@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Permission denied?
Date: Tue, 2 Mar 2004 23:38:10 -0800
Lines: 5
Distribution: su
Message-ID: <c2420s$lh7$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab428bf1.stanford.edu
X-Trace: news.Stanford.EDU 1078299484 22055 171.66.139.241 (3 Mar 2004 07:38: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:6736

I run ftp in reliable mode, and it says "Permission denied (-1)". That's not
very descriptive. I don't believe that there's data corruption, because my
client/server work.


.

Path: shelby.stanford.edu!not-for-mail
From: "Jaideep Ravela" <jaideep_ravela@hotmail.com>
Newsgroups: su.class.cs244a
Subject: Re: provided ftpcopy behavior
Date: Tue, 2 Mar 2004 23:41:19 -0800
Lines: 44
Distribution: su
Message-ID: <c242ar$ltk$1@news.Stanford.EDU>
References: <c23p0b$ki$1@news.Stanford.EDU> <c23r18$d0i$1@news.Stanford.EDU> <c23v02$ki$2@news.Stanford.EDU> <c23vjj$i5p$1@news.Stanford.EDU>
NNTP-Posting-Host: rains-02-28a.stanford.edu
X-Trace: news.Stanford.EDU 1078299803 22452 128.12.185.88 (3 Mar 2004 07:43: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:6737

Hi,

I changed my Makefile to use the to use the new version of ftpcopy. However,
it seems to be not working correctly. It is creating empty subdirectories
(the older version was not doing that). Could the TA check if the code
works?

Thanks,
Jaideep

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c23vjj$i5p$1@news.Stanford.EDU...
> >Is getting ECONNRESET necessarily bad?
>
> I'm not sure, but it doesn't necessarily seem good... although it could be
> a red herring, I suppose.
>
> >Do you know what generates an ERROR: Permission denied (-1)?  I find it
> >odd that my transport layer would cause such a thing.  I don't think
> >it's a server permission error since my packet logs show a "226 Transfer
> >complete" message after I downloaded a file, but then I get the ERROR:
> >Permission denied which suggests to me that the file could not be
> >created locally or something, which is odd.  Anyway, if you know what
> >could cause this, I'd appreciate it =]
>
> hmm--
> for some reason, the ftpcopy code downloads each file into
"/tmp/tmp_file",
> so I suppose if someone else is running the script on the same machine
> (or this file otherwise exists, owned by someone else), the local open
> could fail.  (I wasn't kidding when I said this is really, really bad
> code).
>
> if such a file doesn't exist, I'm not sure--I only see that one place
> in the local file creation that would likely result in this error.
>
> I've put another version of ftpcopy in the hw1obj directory, this one
> using PASV (libftpcopy_pasv.a)
>
> To use it, change your Makefile to instead of use '-lftpcopy',
> use '-lftpcopy_pasv -lresolv'
>


.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sctp_network_send
Date: Wed, 03 Mar 2004 00:17:18 -0800
Lines: 8
Distribution: su
Message-ID: <4045948E.9A6E8C59@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078301839 25340 128.12.21.88 (3 Mar 2004 08:17:19 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6738

Because we do not implement TIME_WAIT it is possible for an ACK to be
lost and for us to repeatedly try to send a FIN (the other side is
closed).  Right now I just keep trying (eg. if network_send returns a
failure I keep trying it until I reach a transmission error) . Is this
acceptable?  Should we exit or error depending on our state?  Or is it
ok to timeout from failure to send (eg. assume maybe later sends will
work so we can try again)?

.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: How much does each milestone count in the grade for HW3?
Date: Wed, 3 Mar 2004 00:21:49 -0800
Organization: CS Masters Program
Lines: 9
Distribution: su
Message-ID: <c244j1$pau$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078302114 25950 127.0.0.1 (3 Mar 2004 08:21: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:6739

I'm asking this because I passed all tests on the first 2 milestones, but am
failing with timeouts on some tests in the 3rd milestone. At this point I
need to do triage, since I also need to study for a midterm tomorrow.

Thanks,

Greg


.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test Script
Date: Wed, 03 Mar 2004 00:24:44 -0800
Lines: 7
Distribution: su
Message-ID: <4045964C.E9EBEC15@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078302285 26069 128.12.21.88 (3 Mar 2004 08:24:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6740

I wonder whether the test results for milestone 3C test script are
deterministic, i.e., if we passed all the test cases, then we'll pass
all of
them again if the code stays the same. Or does it depend on some
conditions
other than the code itself such as timeout value?

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Compiler warning
Date: Wed, 3 Mar 2004 08:28:24 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c244v8$lrm$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
X-Trace: news.Stanford.EDU 1078302504 22390 171.64.15.101 (3 Mar 2004 08:28: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:6741

When running a test I get the following compiler warning:

gcc -O3 -DSOLARIS -D_REENTRANT -ansi -D__EXTENSIONS__ -Wall -W 
-Wno-unused-function -Wno-unused-parameter  -c connection_demux.c -o 
connection_demux.o

connection_demux.c: In function `_mysock_close_passive_socket':
connection_demux.c:65: warning: `prev' might be used uninitialized in this 
function

Is this a problem?  The tests all pass, so I assume not, but still...

Tyrone

.

Path: shelby.stanford.edu!saga15.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Solutions to PS3
Date: Wed, 3 Mar 2004 00:32:00 -0800
Lines: 4
Distribution: su
Message-ID: <Pine.GSO.4.44.0403030030490.13043-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 1078302730 26667 171.64.15.145 (3 Mar 2004 08:32:10 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6742

Will the solution to PS3 be posted soon?

Thanks.

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: stcp_network_send returnning -1
Date: Wed, 3 Mar 2004 00:34:28 -0800
Lines: 15
Distribution: su
Message-ID: <c2459c$q3v$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1078302828 26751 128.12.189.163 (3 Mar 2004 08:33: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:6743

Hi,
I am tyring to run ftpcopy(yours provided )  and I am failing the test sript
F.1 and F.2
the thing is when the test script tries to execute this command
 ./ftpcopy_tcp  -U c 3 47147@localhost localhost_c_3_0 src
stcp_network_send returns -1 when transferring ftpcmd.c file
But when i try the same command manually  it works just fine, and all the
files get transferred.
why would stcp_netowork_send give -1 for an ACK packet?
Is there some way I could try & debug this?
I cannot seem to manually generate the same problem!
Thanks,
Haripriya


.

Path: shelby.stanford.edu!not-for-mail
From: "Dmitry Belogolovsky" <dbb@stanford.edu>
Newsgroups: su.class.cs244a
Subject: milestone C
Date: Wed, 3 Mar 2004 00:46:35 -0800
Lines: 4
Distribution: su
Message-ID: <c24614$qq5$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab428bf1.stanford.edu
X-Trace: news.Stanford.EDU 1078303588 27461 171.66.139.241 (3 Mar 2004 08:46: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:6744

So, are we supposed to get our ftpcopy working with our tcp for milestone C
or your ftpcopy?


.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: How much does each milestone count in the grade for HW3?
Date: Wed, 03 Mar 2004 00:56:51 -0800
Lines: 26
Distribution: su
Message-ID: <c246kj$r8s$1@news.Stanford.EDU>
References: <c244j1$pau$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine26.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078304211 27932 171.64.15.101 (3 Mar 2004 08:56:51 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.1) Gecko/20020827
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6745

According to the grading guidelines, the points are:

Functionality:
A 20
B 40
C 10

Style:
All 3 combined 30

hope this helps

Tyrone


Greg Friedman wrote:
> I'm asking this because I passed all tests on the first 2 milestones, but am
> failing with timeouts on some tests in the 3rd milestone. At this point I
> need to do triage, since I also need to study for a midterm tomorrow.
> 
> Thanks,
> 
> Greg
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Nicolas Pombourcq" <nicolas.pombourcq@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: weird stcp in ftpd_tcp
Date: Wed, 3 Mar 2004 01:45:07 -0800
Lines: 13
Distribution: su
Message-ID: <c249hl$1n0$1@news.Stanford.EDU>
References: <c1rjfc$2k8$1@news.Stanford.EDU> <c1rvom$edb$1@news.Stanford.EDU> <c1tvdh$k12$1@news.Stanford.EDU> <c1ut44$onq$1@news.Stanford.EDU>
NNTP-Posting-Host: mummy.stanford.edu
X-Trace: news.Stanford.EDU 1078307190 1760 128.12.188.73 (3 Mar 2004 09:46: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:6746

I have had this behavior several times in the past, with the same random
effect when running with or without printfs, or inside or outisde the
debugger. I suspect it comes from synchronisation problems in the provided
code, because I got rid of it for part a by merging two consecutive calls to
stcp_app_recv in a single call.

Now I am once again stuck with that kind of behaviour which prevents me from
passing the tests in part C. (one side blocks at random time even in
reliable mode).

Nicolas


.

Path: shelby.stanford.edu!not-for-mail
From: Myles Barrett Williams <mylesw@saga12.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: HW3C: Final ACK lost, test times out
Date: 03 Mar 2004 02:21:52 -0800
Organization: Stanford University, CA, USA
Lines: 13
Distribution: su
Message-ID: <tl47jy2b58f.fsf@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 1078309314 2469 171.64.15.142 (3 Mar 2004 10:21:54 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:6747


I am failing the ftpcopy UI test with a timeout. It appears to be related to
the final ACK of a connection being dropped on several of the data
connections. If I run the same test manually it eventually finishes with all
files transferred.

What is the rule if the FIN for the second CLOSE on a connection doesn't get a
acknowledgement within the retransmit timeout? Currently I retransmit it 5
times like any other segment, and then assume that it was received (see RFC
793, p. 38 "Case 2"). But this takes time if the peer got the got the FIN the
first time and its ACK was lost, which causes the test timeout.

Myles
.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PASV Fix
Date: Wed, 03 Mar 2004 02:24:00 -0800
Lines: 3
Distribution: su
Message-ID: <4045B240.DA40322B@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078309441 4561 128.12.21.88 (3 Mar 2004 10:24:01 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6748

Was this fixed for both the test script and the ftpd we use in our own
directory?

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: random timeout loops
Date: Wed, 3 Mar 2004 02:26:18 -0800
Lines: 15
Distribution: su
Message-ID: <c24br3$4h9$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078309539 4649 128.12.61.97 (3 Mar 2004 10:25: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:6749

So I'm running the provided ftpcopy against the WWW ftpd_tcp.

Sometimes the ftpcopy runs perfectly, and sometimes it gets through some
files, then starts looping on a TIMEOUT in the control_loop, never getting
anything from the ftpclient, even though the client never exited (in other
words, we haven't closed the socket, but the client just seems to sit there
never doing anything).

Is it possible that I'm shutting out my client's thread?  If the client
won't tell my transport layer what to do, I'm not really sure how to go
about fixing that...

Oded


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: random timeout loops
Date: Wed, 3 Mar 2004 02:33:45 -0800
Lines: 23
Distribution: su
Message-ID: <c24c92$54h$1@news.Stanford.EDU>
References: <c24br3$4h9$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078309986 5265 128.12.61.97 (3 Mar 2004 10:33: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:6750

I had an epiphany.  This is happening as a result of my server crashing, so
my client kind of hangs waiting for something to happen.

Guess I'll focus there.

> So I'm running the provided ftpcopy against the WWW ftpd_tcp.
>
> Sometimes the ftpcopy runs perfectly, and sometimes it gets through some
> files, then starts looping on a TIMEOUT in the control_loop, never getting
> anything from the ftpclient, even though the client never exited (in other
> words, we haven't closed the socket, but the client just seems to sit
there
> never doing anything).
>
> Is it possible that I'm shutting out my client's thread?  If the client
> won't tell my transport layer what to do, I'm not really sure how to go
> about fixing that...
>
> Oded
>
>


.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!bergerj
From: Jonathan Berger <bergerj@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW3C: Final ACK lost, test times out
Date: Wed, 3 Mar 2004 03:09:05 -0800
Lines: 32
Sender: bergerj@elaine3.Stanford.EDU
Distribution: su
Message-ID: <Pine.GSO.4.44.0403030305270.28899-100000@elaine3.Stanford.EDU>
References: <tl47jy2b58f.fsf@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 1078312148 7363 171.64.15.68 (3 Mar 2004 11:09:08 GMT)
X-Complaints-To: news@news.stanford.edu
To: Myles Barrett Williams <mylesw@saga12.Stanford.EDU>
In-Reply-To: <tl47jy2b58f.fsf@saga12.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6751

Myles,
 I'm seeing this same behavior. My code timesout even with the retransmit
set to a fixed100 ms.

 I tried hacking the code to send the final ACK 6 times automatically
before closing, and on an ftp test that opens/closes about 12 sockets, it
only cut the time to 85% of the original - not enough I believe to pass
the script tests.

 My questions are - are there any obvious places to look for performance
improvements? How would grading work if our code is fine functionally, but
doesn't pass the script tests before timing out?

 Jonathan

On 3 Mar 2004, Myles Barrett Williams wrote:

>
> I am failing the ftpcopy UI test with a timeout. It appears to be related to
> the final ACK of a connection being dropped on several of the data
> connections. If I run the same test manually it eventually finishes with all
> files transferred.
>
> What is the rule if the FIN for the second CLOSE on a connection doesn't get a
> acknowledgement within the retransmit timeout? Currently I retransmit it 5
> times like any other segment, and then assume that it was received (see RFC
> 793, p. 38 "Case 2"). But this takes time if the peer got the got the FIN the
> first time and its ACK was lost, which causes the test timeout.
>
> Myles
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: README
Date: Wed, 3 Mar 2004 03:48:19 -0800
Lines: 8
Distribution: su
Message-ID: <c24gm9$9hu$1@news.Stanford.EDU>
NNTP-Posting-Host: cerras1.stanford.edu
X-Trace: news.Stanford.EDU 1078314505 9790 128.12.196.135 (3 Mar 2004 11:48: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:6752

what are we supposed to talk about for Milestone C?  all I did was a quick
find/replace and some more testing.

Thanks,

Justin


.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sctp_network_send
Date: Wed, 3 Mar 2004 06:04:09 -0800
Lines: 17
Distribution: su
Message-ID: <c24olg$j6n$1@news.Stanford.EDU>
References: <4045948E.9A6E8C59@stanford.edu>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1078322672 19671 128.12.44.20 (3 Mar 2004 14:04: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:6753

In the case that you keep sending the final FIN, shouldn't you simply exit
after the 5th retransmission, just as with any other SYN/FIN/data packet?

- Sean

"Ryan" <ryan05@stanford.edu> wrote in message
news:4045948E.9A6E8C59@stanford.edu...
> Because we do not implement TIME_WAIT it is possible for an ACK to be
> lost and for us to repeatedly try to send a FIN (the other side is
> closed).  Right now I just keep trying (eg. if network_send returns a
> failure I keep trying it until I reach a transmission error) . Is this
> acceptable?  Should we exit or error depending on our state?  Or is it
> ok to timeout from failure to send (eg. assume maybe later sends will
> work so we can try again)?
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Sean M." <seanm514@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sctp_network_send
Date: Wed, 3 Mar 2004 06:15:13 -0800
Lines: 26
Distribution: su
Message-ID: <c24pad$jvj$1@news.Stanford.EDU>
References: <4045948E.9A6E8C59@stanford.edu> <c24olg$j6n$1@news.Stanford.EDU>
NNTP-Posting-Host: trancos-03-rcc.stanford.edu
X-Trace: news.Stanford.EDU 1078323341 20467 128.12.44.20 (3 Mar 2004 14:15: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:6754

Sorry, see a few posts up, it seems that waiting this long may take too much
time. Still, it's the appropriate action by the STCP specs.

- Sean

"Sean M." <seanm514@stanford.edu> wrote in message
news:c24olg$j6n$1@news.Stanford.EDU...
> In the case that you keep sending the final FIN, shouldn't you simply exit
> after the 5th retransmission, just as with any other SYN/FIN/data packet?
>
> - Sean
>
> "Ryan" <ryan05@stanford.edu> wrote in message
> news:4045948E.9A6E8C59@stanford.edu...
> > Because we do not implement TIME_WAIT it is possible for an ACK to be
> > lost and for us to repeatedly try to send a FIN (the other side is
> > closed).  Right now I just keep trying (eg. if network_send returns a
> > failure I keep trying it until I reach a transmission error) . Is this
> > acceptable?  Should we exit or error depending on our state?  Or is it
> > ok to timeout from failure to send (eg. assume maybe later sends will
> > work so we can try again)?
> >
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: How much does each milestone count in the grade for HW3?
Date: Wed, 3 Mar 2004 09:32:33 -0800
Organization: CS Masters Program
Lines: 36
Distribution: su
Message-ID: <c254rq$4bq$1@news.Stanford.EDU>
References: <c244j1$pau$1@news.Stanford.EDU> <c246kj$r8s$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078335163 4474 127.0.0.1 (3 Mar 2004 17: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:6755

That does help, thanks Tyrone.

Greg

"Tyrone Nicholas" <tyronen@stanford.edu> wrote in message
news:c246kj$r8s$1@news.Stanford.EDU...
> According to the grading guidelines, the points are:
>
> Functionality:
> A 20
> B 40
> C 10
>
> Style:
> All 3 combined 30
>
> hope this helps
>
> Tyrone
>
>
> Greg Friedman wrote:
> > I'm asking this because I passed all tests on the first 2 milestones,
but am
> > failing with timeouts on some tests in the 3rd milestone. At this point
I
> > need to do triage, since I also need to study for a midterm tomorrow.
> >
> > Thanks,
> >
> > Greg
> >
> >
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Test Script
Date: Wed, 3 Mar 2004 09:39:30 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.LNX.4.44.0403030939020.26072-100000@Xenon.Stanford.EDU>
References: <4045964C.E9EBEC15@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078335571 4884 171.64.66.201 (3 Mar 2004 17:39:31 GMT)
X-Complaints-To: news@news.stanford.edu
To: Ryan <ryan05@stanford.edu>
In-Reply-To: <4045964C.E9EBEC15@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:6756


 There is a time consideration for the 3c.

 .m

> I wonder whether the test results for milestone 3C test script are
> deterministic, i.e., if we passed all the test cases, then we'll pass
> all of
> them again if the code stays the same. Or does it depend on some
> conditions
> other than the code itself such as timeout value?
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Compiler warning
Date: Wed, 3 Mar 2004 09:44:44 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0403030939410.26072-100000@Xenon.Stanford.EDU>
References: <c244v8$lrm$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 1078335886 5405 171.64.66.201 (3 Mar 2004 17:44:46 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <c244v8$lrm$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6757


 It is OK.
 
  .m

> When running a test I get the following compiler warning:
> 
> gcc -O3 -DSOLARIS -D_REENTRANT -ansi -D__EXTENSIONS__ -Wall -W 
> -Wno-unused-function -Wno-unused-parameter  -c connection_demux.c -o 
> connection_demux.o
> 
> connection_demux.c: In function `_mysock_close_passive_socket':
> connection_demux.c:65: warning: `prev' might be used uninitialized in this 
> function
> 
> Is this a problem?  The tests all pass, so I assume not, but still...
> 
> Tyrone
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Solutions to PS3
Date: Wed, 3 Mar 2004 09:45:00 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0403030944480.26072-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403030030490.13043-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 1078335902 5423 171.64.66.201 (3 Mar 2004 17:45:02 GMT)
X-Complaints-To: news@news.stanford.edu
To: Edward Chron <echron@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403030030490.13043-100000@saga15.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6758


 Yup, its all done.  Will post later today.

 .m

> Will the solution to PS3 be posted soon?
> 
> Thanks.
> 
> 

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: provided ftpcopy behavior
Date: Wed, 3 Mar 2004 17:47:24 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c255nc$5em$1@news.Stanford.EDU>
References: <c23p0b$ki$1@news.Stanford.EDU> <c23r18$d0i$1@news.Stanford.EDU> <c23v02$ki$2@news.Stanford.EDU> <c23vjj$i5p$1@news.Stanford.EDU> <c242ar$ltk$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1078336044 5590 171.64.15.74 (3 Mar 2004 17:47:24 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6759



>I changed my Makefile to use the to use the new version of ftpcopy. However,
>it seems to be not working correctly. It is creating empty subdirectories
>(the older version was not doing that). Could the TA check if the code
>works?

seems to work for me...

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: milestone C
Date: Wed, 3 Mar 2004 09:49:13 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.LNX.4.44.0403030945390.26072-100000@Xenon.Stanford.EDU>
References: <c24614$qq5$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 1078336156 5798 171.64.66.201 (3 Mar 2004 17:49:16 GMT)
X-Complaints-To: news@news.stanford.edu
To: Dmitry Belogolovsky <dbb@stanford.edu>
In-Reply-To: <c24614$qq5$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6760


> So, are we supposed to get our ftpcopy working with our tcp for milestone C
> or your ftpcopy?

 Either is fine.  Just remember that you are only allowed 1 provided binary for
 hw4.

 .m

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Permission denied?
Date: Wed, 3 Mar 2004 17:49:17 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c255qt$5li$1@news.Stanford.EDU>
References: <c2420s$lh7$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1078336157 5810 171.64.15.74 (3 Mar 2004 17:49:17 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6761


>I run ftp in reliable mode, and it says "Permission denied (-1)". That's not
>very descriptive. I don't believe that there's data corruption, because my
>client/server work.

This has been addressed in a recent thread on the newsgroup.

I hacked ftpcopy to try and work around the bug, so hopefully this problem
goes away now...

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: random timeout loops
Date: Wed, 3 Mar 2004 09:51:24 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.LNX.4.44.0403030951160.26072-100000@Xenon.Stanford.EDU>
References: <c24br3$4h9$1@news.Stanford.EDU> <c24c92$54h$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 1078336286 6162 171.64.66.201 (3 Mar 2004 17:51:26 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <c24c92$54h$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6762


 Haha :) nice.

  .m

> I had an epiphany.  This is happening as a result of my server crashing, so
> my client kind of hangs waiting for something to happen.
> 
> Guess I'll focus there.
> 
> > So I'm running the provided ftpcopy against the WWW ftpd_tcp.
> >
> > Sometimes the ftpcopy runs perfectly, and sometimes it gets through some
> > files, then starts looping on a TIMEOUT in the control_loop, never getting
> > anything from the ftpclient, even though the client never exited (in other
> > words, we haven't closed the socket, but the client just seems to sit
> there
> > never doing anything).
> >
> > Is it possible that I'm shutting out my client's thread?  If the client
> > won't tell my transport layer what to do, I'm not really sure how to go
> > about fixing that...
> >
> > Oded
> >
> >
> 
> 
> 

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: bad ftpd_tcp behavior?
Date: Wed, 3 Mar 2004 17:52:20 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c2560k$620$1@news.Stanford.EDU>
References: <c23rda$dde$1@news.Stanford.EDU> <c23s62$e62$1@news.Stanford.EDU> <c23sub$f72$1@news.Stanford.EDU> <c23uq0$h9k$1@news.Stanford.EDU> <c23vdp$i15$1@news.Stanford.EDU> <c2403g$ioc$1@news.Stanford.EDU> <c240ne$jrg$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1078336340 6208 171.64.15.74 (3 Mar 2004 17:52:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6763


>On a related note, when retransmitting a packet, should we update the th_ack
>field to the most current value, or retransmit it with what the th_ack value
>was at the time of initial transmission?

it's up to you--it would probably make sense to use the most current value,
but our implementation doesn't bother with this and still works fine.  the
other side should be able to handle either case.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: README
Date: Wed, 3 Mar 2004 09:54:07 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.LNX.4.44.0403030951410.26072-100000@Xenon.Stanford.EDU>
References: <c24gm9$9hu$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 1078336450 6327 171.64.66.201 (3 Mar 2004 17:54:10 GMT)
X-Complaints-To: news@news.stanford.edu
To: Justin <justinfw@stanford.edu>
In-Reply-To: <c24gm9$9hu$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6764



 In the README?  Just cover how you went about it, what problems you had (if
 any), lessons learned (if any).  

 .m


> what are we supposed to talk about for Milestone C?  all I did was a quick
> find/replace and some more testing.
> 
> Thanks,
> 
> Justin
> 
> 
> 

.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: README
Date: Wed, 3 Mar 2004 17:59:57 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c256et$6ik$1@news.Stanford.EDU>
References: <c24gm9$9hu$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1078336797 6740 171.64.15.67 (3 Mar 2004 17:59:57 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6765


>what are we supposed to talk about for Milestone C?  all I did was a quick
>find/replace and some more testing.

In addition to what Martin said, please include whatever you'd have put in
your README for parts A and B (we aren't expecting a lot, of course)--since
we look only at the code for part C, it would be helpful to have the
related README(s) in there.

.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PASV Fix
Date: Wed, 3 Mar 2004 18:01:57 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c256il$6q8$1@news.Stanford.EDU>
References: <4045B240.DA40322B@stanford.edu>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1078336917 6984 171.64.15.67 (3 Mar 2004 18:01:57 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6766


>Was this fixed for both the test script and the ftpd we use in our own
>directory?

Was what fixed?

PASV came up in two places--
in ftpd, the server obtains a local address, and this was fixed (for
the script, for our ftpd, for your ftpd, ...)

for ftpcopy, we provided an alternative version of the app that uses PASV
rather than PORT, in libftpcopy_pasv.a in the hw1obj directory.

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: No libftpcopy...
Date: Wed, 03 Mar 2004 10:04:07 -0800
Lines: 2
Distribution: su
Message-ID: <40461E17.F66BCED0@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078337048 7120 128.12.21.88 (3 Mar 2004 18:04:08 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6767

How is my ftpcopy compiling?

.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: HW3C: Final ACK lost, test times out
Date: Wed, 3 Mar 2004 18:04:24 +0000 (UTC)
Lines: 17
Distribution: su
Message-ID: <c256n8$70f$1@news.Stanford.EDU>
References: <tl47jy2b58f.fsf@saga12.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1078337064 7183 171.64.15.67 (3 Mar 2004 18:04:24 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6768



>I am failing the ftpcopy UI test with a timeout. It appears to be related to
>the final ACK of a connection being dropped on several of the data
>connections. If I run the same test manually it eventually finishes with all
>files transferred.

>What is the rule if the FIN for the second CLOSE on a connection doesn't get a
>acknowledgement within the retransmit timeout? Currently I retransmit it 5
>times like any other segment, and then assume that it was received (see RFC
>793, p. 38 "Case 2"). But this takes time if the peer got the got the FIN the
>first time and its ACK was lost, which causes the test timeout.

This doesn't seem sufficient to explain the timeout--our code sees the
same behaviour (also retransmits the FIN five times before giving up), but
consistently finishes with no problems.  Is this the only test case you fail?

.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: HW3C: Final ACK lost, test times out
Date: Wed, 3 Mar 2004 18:10:50 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c2573a$7h9$1@news.Stanford.EDU>
References: <tl47jy2b58f.fsf@saga12.Stanford.EDU> <c256n8$70f$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1078337450 7721 171.64.15.67 (3 Mar 2004 18:10:50 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6769


By the way, just to add--
the timeout for the test is 120s.  our ftpcopy, with both the client and
server running in unreliable mode, finishes in ~35-40s.  You can end up
timing out if you don't correctly handle some of the edge cases such as a
FIN in SYN_RCVD.

.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: sctp_network_send
Date: Wed, 3 Mar 2004 18:14:53 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c257at$7rr$1@news.Stanford.EDU>
References: <4045948E.9A6E8C59@stanford.edu>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1078337693 8059 171.64.15.67 (3 Mar 2004 18:14:53 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6770


>Because we do not implement TIME_WAIT it is possible for an ACK to be
>lost and for us to repeatedly try to send a FIN (the other side is
>closed).  Right now I just keep trying (eg. if network_send returns a
>failure I keep trying it until I reach a transmission error) . Is this
>acceptable?  Should we exit or error depending on our state?  Or is it
>ok to timeout from failure to send (eg. assume maybe later sends will
>work so we can try again)?

if stcp_network_send() returns a failure, you can regard the connection
as terminated.
.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: weird stcp in ftpd_tcp
Date: Wed, 3 Mar 2004 18:16:52 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c257ek$81k$1@news.Stanford.EDU>
References: <c1rjfc$2k8$1@news.Stanford.EDU> <c1rvom$edb$1@news.Stanford.EDU> <c1tvdh$k12$1@news.Stanford.EDU> <c1ut44$onq$1@news.Stanford.EDU> <c249hl$1n0$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1078337812 8244 171.64.15.67 (3 Mar 2004 18:16:52 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6771


>I have had this behavior several times in the past, with the same random
>effect when running with or without printfs, or inside or outisde the
>debugger. I suspect it comes from synchronisation problems in the provided
>code, because I got rid of it for part a by merging two consecutive calls to
>stcp_app_recv in a single call.

If that were the case, it would seem that this would prevent more people
from passing the tests.  I suspect a problem in your transport layer.
Did purify show anything?  Can you find where it's hanging when you
run inside gdb?
.

Path: shelby.stanford.edu!not-for-mail
From: Myles Barrett Williams <mylesw@saga13.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: HW3C: Final ACK lost, test times out
Date: 03 Mar 2004 11:00:51 -0800
Organization: Stanford University, CA, USA
Lines: 7
Distribution: su
Message-ID: <tl4llmhycv0.fsf@saga13.Stanford.EDU>
References: <tl47jy2b58f.fsf@saga12.Stanford.EDU> <c256n8$70f$1@news.Stanford.EDU>
NNTP-Posting-Host: saga13.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1078340451 11348 171.64.15.143 (3 Mar 2004 19:00:51 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:6772

holliman@Stanford.EDU (Matthew Jonathan Holliman) writes:

> This doesn't seem sufficient to explain the timeout--our code sees the
> same behaviour (also retransmits the FIN five times before giving up), but
> consistently finishes with no problems.  Is this the only test case you fail?

Yes
.

Path: shelby.stanford.edu!not-for-mail
From: "jsilver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Test 2.D
Date: Wed, 3 Mar 2004 11:08:50 -0800
Lines: 124
Distribution: su
Message-ID: <c25ag6$bti$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078340935 12210 127.0.0.1 (3 Mar 2004 19: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:6773

Arghhh....My Test2.D is now failing.   The server startes ACK'ing me with -1
and I eventually fail after 5 retransmits of data.   Any hints on what's
going on?

Test 2.D, using current source tree and build
make -f /usr/class/cs244a/grading_script/hw3/Makefile
LIBDIR=/usr/class/cs244a/grading_script/hw3 testclient
gcc -g -ansi -DSOLARIS -D__EXTENSIONS__ -Wall -I/usr/class/cs244a/WWW/homewo
rks/hw3/src -DFIXED_INITNUM -c -o transport_fixed_init.o transport.c
transport.c: In function `print_state':
transport.c:848: warning: int format, long int arg (arg 2)
transport.c:848: warning: int format, long int arg (arg 3)
gcc -g -ansi -DSOLARIS -D__EXTENSIONS__ -Wall -I/usr/class/cs244a/WWW/homewo
rks/hw3/src -o testclient /usr/class/cs244a/grading_script/hw3/testclient.o
/usr/class/cs244a/grading_script/hw3/connection_demux.o
/usr/class/cs244a/grading_script/hw3/mysock.o
/usr/class/cs244a/grading_script/hw3/mysock_api.o
/usr/class/cs244a/grading_script/hw3/network_io.o
/usr/class/cs244a/grading_script/hw3/network_io_socket.o
/usr/class/cs244a/grading_script/hw3/network_io_tcp.o
/usr/class/cs244a/grading_script/hw3/stcp_api.o
/usr/class/cs244a/grading_script/hw3/tcp_sum.o
/usr/class/cs244a/grading_script/hw3/network.o
transport_fixed_init.o -lsocket -lnsl -lm -lmd5 -lpthread

Testing input file net_instruct_resend_same_info

Starting server: /usr/class/cs244a/grading_script/hw3/testserver -f
/usr/class/cs244a/grading_script/hw3/net_instruct_resend_same_info.txt -p
/afs/ir.stanford.edu/users/j/m/jmsilver/cs244a/hw3/hw3.v2/grading_src/build/
..server_port 2>&1 >
/afs/ir.stanford.edu/users/j/m/jmsilver/cs244a/hw3/hw3.v2/grading_src/build/
..server_output
Server started
Starting client: ./testclient  -p .server_port -f
net_instruct_resend_same_info foo
connected to 171.64.15.134 at port 44649
warning:  client exited with non-zero status (256)
program output:
Send packet list:***
Printing data q***
seq = 1, len =1 sendtimes=0

Sending for the 0 time
Time is 315056.353
Sending packet
seq=1 ack=0 offset=5 flags=2 win=3072 CurState=0 ctx=0
active=1 s_next=1, s_una=1
data len = 0
remaining send window: 536

Time is 315056.359
Received input packet
seq=2 ack=2 offset=5 flags=18 win=3072 CurState=3 ctx=0
active=1 s_next=2, s_una=1
data len = 0
remaining send window: 535

s_queue = 1, ack point = 2
Status of Q before accepting packet
Printing data q***

Would like to have packet 2
Status of Q after packet
Printing data q***
seq = 2, len =1 sendtimes=0

Time is 315056.359
Sending an ack
seq=2 ack=3 offset=5 flags=16 win=3072 CurState=4 ctx=0
active=1 s_next=2, s_una=2
data len = 0
remaining send window: 3072

Time is 315056.360
Received input packet
seq=3 ack=-1 offset=5 flags=0 win=3072 CurState=4 ctx=0
active=1 s_next=2, s_una=2
data len = 10
remaining send window: 3072

Status of Q before accepting packet
Printing data q***

Would like to have packet 3
Status of Q after packet
Printing data q***
seq = 3, len =10 sendtimes=0

Time is 315056.360
Sending an ack
seq=2 ack=13 offset=5 flags=16 win=3072 CurState=4 ctx=0
active=1 s_next=2, s_una=2
data len = 0
remaining send window: 3072

Time is 315056.360
Received input packet
seq=3 ack=-1 offset=5 flags=0 win=3072 CurState=4 ctx=0
active=1 s_next=2, s_una=2
data len = 10
remaining send window: 3072

Status of Q before accepting packet
Printing data q***

Time is 315056.360
Sending an ack
seq=2 ack=13 offset=5 flags=16 win=3072 CurState=4 ctx=0
active=1 s_next=2, s_una=2
data len = 0
remaining send window: 3072

Time is 315056.360
Received input packet
seq=3 ack=-1 offset=5 flags=0 win=3072 CurState=4 ctx=0
active=1 s_next=2, s_una=2
data len = 20
remaining send window: 3072





.

Path: shelby.stanford.edu!elaine2.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test 2.D
Date: Wed, 3 Mar 2004 19:10:25 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c25aj1$c4g$1@news.Stanford.EDU>
References: <c25ag6$bti$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine2.stanford.edu
X-Trace: news.Stanford.EDU 1078341025 12432 171.64.15.67 (3 Mar 2004 19:10:25 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6774


>Arghhh....My Test2.D is now failing.   The server startes ACK'ing me with -1
>and I eventually fail after 5 retransmits of data.   Any hints on what's
>going on?

the ack flag isn't set, so the th_ack field isn't valid...

.

Path: shelby.stanford.edu!not-for-mail
From: "jsilver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Test 2.D
Date: Wed, 3 Mar 2004 11:18:55 -0800
Lines: 17
Distribution: su
Message-ID: <c25b33$cnl$1@news.Stanford.EDU>
References: <c25ag6$bti$1@news.Stanford.EDU> <c25aj1$c4g$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078341539 13045 127.0.0.1 (3 Mar 2004 19:18: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:6775

Ok.  But what exactly failed?  Did I not send all the data to the APP or did
my program return the wrong error code as implied by this line:

warning:  client exited with non-zero status (256)

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c25aj1$c4g$1@news.Stanford.EDU...
>
> >Arghhh....My Test2.D is now failing.   The server startes ACK'ing me
with -1
> >and I eventually fail after 5 retransmits of data.   Any hints on what's
> >going on?
>
> the ack flag isn't set, so the th_ack field isn't valid...
>


.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Test 2.D
Date: Wed, 3 Mar 2004 19:41:18 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c25ccu$ejt$1@news.Stanford.EDU>
References: <c25ag6$bti$1@news.Stanford.EDU> <c25aj1$c4g$1@news.Stanford.EDU> <c25b33$cnl$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078342878 14973 171.64.15.69 (3 Mar 2004 19:41:18 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6776


>Ok.  But what exactly failed?  Did I not send all the data to the APP or did
>my program return the wrong error code as implied by this line:

There's no data to retransmit, as this particular client (2.D, 2.E, 2.F)
doesn't send anything other than a SYN, some ACKs, and later a FIN.
(Basically, it just doesn't send a filename).

The exit status is what caused the test to fail.
.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW3C: Final ACK lost, test times out
Date: Wed, 3 Mar 2004 11:42:56 -0800
Organization: CS Masters Program
Lines: 24
Distribution: su
Message-ID: <c25cgc$epv$1@news.Stanford.EDU>
References: <tl47jy2b58f.fsf@saga12.Stanford.EDU> <c256n8$70f$1@news.Stanford.EDU> <c2573a$7h9$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078342990 15167 127.0.0.1 (3 Mar 2004 19:43: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:6777

Matt.

I have a question re: handling FIN in SYN_RCVD

According to the state transition diagram on p. 241 of TCP/IP Illustrated:
Volume 1, The Protocols (Stevens), It doesn't appear that TCP is supposed to
handle a FIN in the SYN_RCVD state; it just handles an ACK or an app
close(). Is the diagram wrong, or am I missing something?

Thanks,

Greg

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c2573a$7h9$1@news.Stanford.EDU...
>
> By the way, just to add--
> the timeout for the test is 120s.  our ftpcopy, with both the client and
> server running in unreliable mode, finishes in ~35-40s.  You can end up
> timing out if you don't correctly handle some of the edge cases such as a
> FIN in SYN_RCVD.
>


.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: HW3C: Final ACK lost, test times out
Date: Wed, 3 Mar 2004 19:51:23 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c25cvr$fam$1@news.Stanford.EDU>
References: <tl47jy2b58f.fsf@saga12.Stanford.EDU> <c256n8$70f$1@news.Stanford.EDU> <c2573a$7h9$1@news.Stanford.EDU> <c25cgc$epv$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine3.stanford.edu
X-Trace: news.Stanford.EDU 1078343483 15702 171.64.15.68 (3 Mar 2004 19:51:23 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6778




>According to the state transition diagram on p. 241 of TCP/IP Illustrated:
>Volume 1, The Protocols (Stevens), It doesn't appear that TCP is supposed to
>handle a FIN in the SYN_RCVD state; it just handles an ACK or an app
>close(). Is the diagram wrong, or am I missing something?

I should have been a bit clearer--I'm assuming the FIN has the ACK bit
set (as real TCP would always do), so the SYN_RCVD transitions to
ESTABLISHED, and then the FIN is processed, so the first myread() on the
connection will return 0.

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: test script using ftpd_tcp
Date: Wed, 3 Mar 2004 11:58:59 -0800
Lines: 8
Distribution: su
Message-ID: <c25dco$foa$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078343896 16138 128.12.61.97 (3 Mar 2004 19:58: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:6779

Is there a way to get the test script to use the ftpd_src/ftpd_tcp version
of ftpd_tcp?  The one in my directory is still getting that segfault (on an
stcp_wait_for_event with no bad pointers), and so even as I make progress,
the test script always fails.

Oded


.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW3C: Final ACK lost, test times out
Date: Wed, 3 Mar 2004 12:02:10 -0800
Organization: CS Masters Program
Lines: 23
Distribution: su
Message-ID: <c25dk8$g42$1@news.Stanford.EDU>
References: <tl47jy2b58f.fsf@saga12.Stanford.EDU> <c256n8$70f$1@news.Stanford.EDU> <c2573a$7h9$1@news.Stanford.EDU> <c25cgc$epv$1@news.Stanford.EDU> <c25cvr$fam$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078344138 16514 127.0.0.1 (3 Mar 2004 20:02: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:6780

Got it. That's very helpful; thanks.

Greg

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c25cvr$fam$1@news.Stanford.EDU...
>
>
>
> >According to the state transition diagram on p. 241 of TCP/IP
Illustrated:
> >Volume 1, The Protocols (Stevens), It doesn't appear that TCP is supposed
to
> >handle a FIN in the SYN_RCVD state; it just handles an ACK or an app
> >close(). Is the diagram wrong, or am I missing something?
>
> I should have been a bit clearer--I'm assuming the FIN has the ACK bit
> set (as real TCP would always do), so the SYN_RCVD transitions to
> ESTABLISHED, and then the FIN is processed, so the first myread() on the
> connection will return 0.
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Nicolas Pombourcq" <nicolas.pombourcq@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: weird stcp in ftpd_tcp
Date: Wed, 3 Mar 2004 12:31:08 -0800
Lines: 9
Distribution: su
Message-ID: <c25fcr$ipm$1@news.Stanford.EDU>
References: <c1rjfc$2k8$1@news.Stanford.EDU> <c1rvom$edb$1@news.Stanford.EDU> <c1tvdh$k12$1@news.Stanford.EDU> <c1ut44$onq$1@news.Stanford.EDU> <c249hl$1n0$1@news.Stanford.EDU> <c257ek$81k$1@news.Stanford.EDU>
NNTP-Posting-Host: mummy.stanford.edu
X-Trace: news.Stanford.EDU 1078345948 19254 128.12.188.73 (3 Mar 2004 20:32: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:6781

Purify doesn't show me any problem.

I'm not very confortable, so I don't know how to tell where it is hanging.
How do you do that ? It would be really helpfull.

Thanks for your help
Nicolas


.

Path: shelby.stanford.edu!not-for-mail
From: "Dmitry Belogolovsky" <dbb@stanford.edu>
Newsgroups: su.class.cs244a
Subject: what does this mean?
Date: Wed, 3 Mar 2004 12:49:27 -0800
Lines: 15
Distribution: su
Message-ID: <c25gcg$jui$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab422625.stanford.edu
X-Trace: news.Stanford.EDU 1078346960 20434 171.66.38.37 (3 Mar 2004 20:49: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:6782

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

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

Results:  NOT OK (passed only 0 out of 1 subtests)

Program output (localhost, expected "OK: sez bytes copied":
***Timeout expired during grading

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

What the heck is sez bytes???


.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: weird stcp in ftpd_tcp
Date: Wed, 3 Mar 2004 21:51:04 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c25k08$oau$1@news.Stanford.EDU>
References: <c1rjfc$2k8$1@news.Stanford.EDU> <c1rvom$edb$1@news.Stanford.EDU> <c1tvdh$k12$1@news.Stanford.EDU> <c1ut44$onq$1@news.Stanford.EDU> <c249hl$1n0$1@news.Stanford.EDU> <c257ek$81k$1@news.Stanford.EDU> <c25fcr$ipm$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1078350664 24926 171.64.15.119 (3 Mar 2004 21:51:04 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6783



>I'm not very confortable, so I don't know how to tell where it is hanging.
>How do you do that ? It would be really helpfull.

You should be able to reproduce the behaviour by running basically the
same commands that the script uses in the shell; once you can do this,
you can then run them with gdb, so a ctrl-c when it hangs will let you
poke around in your code.  (It might be helpful/necessary to build ftpd
and ftpcopy yourself so you have symbol information, but I'm not sure).

.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: what does this mean?
Date: Wed, 3 Mar 2004 21:52:13 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c25k2d$oeh$1@news.Stanford.EDU>
References: <c25gcg$jui$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1078350733 25041 171.64.15.119 (3 Mar 2004 21:52:13 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6784



>What the heck is sez bytes???

Looks like some kind of memory corruption...

.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: shutdown()
Date: Wed, 03 Mar 2004 13:52:48 -0800
Lines: 14
Distribution: su
Message-ID: <404653B0.44D6286E@stanford.edu>
NNTP-Posting-Host: sbkim.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078350781 25136 128.12.181.98 (3 Mar 2004 21:53:01 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:6785

I had used sequences of shutdown()--process reply--close() in the data
channels of ftpcopy, so that I could process the reply messages from
the server that came after the data channels were disconnected.
(At that time I thought my solution was a fairly standard thing.)

Mysock API doesn't seem to have myshutdown(),
so can you give me an idea how I can deal with this problem?

I tried changing the sequence to close()--process reply, but now the
server says: "retrieve(): closed socket after sending data".

-- 
Seungbeom Kim

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: getting weighted average for rto
Date: Wed, 3 Mar 2004 14:11:46 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.GSO.4.44.0403031409310.13246-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 1078351908 26552 171.64.15.100 (3 Mar 2004 22:11:48 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6786


Is there a library that can help w/ all the RTO calculations
(ie...calculating the weighted average, etc)

its sort of a pain to do all the operations necessary
because we have to worry about nano-seconds wrapping and seconds
getting split, etc...

does anyone know of any ansi c lib that makes time operations
easier?

--vishal

.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: shutdown()
Date: Wed, 03 Mar 2004 14:13:52 -0800
Lines: 19
Distribution: su
Message-ID: <404658A0.68C1B703@stanford.edu>
References: <404653B0.44D6286E@stanford.edu>
NNTP-Posting-Host: sbkim.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078352032 26047 128.12.181.98 (3 Mar 2004 22:13: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:6787

Seungbeom Kim wrote:
> 
> I had used sequences of shutdown()--process reply--close() in the data
> channels of ftpcopy, so that I could process the reply messages from
> the server that came after the data channels were disconnected.
> (At that time I thought my solution was a fairly standard thing.)

(I was using PASV mode.)

> 
> I tried changing the sequence to close()--process reply, but now the
> server says: "retrieve(): closed socket after sending data".

A question in addition:
If my ftpcopy succeeds to transfer all the required files quietly
but yet make the server produce such warning messages, is it acceptable?

-- 
Seungbeom Kim
.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Submission
Date: Wed, 3 Mar 2004 14:20:44 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.GSO.4.44.0403031417130.23906-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 1078352445 27285 171.64.15.39 (3 Mar 2004 22:20:45 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6788

Under "Deliverables", assignment states that we should submit
libftpcopy.a if we're using reference ftpcopy_tcp.  However,
submission script run as

/afs/ir/class/cs244a/bin/submit.pl hw3.C TA

is not picking it up.  Since I copied it from your location, I
presume your script will find it.  Is this correct or do I need
to do something to make submit script to pick up libftpcopy.a

Thanks,
Boris.

.

Path: shelby.stanford.edu!not-for-mail
From: "Lei Zhang" <lei.zhang@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftpd hangs after initialization
Date: Wed, 3 Mar 2004 14:32:27 -0800
Lines: 12
Distribution: su
Message-ID: <c25me2$rgh$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078353156 28177 127.0.0.1 (3 Mar 2004 22:32:36 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:6789

When ftpd runs on my stcp layer, it intermittently hangs after the initial
handshake. I.e. after the server receives an ACK for its SYN and enters the
control loop, there is no APP_DATA event generated. It appears ftpd was
blocked for some reason, because if I kill the ftpcopy client, the server
immediately receives APP_DATA event.

What could be the problem?

Thanks,
Lei


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: hanging on myclose()???
Date: Wed, 3 Mar 2004 14:35:41 -0800
Lines: 24
Distribution: su
Message-ID: <c25mih$rm0$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078353297 28352 128.12.61.97 (3 Mar 2004 22:34: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:6790

So I'm running my client/server (the ones we used in milestone A and B) with
my server in gdb.
I put a breakpoint in server.c at lines 149 and 152:

149  if (myclose(sd) < 0)
150 {
151     perror("myclose (sd)");
152 }

Usually I break at 149, continue, and break at 152.  By the time I get to
152, my client has exitted successfully.

Once in a while, I break at 149, continue, and then continuously get TIMEOUT
from the stcp_wait_for_event in my transport.c control loop (in both the
client and the server), never reaching line 152.  What could be causing it
to hang on myclose(sd), and only occasionally?

Because of this, my server doesn't ever send a APP_CLOSE_REQUESTED and
things tend to suck when that happens.

Thanks,
Oded


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: hanging on myclose()???
Date: Wed, 3 Mar 2004 14:41:59 -0800
Lines: 41
Distribution: su
Message-ID: <c25muc$s2m$1@news.Stanford.EDU>
References: <c25mih$rm0$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078353676 28758 128.12.61.97 (3 Mar 2004 22:41: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:6791

More information:
I gdb'd mysock_api.c, and the hanging is happening on the following call in
myclose():

179    PTHREAD_CALL(pthread_join(ctx->transport_thread, NULL));

So it seems like the mysocket API is waiting for my thread to exit, but my
thread only sometimes gets the APP_CLOSE_REQUESTED.

I'm going to keep looking, but some advice would be greatly appreciated.

Oded

> So I'm running my client/server (the ones we used in milestone A and B)
with
> my server in gdb.
> I put a breakpoint in server.c at lines 149 and 152:
>
> 149  if (myclose(sd) < 0)
> 150 {
> 151     perror("myclose (sd)");
> 152 }
>
> Usually I break at 149, continue, and break at 152.  By the time I get to
> 152, my client has exitted successfully.
>
> Once in a while, I break at 149, continue, and then continuously get
TIMEOUT
> from the stcp_wait_for_event in my transport.c control loop (in both the
> client and the server), never reaching line 152.  What could be causing it
> to hang on myclose(sd), and only occasionally?
>
> Because of this, my server doesn't ever send a APP_CLOSE_REQUESTED and
> things tend to suck when that happens.
>
> Thanks,
> Oded
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Dmitry Belogolovsky" <dbb@stanford.edu>
Newsgroups: su.class.cs244a
Subject: what's it supposed to be instead?
Date: Wed, 3 Mar 2004 14:42:40 -0800
Lines: 16
Distribution: su
Message-ID: <c25n0o$s4o$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab40d090.stanford.edu
X-Trace: news.Stanford.EDU 1078353752 28824 171.64.208.144 (3 Mar 2004 22:42: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:6792

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

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

Results:  NOT OK (passed only 0 out of 1 subtests)

Program output (localhost, expected "OK: sez bytes copied":
***Timeout expired during grading

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

What the heck is sez bytes??? What is it supposed to be instead of sze
bytes???


.

Path: shelby.stanford.edu!not-for-mail
From: "Nicolas Pombourcq" <nicolas.pombourcq@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: weird stcp in ftpd_tcp
Date: Wed, 3 Mar 2004 14:41:05 -0800
Lines: 4
Distribution: su
Message-ID: <c25n0r$s4r$1@news.Stanford.EDU>
References: <c1rjfc$2k8$1@news.Stanford.EDU> <c1rvom$edb$1@news.Stanford.EDU> <c1tvdh$k12$1@news.Stanford.EDU> <c1ut44$onq$1@news.Stanford.EDU> <c249hl$1n0$1@news.Stanford.EDU> <c257ek$81k$1@news.Stanford.EDU> <c25fcr$ipm$1@news.Stanford.EDU> <c25k08$oau$1@news.Stanford.EDU>
NNTP-Posting-Host: mummy.stanford.edu
X-Trace: news.Stanford.EDU 1078353755 28827 128.12.188.73 (3 Mar 2004 22:42: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:6793

When I hit ctrl+c in gdb, the position in code shown by gdb is the signal
handler ... not really helpfull.


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: weird stcp in ftpd_tcp
Date: Wed, 3 Mar 2004 14:46:24 -0800
Lines: 14
Distribution: su
Message-ID: <c25n6m$sb0$1@news.Stanford.EDU>
References: <c1rjfc$2k8$1@news.Stanford.EDU> <c1rvom$edb$1@news.Stanford.EDU> <c1tvdh$k12$1@news.Stanford.EDU> <c1ut44$onq$1@news.Stanford.EDU> <c249hl$1n0$1@news.Stanford.EDU> <c257ek$81k$1@news.Stanford.EDU> <c25fcr$ipm$1@news.Stanford.EDU> <c25k08$oau$1@news.Stanford.EDU> <c25n0r$s4r$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078353942 29024 128.12.61.97 (3 Mar 2004 22:45: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:6794

Try using:
thread 1
thread 2
etc.
to find a thread that is helpful.

"Nicolas Pombourcq" <nicolas.pombourcq@stanford.edu> wrote in message
news:c25n0r$s4r$1@news.Stanford.EDU...
> When I hit ctrl+c in gdb, the position in code shown by gdb is the signal
> handler ... not really helpfull.
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: hanging on myclose()???
Date: Wed, 3 Mar 2004 14:52:02 -0800
Lines: 60
Distribution: su
Message-ID: <c25nh7$smm$1@news.Stanford.EDU>
References: <c25mih$rm0$1@news.Stanford.EDU> <c25muc$s2m$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078354279 29398 128.12.61.97 (3 Mar 2004 22:51: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:6795

OK.  Got it.

My APP_CLOSE_REQUESTED was sent to a different wait_for_event call.
The call was stcp_wait_for_event( sd, NETWORK_DATA, &timeout );

I think this was asked before, but how come the stcp_api doesn't check if we
are asking for APP_CLOSE_REQUESTED before sending it?  Otherwise, it sends
it when we aren't listening for it, and it's lost.

Oded


"Oded Wurman" <owurman@stanford.edu> wrote in message
news:c25muc$s2m$1@news.Stanford.EDU...
> More information:
> I gdb'd mysock_api.c, and the hanging is happening on the following call
in
> myclose():
>
> 179    PTHREAD_CALL(pthread_join(ctx->transport_thread, NULL));
>
> So it seems like the mysocket API is waiting for my thread to exit, but my
> thread only sometimes gets the APP_CLOSE_REQUESTED.
>
> I'm going to keep looking, but some advice would be greatly appreciated.
>
> Oded
>
> > So I'm running my client/server (the ones we used in milestone A and B)
> with
> > my server in gdb.
> > I put a breakpoint in server.c at lines 149 and 152:
> >
> > 149  if (myclose(sd) < 0)
> > 150 {
> > 151     perror("myclose (sd)");
> > 152 }
> >
> > Usually I break at 149, continue, and break at 152.  By the time I get
to
> > 152, my client has exitted successfully.
> >
> > Once in a while, I break at 149, continue, and then continuously get
> TIMEOUT
> > from the stcp_wait_for_event in my transport.c control loop (in both the
> > client and the server), never reaching line 152.  What could be causing
it
> > to hang on myclose(sd), and only occasionally?
> >
> > Because of this, my server doesn't ever send a APP_CLOSE_REQUESTED and
> > things tend to suck when that happens.
> >
> > Thanks,
> > Oded
> >
> >
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: stcp_api.c:72
Date: Wed, 3 Mar 2004 14:53:13 -0800
Lines: 18
Distribution: su
Message-ID: <c25nje$spq$1@news.Stanford.EDU>
References: <c21c8q$gp8$2@news.Stanford.EDU> <c23ejc$e1b$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078354350 29498 128.12.61.97 (3 Mar 2004 22:52: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:6796

Could this be fixed please?  Otherwise APP_CLOSE_REQUESTED is sent to a
wait_for_event that isn't listening for it, and since it's only sent once
and then never again, it's lost.

Oded

>
> >Is there a reason why stcp_wait_for_event is not checking for a
> >APP_CLOSE_REQUESTED flag before returning the event?
>
> no, not particularly--the network event flag could be handled the same
way,
> since this would always be set on input.  the reason is most likely that
it
> was written late at night...
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Ramesh Kumar" <rameshk@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: random timeout loops
Date: Wed, 3 Mar 2004 15:10:54 -0800
Lines: 61
Distribution: su
Message-ID: <c25om6$t7$1@news.Stanford.EDU>
References: <c24br3$4h9$1@news.Stanford.EDU> <c24c92$54h$1@news.Stanford.EDU> <Pine.LNX.4.44.0403030951160.26072-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: ayyappa.stanford.edu
X-Trace: news.Stanford.EDU 1078355462 935 128.12.131.94 (3 Mar 2004 23:11: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:6797


     I am getting the control loop hanging. Though my transport.c works
correctly and passed all tests
when I run it with ftpd, connection is established, data is transferred
between both sockets but they don't close, both sit waiting in timeouts in
control loop.
it then moves to other threads with new transport layers and they also sit
waiting in control loop for exit after data transfer.

I am running with reference ftpcopy  (pasv mode).

can anybody tell me if they had this problem and how to solve it.

is there is some edge case in fin management when running ftpd.

I think I don't receive an app closedown.

Ramesh.



"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0403030951160.26072-100000@Xenon.Stanford.EDU...
>
>  Haha :) nice.
>
>   .m
>
> > I had an epiphany.  This is happening as a result of my server crashing,
so
> > my client kind of hangs waiting for something to happen.
> >
> > Guess I'll focus there.
> >
> > > So I'm running the provided ftpcopy against the WWW ftpd_tcp.
> > >
> > > Sometimes the ftpcopy runs perfectly, and sometimes it gets through
some
> > > files, then starts looping on a TIMEOUT in the control_loop, never
getting
> > > anything from the ftpclient, even though the client never exited (in
other
> > > words, we haven't closed the socket, but the client just seems to sit
> > there
> > > never doing anything).
> > >
> > > Is it possible that I'm shutting out my client's thread?  If the
client
> > > won't tell my transport layer what to do, I'm not really sure how to
go
> > > about fixing that...
> > >
> > > Oded
> > >
> > >
> >
> >
> >
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: random timeout loops
Date: Wed, 3 Mar 2004 15:17:14 -0800
Lines: 28
Distribution: su
Message-ID: <c25p0g$1ag$1@news.Stanford.EDU>
References: <c24br3$4h9$1@news.Stanford.EDU> <c24c92$54h$1@news.Stanford.EDU> <Pine.LNX.4.44.0403030951160.26072-100000@Xenon.Stanford.EDU> <c25om6$t7$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078355792 1360 128.12.61.97 (3 Mar 2004 23:16: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:6798

The problem for me ended up being that I never detected APP_CLOSE_REQUESTED.
Be careful, stcp_wait_for_event will return that flag once and only once,
and it will do so whether or not your arugment flag had that bit set.
So I never saw it, so I never sent a FIN, so things just hanged.

Oded

>
>      I am getting the control loop hanging. Though my transport.c works
> correctly and passed all tests
> when I run it with ftpd, connection is established, data is transferred
> between both sockets but they don't close, both sit waiting in timeouts in
> control loop.
> it then moves to other threads with new transport layers and they also sit
> waiting in control loop for exit after data transfer.
>
> I am running with reference ftpcopy  (pasv mode).
>
> can anybody tell me if they had this problem and how to solve it.
>
> is there is some edge case in fin management when running ftpd.
>
> I think I don't receive an app closedown.
>
> Ramesh.
>


.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Submission
Date: Wed, 3 Mar 2004 15:21:04 -0800
Lines: 29
Distribution: su
Message-ID: <Pine.GSO.4.44.0403031516470.24603-100000@epic6.Stanford.EDU>
References: <Pine.GSO.4.44.0403031417130.23906-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 1078356065 1743 171.64.15.39 (3 Mar 2004 23:21:05 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0403031417130.23906-100000@epic6.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6799

More issues with submission.  The first submission attempt picks
up any underlying directories that you might have like sr_transport

2nd or 3rd submission does not pick up any directories.  When I
unzip and untar file that I submitted 2nd or 3rd time, it has
no sr_transport directory and makefile does not finish compilation.
It does build necessary files for hw3 testing but why the difference
between 1st and later submissions?

Thanks.
Boris.

On Wed, 3 Mar 2004, Boris Senderzon wrote:

> Under "Deliverables", assignment states that we should submit
> libftpcopy.a if we're using reference ftpcopy_tcp.  However,
> submission script run as
>
> /afs/ir/class/cs244a/bin/submit.pl hw3.C TA
>
> is not picking it up.  Since I copied it from your location, I
> presume your script will find it.  Is this correct or do I need
> to do something to make submit script to pick up libftpcopy.a
>
> Thanks,
> Boris.
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Nicolas Pombourcq" <nicolas.pombourcq@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: weird stcp in ftpd_tcp
Date: Wed, 3 Mar 2004 15:21:28 -0800
Lines: 62
Distribution: su
Message-ID: <c25pck$1qv$1@news.Stanford.EDU>
References: <c1rjfc$2k8$1@news.Stanford.EDU> <c1rvom$edb$1@news.Stanford.EDU> <c1tvdh$k12$1@news.Stanford.EDU> <c1ut44$onq$1@news.Stanford.EDU> <c249hl$1n0$1@news.Stanford.EDU> <c257ek$81k$1@news.Stanford.EDU> <c25fcr$ipm$1@news.Stanford.EDU> <c25k08$oau$1@news.Stanford.EDU> <c25n0r$s4r$1@news.Stanford.EDU> <c25n6m$sb0$1@news.Stanford.EDU>
NNTP-Posting-Host: mummy.stanford.edu
X-Trace: news.Stanford.EDU 1078356180 1887 128.12.188.73 (3 Mar 2004 23:23:00 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:6800

Here is gdb's output for the ftp client, stacktrace for the 2 interesting
threads

(gdb) backtrace
#0  0xff19f208 in _lwp_sema_wait () from /usr/lib/libc.so.1
#1  0xff0c96e4 in _park () from /usr/lib/libthread.so.1
#2  0xff0c93ac in _swtch () from /usr/lib/libthread.so.1
#3  0xff0c81b4 in cond_wait () from /usr/lib/libthread.so.1
#4  0xff0c8078 in pthread_cond_wait () from /usr/lib/libthread.so.1
#5  0x00014a7c in stcp_wait_for_event (sd=2, flags=7, abstime=0x0) at
stcp_api.c:112
#6  0x00011fb0 in control_loop (sd=2, ctx=0x26fa0) at transport.c:326
#7  0x00011e00 in transport_init (sd=2, is_active=0) at transport.c:270
#8  0x00015ec8 in transport_thread_func (arg_ptr=0x268e8) at mysock.c:359

(gdb) backtrace
#0  0xff19f208 in _lwp_sema_wait () from /usr/lib/libc.so.1
#1  0xff0c96e4 in _park () from /usr/lib/libthread.so.1
#2  0xff0c93ac in _swtch () from /usr/lib/libthread.so.1
#3  0xff0c81b4 in cond_wait () from /usr/lib/libthread.so.1
#4  0xff0c8078 in pthread_cond_wait () from /usr/lib/libthread.so.1
#5  0x00015840 in _mysock_dequeue_buffer (ctx=0x268e8, pq=0x26f88,
dst=0xffbeee30,
    max_len=1024, remove_partial=1) at mysock.c:193
#6  0x00014360 in myread (sd=2, buf=0xffbeee30, buf_len=1024) at
mysock_api.c:225
#7  0x0001a74c in Retr (ctrl_sock=0, filename=0x2b075 "access.c",
    target=0xffbef3d8 "./access.c", is_reliable=1) at commands.c:91
#8  0x0001aea8 in List (ctrl_sock=0, ext=0xffbef9c0 "c",
    target=0xffbef3d8 "./access.c", depth=3, is_reliable=1) at
commands.c:220
#9  0x0001a1dc in main (argc=6, argv=0xffbef860) at main.c:103

and for the ftp daemon:

(gdb) backtrace
#0  0xff19f208 in _lwp_sema_wait () from /usr/lib/libc.so.1
#1  0xff0c96e4 in _park () from /usr/lib/libthread.so.1
#2  0xff0c93ac in _swtch () from /usr/lib/libthread.so.1
#3  0xff0c81b4 in cond_wait () from /usr/lib/libthread.so.1
#4  0xff0c8078 in pthread_cond_wait () from /usr/lib/libthread.so.1
#5  0x000158b4 in stcp_wait_for_event (sd=1, flags=7, abstime=0x0) at
stcp_api.c:112
#6  0x00012de8 in control_loop (sd=1, ctx=0x4bb90) at transport.c:326
#7  0x00012c38 in transport_init (sd=1, is_active=0) at transport.c:270
#8  0x00016d00 in transport_thread_func (arg_ptr=0x4ac88) at mysock.c:359

(gdb) backtrace
#0  0xff19f208 in _lwp_sema_wait () from /usr/lib/libc.so.1
#1  0xff0c96e4 in _park () from /usr/lib/libthread.so.1
#2  0xff0c93ac in _swtch () from /usr/lib/libthread.so.1
#3  0xff0c81b4 in cond_wait () from /usr/lib/libthread.so.1
#4  0xff0c8078 in pthread_cond_wait () from /usr/lib/libthread.so.1
#5  0x000158b4 in stcp_wait_for_event (sd=0, flags=7, abstime=0x0) at
stcp_api.c:112
#6  0x00012de8 in control_loop (sd=0, ctx=0x63d98) at transport.c:326
#7  0x00012c38 in transport_init (sd=0, is_active=1) at transport.c:270
#8  0x00016d00 in transport_thread_func (arg_ptr=0x519d0) at mysock.c:359

It seems there is a deadlock somewhere


.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: shutdown()
Date: Wed, 3 Mar 2004 23:23:09 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <c25pct$1rj$1@news.Stanford.EDU>
References: <404653B0.44D6286E@stanford.edu> <404658A0.68C1B703@stanford.edu>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1078356189 1907 171.64.15.119 (3 Mar 2004 23:23:09 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6801



>> I tried changing the sequence to close()--process reply, but now the
>> server says: "retrieve(): closed socket after sending data".

>A question in addition:
>If my ftpcopy succeeds to transfer all the required files quietly
>but yet make the server produce such warning messages, is it acceptable?

The messages are normal, they aren't warnings, and can be ignored.
And yes, closing the socket rather than using shutdown() should work fine.

.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: getting weighted average for rto
Date: Wed, 3 Mar 2004 23:24:47 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c25pfv$1ut$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403031409310.13246-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1078356287 2013 171.64.15.119 (3 Mar 2004 23:24:47 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6802



>its sort of a pain to do all the operations necessary
>because we have to worry about nano-seconds wrapping and seconds
>getting split, etc...

c'mon, you're talking about a few lines of code!  how lazy can you get?!

.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Submission
Date: Wed, 3 Mar 2004 23:27:52 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c25plo$248$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403031417130.23906-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1078356472 2184 171.64.15.119 (3 Mar 2004 23:27:52 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6803


>Under "Deliverables", assignment states that we should submit
>libftpcopy.a if we're using reference ftpcopy_tcp.  However,
>submission script run as

I've fixed the assignment description now--since the Makefile points to the
right library, there's no need to submit this.

.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Submission
Date: Wed, 3 Mar 2004 23:30:26 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c25pqi$2d0$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403031417130.23906-100000@epic6.Stanford.EDU> <Pine.GSO.4.44.0403031516470.24603-100000@epic6.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1078356626 2464 171.64.15.119 (3 Mar 2004 23:30:26 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6804


>More issues with submission.  The first submission attempt picks
>up any underlying directories that you might have like sr_transport

>2nd or 3rd submission does not pick up any directories.  When I
>unzip and untar file that I submitted 2nd or 3rd time, it has
>no sr_transport directory and makefile does not finish compilation.
>It does build necessary files for hw3 testing but why the difference
>between 1st and later submissions?

for which assignment?  we don't care about sr_transport for hw3.C.
when we grade, we'll do the same gethw you did, then overwrite the
Makefile/transport.c with whatever you submitted.

.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: weird stcp in ftpd_tcp
Date: Wed, 3 Mar 2004 23:31:57 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c25ptd$2gv$1@news.Stanford.EDU>
References: <c1rjfc$2k8$1@news.Stanford.EDU> <c1rvom$edb$1@news.Stanford.EDU> <c1tvdh$k12$1@news.Stanford.EDU> <c1ut44$onq$1@news.Stanford.EDU> <c249hl$1n0$1@news.Stanford.EDU> <c257ek$81k$1@news.Stanford.EDU> <c25fcr$ipm$1@news.Stanford.EDU> <c25k08$oau$1@news.Stanford.EDU> <c25n0r$s4r$1@news.Stanford.EDU> <c25n6m$sb0$1@news.Stanford.EDU> <c25pck$1qv$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1078356717 2591 171.64.15.119 (3 Mar 2004 23:31:57 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6805



>It seems there is a deadlock somewhere

If that's the case, please show the deadlocking threads... there must
be at least two threads of interest on one side for this to be the
case...

.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: stcp_api.c:72
Date: Wed, 3 Mar 2004 23:36:02 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <c25q52$2q1$1@news.Stanford.EDU>
References: <c21c8q$gp8$2@news.Stanford.EDU> <c23ejc$e1b$1@news.Stanford.EDU> <c25nje$spq$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1078356962 2881 171.64.15.119 (3 Mar 2004 23:36:02 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6806


>Could this be fixed please?  Otherwise APP_CLOSE_REQUESTED is sent to a
>wait_for_event that isn't listening for it, and since it's only sent once
>and then never again, it's lost.

No, I can't "fix" this now.

The comments for wait_for_event in stcp_api.h make it quite clear that
the app can close the socket at any time--as does the implementation,
and that this will always be returned to the transport layer.  So I don't
know why it's suddenly a shock that this is the case.

I'm not changing the interface now, since it's been like this since the
assignment was out and to do so might break others' code.  In any case, I
don't see why this is a big deal (or why you weren't expecting this event
at almost any time)--it doesn't seem difficult to keep a closed flag
around if for some reason you want to only process the event later.

.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: random timeout loops
Date: Wed, 3 Mar 2004 23:38:42 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c25qa2$2vr$1@news.Stanford.EDU>
References: <c24br3$4h9$1@news.Stanford.EDU> <c24c92$54h$1@news.Stanford.EDU> <Pine.LNX.4.44.0403030951160.26072-100000@Xenon.Stanford.EDU> <c25om6$t7$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1078357122 3067 171.64.15.119 (3 Mar 2004 23:38:42 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6807



>can anybody tell me if they had this problem and how to solve it.

there have been several posts on the newsgroup about similar problems.
as for how to solve it, you should be an expert in debugging this kind
of thing by now, and can no doubt describe a number of steps to follow
in tracking the bug down, without anyone else having to enumerate these
for you...

.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: what's it supposed to be instead?
Date: Wed, 3 Mar 2004 23:41:07 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c25qej$37u$1@news.Stanford.EDU>
References: <c25n0o$s4o$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1078357267 3326 171.64.15.119 (3 Mar 2004 23:41:07 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6808



>What the heck is sez bytes??? What is it supposed to be instead of sze
>bytes???

It should say "OK: nnn bytes copies" where nnn is some number...

I'm not sure where the 'sez' comes from...

You should be able to reproduce this in the shell.

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Data beyond FIN
Date: Wed, 03 Mar 2004 15:49:24 -0800
Lines: 6
Distribution: su
Message-ID: <40466F04.B5740E6A@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078357765 3934 128.12.21.88 (3 Mar 2004 23:49:25 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6809

If we receive a packet that contains data beyond the sequence number of
the FIN, we can just drop the whole packet as this shoul dneve rhappen.
Right?



.

Path: shelby.stanford.edu!not-for-mail
From: "Nicolas Pombourcq" <nicolas.pombourcq@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: weird stcp in ftpd_tcp
Date: Wed, 3 Mar 2004 16:20:57 -0800
Lines: 5
Distribution: su
Message-ID: <c25ssa$6gk$1@news.Stanford.EDU>
References: <c1rjfc$2k8$1@news.Stanford.EDU> <c1rvom$edb$1@news.Stanford.EDU> <c1tvdh$k12$1@news.Stanford.EDU> <c1ut44$onq$1@news.Stanford.EDU> <c249hl$1n0$1@news.Stanford.EDU> <c257ek$81k$1@news.Stanford.EDU> <c25fcr$ipm$1@news.Stanford.EDU> <c25k08$oau$1@news.Stanford.EDU> <c25n0r$s4r$1@news.Stanford.EDU> <c25n6m$sb0$1@news.Stanford.EDU> <c25pck$1qv$1@news.Stanford.EDU> <c25ptd$2gv$1@news.Stanford.EDU>
NNTP-Posting-Host: mummy.stanford.edu
X-Trace: news.Stanford.EDU 1078359754 6676 128.12.188.73 (4 Mar 2004 00:22:34 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:6810

My mistake, I was considering a FIN as acked when it was not yet acked,
which caused the server to wait for a FIN from the client while the client
had not received the server's FIN.


.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Grading Script Error?? Test for HWB
Date: Wed, 03 Mar 2004 16:41:19 -0800
Lines: 19
Distribution: su
Message-ID: <40467B2E.FE612D80@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078360880 8099 128.12.21.88 (4 Mar 2004 00:41:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6811

I get this error for the test of hwB:

Test 2.F [out of 5]
Checks transport layer enforces correct receiver window.

Results:  NOT OK

Unexpected exit status 256.  Program output:
myconnect: Connection refused


Connection refused however I only trigger if my network send fails when
I send the original syn.  (In other words this error is only caused by a
-1 return value from stcp_network_send when trying to send the first
syn).  So, I reran my test without changing the code and it passed now -
two times in a row.  Can I correctly assume it was an error in the
grading script (picking a busy port or something like that)?  Is the
port number just picked at random and maybe someone else was using it?

.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Grading Script Error?? Test for HWB
Date: Thu, 4 Mar 2004 00:45:19 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c25u6v$881$1@news.Stanford.EDU>
References: <40467B2E.FE612D80@stanford.edu>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1078361119 8449 171.64.15.119 (4 Mar 2004 00:45:19 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6812


>Connection refused however I only trigger if my network send fails when
>I send the original syn.  (In other words this error is only caused by a
>-1 return value from stcp_network_send when trying to send the first
>syn).  So, I reran my test without changing the code and it passed now -
>two times in a row.  Can I correctly assume it was an error in the
>grading script (picking a busy port or something like that)?  Is the
>port number just picked at random and maybe someone else was using it?

no, the server uses an ephemeral port (assigned by the O/S), so this
wouldn't be the cause.  I haven't seen the script fail on the ref soln,
and it's been tested against that a few dozen times, so I'm skeptical
that there's a problem in the script.  But I'll take a look.

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Grading Script Error?? Test for HWB
Date: Wed, 03 Mar 2004 16:47:42 -0800
Lines: 24
Distribution: su
Message-ID: <40467CAE.77953B56@stanford.edu>
References: <40467B2E.FE612D80@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078361264 8099 128.12.21.88 (4 Mar 2004 00:47:44 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6813

Reference server just have been busy?  Only time the errno value gets set to
ECONNREFUSED is in open syn.  And the fact passed two other times in a
row... with no code changing

Ryan wrote:

> I get this error for the test of hwB:
>
> Test 2.F [out of 5]
> Checks transport layer enforces correct receiver window.
>
> Results:  NOT OK
>
> Unexpected exit status 256.  Program output:
> myconnect: Connection refused
>
> Connection refused however I only trigger if my network send fails when
> I send the original syn.  (In other words this error is only caused by a
> -1 return value from stcp_network_send when trying to send the first
> syn).  So, I reran my test without changing the code and it passed now -
> two times in a row.  Can I correctly assume it was an error in the
> grading script (picking a busy port or something like that)?  Is the
> port number just picked at random and maybe someone else was using it?

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftpd_tcp
Date: Wed, 3 Mar 2004 16:55:22 -0800
Lines: 7
Distribution: su
Message-ID: <c25uod$8pk$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078361677 9012 128.12.61.97 (4 Mar 2004 00:54: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:6814

Any word on how to get the script to use
/afs/ir/class/cs244a/WWW/homeworks/hw3/ftpd_src/ftpd_tcp?

Thanks,
Oded


.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ftpd_tcp
Date: Thu, 4 Mar 2004 01:04:49 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c25vbh$9n8$1@news.Stanford.EDU>
References: <c25uod$8pk$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1078362289 9960 171.64.15.119 (4 Mar 2004 01:04:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6815


>Any word on how to get the script to use
>/afs/ir/class/cs244a/WWW/homeworks/hw3/ftpd_src/ftpd_tcp?

This seems a bit academic, since that's not what we're grading on...

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftpd_tcp
Date: Wed, 3 Mar 2004 17:12:41 -0800
Lines: 26
Distribution: su
Message-ID: <c25vov$a6n$1@news.Stanford.EDU>
References: <c25uod$8pk$1@news.Stanford.EDU> <c25vbh$9n8$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078362719 10455 128.12.61.97 (4 Mar 2004 01:11: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:6816

From the assignment:
"We have supplied you the code for an ftp server daemon here.  You can copy
the code over or simply run the ftp server as
/afs/ir/class/cs244a/WWW/homeworks/hw3/ftpd_src/src/ftp_tcp.  This ftp
server talks STCP over our simulated network layer, and you are required to
modify your ftp client from the first assignment to work with this server
when your ftp client uses the mysock/stcp implementation you have completed
in milestone HW3.B."

So my client works against the aforementioned server, but not the one that's
compiled in my directory.  I would be ecstatic to get the one in my
directory working, but it's been segfaulting since day 1 and nothing I do to
my transport.c seems to change that.  So I'll settle for being graded
against the provided ftpd_tcp, as the problem statement says we would be.  I
don't think this is unreasonable?

Oded

>
> >Any word on how to get the script to use
> >/afs/ir/class/cs244a/WWW/homeworks/hw3/ftpd_src/ftpd_tcp?
>
> This seems a bit academic, since that's not what we're grading on...
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: segfault in ftpd_tcp
Date: Wed, 3 Mar 2004 18:27:32 -0800
Lines: 26
Distribution: su
Message-ID: <c26458$gt4$1@news.Stanford.EDU>
References: <c1v3fm$2g2$1@news.Stanford.EDU> <c201rn$65r$1@news.Stanford.EDU> <c203l1$883$1@news.Stanford.EDU> <c2067q$bdf$1@news.Stanford.EDU> <c2093o$etm$1@news.Stanford.EDU> <c20dnj$kmo$1@news.Stanford.EDU> <c20dta$kqv$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078367209 17316 128.12.61.97 (4 Mar 2004 02:26: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:6817

I managed to run purify on both ftpcopy_tcp and ftpd_tcp, neither shows any
memory leaks.
I still get the segfault.  Interestingly enough, when I run the purify
version of ftpd_tcp, there is no segfault, but it dies shortly after anyway.
gdb shows nothing wrong in my code.  Your code has a simple variable
assignment on that line.

If you don't mind my asking, WHY THE HELL WONT IT WORK.

Oded

>
> >Is there a ftpd_tcp.purify?  Make all.purify didn't make one.  I'm
confused
> >by a recent post to the newsgroup.  Are we supposed to test our ftpcopy
> >against the provided ftpd_tcp, or the one that's compiled using our
> >transport.c?
>
> There is if you build one.  But you'll have to add the rule for this; the
> Makefile doesn't build this as is.
>
> Your ftpcopy should work against our ftpd_tcp, or your ftpd_tcp.  (If it
> doesn't, something's broken).
>


.

Path: shelby.stanford.edu!not-for-mail
From: Kirk Shimano <kshimano@stanford.edu>
Newsgroups: su.class.cs244a
Subject: P4 Ethernet Header
Date: Wed, 03 Mar 2004 21:07:55 -0800
Lines: 28
Distribution: su
Message-ID: <c26djq$t8o$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 1078376890 29976 128.12.41.60 (4 Mar 2004 05:08:10 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:6818

I'm having some trouble getting the ftpcopy_vns to work...I tried 
compiling the program using all of the pre-built parts. Using Ethereal, 
I found out that the Ethernet header for the first SYN packet looks like 
this:

Ethernet II
	Destionation: ____
	Source: _____
	Type: _____

followed by IP and TCP information.

When I run using my own transport.c, the SYN comes out with this 
Ethernet Header:

IEEE 802.3 Ethernet
	Destination: _____
	Source: ______
	Length: 224

This is followed by a "Logical-Link Control" segement.

Is this the expected behavior? If not, does this mean that I've somehow 
managed to screw up the Ethernet headers? My guess would be that I'm 
doing something wrong, but I don't know how I can affect the Ethernet 
headers when I'm only using stcp_network_send. (At this point, I'm using 
both the prebuilt router and the prebuilt ftpcopy)

.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Internal FTP server
Date: Wed, 3 Mar 2004 21:45:42 -0800
Lines: 43
Distribution: su
Message-ID: <Pine.GSO.4.44.0403032132190.15287-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 1078379152 2682 171.64.15.42 (4 Mar 2004 05:45:52 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6819

I'm seeing internal ftp server sending port unreachable packets
when using reference ftpcopy_vns (with reference transport layer)
with  either prebuilt router or my own router.

However, just doing ftp 192.168.128.19 allows me to login
and ftp files.

This is what I see from ftpcopy_vns

* routing packet to default gateway at 192.168.128.20 on interface eth0
<- sending arp request for ip 192.168.128.20 on interface eth0
* added ip packet  to arp queue
-> received ARP reply from 192.168.128.20
<- sending queued packet
Attempting to send packet out on interface eth0
-> received ARP request from 192.168.128.20 on interface eth0
 <- sent ARP reply to 192.168.128.20 on interface eth0
-> received IP packet [src:192.168.128.19][dst:192.168.128.21]
[Warning]: cannot handle icmp type 3

eventually ftpcopy_vns gives up...
ERROR: Connection refused (-1)

On the router side, tcpdump shows...

21:40:17.146842 0:e0:81:4:8:9b 70:0:0:66:0:3 ip 82:
chongs-router-1.Stanford.EDU > deneb1-router-1.Stanford.EDU:
icmp: chongs-router-1.Stanford.EDU tcp port ftp unreachable for
deneb1-router-1.Stanford.EDU.20484 > chongs-router-1.Stanford.EDU.ftp:
S [tcp sum ok] 129:129(0) win 3072 (ttl 254, id 0, len 40) [tos 0xc0]
(ttl 255, id 6526, len 68)
                         45c0 0044 197e 0000 ff01 2001 c0a8 8013
                         c0a8 8015 0303 7e91 0000 0000 4500 0028
                         0000 0000 fe06 3b56 c0a8 8015 c0a8 8013
                         5004 0015 0000 0081 0000 0000 5002 0c00
                         d1ce 0000

It can't be the routing tables for either router since ping and ftp work
or the ftpcopy_vns since packets do reach ftp server.

Thanks.
Boris.

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ftpd_tcp
Date: Thu, 4 Mar 2004 06:35:36 +0000 (UTC)
Lines: 21
Distribution: su
Message-ID: <c26ino$5mr$1@news.Stanford.EDU>
References: <c25uod$8pk$1@news.Stanford.EDU> <c25vbh$9n8$1@news.Stanford.EDU> <c25vov$a6n$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1078382136 5851 171.64.15.72 (4 Mar 2004 06:35:36 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6820


>From the assignment:
>"We have supplied you the code for an ftp server daemon here.  You can copy
>the code over or simply run the ftp server as
>/afs/ir/class/cs244a/WWW/homeworks/hw3/ftpd_src/src/ftp_tcp.  This ftp
>server talks STCP over our simulated network layer, and you are required to
>modify your ftp client from the first assignment to work with this server
>when your ftp client uses the mysock/stcp implementation you have completed
>in milestone HW3.B."

It seems that you read the assignment description quite carefully.  Since
you did so, you no doubt also noticed the disclaimer:  "Bear in mind that
the black box will not be checking all cases and that we reserve 1/7 of the
final grade for tests that we might include during the grading."

Whether or not we use our ftpd or yours is entirely at our discretion,
and making the public script use one or the other is somewhat arbitrary,
since we could always change this when grading, as the above caveat
implies.  And it really doesn't seem unreasonable that ftpd should work
with your transport layer.

.

Path: shelby.stanford.edu!elaine7.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: segfault in ftpd_tcp
Date: Thu, 4 Mar 2004 06:40:07 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c26j07$5uq$1@news.Stanford.EDU>
References: <c1v3fm$2g2$1@news.Stanford.EDU> <c201rn$65r$1@news.Stanford.EDU> <c203l1$883$1@news.Stanford.EDU> <c2067q$bdf$1@news.Stanford.EDU> <c2093o$etm$1@news.Stanford.EDU> <c20dnj$kmo$1@news.Stanford.EDU> <c20dta$kqv$1@news.Stanford.EDU> <c26458$gt4$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine7.stanford.edu
X-Trace: news.Stanford.EDU 1078382407 6106 171.64.15.72 (4 Mar 2004 06:40:07 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6821


>If you don't mind my asking, WHY THE HELL WONT IT WORK.

Please mail me the most recent version of your transport.c, and I'll
take a look.

.

Path: shelby.stanford.edu!not-for-mail
From: "Tony Hsieh" <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: midterm solutions
Date: Wed, 3 Mar 2004 23:39:49 -0800
Lines: 3
Distribution: su
Message-ID: <c26mg9$9ij$1@news.Stanford.EDU>
NNTP-Posting-Host: ac9b6cf0.ipt.aol.com
X-Trace: news.Stanford.EDU 1078385995 9811 172.155.108.240 (4 Mar 2004 07:39: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:6822

just wondering if you guys were gonna post the midterm solutions.  thanks!


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: segfault in ftpd_tcp
Date: Thu, 4 Mar 2004 00:02:20 -0800
Lines: 9
Distribution: su
Message-ID: <c26nov$b9p$1@news.Stanford.EDU>
References: <c1v3fm$2g2$1@news.Stanford.EDU> <c201rn$65r$1@news.Stanford.EDU> <c203l1$883$1@news.Stanford.EDU> <c2067q$bdf$1@news.Stanford.EDU> <c2093o$etm$1@news.Stanford.EDU> <c20dnj$kmo$1@news.Stanford.EDU> <c20dta$kqv$1@news.Stanford.EDU> <c26458$gt4$1@news.Stanford.EDU> <c26j07$5uq$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078387295 11577 128.12.61.97 (4 Mar 2004 08:01: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:6823

For anyone who was following this thread, Matthew concluded that it was a
linker issue.  I had a function named debug and there was also a global
symbol debug in the ftpd source.

So if anyone else has a function debug, change the name ;-)

Oded


.

Path: shelby.stanford.edu!not-for-mail
From: Myles Barrett Williams <mylesw@epic18.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: HW3C: Final ACK lost, test times out
Date: 04 Mar 2004 02:12:47 -0800
Organization: Stanford University, CA, USA
Lines: 18
Distribution: su
Message-ID: <tl4n06wgbts.fsf@epic18.Stanford.EDU>
References: <tl47jy2b58f.fsf@saga12.Stanford.EDU> <c256n8$70f$1@news.Stanford.EDU> <tl4llmhycv0.fsf@saga13.Stanford.EDU>
NNTP-Posting-Host: epic18.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1078395167 18312 171.64.15.53 (4 Mar 2004 10:12: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:6824


Apparently there's a deeper problem than just ACKs being lost. When I run my
ftpcopy against the reference ftpd_tcp, reliable mode, all retransmission
disabled, I see this exchange at the end of each data connection (arrows that
point to the left are TO ftpcopy)

<-- <SEQ=2573><ACK=203><WND=3072><CTL=FIN,ACK>
--> <SEQ=203><ACK=2574><WND=3072><CTL=ACK>
--> <SEQ=203><ACK=2574><WND=3072><CTL=FIN,ACK>
<-- <SEQ=2573><ACK=204><WND=3072><CTL=ACK>
         ^^^^

Compare with line 5 of the diagram on RFC 793 p. 39. What's going on with the
sequence number? Shouldn't the reference version of STCP increment it over the
FIN? Since it apparently doesn't, I'm ignoring the final ACK even when it does
get through.

Myles
.

Path: shelby.stanford.edu!elaine23.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: HW3C: Final ACK lost, test times out
Date: Thu, 4 Mar 2004 16:02:59 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c27jvj$aig$1@news.Stanford.EDU>
References: <tl47jy2b58f.fsf@saga12.Stanford.EDU> <c256n8$70f$1@news.Stanford.EDU> <tl4llmhycv0.fsf@saga13.Stanford.EDU> <tl4n06wgbts.fsf@epic18.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1078416179 10832 171.64.15.98 (4 Mar 2004 16:02:59 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6825



>Compare with line 5 of the diagram on RFC 793 p. 39. What's going on with the
>sequence number? Shouldn't the reference version of STCP increment it over the
>FIN? Since it apparently doesn't, I'm ignoring the final ACK even when it does
>get through.

Please read the newsgroup!  This has been answered several times on here,
beside which, the assignment specs state for ACKs that "The th_seq field
*should* be set to the sequence number..." -- that's a should, not a must,
so you shouldn't be relying on this.  STCP does not necessarily comply
with RFC 793, it just does the minimum necessary to be able to interoperate
with TCP.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: midterm solutions
Date: Thu, 4 Mar 2004 11:00:59 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.LNX.4.44.0403041100510.32379-100000@Xenon.Stanford.EDU>
References: <c26mg9$9ij$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 1078426860 22926 171.64.66.201 (4 Mar 2004 19:01:00 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tony Hsieh <thsieh@stanford.edu>
In-Reply-To: <c26mg9$9ij$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6826


 Yup soon! :)

  .m

> just wondering if you guys were gonna post the midterm solutions.  thanks!
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Internal FTP server
Date: Thu, 4 Mar 2004 11:07:43 -0800
Lines: 64
Distribution: su
Message-ID: <Pine.LNX.4.44.0403041102410.32379-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403032132190.15287-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 1078427265 23320 171.64.66.201 (4 Mar 2004 19:07:45 GMT)
X-Complaints-To: news@news.stanford.edu
To: Boris Senderzon <senderzo@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403032132190.15287-100000@epic9.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6827


 I'm trying to understand what you are saying is going on here.

 If I understand correctly:

 - if you connect to vrouter and then ftp by hand everything works
 - if you connect to vrouter and then to vhost with our ftpcopy_vns
   and direct it to the internal ftp server, .. the server is sending
   ICMP unreach packets back to the ftpcopy_vns?

 FTPing to the internal server works OK for me.  Would you mind
 posting more of the router trace so we can peak at the tcp connection
 setup packets?  Could it be as simple as your command line is wrong so
 it is attempting to connect to the wrong port?

 Thanks :)
 .m
 

> I'm seeing internal ftp server sending port unreachable packets
> when using reference ftpcopy_vns (with reference transport layer)
> with  either prebuilt router or my own router.
> 
> However, just doing ftp 192.168.128.19 allows me to login
> and ftp files.
> 
> This is what I see from ftpcopy_vns
> 
> * routing packet to default gateway at 192.168.128.20 on interface eth0
> <- sending arp request for ip 192.168.128.20 on interface eth0
> * added ip packet  to arp queue
> -> received ARP reply from 192.168.128.20
> <- sending queued packet
> Attempting to send packet out on interface eth0
> -> received ARP request from 192.168.128.20 on interface eth0
>  <- sent ARP reply to 192.168.128.20 on interface eth0
> -> received IP packet [src:192.168.128.19][dst:192.168.128.21]
> [Warning]: cannot handle icmp type 3
> 
> eventually ftpcopy_vns gives up...
> ERROR: Connection refused (-1)
> 
> On the router side, tcpdump shows...
> 
> 21:40:17.146842 0:e0:81:4:8:9b 70:0:0:66:0:3 ip 82:
> chongs-router-1.Stanford.EDU > deneb1-router-1.Stanford.EDU:
> icmp: chongs-router-1.Stanford.EDU tcp port ftp unreachable for
> deneb1-router-1.Stanford.EDU.20484 > chongs-router-1.Stanford.EDU.ftp:
> S [tcp sum ok] 129:129(0) win 3072 (ttl 254, id 0, len 40) [tos 0xc0]
> (ttl 255, id 6526, len 68)
>                          45c0 0044 197e 0000 ff01 2001 c0a8 8013
>                          c0a8 8015 0303 7e91 0000 0000 4500 0028
>                          0000 0000 fe06 3b56 c0a8 8015 c0a8 8013
>                          5004 0015 0000 0081 0000 0000 5002 0c00
>                          d1ce 0000
> 
> It can't be the routing tables for either router since ping and ftp work
> or the ftpcopy_vns since packets do reach ftp server.
> 
> Thanks.
> Boris.
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: P4 Ethernet Header
Date: Thu, 4 Mar 2004 11:10:02 -0800
Lines: 38
Distribution: su
Message-ID: <Pine.LNX.4.44.0403041107540.32379-100000@Xenon.Stanford.EDU>
References: <c26djq$t8o$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 1078427408 23571 171.64.66.201 (4 Mar 2004 19:10:08 GMT)
X-Complaints-To: news@news.stanford.edu
To: Kirk Shimano <kshimano@stanford.edu>
In-Reply-To: <c26djq$t8o$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6828


 
  No this doesn't look right ... tcpdump trace from your router
  would be helpful.

  thanks,
  martin

> I'm having some trouble getting the ftpcopy_vns to work...I tried 
> compiling the program using all of the pre-built parts. Using Ethereal, 
> I found out that the Ethernet header for the first SYN packet looks like 
> this:
> 
> Ethernet II
> 	Destionation: ____
> 	Source: _____
> 	Type: _____
> 
> followed by IP and TCP information.
> 
> When I run using my own transport.c, the SYN comes out with this 
> Ethernet Header:
> 
> IEEE 802.3 Ethernet
> 	Destination: _____
> 	Source: ______
> 	Length: 224
> 
> This is followed by a "Logical-Link Control" segement.
> 
> Is this the expected behavior? If not, does this mean that I've somehow 
> managed to screw up the Ethernet headers? My guess would be that I'm 
> doing something wrong, but I don't know how I can affect the Ethernet 
> headers when I'm only using stcp_network_send. (At this point, I'm using 
> both the prebuilt router and the prebuilt ftpcopy)
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS3 Solutions are up
Date: Thu, 4 Mar 2004 11:14:50 -0800
Lines: 6
Distribution: su
Message-ID: <Pine.LNX.4.44.0403041110490.32379-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 1078427695 23871 171.64.66.201 (4 Mar 2004 19:14:55 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6829


 get em' while they're hot.

  .m
  

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: VNS reboot
Date: Thu, 4 Mar 2004 11:19:29 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.LNX.4.44.0403041118550.9921-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 1078427971 24126 171.64.66.201 (4 Mar 2004 19:19:31 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6830


 ... don't be alarmed if you cannot connect for a few minutes.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Homework without a name
Date: Thu, 4 Mar 2004 11:32:10 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.LNX.4.44.0403041129160.17585-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 1078428732 25080 171.64.66.201 (4 Mar 2004 19:32:12 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6831


 We homework that is two pages front and back, on lined paper and written in
 black ink .. and without a name.  If you think this might be yours, stop
 by my (Or Theresa's) office. 

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: HW4 Port Unreach Issue
Date: Thu, 4 Mar 2004 11:52:25 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.LNX.4.44.0403041149170.25522-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 1078429947 26476 171.64.66.201 (4 Mar 2004 19:52:27 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6832


 Sorry about that guys, my fault.  Firewall on the app server was dropping all
 packets not from my little test topology *ahem*... things should work OK now. 

 thanks for letting me know,
        .martin

.

Path: shelby.stanford.edu!epic6.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Internal FTP server
Date: Thu, 4 Mar 2004 13:41:51 -0800
Lines: 73
Distribution: su
Message-ID: <Pine.GSO.4.44.0403041341030.3251-100000@epic6.Stanford.EDU>
References: <Pine.GSO.4.44.0403032132190.15287-100000@epic9.Stanford.EDU>
 <Pine.LNX.4.44.0403041102410.32379-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: epic6.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078436512 4353 171.64.15.39 (4 Mar 2004 21:41:52 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0403041102410.32379-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6833

Maybe it was late last night or maybe you fixed something,
but it now works.

Boris.

On Thu, 4 Mar 2004, Martin Casado wrote:

>
>  I'm trying to understand what you are saying is going on here.
>
>  If I understand correctly:
>
>  - if you connect to vrouter and then ftp by hand everything works
>  - if you connect to vrouter and then to vhost with our ftpcopy_vns
>    and direct it to the internal ftp server, .. the server is sending
>    ICMP unreach packets back to the ftpcopy_vns?
>
>  FTPing to the internal server works OK for me.  Would you mind
>  posting more of the router trace so we can peak at the tcp connection
>  setup packets?  Could it be as simple as your command line is wrong so
>  it is attempting to connect to the wrong port?
>
>  Thanks :)
>  .m
>
>
> > I'm seeing internal ftp server sending port unreachable packets
> > when using reference ftpcopy_vns (with reference transport layer)
> > with  either prebuilt router or my own router.
> >
> > However, just doing ftp 192.168.128.19 allows me to login
> > and ftp files.
> >
> > This is what I see from ftpcopy_vns
> >
> > * routing packet to default gateway at 192.168.128.20 on interface eth0
> > <- sending arp request for ip 192.168.128.20 on interface eth0
> > * added ip packet  to arp queue
> > -> received ARP reply from 192.168.128.20
> > <- sending queued packet
> > Attempting to send packet out on interface eth0
> > -> received ARP request from 192.168.128.20 on interface eth0
> >  <- sent ARP reply to 192.168.128.20 on interface eth0
> > -> received IP packet [src:192.168.128.19][dst:192.168.128.21]
> > [Warning]: cannot handle icmp type 3
> >
> > eventually ftpcopy_vns gives up...
> > ERROR: Connection refused (-1)
> >
> > On the router side, tcpdump shows...
> >
> > 21:40:17.146842 0:e0:81:4:8:9b 70:0:0:66:0:3 ip 82:
> > chongs-router-1.Stanford.EDU > deneb1-router-1.Stanford.EDU:
> > icmp: chongs-router-1.Stanford.EDU tcp port ftp unreachable for
> > deneb1-router-1.Stanford.EDU.20484 > chongs-router-1.Stanford.EDU.ftp:
> > S [tcp sum ok] 129:129(0) win 3072 (ttl 254, id 0, len 40) [tos 0xc0]
> > (ttl 255, id 6526, len 68)
> >                          45c0 0044 197e 0000 ff01 2001 c0a8 8013
> >                          c0a8 8015 0303 7e91 0000 0000 4500 0028
> >                          0000 0000 fe06 3b56 c0a8 8015 c0a8 8013
> >                          5004 0015 0000 0081 0000 0000 5002 0c00
> >                          d1ce 0000
> >
> > It can't be the routing tables for either router since ping and ftp work
> > or the ftpcopy_vns since packets do reach ftp server.
> >
> > Thanks.
> > Boris.
> >
> >
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Sumeet Shendrikar <sumeets@stanford.edu>
Newsgroups: su.class.cs244a
Subject: hw4 - error when attempting to connect to ftp.microsoft.com
Date: Thu, 04 Mar 2004 14:26:33 -0800
Lines: 9
Distribution: su
Message-ID: <c28aaj$6pu$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc405.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078439059 6974 128.12.196.5 (4 Mar 2004 22:24:19 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
Xref: shelby.stanford.edu su.class.cs244a:6834

i'm able to connect to the internal ftp server (thanks martin!), but 
when I attempt to connect to ftp.microsoft.com, I get an ICMP 
destination unreachable error, with code 13: "Communication 
administratively filtered".  I'm using the supplied ftpcopy binary.

any ideas?

thanks,
sumeet
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: ftpcopy to external ftp servers
Date: Thu, 4 Mar 2004 14:26:32 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.LNX.4.44.0403041421500.27287-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 1078439194 7252 171.64.66.201 (4 Mar 2004 22:26:34 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6835


 So your vhosts currently have private IP addresses which cannot be routed back
 to the VNS.  I'm going to be allocating global IP addresses for eth0 on vhost 
 for each topology.  For now, test against the internal ftp server.

 Thanks,
 Martin

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: hw4 - error when attempting to connect to ftp.microsoft.com
Date: Thu, 4 Mar 2004 14:47:45 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0403041446550.7869-100000@Xenon.Stanford.EDU>
References: <c28aaj$6pu$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 1078440467 8588 171.64.66.201 (4 Mar 2004 22:47:47 GMT)
X-Complaints-To: news@news.stanford.edu
To: Sumeet Shendrikar <sumeets@stanford.edu>
In-Reply-To: <c28aaj$6pu$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6836


 Global IP addresses are being installed for your vhost as we speak :)
 Will be ready soon!! 

 .m

> i'm able to connect to the internal ftp server (thanks martin!), but 
> when I attempt to connect to ftp.microsoft.com, I get an ICMP 
> destination unreachable error, with code 13: "Communication 
> administratively filtered".  I'm using the supplied ftpcopy binary.
> 
> any ideas?
> 
> thanks,
> sumeet
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: test 1.I again
Date: Thu, 4 Mar 2004 15:47:35 -0800
Lines: 17
Distribution: su
Message-ID: <c28f6m$cjo$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078444054 12920 128.12.61.97 (4 Mar 2004 23:47:34 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:6837

Script is saying No ACK for FIN with sequence number #######

I ran the client.log/server.log, and find that sometimes there is an ACK,
sometimes there isn't.  The client always sends one, just the server doesn't
always receive one.

Isn't this acceptable since we don't implement TIME_WAIT?  The server never
gets it's ACK, but tears down after stcp_network_send returns -1.

Alternately, would it be too much of a hack if I instantly transmitted 6
ACKs for the final FIN before tearing down?  This seems the only way to
consistently pass this test?

Thanks,
Oded


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: HW4 Global IP Addresses
Date: Thu, 4 Mar 2004 15:59:35 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.LNX.4.44.0403041556120.13328-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 1078444779 13565 171.64.66.201 (4 Mar 2004 23:59:39 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6838


 I've finished installing the global IP addresses on all topologies.
 eth0 of your topologie's vhost should now have an IP address of the
 form:

 171.67.71.xxx (where xxx happens to be your topo id)

 Please verify that this is correct when you connect to vhost.

 Thanks,
 Martin

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: test 1.I again
Date: Thu, 4 Mar 2004 16:01:25 -0800
Lines: 27
Distribution: su
Message-ID: <c28g0l$ddd$1@news.Stanford.EDU>
References: <c28f6m$cjo$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078444885 13741 128.12.61.97 (5 Mar 2004 00:01: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:6839

Come to think of it, this is reliable mode.  So the ACK should have been
received.
I'll look into that.

"Oded Wurman" <owurman@stanford.edu> wrote in message
news:c28f6m$cjo$1@news.Stanford.EDU...
> Script is saying No ACK for FIN with sequence number #######
>
> I ran the client.log/server.log, and find that sometimes there is an ACK,
> sometimes there isn't.  The client always sends one, just the server
doesn't
> always receive one.
>
> Isn't this acceptable since we don't implement TIME_WAIT?  The server
never
> gets it's ACK, but tears down after stcp_network_send returns -1.
>
> Alternately, would it be too much of a hack if I instantly transmitted 6
> ACKs for the final FIN before tearing down?  This seems the only way to
> consistently pass this test?
>
> Thanks,
> Oded
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: hw4 ftpcopy error ui guideline
Date: Thu, 04 Mar 2004 17:02:38 -0800
Lines: 10
Distribution: su
Message-ID: <c28jjm$iut$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078448566 19421 127.0.0.1 (5 Mar 2004 01:02:46 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (X11/20040209)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6840

Anyone know why I get an "ERROR: 250 Directory successfully changed 
(-5)" message when I run ftpcopy_vns compiled with the 2 reference 
binaries running over the reference router?  I'm guessing it's because 
the file extension I was looking for did not exist on the server, but 
then I should get an OK: 0 bytes copied right (or maybe my understanding 
of the UI guidelines is incorrect)?  I could not find any c or gz file 
extension on the internal ftp server, in which case I got that message, 
but I found an mp3 in which case I got the normal OK: 1342903 bytes copied.

--William
.

Path: shelby.stanford.edu!epic15.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW4 Global IP Addresses
Date: Thu, 4 Mar 2004 17:20:12 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.GSO.4.44.0403041712190.26247-100000@epic15.Stanford.EDU>
References: <Pine.LNX.4.44.0403041556120.13328-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: epic15.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078449624 19600 171.64.15.48 (5 Mar 2004 01:20:24 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0403041556120.13328-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6841

Martin,

Should we use this address in place of our vhost IP (192.168.128.76 for
topo 113) or in addition to?

Thanks,
Barrett

On Thu, 4 Mar 2004, Martin Casado wrote:

>
>  I've finished installing the global IP addresses on all topologies.
>  eth0 of your topologie's vhost should now have an IP address of the
>  form:
>
>  171.67.71.xxx (where xxx happens to be your topo id)
>
>  Please verify that this is correct when you connect to vhost.
>
>  Thanks,
>  Martin
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: HW4 Grading
Date: Thu, 04 Mar 2004 17:29:59 -0800
Lines: 9
Distribution: su
Message-ID: <c28l6v$iut$2@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078450207 19421 127.0.0.1 (5 Mar 2004 01:30:07 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (X11/20040209)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6842

How is this assignment being graded?  I noticed there is no test script, 
so are the only tests you will be performing just running the router and 
ftpcopy client to download files on some ftp server?

Also, are the extensions optional for extra credit or required for the 
full grade?  Will a fully functional ftpcopy/router/transport get all 
the points?

--William
.

Path: shelby.stanford.edu!elaine6.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: HW4 Grading
Date: Fri, 5 Mar 2004 01:45:05 +0000 (UTC)
Lines: 20
Distribution: su
Message-ID: <c28m31$l17$1@news.Stanford.EDU>
References: <c28l6v$iut$2@news.Stanford.EDU>
NNTP-Posting-Host: elaine6.stanford.edu
X-Trace: news.Stanford.EDU 1078451105 21543 171.64.15.71 (5 Mar 2004 01:45:05 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6843


>How is this assignment being graded?  I noticed there is no test script, 
>so are the only tests you will be performing just running the router and 
>ftpcopy client to download files on some ftp server?

Yeah--
we'll run both with and without your router, in reliable and unreliable mode,
against a few ftp servers.  I can't easily make the script available, because
it uses a fixed topology for grading--and there isn't any need for it,
since you can ftp to servers yourself and verify correct operation.

>Also, are the extensions optional for extra credit or required for the 
>full grade?  Will a fully functional ftpcopy/router/transport get all 
>the points?

Completely optional, for your edification (or for our consideration of best
solution) only (i.e. no extra credit), and no negative impact on your grade
if you don't do anything other than get your stack working.


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: HW4 Global IP Addresses
Date: Thu, 4 Mar 2004 17:57:04 -0800
Lines: 31
Distribution: su
Message-ID: <Pine.LNX.4.44.0403041756460.6505-100000@Xenon.Stanford.EDU>
References: <Pine.LNX.4.44.0403041556120.13328-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0403041712190.26247-100000@epic15.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078451825 22239 171.64.66.201 (5 Mar 2004 01:57:05 GMT)
X-Complaints-To: news@news.stanford.edu
To: Barrett Trask <btrask@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403041712190.26247-100000@epic15.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6844


 Use it in place of your vhost IP. 

 .m

> Martin,
> 
> Should we use this address in place of our vhost IP (192.168.128.76 for
> topo 113) or in addition to?
> 
> Thanks,
> Barrett
> 
> On Thu, 4 Mar 2004, Martin Casado wrote:
> 
> >
> >  I've finished installing the global IP addresses on all topologies.
> >  eth0 of your topologie's vhost should now have an IP address of the
> >  form:
> >
> >  171.67.71.xxx (where xxx happens to be your topo id)
> >
> >  Please verify that this is correct when you connect to vhost.
> >
> >  Thanks,
> >  Martin
> >
> >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: HW4 Grading
Date: Thu, 4 Mar 2004 17:59:06 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0403041757170.6505-100000@Xenon.Stanford.EDU>
References: <c28l6v$iut$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 1078451947 22351 171.64.66.201 (5 Mar 2004 01:59:07 GMT)
X-Complaints-To: news@news.stanford.edu
To: William Chan <chanman@stanford.edu>
In-Reply-To: <c28l6v$iut$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6845


> How is this assignment being graded?  I noticed there is no test script, 
> so are the only tests you will be performing just running the router and 
> ftpcopy client to download files on some ftp server?

 We will run your ftpcopy through your router to a few public servers
 and check the results for correctness. 
 
> Also, are the extensions optional for extra credit or required for the 
> full grade?  Will a fully functional ftpcopy/router/transport get all 
> the points?

 Fully functional hw4 gets all the points.  The extensions are purely optional.

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: "Tim Grow" <grow@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS4 Q2,3
Date: Thu, 4 Mar 2004 18:03:54 -0800
Lines: 8
Distribution: su
Message-ID: <c28n68$m5t$1@news.Stanford.EDU>
NNTP-Posting-Host: grow.stanford.edu
X-Trace: news.Stanford.EDU 1078452232 22717 128.12.191.36 (5 Mar 2004 02:03: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:6846

I have Peterson and Davie 2nd Edition so I stopped by the bookstore to look
at the third edition.  Questions 46 and 44 in the 3rd edition look very
similar to questions 41 and 37 in the 2nd edition.  Can anyone confirm that
they are identical?

Thanks


.

Path: shelby.stanford.edu!epic15.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: provided ftpcopy behavior
Date: Thu, 4 Mar 2004 18:07:54 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.GSO.4.44.0403041805500.26630-100000@epic15.Stanford.EDU>
References: <c23p0b$ki$1@news.Stanford.EDU> <c23r18$d0i$1@news.Stanford.EDU>
 <c23v02$ki$2@news.Stanford.EDU> <c23vjj$i5p$1@news.Stanford.EDU>
NNTP-Posting-Host: epic15.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078452476 22932 171.64.15.48 (5 Mar 2004 02:07:56 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
In-Reply-To: <c23vjj$i5p$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6847

On Wed, 3 Mar 2004, Matthew Jonathan Holliman wrote:

> I've put another version of ftpcopy in the hw1obj directory, this one
> using PASV (libftpcopy_pasv.a)
>
> To use it, change your Makefile to instead of use '-lftpcopy',
> use '-lftpcopy_pasv -lresolv'
>

Is there a VNS copy as well (or is this it, too)?

Thanks,
Barrett


.

Path: shelby.stanford.edu!elaine6.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: provided ftpcopy behavior
Date: Fri, 5 Mar 2004 03:26:28 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <c28s14$ree$1@news.Stanford.EDU>
References: <c23p0b$ki$1@news.Stanford.EDU> <c23r18$d0i$1@news.Stanford.EDU>  <c23v02$ki$2@news.Stanford.EDU> <c23vjj$i5p$1@news.Stanford.EDU> <Pine.GSO.4.44.0403041805500.26630-100000@epic15.Stanford.EDU>
NNTP-Posting-Host: elaine6.stanford.edu
X-Trace: news.Stanford.EDU 1078457188 28110 171.64.15.71 (5 Mar 2004 03:26:28 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6848



>> I've put another version of ftpcopy in the hw1obj directory, this one
>> using PASV (libftpcopy_pasv.a)
>>
>> To use it, change your Makefile to instead of use '-lftpcopy',
>> use '-lftpcopy_pasv -lresolv'
>>

>Is there a VNS copy as well (or is this it, too)?

I've just built one and placed it in the HW4 prebuilt directory
(libftpcopy_vns_pasv.a).  Using it should be a matter of changing your
Makefile's LIBSFTPCOPY_VNS to be '-lftpcopy_vns_pasv'.

.

Path: shelby.stanford.edu!not-for-mail
From: Sumeet Shendrikar <sumeets@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: hw4 ftpcopy error ui guideline
Date: Thu, 04 Mar 2004 19:30:14 -0800
Lines: 23
Distribution: su
Message-ID: <c28s40$rgu$1@news.Stanford.EDU>
References: <c28jjm$iut$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc405.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078457280 28190 128.12.196.5 (5 Mar 2004 03:28:00 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: <c28jjm$iut$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6849

yeah, i got this too when I connected to ftp.stanford.edu.

When I looked at the packet trace, I noticed that the "QUIT" command is 
sent successfully and a response is received.  The "250 ..." message is 
the third to last message received from the server (the second to last 
is a "QUIT okay" message, and the last message is the "You have 
transferred XX bytes in XX transfers").
You think this may be a bug in the supplied binary?

sumeet

William Chan wrote:

> Anyone know why I get an "ERROR: 250 Directory successfully changed 
> (-5)" message when I run ftpcopy_vns compiled with the 2 reference 
> binaries running over the reference router?  I'm guessing it's because 
> the file extension I was looking for did not exist on the server, but 
> then I should get an OK: 0 bytes copied right (or maybe my understanding 
> of the UI guidelines is incorrect)?  I could not find any c or gz file 
> extension on the internal ftp server, in which case I got that message, 
> but I found an mp3 in which case I got the normal OK: 1342903 bytes copied.
> 
> --William
.

Path: shelby.stanford.edu!elaine6.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: hw4 ftpcopy error ui guideline
Date: Fri, 5 Mar 2004 03:58:31 +0000 (UTC)
Lines: 19
Distribution: su
Message-ID: <c28tt7$1e$1@news.Stanford.EDU>
References: <c28jjm$iut$1@news.Stanford.EDU> <c28s40$rgu$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine6.stanford.edu
X-Trace: news.Stanford.EDU 1078459111 46 171.64.15.71 (5 Mar 2004 03:58:31 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6850


>yeah, i got this too when I connected to ftp.stanford.edu.

>When I looked at the packet trace, I noticed that the "QUIT" command is 
>sent successfully and a response is received.  The "250 ..." message is 
>the third to last message received from the server (the second to last 
>is a "QUIT okay" message, and the last message is the "You have 
>transferred XX bytes in XX transfers").
>You think this may be a bug in the supplied binary?

It may well be--that ftpcopy is a horrible implementation.  (Martin will
back me up on this).  Every time I look at it I seem to find another bug.
You might have better luck with the PASV-based client.

Needless to say, you aren't responsible for bugs in the provided binaries.
Along these lines, while on the subject of ftp.stanford.edu, the
original ftpcopy had problems with that.  The PASV-based version should
work okay--or at least it did at one time.

.

Path: shelby.stanford.edu!elaine6.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: HW4 prebuilt binaries/misc.
Date: Fri, 5 Mar 2004 04:04:40 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <c28u8o$ha$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine6.stanford.edu
X-Trace: news.Stanford.EDU 1078459480 554 171.64.15.71 (5 Mar 2004 04:04:40 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6851


A couple of comments:

(1) I've placed an alternative version of ftpcopy in the HW4 prebuilt
directory (libftpcopy_vns_pasv.a).  This uses PASV, and should be a more
robust implementation than the older libftpcopy_vns.a.  The older library
has some bugs that may cause problems with sites like ftp.stanford.edu.

(2) When testing, please do so against Stanford servers before you let
packets loose upon the Internet at large!  Besides the internal ftp server,
some suggestions are ftp.cs.stanford.edu and ftp.slac.stanford.edu.

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW4 prebuilt binaries/misc.
Date: Fri, 05 Mar 2004 14:38:09 +0800
Lines: 39
Distribution: su
Message-ID: <40482051.78E054F7@leland.stanford.edu>
References: <c28u8o$ha$1@news.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078468807 9891 128.12.196.85 (5 Mar 2004 06:40:07 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6852

I am using the reference ftpcopy_vns, with my own transport layer. I am able to
connect to the internal server, but when I tried connecting to ftp.cs, I got
the following error:

[some outputs before the error]
.....
-> received IP packet [src:171.64.67.150][dst:171.67.71.172]
* routing packet to default gateway at 192.168.129.114 on interface eth0
Attempting to send packet out on interface eth0
-> received IP packet [src:171.64.67.150][dst:171.67.71.172]
Assertion failed: _mysock_verify_checksum(ctx, tcp_hdr, packet_len), file
networ
k_io_vns.c, line 505
Abort

I looked at the code in network_io_vns.c, line 505, and I found the following
comment:
/* XXX: the following occassionally fires, I don't know why yet */
assert(_mysock_verify_checksum(ctx, tcp_hdr, packet_len));

Any idea what's going on?

Thanks,
Jimmy


Matthew Jonathan Holliman wrote:

> A couple of comments:
>
> (1) I've placed an alternative version of ftpcopy in the HW4 prebuilt
> directory (libftpcopy_vns_pasv.a).  This uses PASV, and should be a more
> robust implementation than the older libftpcopy_vns.a.  The older library
> has some bugs that may cause problems with sites like ftp.stanford.edu.
>
> (2) When testing, please do so against Stanford servers before you let
> packets loose upon the Internet at large!  Besides the internal ftp server,
> some suggestions are ftp.cs.stanford.edu and ftp.slac.stanford.edu.

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW4 prebuilt binaries/misc.
Date: Fri, 05 Mar 2004 14:55:41 +0800
Lines: 44
Distribution: su
Message-ID: <4048246C.88C31CDA@leland.stanford.edu>
References: <c28u8o$ha$1@news.Stanford.EDU> <40482051.78E054F7@leland.stanford.edu>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078469859 10815 128.12.196.85 (5 Mar 2004 06:57:39 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6853

I switched to libftpcopy_vns_pasv.a the problem seems to go away now.

Jimmy

Jimmy Pang wrote:

> I am using the reference ftpcopy_vns, with my own transport layer. I am able to
> connect to the internal server, but when I tried connecting to ftp.cs, I got
> the following error:
>
> [some outputs before the error]
> ....
> -> received IP packet [src:171.64.67.150][dst:171.67.71.172]
> * routing packet to default gateway at 192.168.129.114 on interface eth0
> Attempting to send packet out on interface eth0
> -> received IP packet [src:171.64.67.150][dst:171.67.71.172]
> Assertion failed: _mysock_verify_checksum(ctx, tcp_hdr, packet_len), file
> networ
> k_io_vns.c, line 505
> Abort
>
> I looked at the code in network_io_vns.c, line 505, and I found the following
> comment:
> /* XXX: the following occassionally fires, I don't know why yet */
> assert(_mysock_verify_checksum(ctx, tcp_hdr, packet_len));
>
> Any idea what's going on?
>
> Thanks,
> Jimmy
>
> Matthew Jonathan Holliman wrote:
>
> > A couple of comments:
> >
> > (1) I've placed an alternative version of ftpcopy in the HW4 prebuilt
> > directory (libftpcopy_vns_pasv.a).  This uses PASV, and should be a more
> > robust implementation than the older libftpcopy_vns.a.  The older library
> > has some bugs that may cause problems with sites like ftp.stanford.edu.
> >
> > (2) When testing, please do so against Stanford servers before you let
> > packets loose upon the Internet at large!  Besides the internal ftp server,
> > some suggestions are ftp.cs.stanford.edu and ftp.slac.stanford.edu.

.

Path: shelby.stanford.edu!elaine16.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: HW4 prebuilt binaries/misc.
Date: Fri, 5 Mar 2004 07:04:24 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c298po$b01$1@news.Stanford.EDU>
References: <c28u8o$ha$1@news.Stanford.EDU> <40482051.78E054F7@leland.stanford.edu>
NNTP-Posting-Host: elaine16.stanford.edu
X-Trace: news.Stanford.EDU 1078470264 11265 171.64.15.81 (5 Mar 2004 07:04:24 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6854


>I am using the reference ftpcopy_vns, with my own transport layer. I am able to
>connect to the internal server, but when I tried connecting to ftp.cs, I got
>the following error:

Does it happen consistently for you?  If so, that would be very helpful...
the assert fires once on every few dozen runs in my experience, but I
haven't been able to track down the cause yet.

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW4 prebuilt binaries/misc.
Date: Fri, 05 Mar 2004 15:02:56 +0800
Lines: 57
Distribution: su
Message-ID: <4048261F.236FBACC@leland.stanford.edu>
References: <c28u8o$ha$1@news.Stanford.EDU> <40482051.78E054F7@leland.stanford.edu> <4048246C.88C31CDA@leland.stanford.edu>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078470294 11368 128.12.196.85 (5 Mar 2004 07:04:54 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6855

I thought the problem went away. It didn't... The program runs for a longer while,
but then...

* routing packet to default gateway at 192.168.129.114 on interface eth0
Attempting to send packet out on interface eth0
* routing packet to default gateway at 192.168.129.114 on interface eth0
Attempting to send packet out on interface eth0
-> received IP packet [src:171.64.67.150][dst:171.67.71.172]
Assertion failed: _mysock_verify_checksum(ctx, tcp_hdr, packet_len), file networ
k_io_vns.c, line 505

Jimmy Pang wrote:

> I switched to libftpcopy_vns_pasv.a the problem seems to go away now.
>
> Jimmy
>
> Jimmy Pang wrote:
>
> > I am using the reference ftpcopy_vns, with my own transport layer. I am able to
> > connect to the internal server, but when I tried connecting to ftp.cs, I got
> > the following error:
> >
> > [some outputs before the error]
> > ....
> > -> received IP packet [src:171.64.67.150][dst:171.67.71.172]
> > * routing packet to default gateway at 192.168.129.114 on interface eth0
> > Attempting to send packet out on interface eth0
> > -> received IP packet [src:171.64.67.150][dst:171.67.71.172]
> > Assertion failed: _mysock_verify_checksum(ctx, tcp_hdr, packet_len), file
> > networ
> > k_io_vns.c, line 505
> > Abort
> >
> > I looked at the code in network_io_vns.c, line 505, and I found the following
> > comment:
> > /* XXX: the following occassionally fires, I don't know why yet */
> > assert(_mysock_verify_checksum(ctx, tcp_hdr, packet_len));
> >
> > Any idea what's going on?
> >
> > Thanks,
> > Jimmy
> >
> > Matthew Jonathan Holliman wrote:
> >
> > > A couple of comments:
> > >
> > > (1) I've placed an alternative version of ftpcopy in the HW4 prebuilt
> > > directory (libftpcopy_vns_pasv.a).  This uses PASV, and should be a more
> > > robust implementation than the older libftpcopy_vns.a.  The older library
> > > has some bugs that may cause problems with sites like ftp.stanford.edu.
> > >
> > > (2) When testing, please do so against Stanford servers before you let
> > > packets loose upon the Internet at large!  Besides the internal ftp server,
> > > some suggestions are ftp.cs.stanford.edu and ftp.slac.stanford.edu.

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW4 prebuilt binaries/misc.
Date: Fri, 05 Mar 2004 15:05:21 +0800
Lines: 16
Distribution: su
Message-ID: <404826B1.A9D0E6B0@leland.stanford.edu>
References: <c28u8o$ha$1@news.Stanford.EDU> <40482051.78E054F7@leland.stanford.edu> <c298po$b01$1@news.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078470440 11368 128.12.196.85 (5 Mar 2004 07:07:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6856

Before I switched over to the new ftpcopy_vns_pasv.a library, it happened more
often. Now it only happens because I'm running it to download a whole bunch of
files.

Jimmy

Matthew Jonathan Holliman wrote:

> >I am using the reference ftpcopy_vns, with my own transport layer. I am able to
> >connect to the internal server, but when I tried connecting to ftp.cs, I got
> >the following error:
>
> Does it happen consistently for you?  If so, that would be very helpful...
> the assert fires once on every few dozen runs in my experience, but I
> haven't been able to track down the cause yet.

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW4 prebuilt binaries/misc.
Date: Fri, 05 Mar 2004 15:16:25 +0800
Lines: 24
Distribution: su
Message-ID: <40482949.A7FF1E7A@leland.stanford.edu>
References: <c28u8o$ha$1@news.Stanford.EDU> <40482051.78E054F7@leland.stanford.edu> <c298po$b01$1@news.Stanford.EDU> <404826B1.A9D0E6B0@leland.stanford.edu>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078471104 12006 128.12.196.85 (5 Mar 2004 07:18:24 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6857

Actually now I still consistently get the error. I haven't successfully completed runs
for ftp.cs because of this assert. Is there anything I can do to help find the bug?
Can it be something wrong with my sr?

Jimmy

Jimmy Pang wrote:

> Before I switched over to the new ftpcopy_vns_pasv.a library, it happened more
> often. Now it only happens because I'm running it to download a whole bunch of
> files.
>
> Jimmy
>
> Matthew Jonathan Holliman wrote:
>
> > >I am using the reference ftpcopy_vns, with my own transport layer. I am able to
> > >connect to the internal server, but when I tried connecting to ftp.cs, I got
> > >the following error:
> >
> > Does it happen consistently for you?  If so, that would be very helpful...
> > the assert fires once on every few dozen runs in my experience, but I
> > haven't been able to track down the cause yet.

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: HW4 prebuilt binaries/misc.
Date: Fri, 5 Mar 2004 07:33:18 +0000 (UTC)
Lines: 18
Distribution: su
Message-ID: <c29afu$cjg$1@news.Stanford.EDU>
References: <c28u8o$ha$1@news.Stanford.EDU> <40482051.78E054F7@leland.stanford.edu> <c298po$b01$1@news.Stanford.EDU> <404826B1.A9D0E6B0@leland.stanford.edu> <40482949.A7FF1E7A@leland.stanford.edu>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1078471998 12912 171.64.15.116 (5 Mar 2004 07:33:18 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6858


>Actually now I still consistently get the error. I haven't successfully completed runs
>for ftp.cs because of this assert. Is there anything I can do to help find the bug?

Can you compile with -DDEBUG?  It should print out in the incoming TCP
packets; I'm curious what the incoming packet looks like that causes the
bad checksum.

>Can it be something wrong with my sr?

No, I don't think so--it's probably something to do with the checksum
calculation/update when the peer's th_seq gets remapped.

It would be helpful if you could mail me a tarball of your source
directory/rtables/etc., and a description of how you can cause the bug.
(I might need to borrow your topology for a bit).

Thanks!
.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW4 Global IP Addresses
Date: Fri, 5 Mar 2004 00:18:38 -0800
Lines: 38
Distribution: su
Message-ID: <Pine.GSO.4.44.0403050017570.21100-100000@elaine43.Stanford.EDU>
References: <Pine.LNX.4.44.0403041556120.13328-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0403041712190.26247-100000@epic15.Stanford.EDU>
 <Pine.LNX.4.44.0403041756460.6505-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 1078474721 17034 171.64.15.118 (5 Mar 2004 08:18:41 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0403041756460.6505-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6859


Should the same IP address be used at eth0 for vrouter?

On Thu, 4 Mar 2004, Martin Casado wrote:

>
>  Use it in place of your vhost IP.
>
>  .m
>
> > Martin,
> >
> > Should we use this address in place of our vhost IP (192.168.128.76 for
> > topo 113) or in addition to?
> >
> > Thanks,
> > Barrett
> >
> > On Thu, 4 Mar 2004, Martin Casado wrote:
> >
> > >
> > >  I've finished installing the global IP addresses on all topologies.
> > >  eth0 of your topologie's vhost should now have an IP address of the
> > >  form:
> > >
> > >  171.67.71.xxx (where xxx happens to be your topo id)
> > >
> > >  Please verify that this is correct when you connect to vhost.
> > >
> > >  Thanks,
> > >  Martin
> > >
> > >
> >
> >
>
>

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS4 Q2,3
Date: Fri, 5 Mar 2004 00:20:59 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.LNX.4.44.0403050017310.14474-100000@Xenon.Stanford.EDU>
References: <c28n68$m5t$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 1078474859 17199 171.64.66.201 (5 Mar 2004 08:20:59 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c28n68$m5t$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6860

On Thu, 4 Mar 2004, Tim Grow wrote:

> I have Peterson and Davie 2nd Edition so I stopped by the bookstore to look
> at the third edition.  Questions 46 and 44 in the 3rd edition look very
> similar to questions 41 and 37 in the 2nd edition.  Can anyone confirm that
> they are identical?
> 

I assume you mean qns 49 and 44 (not 46 and 44) in third edn are the same 
as qns 41 and 37 in second edition. They look the same to me. If someone 
notices any difference, *please* post.

Shankar

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW4 prebuilt binaries/misc.
Date: Fri, 05 Mar 2004 17:54:08 +0800
Lines: 44
Distribution: su
Message-ID: <40484E3F.2754F696@leland.stanford.edu>
References: <c28u8o$ha$1@news.Stanford.EDU> <40482051.78E054F7@leland.stanford.edu> <c298po$b01$1@news.Stanford.EDU> <404826B1.A9D0E6B0@leland.stanford.edu> <40482949.A7FF1E7A@leland.stanford.edu> <c29afu$cjg$1@news.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078480591 22506 128.12.196.85 (5 Mar 2004 09:56:31 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6861

Here's the output when I run with -DDEBUG:

[some outputs...]
-> received IP packet [src:171.64.67.150][dst:171.67.71.172]
incoming segment to 1647
  no entry in connection_table...
TCP segment from 63773->1647, seq 535694218 ack 48 flags  sum 21366
  remap seq start: 533997937
queueing packet for context 49310
stcp_app_send(1):  sending 536 bytes up to app
====>network_send:duplicating the packet
* routing packet to default gateway at 192.168.129.114 on interface eth0
Attempting to send packet out on interface eth0
* routing packet to default gateway at 192.168.129.114 on interface eth0
Attempting to send packet out on interface eth0
-> received IP packet [src:171.64.67.150][dst:171.67.71.172]
incoming segment to 1647
  no entry in connection_table...
TCP segment from 63773->1647, seq 535694754 ack 48 flags  sum 46776
  remap seq start: 533997937
Assertion failed: _mysock_verify_checksum(ctx, tcp_hdr, packet_len), file networ
k_io_vns.c, line 505
Abort

Matthew Jonathan Holliman wrote:

> >Actually now I still consistently get the error. I haven't successfully completed runs
> >for ftp.cs because of this assert. Is there anything I can do to help find the bug?
>
> Can you compile with -DDEBUG?  It should print out in the incoming TCP
> packets; I'm curious what the incoming packet looks like that causes the
> bad checksum.
>
> >Can it be something wrong with my sr?
>
> No, I don't think so--it's probably something to do with the checksum
> calculation/update when the peer's th_seq gets remapped.
>
> It would be helpful if you could mail me a tarball of your source
> directory/rtables/etc., and a description of how you can cause the bug.
> (I might need to borrow your topology for a bit).
>
> Thanks!

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: stcp_echo_server test failed for me
Date: Fri, 5 Mar 2004 02:10:30 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.GSO.4.44.0403050203020.22147-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 1078481434 23928 171.64.15.118 (5 Mar 2004 10:10:34 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6862


As suggested in the review session, I used the "stcp_echo_server -t
topoid -v vhost" and then "telnet vhost 7".  I can see the connection is
established.  From ethereal trace, I can see the following:
when I typed any character into the telnet session,
the echo message reached the vhost.  vhost sends back the response, which
went through the vrouter and eventually sent to vns-firewall.  However,
the packet does not seems to reach the telnet session on the elaine
machine.  What could be wrong?



.

Path: shelby.stanford.edu!not-for-mail
From: "Michael Lyubomirskiy" <lyubomir@stanford.edu>
Newsgroups: su.class.cs244a
Subject: does Martin still hold office hours on Monday?
Date: Fri, 5 Mar 2004 04:48:41 -0800
Lines: 6
Distribution: su
Message-ID: <c29t00$3d1$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-50491.stanford.edu
X-Trace: news.Stanford.EDU 1078490945 3489 128.12.51.110 (5 Mar 2004 12:49: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:6863

I could not seem to find Martin last Monday. Is he still holding his office
hours then? Has he moved them to some other time?

Michael


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: HW4 Global IP Addresses
Date: Fri, 5 Mar 2004 09:29:10 -0800
Lines: 50
Distribution: su
Message-ID: <Pine.LNX.4.44.0403050925170.12427-100000@Xenon.Stanford.EDU>
References: <Pine.LNX.4.44.0403041556120.13328-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0403041712190.26247-100000@epic15.Stanford.EDU>
 <Pine.LNX.4.44.0403041756460.6505-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0403050017570.21100-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 1078507752 19438 171.64.66.201 (5 Mar 2004 17:29:12 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403050017570.21100-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6864


 The only IP address that has changed is eth0 on vhost.  Everything else is the
 same.  

 ... ahh I see the confusion, the assignment says to debug using vrouter.
 This will not work since vrouter has a 192.168 IP.  You will need to
 use vhost through your router.  I'll change the description.

 .m

> 
> Should the same IP address be used at eth0 for vrouter?
> 
> On Thu, 4 Mar 2004, Martin Casado wrote:
> 
> >
> >  Use it in place of your vhost IP.
> >
> >  .m
> >
> > > Martin,
> > >
> > > Should we use this address in place of our vhost IP (192.168.128.76 for
> > > topo 113) or in addition to?
> > >
> > > Thanks,
> > > Barrett
> > >
> > > On Thu, 4 Mar 2004, Martin Casado wrote:
> > >
> > > >
> > > >  I've finished installing the global IP addresses on all topologies.
> > > >  eth0 of your topologie's vhost should now have an IP address of the
> > > >  form:
> > > >
> > > >  171.67.71.xxx (where xxx happens to be your topo id)
> > > >
> > > >  Please verify that this is correct when you connect to vhost.
> > > >
> > > >  Thanks,
> > > >  Martin
> > > >
> > > >
> > >
> > >
> >
> >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: does Martin still hold office hours on Monday?
Date: Fri, 5 Mar 2004 09:33:16 -0800
Lines: 13
Distribution: su
Message-ID: <Pine.LNX.4.44.0403050932171.12427-100000@Xenon.Stanford.EDU>
References: <c29t00$3d1$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 1078507998 19728 171.64.66.201 (5 Mar 2004 17:33:18 GMT)
X-Complaints-To: news@news.stanford.edu
To: Michael Lyubomirskiy <lyubomir@stanford.edu>
In-Reply-To: <c29t00$3d1$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6865


 I was there, near the snack machines.

 .m

> I could not seem to find Martin last Monday. Is he still holding his office
> hours then? Has he moved them to some other time?
> 
> Michael
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: stcp_echo_server test failed for me
Date: Fri, 5 Mar 2004 09:45:56 -0800
Lines: 32
Distribution: su
Message-ID: <Pine.LNX.4.44.0403050943540.12427-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403050203020.22147-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 1078508758 20518 171.64.66.201 (5 Mar 2004 17:45:58 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403050203020.22147-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6866


 seems to work ok for me (though I'm going to vhost)

   elaine2:~> telnet 171.67.71.176 7
   Trying 171.67.71.176...
   Connected to 171.67.71.176 (171.67.71.176).
   Escape character is '^]'.
   hi
   hi
   :)
   :)

 have you tried using vhost through your router or only vrouter?

 .m

 

> 
> As suggested in the review session, I used the "stcp_echo_server -t
> topoid -v vhost" and then "telnet vhost 7".  I can see the connection is
> established.  From ethereal trace, I can see the following:
> when I typed any character into the telnet session,
> the echo message reached the vhost.  vhost sends back the response, which
> went through the vrouter and eventually sent to vns-firewall.  However,
> the packet does not seems to reach the telnet session on the elaine
> machine.  What could be wrong?
> 
> 
> 
> 

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: stcp_echo_server test failed for me
Date: Fri, 5 Mar 2004 10:20:35 -0800
Lines: 58
Distribution: su
Message-ID: <Pine.GSO.4.44.0403051014390.24958-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0403050203020.22147-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0403050943540.12427-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 1078510839 23331 171.64.15.118 (5 Mar 2004 18:20:39 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0403050943540.12427-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6867

I don't know the difference between my router and vrouter.  What I did was
following:

(1) ./sr -v vrouter -t topid -s vns-1.stanford.edu
(2) stcp_echo_server -t topdid -v vhost;

I thought these two steps set up the vrounter and run an echo server on
vhost.

Then I tried;

"telnet vhost 7".

According to the ethereal trace, the echo packet is sent through the
vrounter and reached the vhost.  "vhost (echo server)" sends back the response,
which was sent
all the way to vns-firewall.  However, there is no response coming back
from the vns-firewall.  The vhost (echo server) resends the packet 5 times
and terminates the connection.

-Laura

On Fri, 5 Mar 2004, Martin Casado wrote:

>
>  seems to work ok for me (though I'm going to vhost)
>
>    elaine2:~> telnet 171.67.71.176 7
>    Trying 171.67.71.176...
>    Connected to 171.67.71.176 (171.67.71.176).
>    Escape character is '^]'.
>    hi
>    hi
>    :)
>    :)
>
>  have you tried using vhost through your router or only vrouter?
>
>  .m
>
>
>
> >
> > As suggested in the review session, I used the "stcp_echo_server -t
> > topoid -v vhost" and then "telnet vhost 7".  I can see the connection is
> > established.  From ethereal trace, I can see the following:
> > when I typed any character into the telnet session,
> > the echo message reached the vhost.  vhost sends back the response, which
> > went through the vrouter and eventually sent to vns-firewall.  However,
> > the packet does not seems to reach the telnet session on the elaine
> > machine.  What could be wrong?
> >
> >
> >
> >
>
>

.

Path: shelby.stanford.edu!elaine41.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: HW4 prebuilt binaries/misc.
Date: Fri, 5 Mar 2004 18:36:49 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <c2ahc1$noc$1@news.Stanford.EDU>
References: <c28u8o$ha$1@news.Stanford.EDU> <40482051.78E054F7@leland.stanford.edu> <c298po$b01$1@news.Stanford.EDU> <404826B1.A9D0E6B0@leland.stanford.edu> <40482949.A7FF1E7A@leland.stanford.edu> <c29afu$cjg$1@news.Stanford.EDU> <40484E3F.2754F696@leland.stanford.edu>
NNTP-Posting-Host: elaine41.stanford.edu
X-Trace: news.Stanford.EDU 1078511809 24332 171.64.15.116 (5 Mar 2004 18:36:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6868



I believe the problem should be fixed now, although it's difficult for me
to verify on my topology.

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: topology question
Date: Fri, 5 Mar 2004 13:58:33 -0800
Lines: 33
Distribution: su
Message-ID: <Pine.GSO.4.44.0403051352110.11621-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 1078523914 7850 171.64.15.100 (5 Mar 2004 21:58:34 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6869


when i run :

elaine22:~/private/cs244a/sr_router> ./sr -v vhost -t 132 -s vns-1.stanford.edu -r vhost_rtable

I get the following output:

Destination: 0.0.0.0
  Gateway : 192.168.128.170
  Mask : 0.0.0.0
  Interface : eth0
Client vishalp connecting to Server vns-1.stanford.edu:12345
Requesting topology 132
Sending c_open (type=1 len=108)
Received Hardware Info with 6 entries
INTERFACE: eth0
Speed: 0
Hardware Address: 70:00:00:84:00:06
Ethernet IP: 171.67.71.132
Subnet: 0.0.0.0
Mask: 0.0.0.0
Interface: eth0
  hardware address 70:00:00:84:00:06
  ip address 171.67.71.132

It says the ipaddr of my eth0 is 171.67.71.132 ... but I would expect that
it is 192.168.128.171 (as specified by the topology emailed to me)

What am I doing wrong?

--vishal


.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: topology question (ignore this...sorry)
Date: Fri, 5 Mar 2004 14:00:23 -0800
Lines: 43
Distribution: su
Message-ID: <Pine.GSO.4.44.0403051359550.11621-100000@elaine25.Stanford.EDU>
References: <Pine.GSO.4.44.0403051352110.11621-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 1078524025 8076 171.64.15.100 (5 Mar 2004 22:00:25 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0403051352110.11621-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6870


Sorry

I just read martin's message about the topology change...never mind

--vishal
On Fri, 5 Mar 2004, Vishal Patel wrote:

>
> when i run :
>
> elaine22:~/private/cs244a/sr_router> ./sr -v vhost -t 132 -s vns-1.stanford.edu -r vhost_rtable
>
> I get the following output:
>
> Destination: 0.0.0.0
>   Gateway : 192.168.128.170
>   Mask : 0.0.0.0
>   Interface : eth0
> Client vishalp connecting to Server vns-1.stanford.edu:12345
> Requesting topology 132
> Sending c_open (type=1 len=108)
> Received Hardware Info with 6 entries
> INTERFACE: eth0
> Speed: 0
> Hardware Address: 70:00:00:84:00:06
> Ethernet IP: 171.67.71.132
> Subnet: 0.0.0.0
> Mask: 0.0.0.0
> Interface: eth0
>   hardware address 70:00:00:84:00:06
>   ip address 171.67.71.132
>
> It says the ipaddr of my eth0 is 171.67.71.132 ... but I would expect that
> it is 192.168.128.171 (as specified by the topology emailed to me)
>
> What am I doing wrong?
>
> --vishal
>
>
>

.

Path: shelby.stanford.edu!elaine22.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftpcopy_tcp
Date: Fri, 5 Mar 2004 14:20:10 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.GSO.4.44.0403051418450.6975-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 1078525212 9616 171.64.15.87 (5 Mar 2004 22:20:12 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6871


Is there any point to having this for assignment 4?

or are we only gonna be working w/ ftpcopy_vns?  The reason
I ask is because i'm getting link errors when trying to build ftpcopy_tcp
and intend to simply take this out of my makefile

--vishal

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ftpcopy_tcp
Date: Fri, 5 Mar 2004 14:41:41 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.LNX.4.44.0403051440070.32397-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403051418450.6975-100000@elaine22.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078526503 11022 171.64.66.201 (5 Mar 2004 22:41:43 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403051418450.6975-100000@elaine22.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6872


> 
> Is there any point to having this for assignment 4?

 not really
 
> or are we only gonna be working w/ ftpcopy_vns?  The reason
> I ask is because i'm getting link errors when trying to build ftpcopy_tcp
> and intend to simply take this out of my makefile

 I'm not sure if the submit/grding scripts expect it to be there.

 Matt?

 .m


.

Path: shelby.stanford.edu!elaine4.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ftpcopy_tcp
Date: Sat, 6 Mar 2004 00:00:17 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c2b4ah$ft9$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403051418450.6975-100000@elaine22.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078531217 16297 171.64.15.69 (6 Mar 2004 00:00:17 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6873



>or are we only gonna be working w/ ftpcopy_vns?  The reason
>I ask is because i'm getting link errors when trying to build ftpcopy_tcp
>and intend to simply take this out of my makefile

only ftpcopy_vns.  I don't know why you'd get link errors (what are they?),
because your Makefile is the same as in HW3 and nothing should have changed
on our end, but you can take this out.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS4
Date: Fri, 5 Mar 2004 16:26:42 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.LNX.4.44.0403051622550.16330-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 1078532804 17980 171.64.66.201 (6 Mar 2004 00:26:44 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6874


Note that the material needed for all the PS4 questions (but the question 
on CRC) has already been covered, so people can start working on the 
problem set rightaway. Tuesday's class will cover the material needed for 
answering the CRC question. In today's review session, I discussed some 
CRC problems, and you might want to watch the tape after tuesday's class.

Shankar

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3(b) Solution
Date: Fri, 5 Mar 2004 16:51:08 -0800
Lines: 4
Distribution: su
Message-ID: <Pine.GSO.4.44.0403051648410.27859-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 1078534270 19558 171.64.15.118 (6 Mar 2004 00:51:10 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6875


With PS3(b) solution, I am still confused.  Could one of TA explain a
little? Maybe an example using node A, B, C?

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS4 Q1c
Date: Sat, 6 Mar 2004 01:16:29 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c2b8pd$kgj$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1078535789 21011 171.64.15.98 (6 Mar 2004 01:16:29 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:6876


The formula in the text says for "smallish N".  But for part c, N is 2^30, 
which is hardly "smallish".  The formula given works out to more than 
2000, which doesn't make sense for a probability that is supposed to be 
between 0 and 1.  Or am I missing something?

Tyrone

.

Path: shelby.stanford.edu!elaine22.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftpcopy_tcp
Date: Fri, 5 Mar 2004 17:58:21 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.GSO.4.44.0403051756360.9085-100000@elaine22.Stanford.EDU>
References: <Pine.GSO.4.44.0403051418450.6975-100000@elaine22.Stanford.EDU>
 <c2b4ah$ft9$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine22.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078538304 23563 171.64.15.87 (6 Mar 2004 01:58:24 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c2b4ah$ft9$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6877

I was getting link errors for the sr_api_init...

The link error resulted becasue:

I was using the same ftpcopy.c was being used to make _vns and _tcp,
the _vns links w/ proper libs, but the _tcp does not include
the libs to support sr_api_init

--vishal

On Sat, 6 Mar 2004, Matthew Jonathan Holliman wrote:

>
>
> >or are we only gonna be working w/ ftpcopy_vns?  The reason
> >I ask is because i'm getting link errors when trying to build ftpcopy_tcp
> >and intend to simply take this out of my makefile
>
> only ftpcopy_vns.  I don't know why you'd get link errors (what are they?),
> because your Makefile is the same as in HW3 and nothing should have changed
> on our end, but you can take this out.
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: "jsilver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: NAT for assignment #4
Date: Fri, 5 Mar 2004 18:04:09 -0800
Lines: 11
Distribution: su
Message-ID: <c2bbj0$nic$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078538658 24140 127.0.0.1 (6 Mar 2004 02:04: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:6878


I'd like to try to implement NAT to hide my IP address for vhost from the
rest of the world.  If I use NAT and I'm a host behind the router, when I
send packets to the Internet, the source I advertise should be eth0 of the
router, right?  I'm going to test with the echo_client because my ftp client
doesn't use passive mode.  Is there a way to connect 1 (or preferably 2)
vhosts to my router and give them private IP addresses?

Josh


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: NAT for assignment #4
Date: Fri, 5 Mar 2004 18:17:24 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.LNX.4.44.0403051810430.23328-100000@Xenon.Stanford.EDU>
References: <c2bbj0$nic$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 1078539445 25270 171.64.66.201 (6 Mar 2004 02:17:25 GMT)
X-Complaints-To: news@news.stanford.edu
To: jsilver <jmsilver@stanford.edu>
In-Reply-To: <c2bbj0$nic$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6879


> 
> I'd like to try to implement NAT to hide my IP address for vhost from the
> rest of the world. 

 cool! :)

> If I use NAT and I'm a host behind the router, when I
> send packets to the Internet, the source I advertise should be eth0 of the
> router, right?

 This is up to you.  As long as the Internet knows to route the packet to
 you you can use whatever source address you'd like. 

> I'm going to test with the echo_client because my ftp client
> doesn't use passive mode.  Is there a way to connect 1 (or preferably 2)
> vhosts to my router and give them private IP addresses?

 Let me set you up a separate topology to work with.

 I'll email you details.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3(b) Solution
Date: Fri, 5 Mar 2004 18:30:35 -0800
Lines: 33
Distribution: su
Message-ID: <Pine.LNX.4.44.0403051804360.19025-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403051648410.27859-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 1078540236 26218 171.64.66.201 (6 Mar 2004 02:30:36 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0403051648410.27859-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6880



On Fri, 5 Mar 2004, Xiaohua Fang wrote:

> 
> With PS3(b) solution, I am still confused.  Could one of TA explain a
> little? Maybe an example using node A, B, C?
> 
> 


The only statement in the solution which is a bit hard to grasp is the 
following: "if A detects a collision within PROPMIN time since its last 
packet transmission completed, it knows that its last transmitted packet 
must have collided."

Here is a more detailed explanation of why the above is true. Suppose that 
A transmitted a packet P0 from time 0 to time 2PROP - PROPMIN, and
there was a collision in the time [2PROP-PROPMIN, 2PROP]. Our claim is 
that this collision must involve P0. 

Suppose not, so the collision happened between some packet P1 sent by 
some host X and some packet P2 sent by a different host Y. The qn then is 
when did X and Y start transmitting? They couldn't have started in 
[0,PROP-PROPMIN], else A would detect them beofre completing. They 
couldn't have started in [PROP, 2PROP] since they know by then that A is 
transmitting. So, the only option is [PROP-PROPMIN, PROP], but at most 
one node (the node furthest from A) can start in this time because every 
other node would know A is transmitting by PROP-PROPMIN. Thus, we have a  
contradiction => the collision must involve P0. 

Shankar

.

Path: shelby.stanford.edu!epic9.Stanford.EDU!senderzo
From: Boris Senderzon <senderzo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ftpcopy_vns results
Date: Fri, 5 Mar 2004 20:17:41 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0403052009230.7885-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 1078546713 4685 171.64.15.42 (6 Mar 2004 04:18:33 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6881

I used reference ftpcopy_vns that uses passive mode (provided by Matthew)
and I'm not getting the same results as with my ftpcopy from hw 1.

I execute ./ftpcopy ch 1 ftp.cs.stanford.edu . /pub/cweb
Using my ftpcopy which passes hw1 test script, I get a bunch of .ch
files and a directory "examples" which contains more .ch files.
This is exactly the output expected if one looks at directory structure
in the ftp.cs.stanford.edu

With reference ftpcopy_vns, "examples" directory and its contents is not
transfered.  "examples" is a real directory not a symbolic link.
All other test cases from hw1 are correct.  Is it the case of
"off by one" error?

Thanks.
Boris.


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ftpcopy_vns results
Date: Fri, 5 Mar 2004 22:16:15 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.LNX.4.44.0403052211020.30485-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403052009230.7885-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 1078553779 11776 171.64.66.201 (6 Mar 2004 06:16:19 GMT)
X-Complaints-To: news@news.stanford.edu
To: Boris Senderzon <senderzo@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403052009230.7885-100000@epic9.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6882


 The passive version of ftpcopy_vns is actually from 2 years ago modified and
 retrofitted to support mysock.  There may very well be differences from the
 current homework description (and or errors), but you needn't worry about
 these.

 .m

> I used reference ftpcopy_vns that uses passive mode (provided by Matthew)
> and I'm not getting the same results as with my ftpcopy from hw 1.
> 
> I execute ./ftpcopy ch 1 ftp.cs.stanford.edu . /pub/cweb
> Using my ftpcopy which passes hw1 test script, I get a bunch of .ch
> files and a directory "examples" which contains more .ch files.
> This is exactly the output expected if one looks at directory structure
> in the ftp.cs.stanford.edu
> 
> With reference ftpcopy_vns, "examples" directory and its contents is not
> transfered.  "examples" is a real directory not a symbolic link.
> All other test cases from hw1 are correct.  Is it the case of
> "off by one" error?
> 
> Thanks.
> Boris.
> 
> 
> 

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS3(b) Solution
Date: Fri, 5 Mar 2004 22:56:41 -0800
Lines: 39
Distribution: su
Message-ID: <Pine.GSO.4.44.0403052253590.3177-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0403051648410.27859-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0403051804360.19025-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 1078556203 13799 171.64.15.118 (6 Mar 2004 06:56:43 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0403051804360.19025-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6883

Thank you for the explanation.  It is very clear now!

On Fri, 5 Mar 2004, Shankar Ponnekanti wrote:

>
>
> On Fri, 5 Mar 2004, Xiaohua Fang wrote:
>
> >
> > With PS3(b) solution, I am still confused.  Could one of TA explain a
> > little? Maybe an example using node A, B, C?
> >
> >
>
>
> The only statement in the solution which is a bit hard to grasp is the
> following: "if A detects a collision within PROPMIN time since its last
> packet transmission completed, it knows that its last transmitted packet
> must have collided."
>
> Here is a more detailed explanation of why the above is true. Suppose that
> A transmitted a packet P0 from time 0 to time 2PROP - PROPMIN, and
> there was a collision in the time [2PROP-PROPMIN, 2PROP]. Our claim is
> that this collision must involve P0.
>
> Suppose not, so the collision happened between some packet P1 sent by
> some host X and some packet P2 sent by a different host Y. The qn then is
> when did X and Y start transmitting? They couldn't have started in
> [0,PROP-PROPMIN], else A would detect them beofre completing. They
> couldn't have started in [PROP, 2PROP] since they know by then that A is
> transmitting. So, the only option is [PROP-PROPMIN, PROP], but at most
> one node (the node furthest from A) can start in this time because every
> other node would know A is transmitting by PROP-PROPMIN. Thus, we have a
> contradiction => the collision must involve P0.
>
> Shankar
>
>

.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: HW4: submission script
Date: Sat, 6 Mar 2004 16:21:21 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c2ctq0$d5i$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1078590081 13490 171.64.15.84 (6 Mar 2004 16:21: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:6884

submit.pl doesn't seem to take in the sr_transport sub dir, which is 
needed for ftpcopy on the vhost. Someone reported this issue during hw3 as 
well, not sure what the problem is here?

I suppose I can always tar/gz the whole dir and copy it over directly, 
but...

Jason
.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: HW4: submission script
Date: Sat, 6 Mar 2004 17:47:43 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c2d2rv$hjp$1@news.Stanford.EDU>
References: <c2ctq0$d5i$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine19.stanford.edu
X-Trace: news.Stanford.EDU 1078595263 18041 171.64.15.84 (6 Mar 2004 17:47:43 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6885


>submit.pl doesn't seem to take in the sr_transport sub dir, which is 
>needed for ftpcopy on the vhost. Someone reported this issue during hw3 as 
>well, not sure what the problem is here?

There's no problem--we already have this, so there's no need for the script
to take in those same files.

.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS4: #44 P.159
Date: Sat, 6 Mar 2004 18:21:01 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c2d4qd$j6n$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1078597261 19671 171.64.15.98 (6 Mar 2004 18:21:01 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:6886

For a) and b), should I assume that A already won the 1st backoff race? 
The question only asked the probability that A wins a subsequent race 
after the 1st collision, w/o indicating whether we should assume A 
actually wins the 1st race or not.

Jason
.

Path: shelby.stanford.edu!not-for-mail
From: Jason Ying Li <jasonyli@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS4: #44 P.159 b)
Date: Sat, 6 Mar 2004 18:23:25 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <c2d4ut$jct$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine23.stanford.edu
X-Trace: news.Stanford.EDU 1078597405 19869 171.64.15.98 (6 Mar 2004 18:23: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:6887

Is the question asking for the absolute 3rd backoff race (i.e., A tries to 
transmit A3) or the relative 3rd backoff race from the 1st one, which is 
actually the 4th (i.e., A tries to transmit A4)?

Jason
.

Path: shelby.stanford.edu!epic17.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Truncated IP packet
Date: Sat, 6 Mar 2004 12:38:41 -0800
Lines: 176
Distribution: su
Message-ID: <Pine.GSO.4.44.0403061223530.1666-100000@epic17.Stanford.EDU>
NNTP-Posting-Host: epic17.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078605524 27484 171.64.15.52 (6 Mar 2004 20:38:44 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6889

I'm seeing the following in the tcpdump from my router:

11:36:59.145315 0:e0:81:4:8:9b 70:0:0:71:0:3 ip 1024: truncated-ip - 490
bytes missing! sheilap-router-1.Stanford.EDU.ftp-data >
elaine37.Stanford.EDU.54579: . 1:1449(1448) ack 1 win 5840
<nop,nop,timestamp 382718752 256314993> (DF) [tos 0x8]  (ttl 64, id 53624,
len 1500)
                         4508 05dc d178 4000 4006 67f8 c0a8 804a
                         ab40 0f70 0014 d533 10fb 0257 b4d5 bf16
                         8010 16d0 6645 0000 0101 080a 16cf d320
                         0f47 0e71 fffb 9260 0000 04c7 48c9 4b0c
.... (full packet below)

This was using FTP from the elaines as a base case (to see if the
transport layer produces different results).  I don't know if this is
anything to worry about (I don't see it in traces on my router when using
ftpcopy).

The packet is the same entering as leaving, so I don't think my router is
at fault.  I tried to confirm this by replacing the router with prebuilt
sr, but couldn't get a packet log from this (final result matched the
other experiment, though).

That leaves either the FTP server is sending truncated packets, or the
logging function is truncating them.  Can anyone confirm if they have seen
this problem and if it is anything I should be worried about?

Thanks,
Barrett

Packet In/Out below:

11:36:59.145315 0:e0:81:4:8:9b 70:0:0:71:0:3 ip 1024: truncated-ip - 490
bytes \
missing! sheilap-router-1.Stanford.EDU.ftp-data >
elaine37.Stanford.EDU.54579: \
.. 1:1449(1448) ack 1 win 5840 <nop,nop,timestamp 382718752 256314993> (DF)
[tos\
 0x8]  (ttl 64, id 53624, len 1500)
                         4508 05dc d178 4000 4006 67f8 c0a8 804a
                         ab40 0f70 0014 d533 10fb 0257 b4d5 bf16
                         8010 16d0 6645 0000 0101 080a 16cf d320
                         0f47 0e71 fffb 9260 0000 04c7 48c9 4b0c
                         3362 0000 0970 0000 0110 10f1 39ac bccb
                         8800 0025 c000 0004 5505 96aa ea48 de72
                         b178 40c7 5077 e921 15c5 5618 cb23 abbd
                         e77d 0443 ca82 0071 2813 2da4 120f 1b24
                         1e42 665b 4212 0f1b 120f 2125 9fa4 121c
                         6cc1 c84c df60 e164 2603 0f01 a660 0103
                         c008 1e4d 3308 2078 4207 93d3 0821 6004
                         0f0b 5981 081e 0040 f0b5 9841 0b21 87a7
                         b043 2c86 5a7b 0865 90c3 d3d8 8cb4 32ef
                         6232 d0cb bf11 9682 33c0 1188 0f80 6066
                         6580 3330 3f03 0333 3c03 3307 c070 666f
                         1013 6dbb 24b6 db6c 603c a9c3 2015 4ce4
                         a039 fb86 5d57 e9f9 6734 3990 e0e8 3406
                         d2e9 4a68 cca2 4dc7 54b5 bb56 c1aa 4969
                         db2a a6f2 aa74 f8ea 6f65 65e2 5108 0649
                         6442 7910 9824 4ac8 9172 2460 9127 228b
                         9145 8924 e6a2 e6a2 c492 7367 08a2 c953
                         a28b 91cd 3b5c d973 65aa 9e65 c8cc 26c5
                         4560 6c56 4542 6c54 5e0d 8bd3 617b b1e0
                         d8a0 0dc9 75df ed63 8800 4cb9 7014 0958
                         1402 ed40 9a32 0882 1c00 7310 48a6 60e3
                         27a2 04c4 16d9 8c65 0a00 b879 8076 b394
                         f12f 8959 9b00 516c cc2e 5015 d3ad 2054
                         2408 72cb 89b4 07e8 2f81 63c0 c017 20c5
                         22c5 811c 0ba2 80e1 2022 6628 650b 026b
                         afff fd7f 41f6 fffb 9260 3200 03be 35d0
                         eb18 92de 0000 0970 0000 0110 1ce5 49ec
                         622b 7000 0025 c000 0004 cc88 a181 4cbe
                         440e 179c d753 213c 7d69 9ebf 7a40 5115
                         5d99 9e3e d456 8012 d4a4 3a2b 682c 32e7
                         0969 8125 8994 acac c101 2416 f6e0 c055
                         bc23 2345 86d3 08b5 24a3 4737 2911 8da6
                         3c04 7066 5083 500d 1189 85a9 5220 600d
                         0017 24d8 7201 9b0e d05e 825c f0f8 2182
                         951d 833a 0de2 3314 f208 33c6 c9fa ffff
                         fa1a d1a9 03e7 4771 a0f9 3037 268a 5412
                         3474 d159 a31a 2664 8226 a815 7d88 4814
                         4766 7667 8ff0 15a0 04b7 6609 1949 80d0
                         9015 4b86 7621 df45 5583 a68b 62d6 7089
                         5e55 4a56 084c eeb2 f738 0ae7 bc99 e956
                         9826 50ab a0bb 0e23 1533 3711 a8dc b30c
                         8a86 00fa 0bac 2e00 f306 1005 c864 1344
                         5183 d31a a2c8 9264 3c6e 8e1f ffff fffc
                         a07d 34d1 264a e4b9 17d4 6e75 94a4 e629
                         1648 6934 0734 bbfd f6d6 4680 2807 5d58
                         4784 9880 7367 0411 29f8 6078 4a44 9301
                         2cbc 7208 2d92 2911 1a61 7eaf 0421 888e
                         a34e d261 d5a9 04e2 1017 5014 8500 4827
                         c8bc 68ca 2205 1444 661d a110 1040 0a54
                         3612 88f0 35c3 d91e 467c 1bd4 5b87 60b9
                         46d9 31bd 77f7 db65 3f52 edfe 7506 332f
                         2662 eea5 ac89 2a9a fffb 9260 7480 03a9
                         3752 fb18 92dc 0000 0970 0000 0110 20ed
                         47ad 666b 7000 0025 c000 0004 d492 4ea5
                         a08b 1ab8 bce9 667a 7580 324b b6df ed80
                         8d00 25e9 848c 2598 0066 1697 0579 b861
                         408a 29b7 0aa2 133c 0c59 6689 920c 921d
                         0081 47e0 6910 0e88 8a90 0666 b09e e95c
                         af43 8c4c 80b8 13e8 31ee b0b2 0514 59e2
                         0a87
11:36:59.145527 70:0:0:71:0:2 0:e0:81:4:26:d9 ip 1024: truncated-ip - 490
bytes\
 missing! sheilap-router-1.Stanford.EDU.ftp-data >
elaine37.Stanford.EDU.54579:\
 . 1:1449(1448) ack 1 win 5840 <nop,nop,timestamp 382718752 256314993>
(DF) [to\
s 0x8]  (ttl 63, id 53624, len 1500)
                         4508 05dc d178 4000 3f06 68f8 c0a8 804a
                         ab40 0f70 0014 d533 10fb 0257 b4d5 bf16
                         8010 16d0 6645 0000 0101 080a 16cf d320
                         0f47 0e71 fffb 9260 0000 04c7 48c9 4b0c
                         3362 0000 0970 0000 0110 10f1 39ac bccb
                         8800 0025 c000 0004 5505 96aa ea48 de72
                         b178 40c7 5077 e921 15c5 5618 cb23 abbd
                         e77d 0443 ca82 0071 2813 2da4 120f 1b24
                         1e42 665b 4212 0f1b 120f 2125 9fa4 121c
                         6cc1 c84c df60 e164 2603 0f01 a660 0103
                         c008 1e4d 3308 2078 4207 93d3 0821 6004
                         0f0b 5981 081e 0040 f0b5 9841 0b21 87a7
                         b043 2c86 5a7b 0865 90c3 d3d8 8cb4 32ef
                         6232 d0cb bf11 9682 33c0 1188 0f80 6066
                         6580 3330 3f03 0333 3c03 3307 c070 666f
                         1013 6dbb 24b6 db6c 603c a9c3 2015 4ce4
                         a039 fb86 5d57 e9f9 6734 3990 e0e8 3406
                         d2e9 4a68 cca2 4dc7 54b5 bb56 c1aa 4969
                         db2a a6f2 aa74 f8ea 6f65 65e2 5108 0649
                         6442 7910 9824 4ac8 9172 2460 9127 228b
                         9145 8924 e6a2 e6a2 c492 7367 08a2 c953
                         a28b 91cd 3b5c d973 65aa 9e65 c8cc 26c5
                         4560 6c56 4542 6c54 5e0d 8bd3 617b b1e0
                         d8a0 0dc9 75df ed63 8800 4cb9 7014 0958
                         1402 ed40 9a32 0882 1c00 7310 48a6 60e3
                         27a2 04c4 16d9 8c65 0a00 b879 8076 b394
                         f12f 8959 9b00 516c cc2e 5015 d3ad 2054
                         2408 72cb 89b4 07e8 2f81 63c0 c017 20c5
                         22c5 811c 0ba2 80e1 2022 6628 650b 026b
                         afff fd7f 41f6 fffb 9260 3200 03be 35d0
                         eb18 92de 0000 0970 0000 0110 1ce5 49ec
                         622b 7000 0025 c000 0004 cc88 a181 4cbe
                         440e 179c d753 213c 7d69 9ebf 7a40 5115
                         5d99 9e3e d456 8012 d4a4 3a2b 682c 32e7
                         0969 8125 8994 acac c101 2416 f6e0 c055
                         bc23 2345 86d3 08b5 24a3 4737 2911 8da6
                         3c04 7066 5083 500d 1189 85a9 5220 600d
                         0017 24d8 7201 9b0e d05e 825c f0f8 2182
                         951d 833a 0de2 3314 f208 33c6 c9fa ffff
                         fa1a d1a9 03e7 4771 a0f9 3037 268a 5412
                         3474 d159 a31a 2664 8226 a815 7d88 4814
                         4766 7667 8ff0 15a0 04b7 6609 1949 80d0
                         9015 4b86 7621 df45 5583 a68b 62d6 7089
                         5e55 4a56 084c eeb2 f738 0ae7 bc99 e956
                         9826 50ab a0bb 0e23 1533 3711 a8dc b30c
                         8a86 00fa 0bac 2e00 f306 1005 c864 1344
                         5183 d31a a2c8 9264 3c6e 8e1f ffff fffc
                         a07d 34d1 264a e4b9 17d4 6e75 94a4 e629
                         1648 6934 0734 bbfd f6d6 4680 2807 5d58
                         4784 9880 7367 0411 29f8 6078 4a44 9301
                         2cbc 7208 2d92 2911 1a61 7eaf 0421 888e
                         a34e d261 d5a9 04e2 1017 5014 8500 4827
                         c8bc 68ca 2205 1444 661d a110 1040 0a54
                         3612 88f0 35c3 d91e 467c 1bd4 5b87 60b9
                         46d9 31bd 77f7 db65 3f52 edfe 7506 332f
                         2662 eea5 ac89 2a9a fffb 9260 7480 03a9
                         3752 fb18 92dc 0000 0970 0000 0110 20ed
                         47ad 666b 7000 0025 c000 0004 d492 4ea5
                         a08b 1ab8 bce9 667a 7580 324b b6df ed80
                         8d00 25e9 848c 2598 0066 1697 0579 b861
                         408a 29b7 0aa2 133c 0c59 6689 920c 921d
                         0081 47e0 6910 0e88 8a90 0666 b09e e95c
                         af43 8c4c 80b8 13e8 31ee b0b2 0514 59e2
                         0a87


.

Path: shelby.stanford.edu!epic17.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Truncated IP packet
Date: Sat, 6 Mar 2004 13:14:00 -0800
Lines: 17
Distribution: su
Message-ID: <Pine.GSO.4.44.0403061309120.2287-100000@epic17.Stanford.EDU>
References: <Pine.GSO.4.44.0403061223530.1666-100000@epic17.Stanford.EDU>
NNTP-Posting-Host: epic17.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078607642 29703 171.64.15.52 (6 Mar 2004 21:14:02 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0403061223530.1666-100000@epic17.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6890

Further evidence it is just an output problem:

The ACK byte is for the full packet size:

11:36:59.157996 0:e0:81:4:26:d9 70:0:0:71:0:2 ip 90:
elaine37.Stanford.EDU.54579 > sheilap-router-1.Stanford.EDU.ftp-data: .
[tcp sum ok] 1:1(0) ack 1449 win 24616 <nop,nop,timestamp 256314995
382718752> (DF) (ttl 61, id 18590, len 52)
                         4500 0034 489e 4000 3d06 f982 ab40 0f70
                         c0a8 804a d533 0014 b4d5 bf16 10fb 07ff
                         8010 6028 b119 0000 0101 080a 0f47 0e73
                         16cf d320 1c0b a1c3 437e 0000 05a0 7f49
                         1490 0002 da78 4e19 a4b4 0000

-Barrett


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Truncated IP packet
Date: Sat, 6 Mar 2004 13:15:28 -0800
Lines: 186
Distribution: su
Message-ID: <Pine.LNX.4.44.0403061313250.22059-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403061223530.1666-100000@epic17.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078607730 29779 171.64.66.201 (6 Mar 2004 21:15:30 GMT)
X-Complaints-To: news@news.stanford.edu
To: Barrett Trask <btrask@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403061223530.1666-100000@epic17.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6891



 Don't worry about that, this is the snaplen used to log the packets, you 
 can change this in sr_router.h (PACKET_DUMP_SIZE).


  .m

> I'm seeing the following in the tcpdump from my router:
> 
> 11:36:59.145315 0:e0:81:4:8:9b 70:0:0:71:0:3 ip 1024: truncated-ip - 490
> bytes missing! sheilap-router-1.Stanford.EDU.ftp-data >
> elaine37.Stanford.EDU.54579: . 1:1449(1448) ack 1 win 5840
> <nop,nop,timestamp 382718752 256314993> (DF) [tos 0x8]  (ttl 64, id 53624,
> len 1500)
>                          4508 05dc d178 4000 4006 67f8 c0a8 804a
>                          ab40 0f70 0014 d533 10fb 0257 b4d5 bf16
>                          8010 16d0 6645 0000 0101 080a 16cf d320
>                          0f47 0e71 fffb 9260 0000 04c7 48c9 4b0c
> ... (full packet below)
> 
> This was using FTP from the elaines as a base case (to see if the
> transport layer produces different results).  I don't know if this is
> anything to worry about (I don't see it in traces on my router when using
> ftpcopy).
> 
> The packet is the same entering as leaving, so I don't think my router is
> at fault.  I tried to confirm this by replacing the router with prebuilt
> sr, but couldn't get a packet log from this (final result matched the
> other experiment, though).
> 
> That leaves either the FTP server is sending truncated packets, or the
> logging function is truncating them.  Can anyone confirm if they have seen
> this problem and if it is anything I should be worried about?
> 
> Thanks,
> Barrett
> 
> Packet In/Out below:
> 
> 11:36:59.145315 0:e0:81:4:8:9b 70:0:0:71:0:3 ip 1024: truncated-ip - 490
> bytes \
> missing! sheilap-router-1.Stanford.EDU.ftp-data >
> elaine37.Stanford.EDU.54579: \
> . 1:1449(1448) ack 1 win 5840 <nop,nop,timestamp 382718752 256314993> (DF)
> [tos\
>  0x8]  (ttl 64, id 53624, len 1500)
>                          4508 05dc d178 4000 4006 67f8 c0a8 804a
>                          ab40 0f70 0014 d533 10fb 0257 b4d5 bf16
>                          8010 16d0 6645 0000 0101 080a 16cf d320
>                          0f47 0e71 fffb 9260 0000 04c7 48c9 4b0c
>                          3362 0000 0970 0000 0110 10f1 39ac bccb
>                          8800 0025 c000 0004 5505 96aa ea48 de72
>                          b178 40c7 5077 e921 15c5 5618 cb23 abbd
>                          e77d 0443 ca82 0071 2813 2da4 120f 1b24
>                          1e42 665b 4212 0f1b 120f 2125 9fa4 121c
>                          6cc1 c84c df60 e164 2603 0f01 a660 0103
>                          c008 1e4d 3308 2078 4207 93d3 0821 6004
>                          0f0b 5981 081e 0040 f0b5 9841 0b21 87a7
>                          b043 2c86 5a7b 0865 90c3 d3d8 8cb4 32ef
>                          6232 d0cb bf11 9682 33c0 1188 0f80 6066
>                          6580 3330 3f03 0333 3c03 3307 c070 666f
>                          1013 6dbb 24b6 db6c 603c a9c3 2015 4ce4
>                          a039 fb86 5d57 e9f9 6734 3990 e0e8 3406
>                          d2e9 4a68 cca2 4dc7 54b5 bb56 c1aa 4969
>                          db2a a6f2 aa74 f8ea 6f65 65e2 5108 0649
>                          6442 7910 9824 4ac8 9172 2460 9127 228b
>                          9145 8924 e6a2 e6a2 c492 7367 08a2 c953
>                          a28b 91cd 3b5c d973 65aa 9e65 c8cc 26c5
>                          4560 6c56 4542 6c54 5e0d 8bd3 617b b1e0
>                          d8a0 0dc9 75df ed63 8800 4cb9 7014 0958
>                          1402 ed40 9a32 0882 1c00 7310 48a6 60e3
>                          27a2 04c4 16d9 8c65 0a00 b879 8076 b394
>                          f12f 8959 9b00 516c cc2e 5015 d3ad 2054
>                          2408 72cb 89b4 07e8 2f81 63c0 c017 20c5
>                          22c5 811c 0ba2 80e1 2022 6628 650b 026b
>                          afff fd7f 41f6 fffb 9260 3200 03be 35d0
>                          eb18 92de 0000 0970 0000 0110 1ce5 49ec
>                          622b 7000 0025 c000 0004 cc88 a181 4cbe
>                          440e 179c d753 213c 7d69 9ebf 7a40 5115
>                          5d99 9e3e d456 8012 d4a4 3a2b 682c 32e7
>                          0969 8125 8994 acac c101 2416 f6e0 c055
>                          bc23 2345 86d3 08b5 24a3 4737 2911 8da6
>                          3c04 7066 5083 500d 1189 85a9 5220 600d
>                          0017 24d8 7201 9b0e d05e 825c f0f8 2182
>                          951d 833a 0de2 3314 f208 33c6 c9fa ffff
>                          fa1a d1a9 03e7 4771 a0f9 3037 268a 5412
>                          3474 d159 a31a 2664 8226 a815 7d88 4814
>                          4766 7667 8ff0 15a0 04b7 6609 1949 80d0
>                          9015 4b86 7621 df45 5583 a68b 62d6 7089
>                          5e55 4a56 084c eeb2 f738 0ae7 bc99 e956
>                          9826 50ab a0bb 0e23 1533 3711 a8dc b30c
>                          8a86 00fa 0bac 2e00 f306 1005 c864 1344
>                          5183 d31a a2c8 9264 3c6e 8e1f ffff fffc
>                          a07d 34d1 264a e4b9 17d4 6e75 94a4 e629
>                          1648 6934 0734 bbfd f6d6 4680 2807 5d58
>                          4784 9880 7367 0411 29f8 6078 4a44 9301
>                          2cbc 7208 2d92 2911 1a61 7eaf 0421 888e
>                          a34e d261 d5a9 04e2 1017 5014 8500 4827
>                          c8bc 68ca 2205 1444 661d a110 1040 0a54
>                          3612 88f0 35c3 d91e 467c 1bd4 5b87 60b9
>                          46d9 31bd 77f7 db65 3f52 edfe 7506 332f
>                          2662 eea5 ac89 2a9a fffb 9260 7480 03a9
>                          3752 fb18 92dc 0000 0970 0000 0110 20ed
>                          47ad 666b 7000 0025 c000 0004 d492 4ea5
>                          a08b 1ab8 bce9 667a 7580 324b b6df ed80
>                          8d00 25e9 848c 2598 0066 1697 0579 b861
>                          408a 29b7 0aa2 133c 0c59 6689 920c 921d
>                          0081 47e0 6910 0e88 8a90 0666 b09e e95c
>                          af43 8c4c 80b8 13e8 31ee b0b2 0514 59e2
>                          0a87
> 11:36:59.145527 70:0:0:71:0:2 0:e0:81:4:26:d9 ip 1024: truncated-ip - 490
> bytes\
>  missing! sheilap-router-1.Stanford.EDU.ftp-data >
> elaine37.Stanford.EDU.54579:\
>  . 1:1449(1448) ack 1 win 5840 <nop,nop,timestamp 382718752 256314993>
> (DF) [to\
> s 0x8]  (ttl 63, id 53624, len 1500)
>                          4508 05dc d178 4000 3f06 68f8 c0a8 804a
>                          ab40 0f70 0014 d533 10fb 0257 b4d5 bf16
>                          8010 16d0 6645 0000 0101 080a 16cf d320
>                          0f47 0e71 fffb 9260 0000 04c7 48c9 4b0c
>                          3362 0000 0970 0000 0110 10f1 39ac bccb
>                          8800 0025 c000 0004 5505 96aa ea48 de72
>                          b178 40c7 5077 e921 15c5 5618 cb23 abbd
>                          e77d 0443 ca82 0071 2813 2da4 120f 1b24
>                          1e42 665b 4212 0f1b 120f 2125 9fa4 121c
>                          6cc1 c84c df60 e164 2603 0f01 a660 0103
>                          c008 1e4d 3308 2078 4207 93d3 0821 6004
>                          0f0b 5981 081e 0040 f0b5 9841 0b21 87a7
>                          b043 2c86 5a7b 0865 90c3 d3d8 8cb4 32ef
>                          6232 d0cb bf11 9682 33c0 1188 0f80 6066
>                          6580 3330 3f03 0333 3c03 3307 c070 666f
>                          1013 6dbb 24b6 db6c 603c a9c3 2015 4ce4
>                          a039 fb86 5d57 e9f9 6734 3990 e0e8 3406
>                          d2e9 4a68 cca2 4dc7 54b5 bb56 c1aa 4969
>                          db2a a6f2 aa74 f8ea 6f65 65e2 5108 0649
>                          6442 7910 9824 4ac8 9172 2460 9127 228b
>                          9145 8924 e6a2 e6a2 c492 7367 08a2 c953
>                          a28b 91cd 3b5c d973 65aa 9e65 c8cc 26c5
>                          4560 6c56 4542 6c54 5e0d 8bd3 617b b1e0
>                          d8a0 0dc9 75df ed63 8800 4cb9 7014 0958
>                          1402 ed40 9a32 0882 1c00 7310 48a6 60e3
>                          27a2 04c4 16d9 8c65 0a00 b879 8076 b394
>                          f12f 8959 9b00 516c cc2e 5015 d3ad 2054
>                          2408 72cb 89b4 07e8 2f81 63c0 c017 20c5
>                          22c5 811c 0ba2 80e1 2022 6628 650b 026b
>                          afff fd7f 41f6 fffb 9260 3200 03be 35d0
>                          eb18 92de 0000 0970 0000 0110 1ce5 49ec
>                          622b 7000 0025 c000 0004 cc88 a181 4cbe
>                          440e 179c d753 213c 7d69 9ebf 7a40 5115
>                          5d99 9e3e d456 8012 d4a4 3a2b 682c 32e7
>                          0969 8125 8994 acac c101 2416 f6e0 c055
>                          bc23 2345 86d3 08b5 24a3 4737 2911 8da6
>                          3c04 7066 5083 500d 1189 85a9 5220 600d
>                          0017 24d8 7201 9b0e d05e 825c f0f8 2182
>                          951d 833a 0de2 3314 f208 33c6 c9fa ffff
>                          fa1a d1a9 03e7 4771 a0f9 3037 268a 5412
>                          3474 d159 a31a 2664 8226 a815 7d88 4814
>                          4766 7667 8ff0 15a0 04b7 6609 1949 80d0
>                          9015 4b86 7621 df45 5583 a68b 62d6 7089
>                          5e55 4a56 084c eeb2 f738 0ae7 bc99 e956
>                          9826 50ab a0bb 0e23 1533 3711 a8dc b30c
>                          8a86 00fa 0bac 2e00 f306 1005 c864 1344
>                          5183 d31a a2c8 9264 3c6e 8e1f ffff fffc
>                          a07d 34d1 264a e4b9 17d4 6e75 94a4 e629
>                          1648 6934 0734 bbfd f6d6 4680 2807 5d58
>                          4784 9880 7367 0411 29f8 6078 4a44 9301
>                          2cbc 7208 2d92 2911 1a61 7eaf 0421 888e
>                          a34e d261 d5a9 04e2 1017 5014 8500 4827
>                          c8bc 68ca 2205 1444 661d a110 1040 0a54
>                          3612 88f0 35c3 d91e 467c 1bd4 5b87 60b9
>                          46d9 31bd 77f7 db65 3f52 edfe 7506 332f
>                          2662 eea5 ac89 2a9a fffb 9260 7480 03a9
>                          3752 fb18 92dc 0000 0970 0000 0110 20ed
>                          47ad 666b 7000 0025 c000 0004 d492 4ea5
>                          a08b 1ab8 bce9 667a 7580 324b b6df ed80
>                          8d00 25e9 848c 2598 0066 1697 0579 b861
>                          408a 29b7 0aa2 133c 0c59 6689 920c 921d
>                          0081 47e0 6910 0e88 8a90 0666 b09e e95c
>                          af43 8c4c 80b8 13e8 31ee b0b2 0514 59e2
>                          0a87
> 
> 
> 

.

Path: shelby.stanford.edu!epic17.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Strange behavior with /usr/bin/ftp
Date: Sat, 6 Mar 2004 14:03:50 -0800
Lines: 111
Distribution: su
Message-ID: <Pine.GSO.4.44.0403061319160.2287-100000@epic17.Stanford.EDU>
NNTP-Posting-Host: epic17.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078610632 2528 171.64.15.52 (6 Mar 2004 22:03:52 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6892

I mentioned in a previous post that I was using ftp to verify the
correctness of my STCP layer transfer.  There was a slight difference in
the files: what I assumed was the insertion of an extra byte
(occasionally) into my transfer layer's file.

> cksum sbnatan.mp3 mysbnatan.mp3
367305469 1342870 sbnatan.mp3
776268028 1342903 mysbnatan.mp3

The file sizes differ as can be seen from the above output.  I seem to
remember a post during the first assignment about the reported bytes
during transfer differing from actual bytes, but I don't recall if it was
ever explained.

> /usr/bin/ftp 192.168.128.74
Connected to 192.168.128.74.
220 (vsFTPd 1.2.1)
Name (192.168.128.74:btrask): anonymous
331 Please specify the password.
Password:
230 Login successful.
ftp> cd pub
250 Directory successfully changed.
ftp> get sbnatan.mp3
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for sbnatan.mp3 (1342903 bytes).
226 File send OK.
local: sbnatan.mp3 remote: sbnatan.mp3
1342903 bytes received in 27 seconds (48.33 Kbytes/s)
ftp> by
221 Goodbye.
> ls -l sbnatan.mp3
-rw-------    1 btrask   37        1342870 Mar  6 13:33 sbnatan.mp3

The reported number of bytes from FTP matched the file size of my STCP
transfer, but not the file created as a result of the FTP.

The only "unofficial" component in this transfer is my router, but it did
not make any difference in the result when running the provided sr.

My next step to debug this was to look at the file bytes and compare to
the packet trace coming from the router:

> cmp -l -n 27520 sbnatan.mp3 mysbnatan.mp3
27516  12  15
27517 106  12
27518 311 106
27519 226 311
27520   6 226

For my transfer (with provided ftpcopy and my transport and router):

Packet from router (byte 27516 marked):

17:55:17.249333 70:0:0:71:0:5 70:0:0:71:0:6 ip 590:
sheilap-router-1.Stanford.EDU.ftp-data > 171.67.71.113.25234: . [tcp sum
ok] 27337:27873(536) ack 1 win 5840 (DF) [tos 0x8]  (ttl 63, id 64395, len
576)
                         4508 0240 fb8b 4000 3f06 0a7d c0a8 804a
                         ab43 4771 0014 6292 db84 9724 0000 00c7
                         5010 16d0 7a68 0000 10fe 66c6 a388 39e6
                         6b4d bffe e709 a533 13c8 9f2a 12d0 b817
                         b518 2934 0b8c 6ac3 2860 c922 7178 778e
                         c312 b2f9 7896 3f27 1d34 50a3 2bc9 b02e
                         b6b3 74dd 86d5 a8b6 2a95 6a21 3814 1061
                         63a7 622a 62e1 25eb 2f9a 99a6 4084 8024
                         248d 894d 48b3 b310 4f58 121e 60c3 0310
                         8074 289c 976c d191 3292 50b5 b686 bd94
                         9c13 5e09 4797 278f c51e 1bff ffff ffff
                         ffa8 b853 13f9 98eb 041c 852c 0c68 b945
                         c628 5164 8f90 d884 1833 c1ea 05ea 06c1
                         2009 02e7 43f4 1ca1 8e2c 970d 0a46 c996
			 ...                        ^^

> od -A d -j 27504 -N 16 -t x2 mysbnatan.mp3
0027504 2009 02e7 43f4 1ca1 8e2c 970d 0a46 c996
				   ^^

This matches exactly the bytes through the router, which seems correct.

Now for the FTP transfer:

11:36:59.200852 70:0:0:71:0:2 0:e0:81:4:26:d9 ip 1024: truncated-ip - 490
bytes missing! sheilap-router-1.Stanford.EDU.ftp-data >
elaine37.Stanford.EDU.54579: . 27513:28961(1448) ack 1 win 5840
<nop,nop,timestamp 382718757 256314999> (DF) [tos 0x8]  (ttl 63, id 53643,
len 1500)
                         4508 05dc d18b 4000 3f06 68e5 c0a8 804a
                         ab40 0f70 0014 d533 10fb 6dcf b4d5 bf16
                         8010 16d0 e1d5 0000 0101 080a 16cf d325
                         0f47 0e77 8e2c 970d 0a46 c996 067c 3e21
			 ...		  ^^

> od -A d -j 27504 -N 16 -t x2 sbnatan.mp3
0027504 2009 02e7 43f4 1ca1 8e2c 970a 46c9 9606
				   ^^??

So, even though the bytes from the router are identical as before, the
file created by FTP is actually MISSING the byte!

This is very strange, but I also have a hard time believing that the FTP
implementation is broken.  Is there anything I forgot to check???  Can
anyone explain this?

As a final check, I tried playing both files on an mp3 player, with no
noticable difference (possible skips in the FTP version, but hard to tell
if I just imagined them =).

Thanks,
Barrett

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Strange behavior with /usr/bin/ftp
Date: Sat, 6 Mar 2004 14:39:10 -0800
Lines: 130
Distribution: su
Message-ID: <Pine.LNX.4.44.0403061431170.18743-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403061319160.2287-100000@epic17.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078612751 4501 171.64.66.201 (6 Mar 2004 22:39:11 GMT)
X-Complaints-To: news@news.stanford.edu
To: Barrett Trask <btrask@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403061319160.2287-100000@epic17.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6893



 These values should match exactly

226 File send OK.
1342903 bytes received in 25.9 secs (51 Kbytes/sec)
ftp> quit
421 Timeout.
[casado@nity golden]$ ls -al sbnatan.mp3
-rw-r--r--    1 casado   users     1342903 Mar  6  2004 sbnatan.mp3
[casado@nity golden]$ md5sum sbnatan.mp3
1fec07f96585cd9e4659d71223201660  sbnatan.mp3
[casado@nity golden]$
 
 .m


> I mentioned in a previous post that I was using ftp to verify the
> correctness of my STCP layer transfer.  There was a slight difference in
> the files: what I assumed was the insertion of an extra byte
> (occasionally) into my transfer layer's file.
> 
> > cksum sbnatan.mp3 mysbnatan.mp3
> 367305469 1342870 sbnatan.mp3
> 776268028 1342903 mysbnatan.mp3
> 
> The file sizes differ as can be seen from the above output.  I seem to
> remember a post during the first assignment about the reported bytes
> during transfer differing from actual bytes, but I don't recall if it was
> ever explained.
> 
> > /usr/bin/ftp 192.168.128.74
> Connected to 192.168.128.74.
> 220 (vsFTPd 1.2.1)
> Name (192.168.128.74:btrask): anonymous
> 331 Please specify the password.
> Password:
> 230 Login successful.
> ftp> cd pub
> 250 Directory successfully changed.
> ftp> get sbnatan.mp3
> 200 PORT command successful. Consider using PASV.
> 150 Opening BINARY mode data connection for sbnatan.mp3 (1342903 bytes).
> 226 File send OK.
> local: sbnatan.mp3 remote: sbnatan.mp3
> 1342903 bytes received in 27 seconds (48.33 Kbytes/s)
> ftp> by
> 221 Goodbye.
> > ls -l sbnatan.mp3
> -rw-------    1 btrask   37        1342870 Mar  6 13:33 sbnatan.mp3
> 
> The reported number of bytes from FTP matched the file size of my STCP
> transfer, but not the file created as a result of the FTP.
> 
> The only "unofficial" component in this transfer is my router, but it did
> not make any difference in the result when running the provided sr.
> 
> My next step to debug this was to look at the file bytes and compare to
> the packet trace coming from the router:
> 
> > cmp -l -n 27520 sbnatan.mp3 mysbnatan.mp3
> 27516  12  15
> 27517 106  12
> 27518 311 106
> 27519 226 311
> 27520   6 226
> 
> For my transfer (with provided ftpcopy and my transport and router):
> 
> Packet from router (byte 27516 marked):
> 
> 17:55:17.249333 70:0:0:71:0:5 70:0:0:71:0:6 ip 590:
> sheilap-router-1.Stanford.EDU.ftp-data > 171.67.71.113.25234: . [tcp sum
> ok] 27337:27873(536) ack 1 win 5840 (DF) [tos 0x8]  (ttl 63, id 64395, len
> 576)
>                          4508 0240 fb8b 4000 3f06 0a7d c0a8 804a
>                          ab43 4771 0014 6292 db84 9724 0000 00c7
>                          5010 16d0 7a68 0000 10fe 66c6 a388 39e6
>                          6b4d bffe e709 a533 13c8 9f2a 12d0 b817
>                          b518 2934 0b8c 6ac3 2860 c922 7178 778e
>                          c312 b2f9 7896 3f27 1d34 50a3 2bc9 b02e
>                          b6b3 74dd 86d5 a8b6 2a95 6a21 3814 1061
>                          63a7 622a 62e1 25eb 2f9a 99a6 4084 8024
>                          248d 894d 48b3 b310 4f58 121e 60c3 0310
>                          8074 289c 976c d191 3292 50b5 b686 bd94
>                          9c13 5e09 4797 278f c51e 1bff ffff ffff
>                          ffa8 b853 13f9 98eb 041c 852c 0c68 b945
>                          c628 5164 8f90 d884 1833 c1ea 05ea 06c1
>                          2009 02e7 43f4 1ca1 8e2c 970d 0a46 c996
> 			 ...                        ^^
> 
> > od -A d -j 27504 -N 16 -t x2 mysbnatan.mp3
> 0027504 2009 02e7 43f4 1ca1 8e2c 970d 0a46 c996
> 				   ^^
> 
> This matches exactly the bytes through the router, which seems correct.
> 
> Now for the FTP transfer:
> 
> 11:36:59.200852 70:0:0:71:0:2 0:e0:81:4:26:d9 ip 1024: truncated-ip - 490
> bytes missing! sheilap-router-1.Stanford.EDU.ftp-data >
> elaine37.Stanford.EDU.54579: . 27513:28961(1448) ack 1 win 5840
> <nop,nop,timestamp 382718757 256314999> (DF) [tos 0x8]  (ttl 63, id 53643,
> len 1500)
>                          4508 05dc d18b 4000 3f06 68e5 c0a8 804a
>                          ab40 0f70 0014 d533 10fb 6dcf b4d5 bf16
>                          8010 16d0 e1d5 0000 0101 080a 16cf d325
>                          0f47 0e77 8e2c 970d 0a46 c996 067c 3e21
> 			 ...		  ^^
> 
> > od -A d -j 27504 -N 16 -t x2 sbnatan.mp3
> 0027504 2009 02e7 43f4 1ca1 8e2c 970a 46c9 9606
> 				   ^^??
> 
> So, even though the bytes from the router are identical as before, the
> file created by FTP is actually MISSING the byte!
> 
> This is very strange, but I also have a hard time believing that the FTP
> implementation is broken.  Is there anything I forgot to check???  Can
> anyone explain this?
> 
> As a final check, I tried playing both files on an mp3 player, with no
> noticable difference (possible skips in the FTP version, but hard to tell
> if I just imagined them =).
> 
> Thanks,
> Barrett
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: HW4 questions
Date: Sat, 6 Mar 2004 15:02:43 -0800
Lines: 18
Distribution: su
Message-ID: <c2dlar$5sg$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc507.stanford.edu
X-Trace: news.Stanford.EDU 1078614171 6032 128.12.197.7 (6 Mar 2004 23:02: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:6894

If I am using my transport layer, that requires no modification? (assuming
it works)

If I am using my ftp client, I need to modify it to support those new
command line args?  Once I pass those args to sr_api_init, I don't need them
anymore?

Do I need to specify a routing table for my ftpclient?  If so, what would it
look like?

If I am using your router, I don't need to do anything except grab the
routing table I used from HW3?

Thanks,

Justin


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ftpcopy_vns results
Date: Sat, 6 Mar 2004 15:12:02 -0800
Lines: 43
Distribution: su
Message-ID: <Pine.LNX.4.44.0403061510160.30448-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403052009230.7885-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 1078614724 6563 171.64.66.201 (6 Mar 2004 23:12:04 GMT)
X-Complaints-To: news@news.stanford.edu
To: Boris Senderzon <senderzo@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403052009230.7885-100000@epic9.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6895


 Boris,

 I can't reproduce this error, seems to work fine for me:

OK: 59465 bytes copied
elaine37:~/projects/hw1> ls
Makefile  boris    ftpcopy.c   ftpparse.h  grading_src  myftplib.h  purify.output  rfc959.h  socket_imp.c  socket_imp.o
README    ftpcopy  ftpparse.c  ftpparse.o  myftplib.c   myftplib.o  rfc959.c       rfc959.o  socket_imp.h  tmp
elaine37:~/projects/hw1> cd boris/
elaine37:~/projects/hw1/boris> ls
comm-amiga.ch  comm-man.ch  comm-ql.ch   ctang-bs.ch   ctang-ql.ch   cweav-bs.ch   cweav-ql.ch   examples
comm-bs.ch     comm-os2.ch  comm-vms.ch  ctang-man.ch  ctang-vms.ch  cweav-man.ch  cweav-vms.ch
comm-mac.ch    comm-pc.ch   comm-w32.ch  ctang-pc.ch   ctang-w32.ch  cweav-pc.ch   cweav-w32.ch
elaine37:~/projects/hw1/boris> cd examples/
elaine37:~/projects/hw1/boris/examples> ls
extex.ch  wc-dos.ch  wmer-os2.ch  wmerg-pc.ch

 :-/

 .m


> I used reference ftpcopy_vns that uses passive mode (provided by Matthew)
> and I'm not getting the same results as with my ftpcopy from hw 1.
> 
> I execute ./ftpcopy ch 1 ftp.cs.stanford.edu . /pub/cweb
> Using my ftpcopy which passes hw1 test script, I get a bunch of .ch
> files and a directory "examples" which contains more .ch files.
> This is exactly the output expected if one looks at directory structure
> in the ftp.cs.stanford.edu
> 
> With reference ftpcopy_vns, "examples" directory and its contents is not
> transfered.  "examples" is a real directory not a symbolic link.
> All other test cases from hw1 are correct.  Is it the case of
> "off by one" error?
> 
> Thanks.
> Boris.
> 
> 
> 

.

Path: shelby.stanford.edu!epic17.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Strange behavior with /usr/bin/ftp
Date: Sat, 6 Mar 2004 15:41:29 -0800
Lines: 36
Distribution: su
Message-ID: <Pine.GSO.4.44.0403061536100.3567-100000@epic17.Stanford.EDU>
References: <Pine.GSO.4.44.0403061319160.2287-100000@epic17.Stanford.EDU>
 <Pine.LNX.4.44.0403061431170.18743-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: epic17.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078616490 8116 171.64.15.52 (6 Mar 2004 23:41:30 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0403061431170.18743-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6896

On Sat, 6 Mar 2004, Martin Casado wrote:

>
>
>  These values should match exactly
>
> 226 File send OK.
> 1342903 bytes received in 25.9 secs (51 Kbytes/sec)
> ftp> quit
> 421 Timeout.
> [casado@nity golden]$ ls -al sbnatan.mp3
> -rw-r--r--    1 casado   users     1342903 Mar  6  2004 sbnatan.mp3
> [casado@nity golden]$ md5sum sbnatan.mp3
> 1fec07f96585cd9e4659d71223201660  sbnatan.mp3
> [casado@nity golden]$
>
>  .m

My result matches the result above (my STCP and SR (provided ftpcopy)).

The result obtained by /usr/bin/ftp was (seemingly) incorrect.  It
produced the same result over my router or the provided binary.

> md5sum mysbnatan.mp3
1fec07f96585cd9e4659d71223201660  mysbnatan.mp3
> md5sum sbnatan.mp3
43e4f4e2e0d14e4f0e196fa97c891ac2  sbnatan.mp3

My question was: can there be something going wrong with the FTP
implementation in /usr/bin/ftp?

I don't know if it matters, but I was running on elaine37.

Thanks,
Barrett

.

Path: shelby.stanford.edu!not-for-mail
From: "Michael Lyubomirskiy" <lyubomir@stanford.edu>
Newsgroups: su.class.cs244a
Subject: is ftp daemon sending a fin after sending list data?
Date: Sat, 6 Mar 2004 15:44:48 -0800
Lines: 9
Distribution: su
Message-ID: <c2dnpl$84d$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-50491.stanford.edu
X-Trace: news.Stanford.EDU 1078616693 8333 128.12.51.110 (6 Mar 2004 23:44: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:6897

from my logs, it appears that ftp daemon never sends a fin after completing
sending list data through a connection. It just sends the last piece of list
data, and then hangs, causing lots of timeouts for the socket. So as a
result my ftp client just hangs. I have checked that in stcp_wait_for_event
ctx->close_requested really is always 0.
Am I doing something obviously wrong here? Does everybody else see those
fins?


.

Path: shelby.stanford.edu!not-for-mail
From: "jsilver" <jmsilver@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Pinging/Tracerouting to our host
Date: Sat, 6 Mar 2004 15:47:33 -0800
Lines: 4
Distribution: su
Message-ID: <c2dnut$8b8$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078616864 8552 127.0.0.1 (6 Mar 2004 23: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:6898

I can't ping or traceroute to my vhost, although these do work for my
internal ftp server.  Is this the expected behavior?


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Strange behavior with /usr/bin/ftp
Date: Sat, 6 Mar 2004 16:00:23 -0800
Lines: 44
Distribution: su
Message-ID: <Pine.LNX.4.44.0403061558560.17247-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403061319160.2287-100000@epic17.Stanford.EDU>
 <Pine.LNX.4.44.0403061431170.18743-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0403061536100.3567-100000@epic17.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078617625 9341 171.64.66.201 (7 Mar 2004 00:00:25 GMT)
X-Complaints-To: news@news.stanford.edu
To: Barrett Trask <btrask@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403061536100.3567-100000@epic17.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6899


> On Sat, 6 Mar 2004, Martin Casado wrote:
> 
> >
> >
> >  These values should match exactly
> >
> > 226 File send OK.
> > 1342903 bytes received in 25.9 secs (51 Kbytes/sec)
> > ftp> quit
> > 421 Timeout.
> > [casado@nity golden]$ ls -al sbnatan.mp3
> > -rw-r--r--    1 casado   users     1342903 Mar  6  2004 sbnatan.mp3
> > [casado@nity golden]$ md5sum sbnatan.mp3
> > 1fec07f96585cd9e4659d71223201660  sbnatan.mp3
> > [casado@nity golden]$
> >
> >  .m
> 
> My result matches the result above (my STCP and SR (provided ftpcopy)).
> 
> The result obtained by /usr/bin/ftp was (seemingly) incorrect.  It
> produced the same result over my router or the provided binary.
> 
> > md5sum mysbnatan.mp3
> 1fec07f96585cd9e4659d71223201660  mysbnatan.mp3
> > md5sum sbnatan.mp3
> 43e4f4e2e0d14e4f0e196fa97c891ac2  sbnatan.mp3
> 
> My question was: can there be something going wrong with the FTP
> implementation in /usr/bin/ftp?

 This seems pretty far fetched to me ... you test this by ftping to
 vns-app-1 directly.

 .m
 
> I don't know if it matters, but I was running on elaine37.
> 
> Thanks,
> Barrett
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Pinging/Tracerouting to our host
Date: Sat, 6 Mar 2004 16:01:54 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0403061600450.17247-100000@Xenon.Stanford.EDU>
References: <c2dnut$8b8$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 1078617717 9434 171.64.66.201 (7 Mar 2004 00:01:57 GMT)
X-Complaints-To: news@news.stanford.edu
To: jsilver <jmsilver@stanford.edu>
In-Reply-To: <c2dnut$8b8$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6900


 You don't need to worry about tracrouting to/pinging vhost.

 .m

> I can't ping or traceroute to my vhost, although these do work for my
> internal ftp server.  Is this the expected behavior?
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: HW4 questions
Date: Sat, 6 Mar 2004 16:06:14 -0800
Lines: 30
Distribution: su
Message-ID: <Pine.LNX.4.44.0403061604090.18648-100000@Xenon.Stanford.EDU>
References: <c2dlar$5sg$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 1078617976 9637 171.64.66.201 (7 Mar 2004 00:06:16 GMT)
X-Complaints-To: news@news.stanford.edu
To: Justin <justinfw@stanford.edu>
In-Reply-To: <c2dlar$5sg$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6901


> If I am using my transport layer, that requires no modification? (assuming
> it works)

 correct.
 
> If I am using my ftp client, I need to modify it to support those new
> command line args?  Once I pass those args to sr_api_init, I don't need them
> anymore?

 correct.

> Do I need to specify a routing table for my ftpclient?  If so, what would it
> look like?

 yes and it should consist of one correct default route.

> If I am using your router, I don't need to do anything except grab the
> routing table I used from HW3?

 routing table is different now.

> Thanks,

 most welcome

> Justin

  martin

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: mylocalip
Date: Sat, 6 Mar 2004 20:15:19 -0800
Lines: 7
Distribution: su
Message-ID: <c2e7ji$pg3$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1078632882 26115 128.12.189.163 (7 Mar 2004 04:14: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:6902

Hi,
when we call mylocalip, what exactly is the peer_addr we pass to the
function?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sr_api_init
Date: Sat, 6 Mar 2004 20:49:14 -0800
Lines: 11
Distribution: su
Message-ID: <c2e9kl$r7u$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc507.stanford.edu
X-Trace: news.Stanford.EDU 1078634965 27902 128.12.197.7 (7 Mar 2004 04:49: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:6903

When I try and call this fn, it says "undefined reference to sr_api_init",
but I have

#include "mysock_vns.h"


What's wrong?

-Justin


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: sr_api_init
Date: Sat, 6 Mar 2004 21:17:59 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.LNX.4.44.0403062117300.9817-100000@Xenon.Stanford.EDU>
References: <c2e9kl$r7u$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 1078636681 29427 171.64.66.201 (7 Mar 2004 05:18:01 GMT)
X-Complaints-To: news@news.stanford.edu
To: Justin <justinfw@stanford.edu>
In-Reply-To: <c2e9kl$r7u$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6904


 undefined reference is a linker error.  You will have to link with the
 sr_transport library.

 .m

> When I try and call this fn, it says "undefined reference to sr_api_init",
> but I have
> 
> #include "mysock_vns.h"
> 
> 
> What's wrong?
> 
> -Justin
> 
> 
> 

.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: sr_api_init
Date: Sun, 7 Mar 2004 05:18:29 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c2ebb5$so0$1@news.Stanford.EDU>
References: <c2e9kl$r7u$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1078636709 29440 171.64.15.119 (7 Mar 2004 05:18:29 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6905


>When I try and call this fn, it says "undefined reference to sr_api_init",
>but I have

>#include "mysock_vns.h"

Sounds like a link error--are you linking with $(VNS_GLUE) etc?
Are you doing 'make all' or 'make all_hw4'?  (If you just change your
ftpcopy code and try to build ftpcopy_tcp, it will complain about a
link error--'make all_hw4' or 'make ftpcopy_vns' should work around this).

.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: mylocalip
Date: Sun, 7 Mar 2004 05:19:55 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c2ebdr$sqp$1@news.Stanford.EDU>
References: <c2e7ji$pg3$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1078636795 29529 171.64.15.119 (7 Mar 2004 05:19:55 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6906


>when we call mylocalip, what exactly is the peer_addr we pass to the
>function?

the address of the peer for which you want to find the local IP address.
the function looks up the local interface out of which packets to that
peer are sent (in the VNS case, anyway), and returns that.

.

Path: shelby.stanford.edu!elaine0.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Strange behavior with /usr/bin/ftp
Date: Sun, 7 Mar 2004 05:21:00 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c2ebfs$sus$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403061319160.2287-100000@epic17.Stanford.EDU>
NNTP-Posting-Host: elaine0.stanford.edu
X-Trace: news.Stanford.EDU 1078636860 29660 171.64.15.119 (7 Mar 2004 05:21:00 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6907


>The file sizes differ as can be seen from the above output.  I seem to
>remember a post during the first assignment about the reported bytes
>during transfer differing from actual bytes, but I don't recall if it was
>ever explained.

That was due to people trying to transfer the MP3 in ASCII mode, which
seems different than this case.

.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sr_api_init
Date: Sat, 6 Mar 2004 21:29:03 -0800
Lines: 20
Distribution: su
Message-ID: <c2ebvb$4h$1@news.Stanford.EDU>
References: <c2e9kl$r7u$1@news.Stanford.EDU> <c2ebb5$so0$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc507.stanford.edu
X-Trace: news.Stanford.EDU 1078637355 145 128.12.197.7 (7 Mar 2004 05:29: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:6908

Ah, that worked.

-Justin

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c2ebb5$so0$1@news.Stanford.EDU...
>
> >When I try and call this fn, it says "undefined reference to
sr_api_init",
> >but I have
>
> >#include "mysock_vns.h"
>
> Sounds like a link error--are you linking with $(VNS_GLUE) etc?
> Are you doing 'make all' or 'make all_hw4'?  (If you just change your
> ftpcopy code and try to build ftpcopy_tcp, it will complain about a
> link error--'make all_hw4' or 'make ftpcopy_vns' should work around this).
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sr_ip_route.c
Date: Sat, 6 Mar 2004 21:29:48 -0800
Lines: 26
Distribution: su
Message-ID: <c2ec0n$60$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc507.stanford.edu
X-Trace: news.Stanford.EDU 1078637399 192 128.12.197.7 (7 Mar 2004 05: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:6909

When I try and connect my ftp client, I get...



justinfw:saga13:9:26pm:~/private/cs244a/HW4# ./your.ftpcopy_vns -t 134 -v
vhost -r ftp_rtable .txt 2 33267@saga13.stanford.edu ~/public

Assertion failed: sr, file sr_ip_route.c, line 123

Abort



I have already connected the router and can access the router and ftp server
behind it.  I don't have access to sr_ip_route.c, so i don't know why it's
asserting.



Thanks,



Justin


.

Path: shelby.stanford.edu!saga15.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: peer_addr for mylocalip
Date: Sat, 6 Mar 2004 21:49:41 -0800
Lines: 8
Distribution: su
Message-ID: <Pine.GSO.4.44.0403062147490.8929-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 1078638583 1476 171.64.15.145 (7 Mar 2004 05:49:43 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6910

I'm not clear on what the peer_addr were supposed to pass to mylocalip
is supposed to be. Do we pass the local host IP address and get back the
IP of the virtual host in the VNS?

Thanks,

Ed

.

Path: shelby.stanford.edu!saga15.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: peer_addr for mylocalip
Date: Sat, 6 Mar 2004 21:53:44 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.GSO.4.44.0403062152230.8981-100000@saga15.Stanford.EDU>
References: <Pine.GSO.4.44.0403062147490.8929-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 1078638826 1752 171.64.15.145 (7 Mar 2004 05:53:46 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0403062147490.8929-100000@saga15.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6911

This question was just answered.
Sorry I missed the previous post.

On Sat, 6 Mar 2004, Edward Chron wrote:

> Date: Sat, 6 Mar 2004 21:49:41 -0800
> From: Edward Chron <echron@stanford.edu>
> Newsgroups: su.class.cs244a
> Subject: peer_addr for mylocalip
>
> I'm not clear on what the peer_addr were supposed to pass to mylocalip
> is supposed to be. Do we pass the local host IP address and get back the
> IP of the virtual host in the VNS?
>
> Thanks,
>
> Ed
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS4 questions
Date: Sat, 6 Mar 2004 22:00:23 -0800
Organization: CS Masters Program
Lines: 16
Distribution: su
Message-ID: <c2edps$24h$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078639230 2193 127.0.0.1 (7 Mar 2004 06:00: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:6912

Problem 3 (Q 44 p. 159), part C:
  1. Does "all the remaining backoff races" mean "all the races between A
and B, until B gives up"?
  2. Instead of giving a lower bound on the probability, can we just give an
expression of the *exact* probability, assuming particular values for the
total # of retries B will attempt, and the maximum value of "k" in the
exponential backoff algorithm?

Problem 5:
  1. Do the edges in this graph represent LANs with attached hosts? (I
haven't seen this notation before, either in lecture or in the book.)
  2. If so, does this mean it is a requirement that all edges are reachable,
but it is not a requirement that all switches are reachable?



.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: sr_ip_route.c
Date: Sat, 6 Mar 2004 23:15:23 -0800
Lines: 33
Distribution: su
Message-ID: <Pine.LNX.4.44.0403062314320.16560-100000@Xenon.Stanford.EDU>
References: <c2ec0n$60$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 1078643726 6025 171.64.66.201 (7 Mar 2004 07:15:26 GMT)
X-Complaints-To: news@news.stanford.edu
To: Justin <justinfw@stanford.edu>
In-Reply-To: <c2ec0n$60$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6913


 Does this happen when you use our stcp or yours? (or both?)

 .m

> When I try and connect my ftp client, I get...
> 
> 
> 
> justinfw:saga13:9:26pm:~/private/cs244a/HW4# ./your.ftpcopy_vns -t 134 -v
> vhost -r ftp_rtable .txt 2 33267@saga13.stanford.edu ~/public
> 
> Assertion failed: sr, file sr_ip_route.c, line 123
> 
> Abort
> 
> 
> 
> I have already connected the router and can access the router and ftp server
> behind it.  I don't have access to sr_ip_route.c, so i don't know why it's
> asserting.
> 
> 
> 
> Thanks,
> 
> 
> 
> Justin
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: libftpcopy_vns_pasv.a updated
Date: Sat, 6 Mar 2004 23:16:31 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.LNX.4.44.0403062315340.18326-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 1078643794 6065 171.64.66.201 (7 Mar 2004 07:16:34 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6914


 As Boris pointed out, there was a problem with libftpcopy_vns_pasv.a.
 This has been fixed and the library has been updated.

 Thanks,
 Martin

.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sr_ip_route.c
Date: Sat, 6 Mar 2004 23:20:55 -0800
Lines: 46
Distribution: su
Message-ID: <c2eih4$687$1@news.Stanford.EDU>
References: <c2ec0n$60$1@news.Stanford.EDU> <Pine.LNX.4.44.0403062314320.16560-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: dn800cc507.stanford.edu
X-Trace: news.Stanford.EDU 1078644068 6407 128.12.197.7 (7 Mar 2004 07:21: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:6915

I happens when I run ./your.ftpcopy_vns and ./ftpcopy_vns (this is your
version, right?)

-Justin


"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0403062314320.16560-100000@Xenon.Stanford.EDU...
>
>  Does this happen when you use our stcp or yours? (or both?)
>
>  .m
>
> > When I try and connect my ftp client, I get...
> >
> >
> >
> > justinfw:saga13:9:26pm:~/private/cs244a/HW4# ./your.ftpcopy_vns -t
134 -v
> > vhost -r ftp_rtable .txt 2 33267@saga13.stanford.edu ~/public
> >
> > Assertion failed: sr, file sr_ip_route.c, line 123
> >
> > Abort
> >
> >
> >
> > I have already connected the router and can access the router and ftp
server
> > behind it.  I don't have access to sr_ip_route.c, so i don't know why
it's
> > asserting.
> >
> >
> >
> > Thanks,
> >
> >
> >
> > Justin
> >
> >
> >
>


.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Echo
Date: Sun, 7 Mar 2004 07:32:39 +0000 (UTC)
Lines: 29
Distribution: su
Message-ID: <c2ej6n$6c2$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine18.stanford.edu
X-Trace: news.Stanford.EDU 1078644759 6530 171.64.15.83 (7 Mar 2004 07:32:39 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:6916

Just how is STCP echo supposed to work?  I don't see any explanation in the 
assignment.

I try entering stcp_echo_server -v vhost -t 162 in one window.  I try 
stcp_echo_client -t 162 vhost and get:

vns server closed session
Reason: reservehost failed
recv(..):sr_client.c::sr_read_from_server: Bad file number
Error: could not get hardware information from the server[TODO]: 
sr_vns_integ_destroy
can't initialise VNS subsystem

If I try stcp_echo_client -t 162 -v vhost, I get 

usage: stcp_echo_client [-U] [VNS options] remote-host

I also tried telnet 7 vhost and got

vhost: bad port number


This is using all three reference layers.

How do I use the echo server and client?  For that matter (yes, this may be
a stupid question), just what is an echo and server client anyway?


Tyrone
.

Path: shelby.stanford.edu!elaine37.Stanford.EDU!btrask
From: Barrett Trask <btrask@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Strange behavior with /usr/bin/ftp
Date: Sun, 7 Mar 2004 09:49:33 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.GSO.4.44.0403070946470.7331-100000@elaine37.Stanford.EDU>
References: <Pine.GSO.4.44.0403061319160.2287-100000@epic17.Stanford.EDU>
 <c2ebfs$sus$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine37.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078681775 11859 171.64.15.112 (7 Mar 2004 17:49:35 GMT)
X-Complaints-To: news@news.stanford.edu
To: Matthew Jonathan Holliman <holliman@Stanford.EDU>
In-Reply-To: <c2ebfs$sus$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6917

On Sun, 7 Mar 2004, Matthew Jonathan Holliman wrote:

>
> >The file sizes differ as can be seen from the above output.  I seem to
> >remember a post during the first assignment about the reported bytes
> >during transfer differing from actual bytes, but I don't recall if it was
> >ever explained.
>
> That was due to people trying to transfer the MP3 in ASCII mode, which
> seems different than this case.
>
>

I think this is it!  Even though the ftp output lead me to believe it was
using binary mode, I think it is incorrect.  When I explicitly set the
mode, the file transfer was correct.

Lesson learned: don't trust the default mode!

-Barrett

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftpcopy_vns results
Date: Sun, 7 Mar 2004 10:13:48 -0800
Lines: 52
Distribution: su
Message-ID: <Pine.GSO.4.44.0403071011310.28177-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0403052009230.7885-100000@epic9.Stanford.EDU>
 <Pine.LNX.4.44.0403061510160.30448-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 1078683230 13426 171.64.15.118 (7 Mar 2004 18:13:50 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0403061510160.30448-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6918

I encountered the same problem with the "example" directory missing.  I
even
tried the STCP stack + ftpcopy provided by TA and the result is the same.

-Laura
On Sat, 6 Mar 2004, Martin Casado wrote:

>
>  Boris,
>
>  I can't reproduce this error, seems to work fine for me:
>
> OK: 59465 bytes copied
> elaine37:~/projects/hw1> ls
> Makefile  boris    ftpcopy.c   ftpparse.h  grading_src  myftplib.h  purify.output  rfc959.h  socket_imp.c  socket_imp.o
> README    ftpcopy  ftpparse.c  ftpparse.o  myftplib.c   myftplib.o  rfc959.c       rfc959.o  socket_imp.h  tmp
> elaine37:~/projects/hw1> cd boris/
> elaine37:~/projects/hw1/boris> ls
> comm-amiga.ch  comm-man.ch  comm-ql.ch   ctang-bs.ch   ctang-ql.ch   cweav-bs.ch   cweav-ql.ch   examples
> comm-bs.ch     comm-os2.ch  comm-vms.ch  ctang-man.ch  ctang-vms.ch  cweav-man.ch  cweav-vms.ch
> comm-mac.ch    comm-pc.ch   comm-w32.ch  ctang-pc.ch   ctang-w32.ch  cweav-pc.ch   cweav-w32.ch
> elaine37:~/projects/hw1/boris> cd examples/
> elaine37:~/projects/hw1/boris/examples> ls
> extex.ch  wc-dos.ch  wmer-os2.ch  wmerg-pc.ch
>
>  :-/
>
>  .m
>
>
> > I used reference ftpcopy_vns that uses passive mode (provided by Matthew)
> > and I'm not getting the same results as with my ftpcopy from hw 1.
> >
> > I execute ./ftpcopy ch 1 ftp.cs.stanford.edu . /pub/cweb
> > Using my ftpcopy which passes hw1 test script, I get a bunch of .ch
> > files and a directory "examples" which contains more .ch files.
> > This is exactly the output expected if one looks at directory structure
> > in the ftp.cs.stanford.edu
> >
> > With reference ftpcopy_vns, "examples" directory and its contents is not
> > transfered.  "examples" is a real directory not a symbolic link.
> > All other test cases from hw1 are correct.  Is it the case of
> > "off by one" error?
> >
> > Thanks.
> > Boris.
> >
> >
> >
>
>

.

Path: shelby.stanford.edu!elaine22.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: initial rto value
Date: Sun, 7 Mar 2004 12:25:40 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.GSO.4.44.0403071221001.5458-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 1078691142 21417 171.64.15.87 (7 Mar 2004 20:25:42 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6919


I'm trying to pick an initial rto value for my transport layer.
I am using Karn's algorithm, so i only count non-retransmitted packets
in the calculation.

I'm thinking it should be relatively large, since if i pick it too small
and the test case tests somewhere half way around the world, i'll
never have a packet that is not retransmitted...but I'm not sure
what is a reasonable 'high' value...For now, I have 1 second, is that
big enough?

--vishal


.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: stcp_network_recv() changes the incoming seq number
Date: Sun, 7 Mar 2004 13:00:05 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.GSO.4.44.0403071257300.1167-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 1078693206 23656 171.64.15.118 (7 Mar 2004 21:00:06 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6920


I single-step my transport.c code and found the after calling the
stcp_network_recv(), the incoming packet's th_seq does not equal to the
one shown in the ethereal trace.  What is done in stcp_network_recv for
the th_seq?

Still investigating...  Any hint/suggestion is appreciated.
-Laura

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS4 questions
Date: Sun, 7 Mar 2004 13:30:08 -0800
Lines: 25
Distribution: su
Message-ID: <Pine.LNX.4.44.0403071314460.17788-100000@Xenon.Stanford.EDU>
References: <c2edps$24h$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 1078695011 25427 171.64.66.201 (7 Mar 2004 21:30:11 GMT)
X-Complaints-To: news@news.stanford.edu
To: Greg Friedman <gregory.friedman@cs.stanford.edu>
In-Reply-To: <c2edps$24h$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6921


> Problem 3 (Q 44 p. 159), part C:
>   1. Does "all the remaining backoff races" mean "all the races between A
> and B, until B gives up"?


>   2. Instead of giving a lower bound on the probability, can we just give an
> expression of the *exact* probability, assuming particular values for the
> total # of retries B will attempt, and the maximum value of "k" in the
> exponential backoff algorithm?

 Unfortunately I don't have the third edition book.  Does anyone know if it
 the questions are the same in the 2nd edition? 
 
> 
> Problem 5:
>   1. Do the edges in this graph represent LANs with attached hosts? (I
> haven't seen this notation before, either in lecture or in the book.)

 The nodes are bridges (switches) and the edges are links between them (not
 LANS).   You are to build a spanning tree as demonstrated in the slides such
 that each bridge is in the tree.

 .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: sr_ip_route.c
Date: Sun, 7 Mar 2004 13:30:40 -0800
Lines: 53
Distribution: su
Message-ID: <Pine.LNX.4.44.0403071330270.17788-100000@Xenon.Stanford.EDU>
References: <c2ec0n$60$1@news.Stanford.EDU> <Pine.LNX.4.44.0403062314320.16560-100000@Xenon.Stanford.EDU>
 <c2eih4$687$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 1078695042 25441 171.64.66.201 (7 Mar 2004 21:30:42 GMT)
X-Complaints-To: news@news.stanford.edu
To: Justin <justinfw@stanford.edu>
In-Reply-To: <c2eih4$687$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6922


 Whose STCP?

 .m

> I happens when I run ./your.ftpcopy_vns and ./ftpcopy_vns (this is your
> version, right?)
> 
> -Justin
> 
> 
> "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> news:Pine.LNX.4.44.0403062314320.16560-100000@Xenon.Stanford.EDU...
> >
> >  Does this happen when you use our stcp or yours? (or both?)
> >
> >  .m
> >
> > > When I try and connect my ftp client, I get...
> > >
> > >
> > >
> > > justinfw:saga13:9:26pm:~/private/cs244a/HW4# ./your.ftpcopy_vns -t
> 134 -v
> > > vhost -r ftp_rtable .txt 2 33267@saga13.stanford.edu ~/public
> > >
> > > Assertion failed: sr, file sr_ip_route.c, line 123
> > >
> > > Abort
> > >
> > >
> > >
> > > I have already connected the router and can access the router and ftp
> server
> > > behind it.  I don't have access to sr_ip_route.c, so i don't know why
> it's
> > > asserting.
> > >
> > >
> > >
> > > Thanks,
> > >
> > >
> > >
> > > Justin
> > >
> > >
> > >
> >
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ftpcopy_vns results
Date: Sun, 7 Mar 2004 13:32:18 -0800
Lines: 59
Distribution: su
Message-ID: <Pine.LNX.4.44.0403071331430.17788-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403052009230.7885-100000@epic9.Stanford.EDU>
 <Pine.LNX.4.44.0403061510160.30448-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0403071011310.28177-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 1078695141 25507 171.64.66.201 (7 Mar 2004 21:32:21 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403071011310.28177-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6923


 Check my above post.  The pasv ftcopy library was patched. 

 .m

> I encountered the same problem with the "example" directory missing.  I
> even
> tried the STCP stack + ftpcopy provided by TA and the result is the same.
> 
> -Laura
> On Sat, 6 Mar 2004, Martin Casado wrote:
> 
> >
> >  Boris,
> >
> >  I can't reproduce this error, seems to work fine for me:
> >
> > OK: 59465 bytes copied
> > elaine37:~/projects/hw1> ls
> > Makefile  boris    ftpcopy.c   ftpparse.h  grading_src  myftplib.h  purify.output  rfc959.h  socket_imp.c  socket_imp.o
> > README    ftpcopy  ftpparse.c  ftpparse.o  myftplib.c   myftplib.o  rfc959.c       rfc959.o  socket_imp.h  tmp
> > elaine37:~/projects/hw1> cd boris/
> > elaine37:~/projects/hw1/boris> ls
> > comm-amiga.ch  comm-man.ch  comm-ql.ch   ctang-bs.ch   ctang-ql.ch   cweav-bs.ch   cweav-ql.ch   examples
> > comm-bs.ch     comm-os2.ch  comm-vms.ch  ctang-man.ch  ctang-vms.ch  cweav-man.ch  cweav-vms.ch
> > comm-mac.ch    comm-pc.ch   comm-w32.ch  ctang-pc.ch   ctang-w32.ch  cweav-pc.ch   cweav-w32.ch
> > elaine37:~/projects/hw1/boris> cd examples/
> > elaine37:~/projects/hw1/boris/examples> ls
> > extex.ch  wc-dos.ch  wmer-os2.ch  wmerg-pc.ch
> >
> >  :-/
> >
> >  .m
> >
> >
> > > I used reference ftpcopy_vns that uses passive mode (provided by Matthew)
> > > and I'm not getting the same results as with my ftpcopy from hw 1.
> > >
> > > I execute ./ftpcopy ch 1 ftp.cs.stanford.edu . /pub/cweb
> > > Using my ftpcopy which passes hw1 test script, I get a bunch of .ch
> > > files and a directory "examples" which contains more .ch files.
> > > This is exactly the output expected if one looks at directory structure
> > > in the ftp.cs.stanford.edu
> > >
> > > With reference ftpcopy_vns, "examples" directory and its contents is not
> > > transfered.  "examples" is a real directory not a symbolic link.
> > > All other test cases from hw1 are correct.  Is it the case of
> > > "off by one" error?
> > >
> > > Thanks.
> > > Boris.
> > >
> > >
> > >
> >
> >
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: initial rto value
Date: Sun, 7 Mar 2004 13:34:17 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0403071332380.17788-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403071221001.5458-100000@elaine22.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078695260 25605 171.64.66.201 (7 Mar 2004 21:34:20 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403071221001.5458-100000@elaine22.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6924


 An initial RTE os 350 milliseconds seems to work just fine.

 .m

> 
> I'm trying to pick an initial rto value for my transport layer.
> I am using Karn's algorithm, so i only count non-retransmitted packets
> in the calculation.
> 
> I'm thinking it should be relatively large, since if i pick it too small
> and the test case tests somewhere half way around the world, i'll
> never have a packet that is not retransmitted...but I'm not sure
> what is a reasonable 'high' value...For now, I have 1 second, is that
> big enough?
> 
> --vishal
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS4 questions
Date: Sun, 7 Mar 2004 14:39:42 -0800
Organization: CS Masters Program
Lines: 37
Distribution: su
Message-ID: <c2g8bm$srg$1@news.Stanford.EDU>
References: <c2edps$24h$1@news.Stanford.EDU> <Pine.LNX.4.44.0403071314460.17788-100000@Xenon.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078699192 29552 127.0.0.1 (7 Mar 2004 22:39: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:6925

Hi Martin,

I have a couple of follow-up questions below.

Thanks,

Greg

"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0403071314460.17788-100000@Xenon.Stanford.EDU...
>
> > Problem 5:
> >   1. Do the edges in this graph represent LANs with attached hosts? (I
> > haven't seen this notation before, either in lecture or in the book.)
>
>  The nodes are bridges (switches) and the edges are links between them
(not
>  LANS).

I'm still a little confused. Should we not worry about the "designated
switch for a LAN" part of the spanning tree algorithm, since there are no
LANs in this graph? Doesn't this make part (c) of the question (marking
which switch ports are turned off) a lot less interesting, and in fact
redundant with part (b)? Or am I missing something?


>  You are to build a spanning tree as demonstrated in the slides such
>  that each bridge is in the tree.
>

Could you be specific (handout number and slides numbers) as to which slides
you're referring to? I thought Prof. McKeown described an algorithm (as did
the book) where all LANs had to be in the tree; in fact, some bridges can
actually be cut off from the tree in certain topologies.



.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: initial rto value
Date: Sun, 7 Mar 2004 14:57:47 -0800
Lines: 28
Distribution: su
Message-ID: <Pine.LNX.4.44.0403071457350.26735-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403071221001.5458-100000@elaine22.Stanford.EDU>
 <Pine.LNX.4.44.0403071332380.17788-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 1078700270 713 171.64.66.201 (7 Mar 2004 22:57:50 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.LNX.4.44.0403071332380.17788-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6926


 err that is an initial rto of 250 seconds.

 .m

> 
>  An initial RTE os 350 milliseconds seems to work just fine.
> 
>  .m
> 
> > 
> > I'm trying to pick an initial rto value for my transport layer.
> > I am using Karn's algorithm, so i only count non-retransmitted packets
> > in the calculation.
> > 
> > I'm thinking it should be relatively large, since if i pick it too small
> > and the test case tests somewhere half way around the world, i'll
> > never have a packet that is not retransmitted...but I'm not sure
> > what is a reasonable 'high' value...For now, I have 1 second, is that
> > big enough?
> > 
> > --vishal
> > 
> > 
> > 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS4 questions
Date: Sun, 7 Mar 2004 15:12:39 -0800
Lines: 44
Distribution: su
Message-ID: <Pine.LNX.4.44.0403071458090.26735-100000@Xenon.Stanford.EDU>
References: <c2edps$24h$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0403071314460.17788-100000@Xenon.Stanford.EDU>
 <c2g8bm$srg$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 1078701162 1822 171.64.66.201 (7 Mar 2004 23:12:42 GMT)
X-Complaints-To: news@news.stanford.edu
To: Greg Friedman <gregory.friedman@cs.stanford.edu>
In-Reply-To: <c2g8bm$srg$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6927


  I'm sorry I was mistaken.  The nodes are bridges, the links are LANs. you
  need full forwarding connectivity to the LANs in the spanning tree and it is
  possible that a bridge will not participate in the fowarding of frames.

  .m

> I have a couple of follow-up questions below.
> 
> Thanks,
> 
> Greg
> 
> "Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> news:Pine.LNX.4.44.0403071314460.17788-100000@Xenon.Stanford.EDU...
> >
> > > Problem 5:
> > >   1. Do the edges in this graph represent LANs with attached hosts? (I
> > > haven't seen this notation before, either in lecture or in the book.)
> >
> >  The nodes are bridges (switches) and the edges are links between them
> (not
> >  LANS).
> 
> I'm still a little confused. Should we not worry about the "designated
> switch for a LAN" part of the spanning tree algorithm, since there are no
> LANs in this graph? Doesn't this make part (c) of the question (marking
> which switch ports are turned off) a lot less interesting, and in fact
> redundant with part (b)? Or am I missing something?
> 
> 
> >  You are to build a spanning tree as demonstrated in the slides such
> >  that each bridge is in the tree.
> >
> 
> Could you be specific (handout number and slides numbers) as to which slides
> you're referring to? I thought Prof. McKeown described an algorithm (as did
> the book) where all LANs had to be in the tree; in fact, some bridges can
> actually be cut off from the tree in certain topologies.
> 
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Tony Hsieh <thsieh@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: sr_ip_route.c
Date: Sun, 07 Mar 2004 15:40:05 -0800
Lines: 64
Distribution: su
Message-ID: <404BB2D5.4020003@stanford.edu>
References: <c2ec0n$60$1@news.Stanford.EDU> <Pine.LNX.4.44.0403062314320.16560-100000@Xenon.Stanford.EDU> <c2eih4$687$1@news.Stanford.EDU> <Pine.LNX.4.44.0403071330270.17788-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: perch.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078702733 3378 171.64.75.22 (7 Mar 2004 23:38:53 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6928

i get this same assertion when I am trying to connect my ftpcopy using 
your STCP.  Any ideas?

Martin Casado wrote:
>  Whose STCP?
> 
>  .m
> 
> 
>>I happens when I run ./your.ftpcopy_vns and ./ftpcopy_vns (this is your
>>version, right?)
>>
>>-Justin
>>
>>
>>"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
>>news:Pine.LNX.4.44.0403062314320.16560-100000@Xenon.Stanford.EDU...
>>
>>> Does this happen when you use our stcp or yours? (or both?)
>>>
>>> .m
>>>
>>>
>>>>When I try and connect my ftp client, I get...
>>>>
>>>>
>>>>
>>>>justinfw:saga13:9:26pm:~/private/cs244a/HW4# ./your.ftpcopy_vns -t
>>>
>>134 -v
>>
>>>>vhost -r ftp_rtable .txt 2 33267@saga13.stanford.edu ~/public
>>>>
>>>>Assertion failed: sr, file sr_ip_route.c, line 123
>>>>
>>>>Abort
>>>>
>>>>
>>>>
>>>>I have already connected the router and can access the router and ftp
>>>
>>server
>>
>>>>behind it.  I don't have access to sr_ip_route.c, so i don't know why
>>>
>>it's
>>
>>>>asserting.
>>>>
>>>>
>>>>
>>>>Thanks,
>>>>
>>>>
>>>>
>>>>Justin
>>>>
>>>>
>>>>
>>>
>>
>>
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: initial rto value
Date: Sun, 7 Mar 2004 15:41:11 -0800
Lines: 9
Distribution: su
Message-ID: <c2gbu2$3ej$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403071221001.5458-100000@elaine22.Stanford.EDU> <Pine.LNX.4.44.0403071332380.17788-100000@Xenon.Stanford.EDU> <Pine.LNX.4.44.0403071457350.26735-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078702850 3539 128.12.61.97 (7 Mar 2004 23:40: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:6929

I hope you mean 250 milliseconds ;-)

>
>  err that is an initial rto of 250 seconds.
>
>  .m
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Ayaz" <ayaz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW4 Global IP Addresses
Date: Sun, 7 Mar 2004 16:03:28 -0800
Lines: 68
Distribution: su
Message-ID: <c2gd8o$4o0$1@news.Stanford.EDU>
References: <Pine.LNX.4.44.0403041556120.13328-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0403041712190.26247-100000@epic15.Stanford.EDU> <Pine.LNX.4.44.0403041756460.6505-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0403050017570.21100-100000@elaine43.Stanford.EDU> <Pine.LNX.4.44.0403050925170.12427-100000@Xenon.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078704218 4864 127.0.0.1 (8 Mar 2004 00:03:38 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
Xref: shelby.stanford.edu su.class.cs244a:6930

I still not sure on how the setup works.

I have an rtable file for the ftpcopy program that contains the following:
0.0.0.0 192.168.128.120 0.0.0.0  eth0

where 192.168.128.120 is the IP of the router's eth2.

How do we use this global IP?


"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0403050925170.12427-100000@Xenon.Stanford.EDU...
>
>  The only IP address that has changed is eth0 on vhost.  Everything else
is the
>  same.
>
>  ... ahh I see the confusion, the assignment says to debug using vrouter.
>  This will not work since vrouter has a 192.168 IP.  You will need to
>  use vhost through your router.  I'll change the description.
>
>  .m
>
> >
> > Should the same IP address be used at eth0 for vrouter?
> >
> > On Thu, 4 Mar 2004, Martin Casado wrote:
> >
> > >
> > >  Use it in place of your vhost IP.
> > >
> > >  .m
> > >
> > > > Martin,
> > > >
> > > > Should we use this address in place of our vhost IP (192.168.128.76
for
> > > > topo 113) or in addition to?
> > > >
> > > > Thanks,
> > > > Barrett
> > > >
> > > > On Thu, 4 Mar 2004, Martin Casado wrote:
> > > >
> > > > >
> > > > >  I've finished installing the global IP addresses on all
topologies.
> > > > >  eth0 of your topologie's vhost should now have an IP address of
the
> > > > >  form:
> > > > >
> > > > >  171.67.71.xxx (where xxx happens to be your topo id)
> > > > >
> > > > >  Please verify that this is correct when you connect to vhost.
> > > > >
> > > > >  Thanks,
> > > > >  Martin
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>


.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS4 - Q1: 49(b)
Date: Sun, 7 Mar 2004 16:10:09 -0800
Lines: 6
Distribution: su
Message-ID: <Pine.GSO.4.44.0403071608020.7851-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 1078704611 5279 171.64.15.118 (8 Mar 2004 00:10:11 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6931


Whta does it mean "some one of more of 2**20 networks"?

2**20 networks of 1024-host each?


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: sr_ip_route.c
Date: Sun, 7 Mar 2004 16:24:05 -0800
Lines: 73
Distribution: su
Message-ID: <Pine.LNX.4.44.0403071623200.31047-100000@Xenon.Stanford.EDU>
References: <c2ec0n$60$1@news.Stanford.EDU> <Pine.LNX.4.44.0403062314320.16560-100000@Xenon.Stanford.EDU>
 <c2eih4$687$1@news.Stanford.EDU> <Pine.LNX.4.44.0403071330270.17788-100000@Xenon.Stanford.EDU>
 <404BB2D5.4020003@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078705447 6350 171.64.66.201 (8 Mar 2004 00:24:07 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tony Hsieh <thsieh@stanford.edu>
In-Reply-To: <404BB2D5.4020003@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:6932


 That is two people.  I am unable to reproduce this error.  If one of
 you can come to my office or show up at office hours it will be easier
 to determine what may be going on.

 .m

> i get this same assertion when I am trying to connect my ftpcopy using 
> your STCP.  Any ideas?
> 
> Martin Casado wrote:
> >  Whose STCP?
> > 
> >  .m
> > 
> > 
> >>I happens when I run ./your.ftpcopy_vns and ./ftpcopy_vns (this is your
> >>version, right?)
> >>
> >>-Justin
> >>
> >>
> >>"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> >>news:Pine.LNX.4.44.0403062314320.16560-100000@Xenon.Stanford.EDU...
> >>
> >>> Does this happen when you use our stcp or yours? (or both?)
> >>>
> >>> .m
> >>>
> >>>
> >>>>When I try and connect my ftp client, I get...
> >>>>
> >>>>
> >>>>
> >>>>justinfw:saga13:9:26pm:~/private/cs244a/HW4# ./your.ftpcopy_vns -t
> >>>
> >>134 -v
> >>
> >>>>vhost -r ftp_rtable .txt 2 33267@saga13.stanford.edu ~/public
> >>>>
> >>>>Assertion failed: sr, file sr_ip_route.c, line 123
> >>>>
> >>>>Abort
> >>>>
> >>>>
> >>>>
> >>>>I have already connected the router and can access the router and ftp
> >>>
> >>server
> >>
> >>>>behind it.  I don't have access to sr_ip_route.c, so i don't know why
> >>>
> >>it's
> >>
> >>>>asserting.
> >>>>
> >>>>
> >>>>
> >>>>Thanks,
> >>>>
> >>>>
> >>>>
> >>>>Justin
> >>>>
> >>>>
> >>>>
> >>>
> >>
> >>
> > 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: initial rto value
Date: Sun, 7 Mar 2004 16:24:38 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0403071624090.31047-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403071221001.5458-100000@elaine22.Stanford.EDU>
 <Pine.LNX.4.44.0403071332380.17788-100000@Xenon.Stanford.EDU>
 <Pine.LNX.4.44.0403071457350.26735-100000@Xenon.Stanford.EDU>
 <c2gbu2$3ej$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 1078705480 6377 171.64.66.201 (8 Mar 2004 00:24:40 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <c2gbu2$3ej$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6933


 Whoops

 Ok .. now for the third time *ahem*

 250 milliseconds.

 yeesh
 .m

> I hope you mean 250 milliseconds ;-)
> 
> >
> >  err that is an initial rto of 250 seconds.
> >
> >  .m
> >
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: HW4 Global IP Addresses
Date: Sun, 7 Mar 2004 16:25:11 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0403071624520.31047-100000@Xenon.Stanford.EDU>
References: <Pine.LNX.4.44.0403041556120.13328-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0403041712190.26247-100000@epic15.Stanford.EDU>
 <Pine.LNX.4.44.0403041756460.6505-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0403050017570.21100-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0403050925170.12427-100000@Xenon.Stanford.EDU>
 <c2gd8o$4o0$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 1078705512 6446 171.64.66.201 (8 Mar 2004 00:25:12 GMT)
X-Complaints-To: news@news.stanford.edu
To: Ayaz <ayaz@stanford.edu>
In-Reply-To: <c2gd8o$4o0$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6934




> I still not sure on how the setup works.
> 
> I have an rtable file for the ftpcopy program that contains the following:
> 0.0.0.0 192.168.128.120 0.0.0.0  eth0
> 
> where 192.168.128.120 is the IP of the router's eth2.
> 
> How do we use this global IP?

 you will need to add it to your router's routing table.

 .m

.

Path: shelby.stanford.edu!elaine37.Stanford.EDU!bahaa
From: Bahaa Eldin Yehia Fahim <bahaa@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Weird stube code behaviour
Date: Sun, 7 Mar 2004 17:43:21 -0800
Lines: 71
Distribution: su
Message-ID: <Pine.GSO.4.44.0403071726190.23887-100000@elaine37.Stanford.EDU>
NNTP-Posting-Host: elaine37.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078710203 11376 171.64.15.112 (8 Mar 2004 01:43:23 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6935


I'm totally lost here. I think the stub code is ignoring my routing
table and trying to talk directly to the client.

I even used the reference router code :

elaine37:~/cs244a/proj4/router> /usr/class/cs244a/WWW/homeworks/hw4/prebuilt/sr -t 157 -v vrouter
.....
[who has: 192.168.129.36] on if eth0
<- sent ARP reply [192.168.129.36 is at 70:00:00:9d:00:02] on interface eth0
-> received ip  [hl:5][v:4][id:29460][len:
48][p:6][src:171.64.15.112][dst:171.67.71.157]
* routing packet to ip 192.168.129.39 on interface eth2
<- sending arp request for ip 171.67.71.157 on interface eth2
* added ip packet [hl:5][v:4][id:29460][len:
48][p:6][src:171.64.15.112][dst:171.67.71.157] to arp queue
[171.67.71.157 is at 70:00:00:9d:00:06] on if eth2
<- sending queued packet [hl:5][v:4][id:29460][len:
48][p:6][src:171.64.15.112][dst:171.67.71.157]
-> received ip  [hl:5][v:4][id:29461][len:
48][p:6][src:171.64.15.112][dst:171.67.71.157]
* routing packet to ip 192.168.129.39 on interface eth2
-> received ip  [hl:5][v:4][id:29462][len:
40][p:6][src:171.64.15.112][dst:171.67.71.157]
* routing packet to ip 192.168.129.39 on interface eth2

And in another window I start my echo server

elaine37:~/cs244a/proj4/downloads> ../stcp_echo_server -t 157 -v vhost
-> received ARP request from 192.168.129.39 on interface eth0
 <- sent ARP reply to 192.168.129.39 on interface eth0
-> received IP packet [src:171.64.15.112][dst:171.67.71.157]
* routing packet to ip 192.168.129.39 on interface eth0
<- sending arp request for ip 171.64.15.112 on interface eth0
* added ip packet  to arp queue
* routing packet to ip 192.168.129.39 on interface eth0
<- sending arp request for ip 171.64.15.112 on interface eth0
* added ip packet  to arp queue
* routing packet to ip 192.168.129.39 on interface eth0
<- sending arp request for ip 171.64.15.112 on interface eth0
* added ip packet  to arp queue
* routing packet to ip 192.168.129.39 on interface eth0
<- sending arp request for ip 171.64.15.112 on interface eth0
* added ip packet  to arp queue
* routing packet to ip 192.168.129.39 on interface eth0
<- sending arp request for ip 171.64.15.112 on interface eth0
* added ip packet  to arp queue
* routing packet to ip 192.168.129.39 on interface eth0
<- sending arp request for ip 171.64.15.112 on interface eth0
* added ip packet  to arp queue

In another window I do a "telnet 171.67.71.157 7" . The assignment says to
use "vhost", but that never works for me. Is there a reason ?

In any case, from the above traces, it is clear that vhost is trying to
ARP elaine37, which it really ought not to do because the next hop is
192.168.129.39 and not elaine37. Can someone please explain to me what am
I doing wrong ? I've spent quite a number of hours on this... I think I do
have the correct routing table for vhost. Next hop is 192.168.129.39 and
gateway is 171.64.15.112

am I perhaps using echo_server incorrectly ?

By the way what's the difference between "vrouter" and "router". That's
not explained anywhere that I could find ?


Thanks,
B


.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS4 questions
Date: Sun, 07 Mar 2004 17:46:56 -0800
Lines: 60
Distribution: su
Message-ID: <c2gjah$12$1@news.Stanford.EDU>
References: <c2edps$24h$1@news.Stanford.EDU> <Pine.LNX.4.44.0403071314460.17788-100000@Xenon.Stanford.EDU> <c2g8bm$srg$1@news.Stanford.EDU> <Pine.LNX.4.44.0403071458090.26735-100000@Xenon.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078710417 34 127.0.0.1 (8 Mar 2004 01:46:57 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (X11/20040209)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.LNX.4.44.0403071458090.26735-100000@Xenon.Stanford.EDU>
X-Enigmail-Version: 0.83.2.0
X-Enigmail-Supports: pgp-inline, pgp-mime
Xref: shelby.stanford.edu su.class.cs244a:6936

I was under the assumption that the links only represent LANs where
there are more than one bridges.  Are the links the only LANs present,
or are there LANs connected to just one bridge and not indicated on the
graph?

--William

Martin Casado wrote:
 >   I'm sorry I was mistaken.  The nodes are bridges, the links are 
LANs. you
 >   need full forwarding connectivity to the LANs in the spanning tree 
and it is
 >   possible that a bridge will not participate in the fowarding of frames.
 >
 >   .m
 >
 >
 >>I have a couple of follow-up questions below.
 >>
 >>Thanks,
 >>
 >>Greg
 >>
 >>"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
 >>news:Pine.LNX.4.44.0403071314460.17788-100000@Xenon.Stanford.EDU...
 >>
 >>>>Problem 5:
 >>>>  1. Do the edges in this graph represent LANs with attached hosts? (I
 >>>>haven't seen this notation before, either in lecture or in the book.)
 >>>
 >>> The nodes are bridges (switches) and the edges are links between them
 >>
 >>(not
 >>
 >>> LANS).
 >>
 >>I'm still a little confused. Should we not worry about the "designated
 >>switch for a LAN" part of the spanning tree algorithm, since there are no
 >>LANs in this graph? Doesn't this make part (c) of the question (marking
 >>which switch ports are turned off) a lot less interesting, and in fact
 >>redundant with part (b)? Or am I missing something?
 >>
 >>
 >>
 >>> You are to build a spanning tree as demonstrated in the slides such
 >>> that each bridge is in the tree.
 >>>
 >>
 >>Could you be specific (handout number and slides numbers) as to which 
slides
 >>you're referring to? I thought Prof. McKeown described an algorithm 
(as did
 >>the book) where all LANs had to be in the tree; in fact, some bridges can
 >>actually be cut off from the tree in certain topologies.
 >>
 >>
 >>
 >>
 >
 >
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: sr_ip_route.c
Date: Sun, 7 Mar 2004 17:52:26 -0800
Lines: 83
Distribution: su
Message-ID: <Pine.LNX.4.44.0403071751410.6374-100000@Xenon.Stanford.EDU>
References: <c2ec0n$60$1@news.Stanford.EDU> <Pine.LNX.4.44.0403062314320.16560-100000@Xenon.Stanford.EDU>
 <c2eih4$687$1@news.Stanford.EDU> <Pine.LNX.4.44.0403071330270.17788-100000@Xenon.Stanford.EDU>
 <404BB2D5.4020003@stanford.edu> <Pine.LNX.4.44.0403071623200.31047-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 1078710747 12056 171.64.66.201 (8 Mar 2004 01:52:27 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tony Hsieh <thsieh@stanford.edu>
In-Reply-To: <Pine.LNX.4.44.0403071623200.31047-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6937


  To follow up on this.  The reason one student was getting this
  error was that sr_api_init(..) was not being called.  Be sure
  you are calling this function.

  .m


> 
>  That is two people.  I am unable to reproduce this error.  If one of
>  you can come to my office or show up at office hours it will be easier
>  to determine what may be going on.
> 
>  .m
> 
> > i get this same assertion when I am trying to connect my ftpcopy using 
> > your STCP.  Any ideas?
> > 
> > Martin Casado wrote:
> > >  Whose STCP?
> > > 
> > >  .m
> > > 
> > > 
> > >>I happens when I run ./your.ftpcopy_vns and ./ftpcopy_vns (this is your
> > >>version, right?)
> > >>
> > >>-Justin
> > >>
> > >>
> > >>"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
> > >>news:Pine.LNX.4.44.0403062314320.16560-100000@Xenon.Stanford.EDU...
> > >>
> > >>> Does this happen when you use our stcp or yours? (or both?)
> > >>>
> > >>> .m
> > >>>
> > >>>
> > >>>>When I try and connect my ftp client, I get...
> > >>>>
> > >>>>
> > >>>>
> > >>>>justinfw:saga13:9:26pm:~/private/cs244a/HW4# ./your.ftpcopy_vns -t
> > >>>
> > >>134 -v
> > >>
> > >>>>vhost -r ftp_rtable .txt 2 33267@saga13.stanford.edu ~/public
> > >>>>
> > >>>>Assertion failed: sr, file sr_ip_route.c, line 123
> > >>>>
> > >>>>Abort
> > >>>>
> > >>>>
> > >>>>
> > >>>>I have already connected the router and can access the router and ftp
> > >>>
> > >>server
> > >>
> > >>>>behind it.  I don't have access to sr_ip_route.c, so i don't know why
> > >>>
> > >>it's
> > >>
> > >>>>asserting.
> > >>>>
> > >>>>
> > >>>>
> > >>>>Thanks,
> > >>>>
> > >>>>
> > >>>>
> > >>>>Justin
> > >>>>
> > >>>>
> > >>>>
> > >>>
> > >>
> > >>
> > > 
> > 
> > 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS4 questions
Date: Sun, 7 Mar 2004 17:58:56 -0800
Lines: 69
Distribution: su
Message-ID: <Pine.LNX.4.44.0403071753550.6374-100000@Xenon.Stanford.EDU>
References: <c2edps$24h$1@news.Stanford.EDU>
 <Pine.LNX.4.44.0403071314460.17788-100000@Xenon.Stanford.EDU>
 <c2g8bm$srg$1@news.Stanford.EDU> <Pine.LNX.4.44.0403071458090.26735-100000@Xenon.Stanford.EDU>
 <c2gjah$12$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 1078711137 12530 171.64.66.201 (8 Mar 2004 01:58:57 GMT)
X-Complaints-To: news@news.stanford.edu
To: William Chan <chanman@stanford.edu>
In-Reply-To: <c2gjah$12$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6938


 You can assume that the links are the only LANs on the network, otherwise 
 it would be difficult to do part (c).  Other than that, it doesn't matter
 much.

 .m

> I was under the assumption that the links only represent LANs where
> there are more than one bridges.  Are the links the only LANs present,
> or are there LANs connected to just one bridge and not indicated on the
> graph?
> 
> --William
> 
> Martin Casado wrote:
>  >   I'm sorry I was mistaken.  The nodes are bridges, the links are 
> LANs. you
>  >   need full forwarding connectivity to the LANs in the spanning tree 
> and it is
>  >   possible that a bridge will not participate in the fowarding of frames.
>  >
>  >   .m
>  >
>  >
>  >>I have a couple of follow-up questions below.
>  >>
>  >>Thanks,
>  >>
>  >>Greg
>  >>
>  >>"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
>  >>news:Pine.LNX.4.44.0403071314460.17788-100000@Xenon.Stanford.EDU...
>  >>
>  >>>>Problem 5:
>  >>>>  1. Do the edges in this graph represent LANs with attached hosts? (I
>  >>>>haven't seen this notation before, either in lecture or in the book.)
>  >>>
>  >>> The nodes are bridges (switches) and the edges are links between them
>  >>
>  >>(not
>  >>
>  >>> LANS).
>  >>
>  >>I'm still a little confused. Should we not worry about the "designated
>  >>switch for a LAN" part of the spanning tree algorithm, since there are no
>  >>LANs in this graph? Doesn't this make part (c) of the question (marking
>  >>which switch ports are turned off) a lot less interesting, and in fact
>  >>redundant with part (b)? Or am I missing something?
>  >>
>  >>
>  >>
>  >>> You are to build a spanning tree as demonstrated in the slides such
>  >>> that each bridge is in the tree.
>  >>>
>  >>
>  >>Could you be specific (handout number and slides numbers) as to which 
> slides
>  >>you're referring to? I thought Prof. McKeown described an algorithm 
> (as did
>  >>the book) where all LANs had to be in the tree; in fact, some bridges can
>  >>actually be cut off from the tree in certain topologies.
>  >>
>  >>
>  >>
>  >>
>  >
>  >
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Weird stube code behaviour
Date: Sun, 7 Mar 2004 18:03:13 -0800
Lines: 79
Distribution: su
Message-ID: <Pine.LNX.4.44.0403071801000.6374-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403071726190.23887-100000@elaine37.Stanford.EDU>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078711394 12834 171.64.66.201 (8 Mar 2004 02:03:14 GMT)
X-Complaints-To: news@news.stanford.edu
To: Bahaa Eldin Yehia Fahim <bahaa@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403071726190.23887-100000@elaine37.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6939


 It seems to me as if your routing table for vhost is incorrect. Can you
 paste the initial printout from your vhost on startup?

 .m
 
> 
> I'm totally lost here. I think the stub code is ignoring my routing
> table and trying to talk directly to the client.
> 
> I even used the reference router code :
> 
> elaine37:~/cs244a/proj4/router> /usr/class/cs244a/WWW/homeworks/hw4/prebuilt/sr -t 157 -v vrouter
> ....
> [who has: 192.168.129.36] on if eth0
> <- sent ARP reply [192.168.129.36 is at 70:00:00:9d:00:02] on interface eth0
> -> received ip  [hl:5][v:4][id:29460][len:
> 48][p:6][src:171.64.15.112][dst:171.67.71.157]
> * routing packet to ip 192.168.129.39 on interface eth2
> <- sending arp request for ip 171.67.71.157 on interface eth2
> * added ip packet [hl:5][v:4][id:29460][len:
> 48][p:6][src:171.64.15.112][dst:171.67.71.157] to arp queue
> [171.67.71.157 is at 70:00:00:9d:00:06] on if eth2
> <- sending queued packet [hl:5][v:4][id:29460][len:
> 48][p:6][src:171.64.15.112][dst:171.67.71.157]
> -> received ip  [hl:5][v:4][id:29461][len:
> 48][p:6][src:171.64.15.112][dst:171.67.71.157]
> * routing packet to ip 192.168.129.39 on interface eth2
> -> received ip  [hl:5][v:4][id:29462][len:
> 40][p:6][src:171.64.15.112][dst:171.67.71.157]
> * routing packet to ip 192.168.129.39 on interface eth2
> 
> And in another window I start my echo server
> 
> elaine37:~/cs244a/proj4/downloads> ../stcp_echo_server -t 157 -v vhost
> -> received ARP request from 192.168.129.39 on interface eth0
>  <- sent ARP reply to 192.168.129.39 on interface eth0
> -> received IP packet [src:171.64.15.112][dst:171.67.71.157]
> * routing packet to ip 192.168.129.39 on interface eth0
> <- sending arp request for ip 171.64.15.112 on interface eth0
> * added ip packet  to arp queue
> * routing packet to ip 192.168.129.39 on interface eth0
> <- sending arp request for ip 171.64.15.112 on interface eth0
> * added ip packet  to arp queue
> * routing packet to ip 192.168.129.39 on interface eth0
> <- sending arp request for ip 171.64.15.112 on interface eth0
> * added ip packet  to arp queue
> * routing packet to ip 192.168.129.39 on interface eth0
> <- sending arp request for ip 171.64.15.112 on interface eth0
> * added ip packet  to arp queue
> * routing packet to ip 192.168.129.39 on interface eth0
> <- sending arp request for ip 171.64.15.112 on interface eth0
> * added ip packet  to arp queue
> * routing packet to ip 192.168.129.39 on interface eth0
> <- sending arp request for ip 171.64.15.112 on interface eth0
> * added ip packet  to arp queue
> 
> In another window I do a "telnet 171.67.71.157 7" . The assignment says to
> use "vhost", but that never works for me. Is there a reason ?
> 
> In any case, from the above traces, it is clear that vhost is trying to
> ARP elaine37, which it really ought not to do because the next hop is
> 192.168.129.39 and not elaine37. Can someone please explain to me what am
> I doing wrong ? I've spent quite a number of hours on this... I think I do
> have the correct routing table for vhost. Next hop is 192.168.129.39 and
> gateway is 171.64.15.112
> 
> am I perhaps using echo_server incorrectly ?
> 
> By the way what's the difference between "vrouter" and "router". That's
> not explained anywhere that I could find ?
> 
> 
> Thanks,
> B
> 
> 
> 

.

Path: shelby.stanford.edu!elaine17.Stanford.EDU!bahaa
From: Bahaa Eldin Yehia Fahim <bahaa@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Weird stube code behaviour
Date: Sun, 7 Mar 2004 18:15:39 -0800
Lines: 130
Distribution: su
Message-ID: <Pine.GSO.4.44.0403071808420.23422-100000@elaine17.Stanford.EDU>
References: <Pine.GSO.4.44.0403071726190.23887-100000@elaine37.Stanford.EDU>
 <Pine.LNX.4.44.0403071801000.6374-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: elaine17.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078712144 13583 171.64.15.82 (8 Mar 2004 02:15:44 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@CS.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0403071801000.6374-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6940


I switched to a different machine, but it's the same problem..

elaine17:~/cs244a/proj4/downloads> ../stcp_echo_server -t 157 -v vhost
********************
Destination: 192.168.129.39
  Gateway : 171.67.71.157
  Mask : 0.0.0.0
  Interface : eth0
********************
Client pepe connecting to Server 171.67.71.19:12345
Requesting topology 157
Sending c_open (type=1 len=108)
Received Hardware Info with 6 entries
Interface: eth0
Speed: 0
Hardware Address: 70:00:00:9d:00:06
Ethernet IP: 171.67.71.157
Subnet: 0.0.0.0
Mask: 0.0.0.0
Interface: eth0
  hardware address 70:00:00:9d:00:06
  ip address 171.67.71.157
-> received ARP request from 192.168.129.39 on interface eth0
 <- sent ARP reply to 192.168.129.39 on interface eth0
-> received IP packet [src:171.64.15.82][dst:171.67.71.157]
* routing packet to ip 171.67.71.157 on interface eth0
<- sending arp request for ip 171.64.15.82 on interface eth0
* added ip packet  to arp queue
-> received IP packet [src:171.64.15.82][dst:171.67.71.157]
* routing packet to ip 171.67.71.157 on interface eth0
<- sending arp request for ip 171.64.15.82 on interface eth0
* added ip packet  to arp queue
-> received ARP request from 192.168.129.39 on interface eth0
 <- sent ARP reply to 192.168.129.39 on interface eth0
-> received IP packet [src:171.64.15.82][dst:171.67.71.157]

is what I get.

somehow I'm causing vhost to ARP the client directly.

I would also really appreciate an explanation for why "telnet vhost 7"
would not work . It seems it cannot resolve vhost. Do I need to do
something special to tell telnet about vhost ?

Thanks !
B

On Sun, 7 Mar 2004, Martin Casado wrote:

>
>  It seems to me as if your routing table for vhost is incorrect. Can you
>  paste the initial printout from your vhost on startup?
>
>  .m
>
> >
> > I'm totally lost here. I think the stub code is ignoring my routing
> > table and trying to talk directly to the client.
> >
> > I even used the reference router code :
> >
> > elaine37:~/cs244a/proj4/router> /usr/class/cs244a/WWW/homeworks/hw4/prebuilt/sr -t 157 -v vrouter
> > ....
> > [who has: 192.168.129.36] on if eth0
> > <- sent ARP reply [192.168.129.36 is at 70:00:00:9d:00:02] on interface eth0
> > -> received ip  [hl:5][v:4][id:29460][len:
> > 48][p:6][src:171.64.15.112][dst:171.67.71.157]
> > * routing packet to ip 192.168.129.39 on interface eth2
> > <- sending arp request for ip 171.67.71.157 on interface eth2
> > * added ip packet [hl:5][v:4][id:29460][len:
> > 48][p:6][src:171.64.15.112][dst:171.67.71.157] to arp queue
> > [171.67.71.157 is at 70:00:00:9d:00:06] on if eth2
> > <- sending queued packet [hl:5][v:4][id:29460][len:
> > 48][p:6][src:171.64.15.112][dst:171.67.71.157]
> > -> received ip  [hl:5][v:4][id:29461][len:
> > 48][p:6][src:171.64.15.112][dst:171.67.71.157]
> > * routing packet to ip 192.168.129.39 on interface eth2
> > -> received ip  [hl:5][v:4][id:29462][len:
> > 40][p:6][src:171.64.15.112][dst:171.67.71.157]
> > * routing packet to ip 192.168.129.39 on interface eth2
> >
> > And in another window I start my echo server
> >
> > elaine37:~/cs244a/proj4/downloads> ../stcp_echo_server -t 157 -v vhost
> > -> received ARP request from 192.168.129.39 on interface eth0
> >  <- sent ARP reply to 192.168.129.39 on interface eth0
> > -> received IP packet [src:171.64.15.112][dst:171.67.71.157]
> > * routing packet to ip 192.168.129.39 on interface eth0
> > <- sending arp request for ip 171.64.15.112 on interface eth0
> > * added ip packet  to arp queue
> > * routing packet to ip 192.168.129.39 on interface eth0
> > <- sending arp request for ip 171.64.15.112 on interface eth0
> > * added ip packet  to arp queue
> > * routing packet to ip 192.168.129.39 on interface eth0
> > <- sending arp request for ip 171.64.15.112 on interface eth0
> > * added ip packet  to arp queue
> > * routing packet to ip 192.168.129.39 on interface eth0
> > <- sending arp request for ip 171.64.15.112 on interface eth0
> > * added ip packet  to arp queue
> > * routing packet to ip 192.168.129.39 on interface eth0
> > <- sending arp request for ip 171.64.15.112 on interface eth0
> > * added ip packet  to arp queue
> > * routing packet to ip 192.168.129.39 on interface eth0
> > <- sending arp request for ip 171.64.15.112 on interface eth0
> > * added ip packet  to arp queue
> >
> > In another window I do a "telnet 171.67.71.157 7" . The assignment says to
> > use "vhost", but that never works for me. Is there a reason ?
> >
> > In any case, from the above traces, it is clear that vhost is trying to
> > ARP elaine37, which it really ought not to do because the next hop is
> > 192.168.129.39 and not elaine37. Can someone please explain to me what am
> > I doing wrong ? I've spent quite a number of hours on this... I think I do
> > have the correct routing table for vhost. Next hop is 192.168.129.39 and
> > gateway is 171.64.15.112
> >
> > am I perhaps using echo_server incorrectly ?
> >
> > By the way what's the difference between "vrouter" and "router". That's
> > not explained anywhere that I could find ?
> >
> >
> > Thanks,
> > B
> >
> >
> >
>

.

Path: shelby.stanford.edu!not-for-mail
From: "Justin" <justinfw@stanford.edu>
Newsgroups: su.class.cs244a
Subject: HW4 problem
Date: Sun, 7 Mar 2004 18:42:04 -0800
Lines: 81
Distribution: su
Message-ID: <c2gmi7$eqb$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cc409.stanford.edu
X-Trace: news.Stanford.EDU 1078713735 15179 128.12.196.9 (8 Mar 2004 02:42: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:6941

When I compile with ALL the reference files, I get:

../our.ftpcopy_vns -t 134 -v vhost -r ftp_rtable .ch 0 ftp.cs ~/public
/pub/cweb
********************
Destination: 0.0.0.0
  Gateway : 192.168.128.180
  Mask : 0.0.0.0
  Interface : eth0
********************
Client pepe connecting to Server 171.67.71.19:12345
Requesting topology 134
Sending c_open (type=1 len=108)
Received Hardware Info with 6 entries
Interface: eth0
Speed: 0
Hardware Address: 70:00:00:86:00:06
Ethernet IP: 171.67.71.134
Subnet: 0.0.0.0
Mask: 0.0.0.0
Interface: eth0
  hardware address 70:00:00:86:00:06
  ip address 171.67.71.134
* routing packet to default gateway at 192.168.128.180 on interface eth0
<- sending arp request for ip 192.168.128.180 on interface eth0
* added ip packet  to arp queue
-> received ARP reply from 192.168.128.180
<- sending queued packet
Attempting to send packet out on interface eth0
* routing packet to default gateway at 192.168.128.180 on interface eth0
Attempting to send packet out on interface eth0
* routing packet to default gateway at 192.168.128.180 on interface eth0
Attempting to send packet out on interface eth0
* routing packet to default gateway at 192.168.128.180 on interface eth0
Attempting to send packet out on interface eth0
* routing packet to default gateway at 192.168.128.180 on interface eth0
Attempting to send packet out on interface eth0
* routing packet to default gateway at 192.168.128.180 on interface eth0
Attempting to send packet out on interface eth0
ERROR: Connection refused (-1)

Is there a problem with my routing tables?    They look like:

ftp_rtable:
0.0.0.0 192.168.128.180 0.0.0.0  eth0

sr_rtable:
192.168.128.179 192.168.128.179 255.255.255.255  eth1
192.168.128.181 192.168.128.181 255.255.255.255  eth2
0.0.0.0 171.67.71.134 0.0.0.0  eth0


and my topology looks like:

                                        +====================+
                                        |                    |
                                        | Internal FTP server|
                                        |                    |
                                        +====================+
                                               / eth0: 192.168.128.179
                                              /
                                             /
                    eth0:                   /
                   192.168.128.177                     /     eth1:
192.168.128.178
                           +============(eth1)==+
                           |                    |
  internet =============(eth0)  vrouter         |
                           |                    |
                           +============(eth2)==+
                                            \    eth2: 192.168.128.180
                                             \
                                              \
                                               \ eth0: 192.168.128.181
                                        +====================+
                                        |                    |
                                        |      vhost         |
                                        |                    |
                                        +====================+


.

Path: shelby.stanford.edu!not-for-mail
From: "Ayaz" <ayaz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: seq number set to zero
Date: Sun, 7 Mar 2004 18:50:30 -0800
Lines: 64
Distribution: su
Message-ID: <c2gn20$f8e$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078714243 15630 127.0.0.1 (8 Mar 2004 02:50:43 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
Xref: shelby.stanford.edu su.class.cs244a:6942

I am using the reference router and reference ftpcopy with my STCP.

I send out a SYN and receive back a SYN-ACK with seq# = 1397746135. However,
the tcpheader i get from stcp_network_recv() is the following:

0 15 3f 17
0 0 0 0              <- th_seq
0 0 0 5b            <- th_ack
60 12 23 98
56 ff 0 0

(I just printed out byte by byte the buffer from stcp_network_recv)

The th_seq is zero! What am I missing here?


Here is the tcpdump

18:45:18.305505 70:0:0:7a:0:6 Broadcast arp 42: arp who-has
www-ballagas.Stanford.EDU tell 171.67.71.122
                         0001 0800 0604 0001 7000 007a 0006 ab43
                         477a 0000 0000 0000 c0a8 8078
18:45:18.309642 70:0:0:7a:0:5 70:0:0:7a:0:6 arp 84: arp reply
www-ballagas.Stanford.EDU is-at 70:0:0:7a:0:5
                         0001 0800 0604 0002 7000 007a 0005 c0a8
                         8078 7000 007a 0006 ab43 477a 0000 0000
                         0000 0000 0000 0000 0000 0000 0000 0000
                         0000 0000 0000 0000 0000 0004 3e98 6574
                         6831 0000 0041
18:45:18.309905 70:0:0:7a:0:6 70:0:0:7a:0:5 ip 54: 171.67.71.122.16151 >
labrea.Stanford.EDU.ftp: S [tcp sum ok] 90:90(0) win 0 (ttl 255, id 0, len
40)
                         4500 0028 0000 0000 ff06 da3b ab43 477a
                         ab40 4396 3f17 0015 0000 005a 0000 0000
                         5002 0000 8ec8 0000
18:45:18.318664 70:0:0:7a:0:5 Broadcast arp 84: arp who-has 171.67.71.122
tell www-ballagas.Stanford.EDU
                         0001 0800 0604 0001 7000 007a 0005 c0a8
                         8078 0000 0000 0000 ab43 477a 0000 0000
                         0000 0000 0000 0000 0000 0000 0000 0000
                         0000 0000 0000 0000 0000 0004 3e98 6574
                         6831 0000 0041
18:45:18.318831 70:0:0:7a:0:6 70:0:0:7a:0:5 arp 42: arp reply 171.67.71.122
is-at 70:0:0:7a:0:6
                         0001 0800 0604 0002 7000 007a 0006 ab43
                         477a 7000 007a 0005 c0a8 8078
18:45:18.321344 70:0:0:7a:0:5 70:0:0:7a:0:6 ip 84: labrea.Stanford.EDU.ftp >
171.67.71.122.16151: S [tcp sum ok] 1397746135:1397746135(0) ack 91 win 9112
<mss 536> (DF) (ttl 252, id 29124, len 44)
                         4500 002c 71c4 4000 fc06 2b73 ab40 4396
                         ab43 477a 0015 3f17 534f e9d7 0000 005b
                         6012 2398 19d8 0000 0204 0218 0000 0000
                         0000 0000 0000 0000 0000 0004 3e98 6574
                         6831 0000 0041
18:45:18.322219 70:0:0:7a:0:6 70:0:0:7a:0:5 ip 54: 171.67.71.122.16151 >
labrea.Stanford.EDU.ftp: . [tcp sum ok] 1:1(0) ack 1 win 3072 (ttl 255, id
0, len 40)
                         4500 0028 0000 0000 ff06 da3b ab43 477a
                         ab40 4396 3f17 0015 0000 005b 534f e9d8
                         5010 0c00 4591 0000




.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: HW4 problem
Date: Sun, 7 Mar 2004 19:03:07 -0800
Lines: 89
Distribution: su
Message-ID: <Pine.LNX.4.44.0403071902250.7180-100000@Xenon.Stanford.EDU>
References: <c2gmi7$eqb$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 1078714989 16319 171.64.66.201 (8 Mar 2004 03:03:09 GMT)
X-Complaints-To: news@news.stanford.edu
To: Justin <justinfw@stanford.edu>
In-Reply-To: <c2gmi7$eqb$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6943


 Your vhost now has a global IP address 171.67.71.134.  This isn't reflected in
 your router's routing table.

 .m

> When I compile with ALL the reference files, I get:
> 
> ./our.ftpcopy_vns -t 134 -v vhost -r ftp_rtable .ch 0 ftp.cs ~/public
> /pub/cweb
> ********************
> Destination: 0.0.0.0
>   Gateway : 192.168.128.180
>   Mask : 0.0.0.0
>   Interface : eth0
> ********************
> Client pepe connecting to Server 171.67.71.19:12345
> Requesting topology 134
> Sending c_open (type=1 len=108)
> Received Hardware Info with 6 entries
> Interface: eth0
> Speed: 0
> Hardware Address: 70:00:00:86:00:06
> Ethernet IP: 171.67.71.134
> Subnet: 0.0.0.0
> Mask: 0.0.0.0
> Interface: eth0
>   hardware address 70:00:00:86:00:06
>   ip address 171.67.71.134
> * routing packet to default gateway at 192.168.128.180 on interface eth0
> <- sending arp request for ip 192.168.128.180 on interface eth0
> * added ip packet  to arp queue
> -> received ARP reply from 192.168.128.180
> <- sending queued packet
> Attempting to send packet out on interface eth0
> * routing packet to default gateway at 192.168.128.180 on interface eth0
> Attempting to send packet out on interface eth0
> * routing packet to default gateway at 192.168.128.180 on interface eth0
> Attempting to send packet out on interface eth0
> * routing packet to default gateway at 192.168.128.180 on interface eth0
> Attempting to send packet out on interface eth0
> * routing packet to default gateway at 192.168.128.180 on interface eth0
> Attempting to send packet out on interface eth0
> * routing packet to default gateway at 192.168.128.180 on interface eth0
> Attempting to send packet out on interface eth0
> ERROR: Connection refused (-1)
> 
> Is there a problem with my routing tables?    They look like:
> 
> ftp_rtable:
> 0.0.0.0 192.168.128.180 0.0.0.0  eth0
> 
> sr_rtable:
> 192.168.128.179 192.168.128.179 255.255.255.255  eth1
> 192.168.128.181 192.168.128.181 255.255.255.255  eth2
> 0.0.0.0 171.67.71.134 0.0.0.0  eth0
> 
> 
> and my topology looks like:
> 
>                                         +====================+
>                                         |                    |
>                                         | Internal FTP server|
>                                         |                    |
>                                         +====================+
>                                                / eth0: 192.168.128.179
>                                               /
>                                              /
>                     eth0:                   /
>                    192.168.128.177                     /     eth1:
> 192.168.128.178
>                            +============(eth1)==+
>                            |                    |
>   internet =============(eth0)  vrouter         |
>                            |                    |
>                            +============(eth2)==+
>                                             \    eth2: 192.168.128.180
>                                              \
>                                               \
>                                                \ eth0: 192.168.128.181
>                                         +====================+
>                                         |                    |
>                                         |      vhost         |
>                                         |                    |
>                                         +====================+
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Ayaz" <ayaz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: seq number set to zero
Date: Sun, 7 Mar 2004 19:03:11 -0800
Lines: 76
Distribution: su
Message-ID: <c2gnpp$fub$1@news.Stanford.EDU>
References: <c2gn20$f8e$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078715003 16331 127.0.0.1 (8 Mar 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.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
Xref: shelby.stanford.edu su.class.cs244a:6944

I checked the reference ftpcopy with reference STCP and it seems to have the
same effect. I guess its something we shouldn't worry about....?


"Ayaz" <ayaz@stanford.edu> wrote in message
news:c2gn20$f8e$1@news.Stanford.EDU...
> I am using the reference router and reference ftpcopy with my STCP.
>
> I send out a SYN and receive back a SYN-ACK with seq# = 1397746135.
However,
> the tcpheader i get from stcp_network_recv() is the following:
>
> 0 15 3f 17
> 0 0 0 0              <- th_seq
> 0 0 0 5b            <- th_ack
> 60 12 23 98
> 56 ff 0 0
>
> (I just printed out byte by byte the buffer from stcp_network_recv)
>
> The th_seq is zero! What am I missing here?
>
>
> Here is the tcpdump
>
> 18:45:18.305505 70:0:0:7a:0:6 Broadcast arp 42: arp who-has
> www-ballagas.Stanford.EDU tell 171.67.71.122
>                          0001 0800 0604 0001 7000 007a 0006 ab43
>                          477a 0000 0000 0000 c0a8 8078
> 18:45:18.309642 70:0:0:7a:0:5 70:0:0:7a:0:6 arp 84: arp reply
> www-ballagas.Stanford.EDU is-at 70:0:0:7a:0:5
>                          0001 0800 0604 0002 7000 007a 0005 c0a8
>                          8078 7000 007a 0006 ab43 477a 0000 0000
>                          0000 0000 0000 0000 0000 0000 0000 0000
>                          0000 0000 0000 0000 0000 0004 3e98 6574
>                          6831 0000 0041
> 18:45:18.309905 70:0:0:7a:0:6 70:0:0:7a:0:5 ip 54: 171.67.71.122.16151 >
> labrea.Stanford.EDU.ftp: S [tcp sum ok] 90:90(0) win 0 (ttl 255, id 0, len
> 40)
>                          4500 0028 0000 0000 ff06 da3b ab43 477a
>                          ab40 4396 3f17 0015 0000 005a 0000 0000
>                          5002 0000 8ec8 0000
> 18:45:18.318664 70:0:0:7a:0:5 Broadcast arp 84: arp who-has 171.67.71.122
> tell www-ballagas.Stanford.EDU
>                          0001 0800 0604 0001 7000 007a 0005 c0a8
>                          8078 0000 0000 0000 ab43 477a 0000 0000
>                          0000 0000 0000 0000 0000 0000 0000 0000
>                          0000 0000 0000 0000 0000 0004 3e98 6574
>                          6831 0000 0041
> 18:45:18.318831 70:0:0:7a:0:6 70:0:0:7a:0:5 arp 42: arp reply
171.67.71.122
> is-at 70:0:0:7a:0:6
>                          0001 0800 0604 0002 7000 007a 0006 ab43
>                          477a 7000 007a 0005 c0a8 8078
> 18:45:18.321344 70:0:0:7a:0:5 70:0:0:7a:0:6 ip 84: labrea.Stanford.EDU.ftp
>
> 171.67.71.122.16151: S [tcp sum ok] 1397746135:1397746135(0) ack 91 win
9112
> <mss 536> (DF) (ttl 252, id 29124, len 44)
>                          4500 002c 71c4 4000 fc06 2b73 ab40 4396
>                          ab43 477a 0015 3f17 534f e9d7 0000 005b
>                          6012 2398 19d8 0000 0204 0218 0000 0000
>                          0000 0000 0000 0000 0000 0004 3e98 6574
>                          6831 0000 0041
> 18:45:18.322219 70:0:0:7a:0:6 70:0:0:7a:0:5 ip 54: 171.67.71.122.16151 >
> labrea.Stanford.EDU.ftp: . [tcp sum ok] 1:1(0) ack 1 win 3072 (ttl 255, id
> 0, len 40)
>                          4500 0028 0000 0000 ff06 da3b ab43 477a
>                          ab40 4396 3f17 0015 0000 005b 534f e9d8
>                          5010 0c00 4591 0000
>
>
>
>


.

Path: shelby.stanford.edu!saga15.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW4 problem
Date: Sun, 7 Mar 2004 19:21:04 -0800
Lines: 109
Distribution: su
Message-ID: <Pine.GSO.4.44.0403071916290.21527-100000@saga15.Stanford.EDU>
References: <c2gmi7$eqb$1@news.Stanford.EDU> <Pine.LNX.4.44.0403071902250.7180-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: saga15.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078716066 17446 171.64.15.145 (8 Mar 2004 03:21:06 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.LNX.4.44.0403071902250.7180-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6945

Maybe this is only confusing to me but I thought this topology was setup
correctly. If the vhost has a global id of 171.67.71.134, what should the
default route for the router be set to?

For HW2 we had something like 172.24.74.17 for our eth0 default route.
I'm not sure what it is for HW4.

Can you clarify this for us Martin? Thanks.

On Sun, 7 Mar 2004, Martin Casado wrote:

> Date: Sun, 7 Mar 2004 19:03:07 -0800
> From: Martin Casado <casado@Xenon.Stanford.EDU>
> To: Justin <justinfw@stanford.edu>
> Newsgroups: su.class.cs244a
> Subject: Re: HW4 problem
>
>
>  Your vhost now has a global IP address 171.67.71.134.  This isn't reflected in
>  your router's routing table.
>
>  .m
>
> > When I compile with ALL the reference files, I get:
> >
> > ./our.ftpcopy_vns -t 134 -v vhost -r ftp_rtable .ch 0 ftp.cs ~/public
> > /pub/cweb
> > ********************
> > Destination: 0.0.0.0
> >   Gateway : 192.168.128.180
> >   Mask : 0.0.0.0
> >   Interface : eth0
> > ********************
> > Client pepe connecting to Server 171.67.71.19:12345
> > Requesting topology 134
> > Sending c_open (type=1 len=108)
> > Received Hardware Info with 6 entries
> > Interface: eth0
> > Speed: 0
> > Hardware Address: 70:00:00:86:00:06
> > Ethernet IP: 171.67.71.134
> > Subnet: 0.0.0.0
> > Mask: 0.0.0.0
> > Interface: eth0
> >   hardware address 70:00:00:86:00:06
> >   ip address 171.67.71.134
> > * routing packet to default gateway at 192.168.128.180 on interface eth0
> > <- sending arp request for ip 192.168.128.180 on interface eth0
> > * added ip packet  to arp queue
> > -> received ARP reply from 192.168.128.180
> > <- sending queued packet
> > Attempting to send packet out on interface eth0
> > * routing packet to default gateway at 192.168.128.180 on interface eth0
> > Attempting to send packet out on interface eth0
> > * routing packet to default gateway at 192.168.128.180 on interface eth0
> > Attempting to send packet out on interface eth0
> > * routing packet to default gateway at 192.168.128.180 on interface eth0
> > Attempting to send packet out on interface eth0
> > * routing packet to default gateway at 192.168.128.180 on interface eth0
> > Attempting to send packet out on interface eth0
> > * routing packet to default gateway at 192.168.128.180 on interface eth0
> > Attempting to send packet out on interface eth0
> > ERROR: Connection refused (-1)
> >
> > Is there a problem with my routing tables?    They look like:
> >
> > ftp_rtable:
> > 0.0.0.0 192.168.128.180 0.0.0.0  eth0
> >
> > sr_rtable:
> > 192.168.128.179 192.168.128.179 255.255.255.255  eth1
> > 192.168.128.181 192.168.128.181 255.255.255.255  eth2
> > 0.0.0.0 171.67.71.134 0.0.0.0  eth0
> >
> >
> > and my topology looks like:
> >
> >                                         +====================+
> >                                         |                    |
> >                                         | Internal FTP server|
> >                                         |                    |
> >                                         +====================+
> >                                                / eth0: 192.168.128.179
> >                                               /
> >                                              /
> >                     eth0:                   /
> >                    192.168.128.177                     /     eth1:
> > 192.168.128.178
> >                            +============(eth1)==+
> >                            |                    |
> >   internet =============(eth0)  vrouter         |
> >                            |                    |
> >                            +============(eth2)==+
> >                                             \    eth2: 192.168.128.180
> >                                              \
> >                                               \
> >                                                \ eth0: 192.168.128.181
> >                                         +====================+
> >                                         |                    |
> >                                         |      vhost         |
> >                                         |                    |
> >                                         +====================+
> >
> >
> >
>
>


.

Path: shelby.stanford.edu!elaine33.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Echo
Date: Mon, 8 Mar 2004 04:17:02 +0000 (UTC)
Lines: 23
Distribution: su
Message-ID: <c2gs3u$k2p$1@news.Stanford.EDU>
References: <c2ej6n$6c2$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1078719422 20569 171.64.15.108 (8 Mar 2004 04:17:02 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6946


>Just how is STCP echo supposed to work?  I don't see any explanation in the 
>assignment.

It works the same way as ftpcopy, only instead of implementing an ftp client,
it implements either an echo server, or echo client, depending on which
program you run.  You might recall using an echo client in HW1, in the
purify/gdb 'demo'--it's a simple TCP service commonly used for debugging
networking problems.  You send a line, it echoes the line back...
'telnet klamath 7' will show an example of how it should work.
klamath is running an echo server on port 7.

stcp_echo_server allows you to run an echo server on your virtual host,
like klamath runs.  stcp_echo_client allows you to connect to another
machine's echo service, like 'telnet klamath 7'.

>If I try stcp_echo_client -t 162 -v vhost, I get 

>usage: stcp_echo_client [-U] [VNS options] remote-host

you need to specify the remote host on which to access the echo service
(e.g. klamath would work).

.

Path: shelby.stanford.edu!elaine33.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: stcp_network_recv() changes the incoming seq number
Date: Mon, 8 Mar 2004 04:19:12 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <c2gs80$k81$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403071257300.1167-100000@elaine43.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1078719552 20737 171.64.15.108 (8 Mar 2004 04:19:12 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6947


>I single-step my transport.c code and found the after calling the
>stcp_network_recv(), the incoming packet's th_seq does not equal to the
>one shown in the ethereal trace.  What is done in stcp_network_recv for
>the th_seq?

If you look in network_io_vns.c, you'll see that sequence numbers are
remapped.  This is done so you don't have to worry about sequence number
wraparound.

N.B. if you use tcpdump, by default it shows sequence numbers relative to
the ISN anyway, so this output should agree with what your code actually
sees in the TCP header.  I presume ethereal would have a similar option, but
haven't tried this.

.

Path: shelby.stanford.edu!elaine33.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: is ftp daemon sending a fin after sending list data?
Date: Mon, 8 Mar 2004 04:21:24 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <c2gsc4$kjt$1@news.Stanford.EDU>
References: <c2dnpl$84d$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1078719684 21117 171.64.15.108 (8 Mar 2004 04:21:24 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6948

>from my logs, it appears that ftp daemon never sends a fin after completing
>sending list data through a connection. It just sends the last piece of list
>data, and then hangs, causing lots of timeouts for the socket. So as a
>result my ftp client just hangs. I have checked that in stcp_wait_for_event
>ctx->close_requested really is always 0.
>Am I doing something obviously wrong here? Does everybody else see those
>fins?

I haven't seen the behaviour you mentioned, so I'd suspect you're doing
some thing wrong, although what it might be isn't obvious from your
description.  Does this happen for all servers?

.

Path: shelby.stanford.edu!elaine33.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: HW4 problem
Date: Mon, 8 Mar 2004 04:22:24 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c2gse0$kld$1@news.Stanford.EDU>
References: <c2gmi7$eqb$1@news.Stanford.EDU> <Pine.LNX.4.44.0403071902250.7180-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0403071916290.21527-100000@saga15.Stanford.EDU>
NNTP-Posting-Host: elaine33.stanford.edu
X-Trace: news.Stanford.EDU 1078719744 21165 171.64.15.108 (8 Mar 2004 04:22:24 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6949


>For HW2 we had something like 172.24.74.17 for our eth0 default route.
>I'm not sure what it is for HW4.

The gateway address is still the same.

.

Path: shelby.stanford.edu!not-for-mail
From: Dmitry B Belogolovsky <dbb@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: tcp_sum.c assertion
Date: Mon, 8 Mar 2004 04:56:46 +0000 (UTC)
Lines: 5
Distribution: su
Message-ID: <c2guee$mcq$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine16.stanford.edu
X-Trace: news.Stanford.EDU 1078721806 22938 171.64.15.81 (8 Mar 2004 04:56: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:6950

.../your.ftpcopy_tcp o 0 62369@elaine16
Assertion failed: dst_addr > 0, file tcp_sum.c, line 39
Abort

what does this mean? is this my fault? i saw something like this on the newsgroup, but i thought that you guys fixed it.
.

Path: shelby.stanford.edu!not-for-mail
From: Abhyudaya Sravanth Chodisetti <sravanth@stanford.edu>
Newsgroups: su.class.cs244a
Subject: USER cmd retransmissions
Date: Sun, 07 Mar 2004 23:33:37 -0800
Lines: 19
Distribution: su
Message-ID: <404C21D1.527B1E01@stanford.edu>
NNTP-Posting-Host: elaine7.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078731218 2749 171.64.15.72 (8 Mar 2004 07:33:38 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:6951

Hi,

I am using my ftp client with my stcp layer and the reference router.
When I connect to ftp.lcs.mit.edu, it works fine and copies files as
expected.

When I am trying to connect to ftp.cs.stanford.edu or
ftp.slac.stanford.edu, I get an error saying "exceeded max retransmits".
So I tried increasing the timeout value, tried adaptive timeouts and
increased the allowed max # of retransmits but nothing seems to work.
The connection seems to be established but the packet with "USER
anonymous\r\n" command is transmitted again and again till the max # is
exceeded and then it quits.  

Did anybody else observe the same behaviour?

Thnx,

Abhyudaya
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS4 questions
Date: Sun, 7 Mar 2004 23:45:43 -0800
Lines: 40
Distribution: su
Message-ID: <Pine.LNX.4.44.0403072338550.1819-100000@Xenon.Stanford.EDU>
References: <c2edps$24h$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 1078731944 3341 171.64.66.201 (8 Mar 2004 07:45:44 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c2edps$24h$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6952

On Sat, 6 Mar 2004, Greg Friedman wrote:

> Problem 3 (Q 44 p. 159), part C:
>   1. Does "all the remaining backoff races" mean "all the races between A
> and B, until B gives up"?

Answering this question will give away part of the answer, so I won't. 
However, I will say that I don't see any scope for confusion in 
interpreting this part of the question.

>   2. Instead of giving a lower bound on the probability, can we just give an
> expression of the *exact* probability, assuming particular values for the
> total # of retries B will attempt, and the maximum value of "k" in the
> exponential backoff algorithm?

We will stick to question and require a lower bound. Do some math :-)

Shankar

> 
> Problem 5:
>   1. Do the edges in this graph represent LANs with attached hosts? (I
> haven't seen this notation before, either in lecture or in the book.)
>   2. If so, does this mean it is a requirement that all edges are reachable,
> but it is not a requirement that all switches are reachable?
> 
> 
> 
> 

-- 

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: PS4: #44 P.159
Date: Sun, 7 Mar 2004 23:46:48 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.LNX.4.44.0403072346370.1819-100000@Xenon.Stanford.EDU>
References: <c2d4qd$j6n$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 1078732010 3377 171.64.66.201 (8 Mar 2004 07:46:50 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c2d4qd$j6n$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6953


On Sat, 6 Mar 2004, Jason Ying Li wrote:

> For a) and b), should I assume that A already won the 1st backoff race? 

yes

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS4: #44 P.159 b)
Date: Sun, 7 Mar 2004 23:55:23 -0800
Lines: 15
Distribution: su
Message-ID: <Pine.LNX.4.44.0403072350330.1819-100000@Xenon.Stanford.EDU>
References: <c2d4ut$jct$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 1078732524 3898 171.64.66.201 (8 Mar 2004 07:55:24 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c2d4ut$jct$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6954


On Sat, 6 Mar 2004, Jason Ying Li wrote:

> Is the question asking for the absolute 3rd backoff race (i.e., A tries to 
> transmit A3) or the relative 3rd backoff race from the 1st one, which is 
> actually the 4th (i.e., A tries to transmit A4)?
> 

This part of the question (part b) is a bit confusing. I feel that the A4 
may be a typo and was intended to be A3. I prefer that you give the answer 
assuming it is A3. In any case, state clearly whether your answer 
concerns the backoff race involving A3 or A4.

Shankar

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS4 Q1c
Date: Sun, 7 Mar 2004 23:59:09 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.LNX.4.44.0403072355470.1819-100000@Xenon.Stanford.EDU>
References: <c2b8pd$kgj$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 1078732750 4445 171.64.66.201 (8 Mar 2004 07:59:10 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c2b8pd$kgj$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6955


On Sat, 6 Mar 2004, Tyrone Nicholas wrote:

> 
> The formula in the text says for "smallish N".  But for part c, N is 2^30, 
> which is hardly "smallish".  The formula given works out to more than 
> 2000, which doesn't make sense for a probability that is supposed to be 
> between 0 and 1.  

You will need to figure out how to find the correct probability, which 
obviously has to lie between 0 and 1.

> Or am I missing something?

Yes. The answer :-)

Shankar

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ftpcopy_vns results
Date: Mon, 8 Mar 2004 00:34:14 -0800
Lines: 69
Distribution: su
Message-ID: <Pine.GSO.4.44.0403080028330.25050-100000@elaine43.Stanford.EDU>
References: <Pine.GSO.4.44.0403052009230.7885-100000@epic9.Stanford.EDU>
 <Pine.LNX.4.44.0403061510160.30448-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0403071011310.28177-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0403071331430.17788-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 1078734864 7423 171.64.15.118 (8 Mar 2004 08:34:24 GMT)
X-Complaints-To: news@news.stanford.edu
To: Martin Casado <casado@Xenon.Stanford.EDU>
In-Reply-To: <Pine.LNX.4.44.0403071331430.17788-100000@Xenon.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6956

This same problem resurfaced tonight.  I also tried to use reference sr,
reference STCP and reference ftpcopy ==> same result: no example dir.

TA, please take a look at it.

On Sun, 7 Mar 2004, Martin Casado wrote:


>
>  Check my above post.  The pasv ftcopy library was patched.
>
>  .m
>
> > I encountered the same problem with the "example" directory missing.  I
> > even
> > tried the STCP stack + ftpcopy provided by TA and the result is the same.
> >
> > -Laura
> > On Sat, 6 Mar 2004, Martin Casado wrote:
> >
> > >
> > >  Boris,
> > >
> > >  I can't reproduce this error, seems to work fine for me:
> > >
> > > OK: 59465 bytes copied
> > > elaine37:~/projects/hw1> ls
> > > Makefile  boris    ftpcopy.c   ftpparse.h  grading_src  myftplib.h  purify.output  rfc959.h  socket_imp.c  socket_imp.o
> > > README    ftpcopy  ftpparse.c  ftpparse.o  myftplib.c   myftplib.o  rfc959.c       rfc959.o  socket_imp.h  tmp
> > > elaine37:~/projects/hw1> cd boris/
> > > elaine37:~/projects/hw1/boris> ls
> > > comm-amiga.ch  comm-man.ch  comm-ql.ch   ctang-bs.ch   ctang-ql.ch   cweav-bs.ch   cweav-ql.ch   examples
> > > comm-bs.ch     comm-os2.ch  comm-vms.ch  ctang-man.ch  ctang-vms.ch  cweav-man.ch  cweav-vms.ch
> > > comm-mac.ch    comm-pc.ch   comm-w32.ch  ctang-pc.ch   ctang-w32.ch  cweav-pc.ch   cweav-w32.ch
> > > elaine37:~/projects/hw1/boris> cd examples/
> > > elaine37:~/projects/hw1/boris/examples> ls
> > > extex.ch  wc-dos.ch  wmer-os2.ch  wmerg-pc.ch
> > >
> > >  :-/
> > >
> > >  .m
> > >
> > >
> > > > I used reference ftpcopy_vns that uses passive mode (provided by Matthew)
> > > > and I'm not getting the same results as with my ftpcopy from hw 1.
> > > >
> > > > I execute ./ftpcopy ch 1 ftp.cs.stanford.edu . /pub/cweb
> > > > Using my ftpcopy which passes hw1 test script, I get a bunch of .ch
> > > > files and a directory "examples" which contains more .ch files.
> > > > This is exactly the output expected if one looks at directory structure
> > > > in the ftp.cs.stanford.edu
> > > >
> > > > With reference ftpcopy_vns, "examples" directory and its contents is not
> > > > transfered.  "examples" is a real directory not a symbolic link.
> > > > All other test cases from hw1 are correct.  Is it the case of
> > > > "off by one" error?
> > > >
> > > > Thanks.
> > > > Boris.
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

.

Path: shelby.stanford.edu!elaine43.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: tcp_sum.c assertion
Date: Mon, 8 Mar 2004 17:05:58 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c2i95m$8ts$1@news.Stanford.EDU>
References: <c2guee$mcq$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine43.stanford.edu
X-Trace: news.Stanford.EDU 1078765558 9148 171.64.15.118 (8 Mar 2004 17:05:58 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6957


>../your.ftpcopy_tcp o 0 62369@elaine16
>Assertion failed: dst_addr > 0, file tcp_sum.c, line 39
>Abort

This sometimes happens in ftpd when the PORT command sent by the
client has an IP address of 0.0.0.0.  (It could happen elsewhere if
you try to connect to such an address, too).

This could happen in old versions of the stub code if people relied on
getting the IP address from a mybind() on a sockaddr_in that already
specified an IP address.  But it was fixed quite a while back, so be sure
you're using the current stub code.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: ftpcopy_vns results
Date: Mon, 8 Mar 2004 11:01:32 -0800
Lines: 77
Distribution: su
Message-ID: <Pine.LNX.4.44.0403081101080.13857-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403052009230.7885-100000@epic9.Stanford.EDU>
 <Pine.LNX.4.44.0403061510160.30448-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0403071011310.28177-100000@elaine43.Stanford.EDU>
 <Pine.LNX.4.44.0403071331430.17788-100000@Xenon.Stanford.EDU>
 <Pine.GSO.4.44.0403080028330.25050-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 1078772494 20578 171.64.66.201 (8 Mar 2004 19:01:34 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0403080028330.25050-100000@elaine43.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6958


 Looks lik eone of my changes didn't make it to the library, this is fixed.  It
 should work correctly now.

 .m

> This same problem resurfaced tonight.  I also tried to use reference sr,
> reference STCP and reference ftpcopy ==> same result: no example dir.
> 
> TA, please take a look at it.
> 
> On Sun, 7 Mar 2004, Martin Casado wrote:
> 
> 
> >
> >  Check my above post.  The pasv ftcopy library was patched.
> >
> >  .m
> >
> > > I encountered the same problem with the "example" directory missing.  I
> > > even
> > > tried the STCP stack + ftpcopy provided by TA and the result is the same.
> > >
> > > -Laura
> > > On Sat, 6 Mar 2004, Martin Casado wrote:
> > >
> > > >
> > > >  Boris,
> > > >
> > > >  I can't reproduce this error, seems to work fine for me:
> > > >
> > > > OK: 59465 bytes copied
> > > > elaine37:~/projects/hw1> ls
> > > > Makefile  boris    ftpcopy.c   ftpparse.h  grading_src  myftplib.h  purify.output  rfc959.h  socket_imp.c  socket_imp.o
> > > > README    ftpcopy  ftpparse.c  ftpparse.o  myftplib.c   myftplib.o  rfc959.c       rfc959.o  socket_imp.h  tmp
> > > > elaine37:~/projects/hw1> cd boris/
> > > > elaine37:~/projects/hw1/boris> ls
> > > > comm-amiga.ch  comm-man.ch  comm-ql.ch   ctang-bs.ch   ctang-ql.ch   cweav-bs.ch   cweav-ql.ch   examples
> > > > comm-bs.ch     comm-os2.ch  comm-vms.ch  ctang-man.ch  ctang-vms.ch  cweav-man.ch  cweav-vms.ch
> > > > comm-mac.ch    comm-pc.ch   comm-w32.ch  ctang-pc.ch   ctang-w32.ch  cweav-pc.ch   cweav-w32.ch
> > > > elaine37:~/projects/hw1/boris> cd examples/
> > > > elaine37:~/projects/hw1/boris/examples> ls
> > > > extex.ch  wc-dos.ch  wmer-os2.ch  wmerg-pc.ch
> > > >
> > > >  :-/
> > > >
> > > >  .m
> > > >
> > > >
> > > > > I used reference ftpcopy_vns that uses passive mode (provided by Matthew)
> > > > > and I'm not getting the same results as with my ftpcopy from hw 1.
> > > > >
> > > > > I execute ./ftpcopy ch 1 ftp.cs.stanford.edu . /pub/cweb
> > > > > Using my ftpcopy which passes hw1 test script, I get a bunch of .ch
> > > > > files and a directory "examples" which contains more .ch files.
> > > > > This is exactly the output expected if one looks at directory structure
> > > > > in the ftp.cs.stanford.edu
> > > > >
> > > > > With reference ftpcopy_vns, "examples" directory and its contents is not
> > > > > transfered.  "examples" is a real directory not a symbolic link.
> > > > > All other test cases from hw1 are correct.  Is it the case of
> > > > > "off by one" error?
> > > > >
> > > > > Thanks.
> > > > > Boris.
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS4 questions
Date: Mon, 08 Mar 2004 14:58:05 -0800
Lines: 76
Distribution: su
Message-ID: <c2itq7$q3b$1@news.Stanford.EDU>
References: <c2edps$24h$1@news.Stanford.EDU> <Pine.LNX.4.44.0403071314460.17788-100000@Xenon.Stanford.EDU> <c2g8bm$srg$1@news.Stanford.EDU> <Pine.LNX.4.44.0403071458090.26735-100000@Xenon.Stanford.EDU> <c2gjah$12$1@news.Stanford.EDU> <Pine.LNX.4.44.0403071753550.6374-100000@Xenon.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078786695 26731 127.0.0.1 (8 Mar 2004 22:58:15 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (X11/20040209)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.LNX.4.44.0403071753550.6374-100000@Xenon.Stanford.EDU>
X-Enigmail-Version: 0.83.2.0
X-Enigmail-Supports: pgp-inline, pgp-mime
Xref: shelby.stanford.edu su.class.cs244a:6959

If this is the case, then in part (d), when it says a host is connected 
to switch "8", does that imply it has to also be connected to switch "5" 
since the only LANs are the links?

--William

Martin Casado wrote:
>  You can assume that the links are the only LANs on the network, otherwise 
>  it would be difficult to do part (c).  Other than that, it doesn't matter
>  much.
> 
>  .m
> 
> 
>>I was under the assumption that the links only represent LANs where
>>there are more than one bridges.  Are the links the only LANs present,
>>or are there LANs connected to just one bridge and not indicated on the
>>graph?
>>
>>--William
>>
>>Martin Casado wrote:
>> >   I'm sorry I was mistaken.  The nodes are bridges, the links are 
>>LANs. you
>> >   need full forwarding connectivity to the LANs in the spanning tree 
>>and it is
>> >   possible that a bridge will not participate in the fowarding of frames.
>> >
>> >   .m
>> >
>> >
>> >>I have a couple of follow-up questions below.
>> >>
>> >>Thanks,
>> >>
>> >>Greg
>> >>
>> >>"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
>> >>news:Pine.LNX.4.44.0403071314460.17788-100000@Xenon.Stanford.EDU...
>> >>
>> >>>>Problem 5:
>> >>>>  1. Do the edges in this graph represent LANs with attached hosts? (I
>> >>>>haven't seen this notation before, either in lecture or in the book.)
>> >>>
>> >>> The nodes are bridges (switches) and the edges are links between them
>> >>
>> >>(not
>> >>
>> >>> LANS).
>> >>
>> >>I'm still a little confused. Should we not worry about the "designated
>> >>switch for a LAN" part of the spanning tree algorithm, since there are no
>> >>LANs in this graph? Doesn't this make part (c) of the question (marking
>> >>which switch ports are turned off) a lot less interesting, and in fact
>> >>redundant with part (b)? Or am I missing something?
>> >>
>> >>
>> >>
>> >>> You are to build a spanning tree as demonstrated in the slides such
>> >>> that each bridge is in the tree.
>> >>>
>> >>
>> >>Could you be specific (handout number and slides numbers) as to which 
>>slides
>> >>you're referring to? I thought Prof. McKeown described an algorithm 
>>(as did
>> >>the book) where all LANs had to be in the tree; in fact, some bridges can
>> >>actually be cut off from the tree in certain topologies.
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>>
> 
.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS4 Q1a
Date: Mon, 08 Mar 2004 19:26:50 -0800
Lines: 15
Distribution: su
Message-ID: <c2jdhq$hgv$1@news.Stanford.EDU>
NNTP-Posting-Host: epic8.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078802810 17951 171.64.15.41 (9 Mar 2004 03:26:50 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.1) Gecko/20020827
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6960

Should the question be interpreted to mean

"exactly two addresses are the same, and all others are different"

or

"two or more addresses are the same"

or

"there are one or more pairs of addresses"?


Tyrone

.

Path: shelby.stanford.edu!elaine18.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: seq number set to zero
Date: Tue, 9 Mar 2004 05:22:40 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c2jkb0$rru$1@news.Stanford.EDU>
References: <c2gn20$f8e$1@news.Stanford.EDU> <c2gnpp$fub$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine18.stanford.edu
X-Trace: news.Stanford.EDU 1078809760 28542 171.64.15.83 (9 Mar 2004 05:22:40 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6961


>I checked the reference ftpcopy with reference STCP and it seems to have the
>same effect. I guess its something we shouldn't worry about....?

this is the intended behaviour--we remap sequence numbers so you don't
have to handle wraparound issues.

.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Confused as to how to use the reference sr
Date: Mon, 8 Mar 2004 21:52:58 -0800
Lines: 13
Distribution: su
Message-ID: <c2jm3r$jn$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1078811579 631 128.12.173.169 (9 Mar 2004 05:52: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:6962

Hi,

I am very confused as to how do I use the reference router. When I type in
make, a sr file is built. Is this built using the reference router, or the
router in my sr_src directory? After doing make, when I look into my sr_src
directory, i do not see a sr exec made there...so I presume the sr made in
the parent directory is actually the reference router? Is that correct?

Thanks

Kumar


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Confused as to how to use the reference sr
Date: Tue, 9 Mar 2004 00:03:27 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0403090003020.20245-100000@Xenon.Stanford.EDU>
References: <c2jm3r$jn$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 1078819408 11581 171.64.66.201 (9 Mar 2004 08:03:28 GMT)
X-Complaints-To: news@news.stanford.edu
To: Murali Kumar <kumarm@stanford.edu>
In-Reply-To: <c2jm3r$jn$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6963


 This final bullet under " Some additional notes" on the web page
 should help clear this up.

 .m

> Hi,
> 
> I am very confused as to how do I use the reference router. When I type in
> make, a sr file is built. Is this built using the reference router, or the
> router in my sr_src directory? After doing make, when I look into my sr_src
> directory, i do not see a sr exec made there...so I presume the sr made in
> the parent directory is actually the reference router? Is that correct?
> 
> Thanks
> 
> Kumar
> 
> 
> 

.

Path: shelby.stanford.edu!elaine18.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Confused as to how to use the reference sr
Date: Tue, 9 Mar 2004 08:15:14 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c2juei$cjo$1@news.Stanford.EDU>
References: <c2jm3r$jn$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine18.stanford.edu
X-Trace: news.Stanford.EDU 1078820114 12920 171.64.15.83 (9 Mar 2004 08:15:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6964



>I am very confused as to how do I use the reference router. When I type in
>make, a sr file is built. Is this built using the reference router, or the
>router in my sr_src directory? After doing make, when I look into my sr_src
>directory, i do not see a sr exec made there...so I presume the sr made in
>the parent directory is actually the reference router? Is that correct?

In addition to Martin's answer, the Makefile will print a warning if
it's using the reference router.  And you can look at the Makefile
yourself to figure out what sr (if any) it's generating--the rule of
interest is for 'sr'.

.

Path: shelby.stanford.edu!elaine18.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS4 Q1a
Date: Tue, 9 Mar 2004 08:16:46 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c2juhe$cro$1@news.Stanford.EDU>
References: <c2jdhq$hgv$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine18.stanford.edu
X-Trace: news.Stanford.EDU 1078820206 13176 171.64.15.83 (9 Mar 2004 08:16:46 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6965


>Should the question be interpreted to mean

I don't have the 3rd edition, so I can't answer this without seeing
the wording of the original question.  You can bring it by office
hours tomorrow if you'd like...

.

Path: shelby.stanford.edu!elaine18.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: final review session
Date: Tue, 9 Mar 2004 08:18:58 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c2juli$cuv$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine18.stanford.edu
X-Trace: news.Stanford.EDU 1078820338 13279 171.64.15.83 (9 Mar 2004 08:18:58 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6966

just a reminder...
there's a final review session this Friday, same place as usual.
if you have any particular questions you'd like me to cover, please
let me know beforehand (preferably ASAP)--you'll have a better chance
of getting them answered if I have a chance to prepare :-)

.

Path: shelby.stanford.edu!not-for-mail
From: "Murali Kumar" <kumarm@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: HW4: submission script
Date: Tue, 9 Mar 2004 12:29:22 -0800
Lines: 36
Distribution: su
Message-ID: <c2l9f4$9pk$1@news.Stanford.EDU>
References: <c2ctq0$d5i$1@news.Stanford.EDU> <c2d2rv$hjp$1@news.Stanford.EDU>
Reply-To: "Murali Kumar" <kumarm@stanford.edu>
NNTP-Posting-Host: rescomp-03-60449.stanford.edu
X-Trace: news.Stanford.EDU 1078864164 10036 128.12.173.169 (9 Mar 2004 20:29: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:6967

I have another question with the submission script. I have two routing table
files called rtable_vrouter and rtable_vhost for my vrouter and vhost
respectively, inside the sr_src directory. When run the submission script,
it does not seem to grab these two files from the sr_src folder (it grabs
all the .c and .h files)...atleast that is what the output of the submission
script shows me:

/usr/pubsw/bin/tar -czvf
/afs/ir/class/cs244a/submissions/grading/hw4/holliman/kumarm/files.tar.gz
../sr_src/Makefile ./Makefile ./sr_src/README ./README
../transport.c ./sr_src/sr_dumper.c ./sr_src/sr_if.c ./sr_src/sr_main.c
../sr_src/sr_router.c ./sr_src/sr_rt.c ./sr_src/sr_vns_comm.c
../sr_src/test_macros.c
../ENVCFG.MK ./sr_src/sr_dumper.h ./sr_src/sr_if.h ./sr_src/sr_protocol.h
../sr_src/sr_router.h ./sr_src/sr_rt.h ./sr_src/vnscommand.h

How do I make it accept the rtable files?

Thanks

Kumar

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c2d2rv$hjp$1@news.Stanford.EDU...
>
> >submit.pl doesn't seem to take in the sr_transport sub dir, which is
> >needed for ftpcopy on the vhost. Someone reported this issue during hw3
as
> >well, not sure what the problem is here?
>
> There's no problem--we already have this, so there's no need for the
script
> to take in those same files.
>


.

Path: shelby.stanford.edu!elaine19.Stanford.EDU!jsalcedo
From: Jonathan Salcedo <jsalcedo@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ps4 question 2 serious problem
Date: Tue, 9 Mar 2004 15:36:05 -0800
Lines: 7
Distribution: su
Message-ID: <Pine.GSO.4.44.0403091532220.22958-100000@elaine19.Stanford.EDU>
NNTP-Posting-Host: elaine19.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078875367 24969 171.64.15.84 (9 Mar 2004 23:36:07 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6968

Can somebody please post question number 2 to the newsgroup? I have the
second edition and I looked for the 3rd edition in the bookstore but
couldn't find it. I just want to know what Question 46 on page 160 in the
3rd edition is. Thanks.

-Jonathan

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS4, Q5(e)
Date: Tue, 9 Mar 2004 16:20:48 -0800
Lines: 6
Distribution: su
Message-ID: <Pine.GSO.4.44.0403091617200.4409-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 1078878050 28312 171.64.15.100 (10 Mar 2004 00:20:50 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6969


For Q5(e), would the ports that were turned off in (b) be turned on
again, if so, what event could trigger that? the event that the switch
who wasn't root just claim itself to be the root again?


.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ps4 question 2 serious problem
Date: Tue, 9 Mar 2004 16:24:12 -0800
Lines: 10
Distribution: su
Message-ID: <Pine.GSO.4.44.0403091623570.4826-100000@elaine25.Stanford.EDU>
References: <Pine.GSO.4.44.0403091532220.22958-100000@elaine19.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078878254 28827 171.64.15.100 (10 Mar 2004 00:24:14 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jonathan Salcedo <jsalcedo@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403091532220.22958-100000@elaine19.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6970

Here you go!

==
Q46: Ethernets use Manchester encoding.  Assuming that hosts sharing the
Etherenet are not perfectly synchronized, why does this allow collisions
to be detected soon after they occur, without waiting for the CRC at the
end of the packet?

-Laura

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: ps4 question 2 serious problem
Date: Tue, 09 Mar 2004 16:24:52 -0800
Lines: 16
Distribution: su
Message-ID: <404E6054.E2FCE6F9@stanford.edu>
References: <Pine.GSO.4.44.0403091532220.22958-100000@elaine19.Stanford.EDU>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078878293 28618 128.12.21.88 (10 Mar 2004 00:24:53 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6971

Question 46 on p. 160:

Ethernet use Manchester encoding. Assuming that hosts sharing the Ethernet
are not perfectly syncrhonized, why does this allow collisions to be detected
soon after they occur, without waiting for the CRC at the end of the packet?


Jonathan Salcedo wrote:

> Can somebody please post question number 2 to the newsgroup? I have the
> second edition and I looked for the 3rd edition in the bookstore but
> couldn't find it. I just want to know what Question 46 on page 160 in the
> 3rd edition is. Thanks.
>
> -Jonathan

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS3(b) Solution
Date: Tue, 09 Mar 2004 16:39:37 -0800
Lines: 46
Distribution: su
Message-ID: <c2lo4i$msl$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403051648410.27859-100000@elaine43.Stanford.EDU> <Pine.LNX.4.44.0403051804360.19025-100000@Xenon.Stanford.EDU> <Pine.GSO.4.44.0403052253590.3177-100000@elaine43.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078879186 23445 127.0.0.1 (10 Mar 2004 00:39:46 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (X11/20040209)
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.44.0403052253590.3177-100000@elaine43.Stanford.EDU>
X-Enigmail-Version: 0.83.2.0
X-Enigmail-Supports: pgp-inline, pgp-mime
Xref: shelby.stanford.edu su.class.cs244a:6972

Can someone explain by TRANP > 2 * (PROP-PROPMIN) doesn't work?

Thanks,
William

Xiaohua Fang wrote:
> Thank you for the explanation.  It is very clear now!
> 
> On Fri, 5 Mar 2004, Shankar Ponnekanti wrote:
> 
> 
>>
>>On Fri, 5 Mar 2004, Xiaohua Fang wrote:
>>
>>
>>>With PS3(b) solution, I am still confused.  Could one of TA explain a
>>>little? Maybe an example using node A, B, C?
>>>
>>>
>>
>>
>>The only statement in the solution which is a bit hard to grasp is the
>>following: "if A detects a collision within PROPMIN time since its last
>>packet transmission completed, it knows that its last transmitted packet
>>must have collided."
>>
>>Here is a more detailed explanation of why the above is true. Suppose that
>>A transmitted a packet P0 from time 0 to time 2PROP - PROPMIN, and
>>there was a collision in the time [2PROP-PROPMIN, 2PROP]. Our claim is
>>that this collision must involve P0.
>>
>>Suppose not, so the collision happened between some packet P1 sent by
>>some host X and some packet P2 sent by a different host Y. The qn then is
>>when did X and Y start transmitting? They couldn't have started in
>>[0,PROP-PROPMIN], else A would detect them beofre completing. They
>>couldn't have started in [PROP, 2PROP] since they know by then that A is
>>transmitting. So, the only option is [PROP-PROPMIN, PROP], but at most
>>one node (the node furthest from A) can start in this time because every
>>other node would know A is transmitting by PROP-PROPMIN. Thus, we have a
>>contradiction => the collision must involve P0.
>>
>>Shankar
>>
>>
> 
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Evan Parker" <nave@stanford.edu>
Newsgroups: su.class.cs244a
Subject: more confusion on PS3 question 3b
Date: Tue, 9 Mar 2004 17:47:30 -0800
Lines: 33
Distribution: su
Message-ID: <c2ls3f$c9a$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cbe09.stanford.edu
X-Trace: news.Stanford.EDU 1078883247 12586 128.12.190.9 (10 Mar 2004 01:47:27 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:6973

So I'm still confused about 3b. Neither the solution nor the above thread
"PS3(b) Solution" explain why 2PROP - PROPMIN is the *minimum* that TRANSP
can be and still allow correct collision detection. Personally I think the
minimum is 2*(PROP - PROPMIN); here's my reasoning:



Say A starts transmitting a packet at time 0. A collision will occur if
another host transmits a packet before A's packet gets to that host. The
latest A will ever see this second packet is 2*PROP (this will happen when C
transmits at time PROP just before seeing A's packet). So if A receives a
packet before time 2*PROP, A knows a collision *might* have occurred. But if
TRANSP was too small, another host could have transmitted after seeing A's
packet go by and A might receive this packet before time 2*PROP even though
no collision occurred. So given we know that hosts are a minimum of PROPMIN
distance apart, what is the minimum TRANSP that will guarantee that when A
receives a packet before time 2*PROP there necessarily was a collision?
Well, say B transmits a packet immediately after it sees A's packet go by
(hence no collision occurs); B's transmission will start at time TRANSP +
PROPMIN, and A will see B's packet at time TRANSP + 2*PROPMIN. So we need
TRANSP to be such that TRANSP + 2*PROPMIN > 2*PROP, or TRANSP > 2*(PROP -
PROPMIN), and if a host sees another packet within 2*PROP of beginning a
packet transmission this indicates that packet was involved in a collision.



Is there a flaw in my reasoning?



--Evan


.

Path: shelby.stanford.edu!not-for-mail
From: "Dmitry Belogolovsky" <dbb@stanford.edu>
Newsgroups: su.class.cs244a
Subject: losing points
Date: Tue, 9 Mar 2004 18:58:50 -0800
Lines: 5
Distribution: su
Message-ID: <c2m094$m3f$1@news.Stanford.EDU>
NNTP-Posting-Host: dnab422659.stanford.edu
X-Trace: news.Stanford.EDU 1078887524 22639 171.66.38.89 (10 Mar 2004 02:58: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:6974

will we lose points if the code works, but we don't fix style problems (and
efficiency problems) which made us lose points on previous assignments? will
you take off twice?


.

Path: shelby.stanford.edu!not-for-mail
From: "Ayaz" <ayaz@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS4 - Q1: 49(b)
Date: Tue, 9 Mar 2004 21:25:43 -0800
Lines: 12
Distribution: su
Message-ID: <c2m8ss$dc1$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403071608020.7851-100000@elaine43.Stanford.EDU>
X-Trace: news.Stanford.EDU 1078896349 13697 127.0.0.1 (10 Mar 2004 05:25:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
Xref: shelby.stanford.edu su.class.cs244a:6975

Can a TA clarify this please?

"Xiaohua Fang" <xxf5@stanford.edu> wrote in message
news:Pine.GSO.4.44.0403071608020.7851-100000@elaine43.Stanford.EDU...
>
> Whta does it mean "some one of more of 2**20 networks"?
>
> 2**20 networks of 1024-host each?
>
>


.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: HW4: submission script
Date: Wed, 10 Mar 2004 06:27:49 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c2mch5$llr$1@news.Stanford.EDU>
References: <c2ctq0$d5i$1@news.Stanford.EDU> <c2d2rv$hjp$1@news.Stanford.EDU> <c2l9f4$9pk$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
X-Trace: news.Stanford.EDU 1078900069 22203 171.64.15.100 (10 Mar 2004 06:27:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6976


>How do I make it accept the rtable files?

This was answered on the newsgroup previously--there's no need.  We'll
test on our own fixed topology during grading rather than using your
individual ones...

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: losing points
Date: Wed, 10 Mar 2004 06:28:57 +0000 (UTC)
Lines: 10
Distribution: su
Message-ID: <c2mcj9$lqa$1@news.Stanford.EDU>
References: <c2m094$m3f$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
X-Trace: news.Stanford.EDU 1078900137 22346 171.64.15.100 (10 Mar 2004 06:28:57 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6977


>will we lose points if the code works, but we don't fix style problems (and
>efficiency problems) which made us lose points on previous assignments? will
>you take off twice?

We'll make sure you fixed hton/ntoh stuff, since these are easy fixes.
But you won't be slapped on the wrist twice for other style/design
issues--we'll take it on faith that you've learned from your mistakes,
and would write better code next time around...

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS4, Q5(e)
Date: Wed, 10 Mar 2004 06:36:59 +0000 (UTC)
Lines: 12
Distribution: su
Message-ID: <c2md2b$mvh$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403091617200.4409-100000@elaine25.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
X-Trace: news.Stanford.EDU 1078900619 23537 171.64.15.100 (10 Mar 2004 06:36:59 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6978



>For Q5(e), would the ports that were turned off in (b) be turned on
>again, if so, what event could trigger that? the event that the switch
>who wasn't root just claim itself to be the root again?

If the spanning tree has to be reconfigured, ports that were turned off
may have to be turned on to build a new tree.  The exact event that
triggers that might depend on the specifics of the protocol, but
certainly something like a link going down, or a new candidate root,
would seem likely triggers.

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: PS4 - Q1: 49(b)
Date: Wed, 10 Mar 2004 06:42:20 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c2mdcc$nod$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403071608020.7851-100000@elaine43.Stanford.EDU> <c2m8ss$dc1$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
X-Trace: news.Stanford.EDU 1078900940 24333 171.64.15.100 (10 Mar 2004 06:42:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6979


>Can a TA clarify this please?

This seems unambiguous to me given the wording in part (c), at least in
the 2nd ed. of the book?  Yes, 1024 hosts in each network.

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: more confusion on PS3 question 3b
Date: Wed, 10 Mar 2004 06:54:51 +0000 (UTC)
Lines: 42
Distribution: su
Message-ID: <c2me3r$pfb$1@news.Stanford.EDU>
References: <c2ls3f$c9a$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine25.stanford.edu
X-Trace: news.Stanford.EDU 1078901691 26091 171.64.15.100 (10 Mar 2004 06:54:51 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6980

"Evan Parker" <nave@stanford.edu> writes:

>So I'm still confused about 3b. Neither the solution nor the above thread
>"PS3(b) Solution" explain why 2PROP - PROPMIN is the *minimum* that TRANSP
>can be and still allow correct collision detection. Personally I think the
>minimum is 2*(PROP - PROPMIN); here's my reasoning:



>Say A starts transmitting a packet at time 0. A collision will occur if
>another host transmits a packet before A's packet gets to that host. The
>latest A will ever see this second packet is 2*PROP (this will happen when C
>transmits at time PROP just before seeing A's packet). So if A receives a
>packet before time 2*PROP, A knows a collision *might* have occurred. But if
>TRANSP was too small, another host could have transmitted after seeing A's
>packet go by and A might receive this packet before time 2*PROP even though
>no collision occurred. So given we know that hosts are a minimum of PROPMIN
>distance apart, what is the minimum TRANSP that will guarantee that when A
>receives a packet before time 2*PROP there necessarily was a collision?
>Well, say B transmits a packet immediately after it sees A's packet go by
>(hence no collision occurs); B's transmission will start at time TRANSP +
>PROPMIN, and A will see B's packet at time TRANSP + 2*PROPMIN. So we need
>TRANSP to be such that TRANSP + 2*PROPMIN > 2*PROP, or TRANSP > 2*(PROP -
>PROPMIN), and if a host sees another packet within 2*PROP of beginning a
>packet transmission this indicates that packet was involved in a collision.



>Is there a flaw in my reasoning?

Your reasoning is correct in most scenarios (FWIW, it would have been my answer
too), but it breaks down in the case of a star network around a hub (PROP =
PROPMIN here, which gives you only that TRANSP > 0):

   D
   |
A--B--C

You can find a discussion of this at the end of the 2002 newsgroup
archives on the class website; I won't copy and paste the counter-example
here.

.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS4 Q1a
Date: Tue, 9 Mar 2004 22:58:37 -0800
Lines: 16
Distribution: su
Message-ID: <c2mear$pvi$1@news.Stanford.EDU>
References: <c2jdhq$hgv$1@news.Stanford.EDU> <c2juhe$cro$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1078901916 26610 128.12.61.97 (10 Mar 2004 06:58:36 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:6981

I believe the only way it makes sense (given the hint) is "two or more
addresses are the same"

Oded

"Matthew Jonathan Holliman" <holliman@Stanford.EDU> wrote in message
news:c2juhe$cro$1@news.Stanford.EDU...
>
> >Should the question be interpreted to mean
>
> I don't have the 3rd edition, so I can't answer this without seeing
> the wording of the original question.  You can bring it by office
> hours tomorrow if you'd like...
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS4 Q1a
Date: Tue, 9 Mar 2004 23:10:05 -0800
Lines: 21
Distribution: su
Message-ID: <Pine.LNX.4.44.0403092308470.31298-100000@Xenon.Stanford.EDU>
References: <c2jdhq$hgv$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 1078902606 28368 171.64.66.201 (10 Mar 2004 07:10:06 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c2jdhq$hgv$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6982

On Mon, 8 Mar 2004, Tyrone Nicholas wrote:

> Should the question be interpreted to mean
> 
> "exactly two addresses are the same, and all others are different"
> 
> or
> 
> "two or more addresses are the same"
> 
> or
> 
> "there are one or more pairs of addresses"?
> 
> 

what is the difference between (2) and the (3) above? 
doesn't (2) => (3) and (3) => (2)

Shankar

.

Path: shelby.stanford.edu!not-for-mail
From: William Chan <chanman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: more confusion on PS3 question 3b
Date: Wed, 10 Mar 2004 00:05:01 -0800
Lines: 17
Distribution: su
Message-ID: <c2mi7e$g2s$1@news.Stanford.EDU>
References: <c2ls3f$c9a$1@news.Stanford.EDU> <c2me3r$pfb$1@news.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078905902 16476 127.0.0.1 (10 Mar 2004 08:05:02 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (X11/20040209)
X-Accept-Language: en-us, en
In-Reply-To: <c2me3r$pfb$1@news.Stanford.EDU>
X-Enigmail-Version: 0.83.2.0
X-Enigmail-Supports: pgp-inline, pgp-mime
Xref: shelby.stanford.edu su.class.cs244a:6983

How does PROP = PROPMIN?  The hub B is clearly less than PROP from any host.

--William

Matthew Jonathan Holliman wrote:
> Your reasoning is correct in most scenarios (FWIW, it would have been my answer
> too), but it breaks down in the case of a star network around a hub (PROP =
> PROPMIN here, which gives you only that TRANSP > 0):
> 
>    D
>    |
> A--B--C
> 
> You can find a discussion of this at the end of the 2002 newsgroup
> archives on the class website; I won't copy and paste the counter-example
> here.
> 
.

Path: shelby.stanford.edu!not-for-mail
From: "Evan Parker" <nave@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: more confusion on PS3 question 3b
Date: Wed, 10 Mar 2004 00:34:25 -0800
Lines: 48
Distribution: su
Message-ID: <c2mjui$b78$1@news.Stanford.EDU>
References: <c2ls3f$c9a$1@news.Stanford.EDU> <c2me3r$pfb$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cbf08.stanford.edu
X-Trace: news.Stanford.EDU 1078907666 11496 128.12.191.8 (10 Mar 2004 08:34: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:6984

> Your reasoning is correct in most scenarios (FWIW, it would have been my
answer
> too), but it breaks down in the case of a star network around a hub (PROP
=
> PROPMIN here, which gives you only that TRANSP > 0):
>
>    D
>    |
> A--B--C
>
> You can find a discussion of this at the end of the 2002 newsgroup
> archives on the class website; I won't copy and paste the counter-example
> here.

Here's a link to that discussion:
http://www.stanford.edu/class/cs244a/news/news2002.html#3617.

I don't think Martin's counter-example in that thread is enough - he himself
states that he thinks the 2*(PROP-PROPMIN) answer is perfectly acceptable,
*and* Hopil Bae's post immidiately following Martin's post successfully (in
my mind) refutes Martin's counter-example.  So what if the minimum packet
size is 1 bit and hosts are connected in a star network?  Everything still
works out: A sends a packet to B at time 0, C sends a 1 bit packet (to any
host) at some time before C get's A's packet (t < PROP), the two packets
cross at some point, A receives C's packet at time t < 2*PROP and thus
(correctly) decides there was a collision and resends the packet.

I am sorry to bother you TAs with this b/c I know you guys are overworked
already, but I am particularly concerned about this question b/c it seems
like each year many students come up with the answer 2*(PROP-PROPMIN), and
it has never been clear that this answer is actually wrong.  In fact, so far
I have yet to hear of a single person who actually thinks this answer is
incorrect and is not just going by what the answer sheet says.  I know the
amount of points lost is insignificant, and that it would be hardly worth it
to go back and change all the grades from this year (let alone previous
years!), but if 2*(PROP-PROPMIN) is the correct answer then at least we can
change the solution so that students aren't mistakenly marked down in the
future and come away wondering why they couldn't quite understand this (as I
am now).

So: if possible, I'd like a clear explanation of why 2*(PROP-PROPMIN) is
incorrect.

Thanks

--Evan


.

Path: shelby.stanford.edu!not-for-mail
From: "Evan Parker" <nave@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: more confusion on PS3 question 3b
Date: Wed, 10 Mar 2004 00:37:23 -0800
Lines: 10
Distribution: su
Message-ID: <c2mk42$b9l$1@news.Stanford.EDU>
References: <c2ls3f$c9a$1@news.Stanford.EDU> <c2me3r$pfb$1@news.Stanford.EDU> <c2mi7e$g2s$1@news.Stanford.EDU>
NNTP-Posting-Host: dn800cbf08.stanford.edu
X-Trace: news.Stanford.EDU 1078907842 11573 128.12.191.8 (10 Mar 2004 08:37: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:6985

> How does PROP = PROPMIN?  The hub B is clearly less than PROP from any
host.

I don't think the hub is counted as a host; it's just a repeater.  If all
hosts are equal distance from the hub, then PROP=PROPMIN.

See my other response for a link to the more fully explained (but in my mind
still incorrect) counter-example Matthew was talking about.


.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Review Session on 03/05 - CRC Evolution and Long-Division Result
Date: Wed, 10 Mar 2004 02:06:17 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.GSO.4.44.0403100201180.24867-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 1078913180 18324 171.64.15.100 (10 Mar 2004 10:06:20 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:6986


As Nick pointed out in class and in PS4, Q4, the CRC circuit result should
mimic the long-division, row-by-row.  However,
after I went through handout from the review session held on last Friday
"Ciricuit Evolution",  and compare the cicuit result with the long
division result shown in the text book, I really could not see the
correlation.

Could one of the TA explain how I could find out the correlation between
the long-division result and the circuit output?

.

Path: shelby.stanford.edu!not-for-mail
From: David Yu Chen <dychen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: sr_api_init?
Date: Wed, 10 Mar 2004 17:33:14 +0000 (UTC)
Lines: 19
Distribution: su
Message-ID: <c2njgq$q6o$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1078939994 26840 171.64.15.69 (10 Mar 2004 17:33:14 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:6987

Hi,

I'm a little unclear about two of the arguements for sr_api_init.  I 
couldn't find any source files for this bit of VNS glue.
-Should host_in be a hostname (ie vhost or vrouter) or a dotted quad?
-What should be in the rtable passed into rtable_in?  I'm confused since 
 rtables seem to be used only by sr.  Is some version of sr being called
 by sr_api_init?  Do I need to do something different to use my own sr? 

Also, it might help to add a faq page since the AFAIK the topology email 
include info not on the assignment description and random newsgroup 
updates include info not in the topology.  For example, the topology
email mentions routing for vhost and vrouter, but all of the example 
command lines default to the single routing table "rtable".  

Thanks,
---
David Yu Chen
http://www.stanford.edu/~dychen/
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: more confusion on PS3 question 3b
Date: Wed, 10 Mar 2004 11:38:15 -0800
Lines: 64
Distribution: su
Message-ID: <Pine.LNX.4.44.0403101119460.4332-100000@Xenon.Stanford.EDU>
References: <c2ls3f$c9a$1@news.Stanford.EDU> <c2me3r$pfb$1@news.Stanford.EDU>
 <c2mjui$b78$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 1078947497 5674 171.64.66.201 (10 Mar 2004 19:38:17 GMT)
X-Complaints-To: news@news.stanford.edu
To: Evan Parker <nave@stanford.edu>
In-Reply-To: <c2mjui$b78$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6988


> > Your reasoning is correct in most scenarios (FWIW, it would have been my
> answer
> > too), but it breaks down in the case of a star network around a hub (PROP
> =
> > PROPMIN here, which gives you only that TRANSP > 0):
> >
> >    D
> >    |
> > A--B--C
> >
> > You can find a discussion of this at the end of the 2002 newsgroup
> > archives on the class website; I won't copy and paste the counter-example
> > here.
> 
> Here's a link to that discussion:
> http://www.stanford.edu/class/cs244a/news/news2002.html#3617.

 
> I don't think Martin's counter-example in that thread is enough - he himself
> states that he thinks the 2*(PROP-PROPMIN) answer is perfectly acceptable,

 First of all, that was posted when I was a student in the class so considering
 my response as normative is a mistake.  Secondly, as far as I can tell my answer
 holds.  Given the simple hub topology I described, A sends a packet a small
 packet to B which arrives untouched, yet A gets a packet from C within a
 fraction of Prop + the time it sent the original packet.  A can either assume
 it collided in which it will INCORRECTLY send a duplicate packet (contrary to
 your response below), or A can assume it did not collide in which case you can
 easily contrive an example where it doesn't detect a collision.

 .m

> *and* Hopil Bae's post immidiately following Martin's post successfully (in
> my mind) refutes Martin's counter-example.  So what if the minimum packet
> size is 1 bit and hosts are connected in a star network?  Everything still
> works out: A sends a packet to B at time 0, C sends a 1 bit packet (to any
> host) at some time before C get's A's packet (t < PROP), the two packets
> cross at some point, A receives C's packet at time t < 2*PROP and thus
> (correctly) decides there was a collision and resends the packet.
> 
> I am sorry to bother you TAs with this b/c I know you guys are overworked
> already, but I am particularly concerned about this question b/c it seems
> like each year many students come up with the answer 2*(PROP-PROPMIN), and
> it has never been clear that this answer is actually wrong.  In fact, so far
> I have yet to hear of a single person who actually thinks this answer is
> incorrect and is not just going by what the answer sheet says.  I know the
> amount of points lost is insignificant, and that it would be hardly worth it
> to go back and change all the grades from this year (let alone previous
> years!), but if 2*(PROP-PROPMIN) is the correct answer then at least we can
> change the solution so that students aren't mistakenly marked down in the
> future and come away wondering why they couldn't quite understand this (as I
> am now).
> 
> So: if possible, I'd like a clear explanation of why 2*(PROP-PROPMIN) is
> incorrect.
> 
> Thanks
> 
> --Evan
> 
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: sr_api_init?
Date: Wed, 10 Mar 2004 11:50:42 -0800
Lines: 36
Distribution: su
Message-ID: <Pine.LNX.4.44.0403101138420.4332-100000@Xenon.Stanford.EDU>
References: <c2njgq$q6o$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 1078948243 6449 171.64.66.201 (10 Mar 2004 19:50:43 GMT)
X-Complaints-To: news@news.stanford.edu
To: David Yu Chen <dychen@Stanford.EDU>
In-Reply-To: <c2njgq$q6o$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6989


 host_in is the virtual host name (vhost, vrouter)
 and yes rtable is the string name of the routing table.  

> Hi,
> 
> I'm a little unclear about two of the arguements for sr_api_init.  I 
> couldn't find any source files for this bit of VNS glue.
> -Should host_in be a hostname (ie vhost or vrouter) or a dotted quad?
> -What should be in the rtable passed into rtable_in?  I'm confused since 
>  rtables seem to be used only by sr.  Is some version of sr being called
>  by sr_api_init?  Do I need to do something different to use my own sr? 
>
> Also, it might help to add a faq page since the AFAIK the topology email 
> include info not on the assignment description and random newsgroup 
> updates include info not in the topology. 


  I agree, last time when I disseminated updates via email to the class email
  list I got a lot of complaints and recommendations to post them to the
  newsgroup instead.  This time when I posted to the newsgroup I'm getting the
  opposite (though in retrospect doing both would have been preferrable).  A
  per assignment "updates" page seems to be the way to go.

> For example, the topology
> email mentions routing for vhost and vrouter, but all of the example 
> command lines default to the single routing table "rtable".  

 I think the confusion comes in not making it absolutely clear that sr is run
 in sr_src/ and ftpcopy in the directory root in which case you use two
 "rtable" files.  This assignment description should be more clear on this
 point.

 Thanks,
  .m

.

Path: shelby.stanford.edu!not-for-mail
From: "Evan Parker" <nave@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: more confusion on PS3 question 3b
Date: Wed, 10 Mar 2004 12:08:49 -0800
Lines: 32
Distribution: su
Message-ID: <c2nskg$7ql$1@news.Stanford.EDU>
References: <c2ls3f$c9a$1@news.Stanford.EDU> <c2me3r$pfb$1@news.Stanford.EDU> <c2mjui$b78$1@news.Stanford.EDU> <Pine.LNX.4.44.0403101119460.4332-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: dn800cbf08.stanford.edu
X-Trace: news.Stanford.EDU 1078949328 8021 128.12.191.8 (10 Mar 2004 20:08: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:6990

>  First of all, that was posted when I was a student in the class so
considering
>  my response as normative is a mistake.  Secondly, as far as I can tell my
answer
>  holds.  Given the simple hub topology I described, A sends a packet a
small
>  packet to B which arrives untouched, yet A gets a packet from C within a
>  fraction of Prop + the time it sent the original packet.  A can either
assume
>  it collided in which it will INCORRECTLY send a duplicate packet
(contrary to
>  your response below), or A can assume it did not collide in which case
you can
>  easily contrive an example where it doesn't detect a collision.

Ok, so you're saying that even though the packets overlap at some point on
the wire, b/c they don't overlap at the hosts, the hosts see uncorrupted
packets and therefore even though a collision happened it doesn't matter.
That makes sense to me; I was going by the assumption that any packet
overlap, whether or not any host actually sees it, should be considered a
collision.

As Hoi-Cheung Pang has since pointed out to me, shouldn't the equation
therefore be:

TRANSP > max(PROPMIN, 2(PROP - PROPMIN))

Which would make the packetsize always at least PROPMIN, preventing the
problem described above, but still allowing for a smaller min packet size
than the 2*PROP-PROPMIN equation in other cases.


.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: more confusion on PS3 question 3b
Date: Thu, 11 Mar 2004 04:25:20 +0800
Lines: 50
Distribution: su
Message-ID: <404F79AF.67F474DA@leland.stanford.edu>
References: <c2ls3f$c9a$1@news.Stanford.EDU> <c2me3r$pfb$1@news.Stanford.EDU> <c2mjui$b78$1@news.Stanford.EDU> <Pine.LNX.4.44.0403101119460.4332-100000@Xenon.Stanford.EDU> <c2nskg$7ql$1@news.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078950525 8871 128.12.196.85 (10 Mar 2004 20:28:45 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6991

To add on what Evan said, I think Martin's example can be made simpler as
follows:
consider the whole network as:

A - B

where A and B are PROPMIN apart. If we use the formula
TRANSP > 2 (PROP - PROPMIN) then we get the min packet size = 0. So it's
possible that both A and B send a 1-byte packet simulatneously, and both got the
packet correctly, but both conclude wrongly that collision occured.

However, I don't see how this case would ever happen when

TRANSP > max(PROPMIN, 2 (PROP - PROPMIN))

Jimmy

Evan Parker wrote:

> >  First of all, that was posted when I was a student in the class so
> considering
> >  my response as normative is a mistake.  Secondly, as far as I can tell my
> answer
> >  holds.  Given the simple hub topology I described, A sends a packet a
> small
> >  packet to B which arrives untouched, yet A gets a packet from C within a
> >  fraction of Prop + the time it sent the original packet.  A can either
> assume
> >  it collided in which it will INCORRECTLY send a duplicate packet
> (contrary to
> >  your response below), or A can assume it did not collide in which case
> you can
> >  easily contrive an example where it doesn't detect a collision.
>
> Ok, so you're saying that even though the packets overlap at some point on
> the wire, b/c they don't overlap at the hosts, the hosts see uncorrupted
> packets and therefore even though a collision happened it doesn't matter.
> That makes sense to me; I was going by the assumption that any packet
> overlap, whether or not any host actually sees it, should be considered a
> collision.
>
> As Hoi-Cheung Pang has since pointed out to me, shouldn't the equation
> therefore be:
>
> TRANSP > max(PROPMIN, 2(PROP - PROPMIN))
>
> Which would make the packetsize always at least PROPMIN, preventing the
> problem described above, but still allowing for a smaller min packet size
> than the 2*PROP-PROPMIN equation in other cases.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: more confusion on PS3 question 3b
Date: Wed, 10 Mar 2004 13:18:11 -0800
Lines: 45
Distribution: su
Message-ID: <Pine.LNX.4.44.0403101225560.30669-100000@Xenon.Stanford.EDU>
References: <c2ls3f$c9a$1@news.Stanford.EDU> <c2me3r$pfb$1@news.Stanford.EDU>
 <c2mjui$b78$1@news.Stanford.EDU> <Pine.LNX.4.44.0403101119460.4332-100000@Xenon.Stanford.EDU>
 <c2nskg$7ql$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 1078953493 12194 171.64.66.201 (10 Mar 2004 21:18:13 GMT)
X-Complaints-To: news@news.stanford.edu
To: Evan Parker <nave@stanford.edu>
In-Reply-To: <c2nskg$7ql$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6992


> >  First of all, that was posted when I was a student in the class so
> considering
> >  my response as normative is a mistake.  Secondly, as far as I can tell my
> answer
> >  holds.  Given the simple hub topology I described, A sends a packet a
> small
> >  packet to B which arrives untouched, yet A gets a packet from C within a
> >  fraction of Prop + the time it sent the original packet.  A can either
> assume
> >  it collided in which it will INCORRECTLY send a duplicate packet
> (contrary to
> >  your response below), or A can assume it did not collide in which case
> you can
> >  easily contrive an example where it doesn't detect a collision.
> 
> Ok, so you're saying that even though the packets overlap at some point on
> the wire, b/c they don't overlap at the hosts, the hosts see uncorrupted
> packets and therefore even though a collision happened it doesn't matter.
> That makes sense to me; I was going by the assumption that any packet
> overlap, whether or not any host actually sees it, should be considered a
> collision.

   Perhaps I was unclear.  What I'm saying is that the packet from A to B gets
   passed the hub before the packet from C reaches the hub.  Therefore the
   packet sent to B on the line between the hub and B is untouched, i.e. never
   collides with the packet from C.  This is an artifact of the hub replicating
   the packet on the outgoing link to B and C.  
  
 
> As Hoi-Cheung Pang has since pointed out to me, shouldn't the equation
> therefore be:
> 
> TRANSP > max(PROPMIN, 2(PROP - PROPMIN))
> 
> Which would make the packetsize always at least PROPMIN, preventing the
> problem described above, but still allowing for a smaller min packet size
> than the 2*PROP-PROPMIN equation in other cases.

 I don't think so... I can still contrive a case in which it doesn't work.  
 Jimmy, yourself or anyone else curious about this particular problem are more
 than welcome to stop by my office for a live demo.

 .martin

.

Path: shelby.stanford.edu!not-for-mail
From: Jimmy Pang <hcpang@leland.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: more confusion on PS3 question 3b
Date: Thu, 11 Mar 2004 06:15:06 +0800
Lines: 56
Distribution: su
Message-ID: <404F936A.84E6E800@leland.stanford.edu>
References: <c2ls3f$c9a$1@news.Stanford.EDU> <c2me3r$pfb$1@news.Stanford.EDU>
	 <c2mjui$b78$1@news.Stanford.EDU> <Pine.LNX.4.44.0403101119460.4332-100000@Xenon.Stanford.EDU>
	 <c2nskg$7ql$1@news.Stanford.EDU> <Pine.LNX.4.44.0403101225560.30669-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: hcpang.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078957115 15897 128.12.196.85 (10 Mar 2004 22:18:35 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:6993



Martin Casado wrote:

> > >  First of all, that was posted when I was a student in the class so
> > considering
> > >  my response as normative is a mistake.  Secondly, as far as I can tell my
> > answer
> > >  holds.  Given the simple hub topology I described, A sends a packet a
> > small
> > >  packet to B which arrives untouched, yet A gets a packet from C within a
> > >  fraction of Prop + the time it sent the original packet.  A can either
> > assume
> > >  it collided in which it will INCORRECTLY send a duplicate packet
> > (contrary to
> > >  your response below), or A can assume it did not collide in which case
> > you can
> > >  easily contrive an example where it doesn't detect a collision.
> >
> > Ok, so you're saying that even though the packets overlap at some point on
> > the wire, b/c they don't overlap at the hosts, the hosts see uncorrupted
> > packets and therefore even though a collision happened it doesn't matter.
> > That makes sense to me; I was going by the assumption that any packet
> > overlap, whether or not any host actually sees it, should be considered a
> > collision.
>
>    Perhaps I was unclear.  What I'm saying is that the packet from A to B gets
>    passed the hub before the packet from C reaches the hub.  Therefore the
>    packet sent to B on the line between the hub and B is untouched, i.e. never
>    collides with the packet from C.  This is an artifact of the hub replicating
>    the packet on the outgoing link to B and C.
>
>
> > As Hoi-Cheung Pang has since pointed out to me, shouldn't the equation
> > therefore be:
> >
> > TRANSP > max(PROPMIN, 2(PROP - PROPMIN))
> >
> > Which would make the packetsize always at least PROPMIN, preventing the
> > problem described above, but still allowing for a smaller min packet size
> > than the 2*PROP-PROPMIN equation in other cases.
>
>  I don't think so... I can still contrive a case in which it doesn't work.
>  Jimmy, yourself or anyone else curious about this particular problem are more
>  than welcome to stop by my office for a live demo.

Is there any time before your office hours next Monday when you'll be in your
office?

Thanks,
Jimmy

>
>
>  .martin

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Review Session on 03/05 - CRC Evolution and Long-Division Result
Date: Wed, 10 Mar 2004 14:36:34 -0800
Lines: 38
Distribution: su
Message-ID: <Pine.LNX.4.44.0403101431320.9872-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403100201180.24867-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 1078958194 16760 171.64.66.201 (10 Mar 2004 22:36:34 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0403100201180.24867-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:6994


Remember that the reminders seen in the CRC circuit are in reverse order. 
So, the successive reminders seen in the long division:
100 (original message, first 3 bits), 100, 100, 101, 110, 001, 010 (shift 
prev reminder by 1 bit as it starts with 0), 100 (shift again because 
prev one still starts with 0), 101 are the same as the reminders seen in 
circuit beginning step 3 (once enough bits of the message have been 
shifted in) if you read them in the order R3,R2,R1

Shankar 



On Wed, 10 Mar 2004, Xiaohua Fang wrote:

> 
> As Nick pointed out in class and in PS4, Q4, the CRC circuit result should
> mimic the long-division, row-by-row.  However,
> after I went through handout from the review session held on last Friday
> "Ciricuit Evolution",  and compare the cicuit result with the long
> division result shown in the text book, I really could not see the
> correlation.
> 
> Could one of the TA explain how I could find out the correlation between
> the long-division result and the circuit output?
> 
> 

-- 

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: more confusion on PS3 question 3b
Date: Wed, 10 Mar 2004 14:57:08 -0800
Lines: 64
Distribution: su
Message-ID: <Pine.LNX.4.44.0403101456300.20499-100000@Xenon.Stanford.EDU>
References: <c2ls3f$c9a$1@news.Stanford.EDU> <c2me3r$pfb$1@news.Stanford.EDU>
  <c2mjui$b78$1@news.Stanford.EDU> <Pine.LNX.4.44.0403101119460.4332-100000@Xenon.Stanford.EDU>
  <c2nskg$7ql$1@news.Stanford.EDU> <Pine.LNX.4.44.0403101225560.30669-100000@Xenon.Stanford.EDU>
 <404F936A.84E6E800@leland.stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1078959431 17955 171.64.66.201 (10 Mar 2004 22:57:11 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jimmy Pang <hcpang@leland.stanford.edu>
In-Reply-To: <404F936A.84E6E800@leland.stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:6995


 Should be in here most of the day today.  Come on by
 Gates 350. (I'll be out from 5 - 6:30 or so)

 .m

> 
> 
> Martin Casado wrote:
> 
> > > >  First of all, that was posted when I was a student in the class so
> > > considering
> > > >  my response as normative is a mistake.  Secondly, as far as I can tell my
> > > answer
> > > >  holds.  Given the simple hub topology I described, A sends a packet a
> > > small
> > > >  packet to B which arrives untouched, yet A gets a packet from C within a
> > > >  fraction of Prop + the time it sent the original packet.  A can either
> > > assume
> > > >  it collided in which it will INCORRECTLY send a duplicate packet
> > > (contrary to
> > > >  your response below), or A can assume it did not collide in which case
> > > you can
> > > >  easily contrive an example where it doesn't detect a collision.
> > >
> > > Ok, so you're saying that even though the packets overlap at some point on
> > > the wire, b/c they don't overlap at the hosts, the hosts see uncorrupted
> > > packets and therefore even though a collision happened it doesn't matter.
> > > That makes sense to me; I was going by the assumption that any packet
> > > overlap, whether or not any host actually sees it, should be considered a
> > > collision.
> >
> >    Perhaps I was unclear.  What I'm saying is that the packet from A to B gets
> >    passed the hub before the packet from C reaches the hub.  Therefore the
> >    packet sent to B on the line between the hub and B is untouched, i.e. never
> >    collides with the packet from C.  This is an artifact of the hub replicating
> >    the packet on the outgoing link to B and C.
> >
> >
> > > As Hoi-Cheung Pang has since pointed out to me, shouldn't the equation
> > > therefore be:
> > >
> > > TRANSP > max(PROPMIN, 2(PROP - PROPMIN))
> > >
> > > Which would make the packetsize always at least PROPMIN, preventing the
> > > problem described above, but still allowing for a smaller min packet size
> > > than the 2*PROP-PROPMIN equation in other cases.
> >
> >  I don't think so... I can still contrive a case in which it doesn't work.
> >  Jimmy, yourself or anyone else curious about this particular problem are more
> >  than welcome to stop by my office for a live demo.
> 
> Is there any time before your office hours next Monday when you'll be in your
> office?
> 
> Thanks,
> Jimmy
> 
> >
> >
> >  .martin
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Sharing code with router
Date: Wed, 10 Mar 2004 18:27:51 -0800
Lines: 7
Distribution: su
Message-ID: <c2oir7$lp$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine12.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1078972071 697 171.64.15.77 (11 Mar 2004 02:27:51 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.1) Gecko/20020827
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:6996

Suppose we want to re-use code submitted for HW2 in the transport layer. 
  Do we need to actually create two files containing the same code in 
two different directories, or can we fiddle with one or both makefiles 
so that one uses source located in the other?

Tyrone

.

Path: shelby.stanford.edu!elaine30.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Sharing code with router
Date: Thu, 11 Mar 2004 06:59:10 +0000 (UTC)
Lines: 15
Distribution: su
Message-ID: <c2p2nu$f6q$1@news.Stanford.EDU>
References: <c2oir7$lp$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine30.stanford.edu
X-Trace: news.Stanford.EDU 1078988350 15578 171.64.15.105 (11 Mar 2004 06:59:10 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:6997


>Suppose we want to re-use code submitted for HW2 in the transport layer. 
>  Do we need to actually create two files containing the same code in 
>two different directories, or can we fiddle with one or both makefiles 
>so that one uses source located in the other?

You can change the makefiles as you like--we'll try to build targets
'ftpcopy.vns' and 'sr' in the main Makefile during grading, so just
don't break those rules.

But you don't need to go out of your way to factor out common code unless
you want to--we won't really be considering much in the way of style/design
for the final project, since there shouldn't be much new code and this has
already been looked at before.

.

Path: shelby.stanford.edu!not-for-mail
From: "Michael Lyubomirskiy" <lyubomir@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sr_api_init sets errno=9 Bad File Descriptor
Date: Thu, 11 Mar 2004 02:41:23 -0800
Lines: 13
Distribution: su
Message-ID: <c2pfoq$sic$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-50491.stanford.edu
X-Trace: news.Stanford.EDU 1079001690 29260 128.12.51.110 (11 Mar 2004 10: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:6998

I have established that in sr_api_init errno is set to 9, or Bad File
Descriptor, when ran in ftpcopy, both yours and mine (I found it by placing
printfs around this call). I would guess this may have something to do with
my routing table file, but it is in the right directory and apparently its
"default" gateway ip is being read correctly.

So far, I am planning to fight this by explicitly resetting errno to 0.
Still, I was wondering if this problem has ever been observed and/or if
there are any obvious diagnosis for it.

Michael


.

Path: shelby.stanford.edu!not-for-mail
From: "Michael Lyubomirskiy" <lyubomir@stanford.edu>
Newsgroups: su.class.cs244a
Subject: how to make a .purify executable of ftpcopy-vns?
Date: Thu, 11 Mar 2004 03:09:00 -0800
Lines: 11
Distribution: su
Message-ID: <c2phci$lc$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-50491.stanford.edu
X-Trace: news.Stanford.EDU 1079003346 684 128.12.51.110 (11 Mar 2004 11:09: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:6999

how do I modify the Makefile to make .purify of my ftpcopy_vns, or for that
matter of reference ftpcopy_vns? When I tried target setting line like this,

ftpcopy_vns.purify: ftpcopy.o sockets.o ftpparse.o $(OBJS)        $(PURIFY)
$(CC) -o $@ $^ $(LIBS)

I was told that sr_api_init() is an undefined symbol. Note that I am already
able to actually compile and run my ftpcopy_vns, so the problem really seems
to be about setting target for Purify correctly.


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: different file sizes
Date: Thu, 11 Mar 2004 08:32:05 -0800
Lines: 10
Distribution: su
Message-ID: <c2q49t$dv5$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1079022717 14309 128.12.61.97 (11 Mar 2004 16:31: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:7000

Just thought I'd share this with anyone else who might be receiving files of
the wrong size.

I kept getting files that were a few hundred bytes smaller than expected
when using my transport layer.  Turned out my problem was that I was not
processing the data onto which a FIN sequence was piggybacked.

Oded


.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: sr_api_init sets errno=9 Bad File Descriptor
Date: Thu, 11 Mar 2004 17:06:47 +0000 (UTC)
Lines: 19
Distribution: su
Message-ID: <c2q6b7$f35$1@news.Stanford.EDU>
References: <c2pfoq$sic$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1079024807 15461 171.64.15.111 (11 Mar 2004 17:06:47 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:7001


>I have established that in sr_api_init errno is set to 9, or Bad File
>Descriptor, when ran in ftpcopy, both yours and mine (I found it by placing
>printfs around this call). I would guess this may have something to do with
>my routing table file, but it is in the right directory and apparently its
>"default" gateway ip is being read correctly.

>So far, I am planning to fight this by explicitly resetting errno to 0.
>Still, I was wondering if this problem has ever been observed and/or if
>there are any obvious diagnosis for it.

I haven't seen this problem (perhaps Martin can offer any comments), but
I've seen a number of Solaris calls set errno even on successful operation
(gethostbyname_r, pthread_mutex_lock, etc.)  This seems broken to me, as
errno should be set only on a failure, but it's conceivable the same thing
could happen in other calls too.  So it's best to be careful with your use
of errno--you should only rely on it having a meaningful value after an
error return from a library/system call.

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: how to make a .purify executable of ftpcopy-vns?
Date: Thu, 11 Mar 2004 17:10:35 +0000 (UTC)
Lines: 17
Distribution: su
Message-ID: <c2q6ib$f9f$1@news.Stanford.EDU>
References: <c2phci$lc$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1079025035 15663 171.64.15.111 (11 Mar 2004 17:10:35 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:7002


>how do I modify the Makefile to make .purify of my ftpcopy_vns, or for that
>matter of reference ftpcopy_vns? When I tried target setting line like this,
>
>ftpcopy_vns.purify: ftpcopy.o sockets.o ftpparse.o $(OBJS)        $(PURIFY)
>$(CC) -o $@ $^ $(LIBS)

You just need to add $(PURIFY) before the $(CC) for the targets of
interest.  In your example, you link with $(OBJS), but these are the
object files for the old TCP-based simulated network layer--you need to
link instead with the object files used for the VNS-based network layer,
i.e. at a minimum, $(OBJS_VNS) $(VNS_GLUE).  (sr_api_init() is defined in
one of the object files listed under VNS_GLUE).

The easiest way is probably to copy and edit your existing
[your|our].ftpcopy_vns rules.

.

Path: shelby.stanford.edu!not-for-mail
From: "Michael Lyubomirskiy" <lyubomir@stanford.edu>
Newsgroups: su.class.cs244a
Subject: if I decide on using provided ftpcopy for grading, should I submit mine?
Date: Thu, 11 Mar 2004 20:20:58 -0800
Lines: 2
Distribution: su
Message-ID: <c2rdrc$p81$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-50491.stanford.edu
X-Trace: news.Stanford.EDU 1079065260 25857 128.12.51.110 (12 Mar 2004 04:21:00 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:7003



.

Path: shelby.stanford.edu!elaine31.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: if I decide on using provided ftpcopy for grading, should I submit mine?
Date: Fri, 12 Mar 2004 04:26:34 +0000 (UTC)
Lines: 2
Distribution: su
Message-ID: <c2re5q$peh$1@news.Stanford.EDU>
References: <c2rdrc$p81$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine31.stanford.edu
X-Trace: news.Stanford.EDU 1079065594 26065 171.64.15.106 (12 Mar 2004 04:26:34 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:7004

nope, it's not necessary, just as in HW3.

.

Path: shelby.stanford.edu!not-for-mail
From: Tyrone Nicholas <tyronen@Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Padding to 32-bit boundaries
Date: Fri, 12 Mar 2004 04:36:32 +0000 (UTC)
Lines: 11
Distribution: su
Message-ID: <c2reog$qeu$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine4.stanford.edu
X-Trace: news.Stanford.EDU 1079066192 27102 171.64.15.69 (12 Mar 2004 04:36:32 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:7005

Are outgoing IP packets supposed to be padded so that their length is a 
multiple of 4 bytes?  

I'd implemented this in hw2, but now it causes the host to reject incoming
packets with messages like "IP length 113 in frame of len 116; discarding
packet".  When I take it out, everything works fine.  But I seem to recall
it being a requirement of hw2.


Tyrone

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Padding to 32-bit boundaries
Date: Thu, 11 Mar 2004 21:20:09 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.LNX.4.44.0403112120020.30730-100000@Xenon.Stanford.EDU>
References: <c2reog$qeu$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 1079068810 28934 171.64.66.201 (12 Mar 2004 05:20:10 GMT)
X-Complaints-To: news@news.stanford.edu
To: Tyrone Nicholas <tyronen@Stanford.EDU>
In-Reply-To: <c2reog$qeu$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:7006

On Fri, 12 Mar 2004, Tyrone Nicholas wrote:

> Are outgoing IP packets supposed to be padded so that their length is a 
> multiple of 4 bytes?  

 nope.

 .m

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Submit Script
Date: Fri, 12 Mar 2004 08:17:30 -0800
Lines: 3
Distribution: su
Message-ID: <4051E29A.21A913D4@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1079108253 2795 128.12.21.88 (12 Mar 2004 16:17:33 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:7007

If our files are in folders (such as sr_src) will these if specified in
the Makefile be picked up by the submit script?

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Submit Script
Date: Fri, 12 Mar 2004 16:33:55 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c2sopj$3ed$1@news.Stanford.EDU>
References: <4051E29A.21A913D4@stanford.edu>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1079109235 3533 171.64.15.74 (12 Mar 2004 16:33:55 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:7008


>If our files are in folders (such as sr_src) will these if specified in
>the Makefile be picked up by the submit script?

Yep, they should be (irrespective of your Makefile--the script just looks
for *.c, *.h, etc. anywhere within the current directory and its
subdirectories).

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Elasticity Buffer
Date: Fri, 12 Mar 2004 09:44:24 -0800
Lines: 8
Distribution: su
Message-ID: <c2ssro$66n$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1079113400 6359 128.12.189.163 (12 Mar 2004 17:43: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:7009

Hi,
Could someone please explain how the buffer size is calcualted for underflow
in the elasticity buffer problem in the problem session that Shankar
conducted?
Thanks,
Haripriya


.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Submission
Date: Fri, 12 Mar 2004 11:00:13 -0800
Lines: 5
Distribution: su
Message-ID: <405208BD.22092DD3@stanford.edu>
NNTP-Posting-Host: ryan05.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1079118016 9650 128.12.21.88 (12 Mar 2004 19:00:16 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:7010

The instructinos say we need transport.c, sources for ftpcopy, and
sources for router.  But it also says we can use 1 free binary.  Do we
need to submit the code for the assignment we choose to replace with a
binary?

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Submission
Date: Fri, 12 Mar 2004 19:02:44 +0000 (UTC)
Lines: 7
Distribution: su
Message-ID: <c2t1gk$9ko$1@news.Stanford.EDU>
References: <405208BD.22092DD3@stanford.edu>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1079118164 9880 171.64.15.74 (12 Mar 2004 19:02:44 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:7011


>The instructinos say we need transport.c, sources for ftpcopy, and
>sources for router.  But it also says we can use 1 free binary.  Do we
>need to submit the code for the assignment we choose to replace with a
>binary?

Nope.
.

Path: shelby.stanford.edu!not-for-mail
From: "Tim Grow" <grow@stanford.edu>
Newsgroups: su.class.cs244a
Subject: sr_api_init
Date: Fri, 12 Mar 2004 11:07:04 -0800
Lines: 14
Distribution: su
Message-ID: <c2t1oi$9nq$1@news.Stanford.EDU>
NNTP-Posting-Host: grow.stanford.edu
X-Trace: news.Stanford.EDU 1079118418 9978 128.12.191.36 (12 Mar 2004 19:06: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:7012

Hi-

When I try to include my ftpcopy I get the following error:

/afs/ir/users/g/r/grow/cs244a/hw4/ftpcopy.c: undefined reference to
'sr_api_init'

Do we need to change the Makefile so ftpcopy can compile?  Or am I doing
something silly (like calling sr_api_init at the wrong spot)?

Thanks,
Tim


.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: sr_api_init
Date: Fri, 12 Mar 2004 19:17:24 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c2t2c4$a7a$1@news.Stanford.EDU>
References: <c2t1oi$9nq$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1079119044 10474 171.64.15.74 (12 Mar 2004 19:17:24 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:7013


>When I try to include my ftpcopy I get the following error:

'make ftpcopy_vns' should avoid the error.  you can also take out 'all_hw3'
from your 'all' prerequisites (you could change the Makefile to build both
HW3 and HW4 versions of ftpcopy, as long as you don't break the
'ftpcopy_vns' rule).

.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: HW4 submission reminder...
Date: Fri, 12 Mar 2004 20:03:20 +0000 (UTC)
Lines: 14
Distribution: su
Message-ID: <c2t528$cqb$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1079121800 13131 171.64.15.74 (12 Mar 2004 20:03:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:7014


Just a reminder--
Please be sure that you follow the directions on the webpage for submitting
HW4.

* Your router code *must* be found in sr_src (or if not, it must be in a
  subdirectory of your main ftpcopy/stcp code, and your Makefile must
  be updated accordingly).  If you don't follow this, i.e. 'make sr' fails
  in your main directory, we will use our router for grading.  You can
  check whether you're set up to use your router by doing 'make sr' yourself.

* 'make ftpcopy_vns' must build the VNS-based ftpcopy (either yours or
  ours, depending on your choice).

.

Path: shelby.stanford.edu!not-for-mail
From: Seungbeom Kim <sbkim@stanford.edu>
Newsgroups: su.class.cs244a
Subject: HW4 submission problem: no space left on device
Date: Fri, 12 Mar 2004 14:09:49 -0800
Lines: 21
Distribution: su
Message-ID: <4052352D.2D1C6CE9@stanford.edu>
NNTP-Posting-Host: sbkim.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1079129401 19373 128.12.181.98 (12 Mar 2004 22:10:01 GMT)
X-Complaints-To: news@news.stanford.edu
To: Susan Shepard <shepard8@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:7015

When I tried to submit my updated files for HW4, an error occurred:

> Renaming old submission...
> /usr/pubsw/bin/tar -czvf /afs/ir/class/cs244a/submissions/grading/hw4/shepard8/sbkim/files.tar.gz ...
> tar (child): Cannot open archive /afs/ir/class/cs244a/submissions/grading/hw4/shepard8/sbkim/files.tar.gz: No space left on device
> tar (child): Error is not recoverable: exiting now
> ======================================================================
> Your code could not be sumitted because of some error. 
> If you think there is a mistake, please send an email to your TA 
> (shepard8; <shepard8@stanford.edu>) with the relevant information.
> ======================================================================

What should I do now?
(I have to leave the terminal now and I'm not sure
whether I can log in again before the deadline.)

I also guess that other people would have the same problem..

-- 
Seungbeom Kim

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Elasticity Buffer
Date: Fri, 12 Mar 2004 15:10:10 -0800
Lines: 24
Distribution: su
Message-ID: <Pine.LNX.4.44.0403121457170.1015-100000@Xenon.Stanford.EDU>
References: <c2ssro$66n$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 1079133011 22244 171.64.66.201 (12 Mar 2004 23:10:11 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <c2ssro$66n$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:7016


To prevent underflow when the receiver is draining faster than the sender 
is sending, you need to have enough bits in the buffer before 
you start draining. Because the receiver is draining at 100Mbps, the 
draining will take only take P/100 micro-sec. So, you can start no earlier 
than t-P/100 where t is the time at which the packet will be fully 
received. Because the sender is sending at 10Mbps, t=P/10 micro-sec. Rest 
of the solution is simple geometry based on the graph.  

What aspect of the above do you have difficulty following?

Shankar

On Fri, 12 Mar 2004, Haripriya Rajagopal wrote:

> Hi,
> Could someone please explain how the buffer size is calcualted for underflow
> in the elasticity buffer problem in the problem session that Shankar
> conducted?
> Thanks,
> Haripriya
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: HW4 submission problem: no space left on device
Date: Fri, 12 Mar 2004 15:14:56 -0800
Lines: 26
Distribution: su
Message-ID: <Pine.LNX.4.44.0403121511001.6524-100000@Xenon.Stanford.EDU>
References: <4052352D.2D1C6CE9@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1079133298 22455 171.64.66.201 (12 Mar 2004 23:14:58 GMT)
X-Complaints-To: news@news.stanford.edu
Cc: Susan Shepard <shepard8@stanford.edu>
To: Seungbeom Kim <sbkim@stanford.edu>
In-Reply-To: <4052352D.2D1C6CE9@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:7017



 Can you try resubmitting?

  .m

> When I tried to submit my updated files for HW4, an error occurred:
> 
> > Renaming old submission...
> > /usr/pubsw/bin/tar -czvf /afs/ir/class/cs244a/submissions/grading/hw4/shepard8/sbkim/files.tar.gz ...
> > tar (child): Cannot open archive /afs/ir/class/cs244a/submissions/grading/hw4/shepard8/sbkim/files.tar.gz: No space left on device
> > tar (child): Error is not recoverable: exiting now
> > ======================================================================
> > Your code could not be sumitted because of some error. 
> > If you think there is a mistake, please send an email to your TA 
> > (shepard8; <shepard8@stanford.edu>) with the relevant information.
> > ======================================================================
> 
> What should I do now?
> (I have to leave the terminal now and I'm not sure
> whether I can log in again before the deadline.)
> 
> I also guess that other people would have the same problem..
> 
> 

.

Path: shelby.stanford.edu!elaine27.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: HW4 submission problem: no space left on device
Date: Fri, 12 Mar 2004 23:15:14 +0000 (UTC)
Lines: 6
Distribution: su
Message-ID: <c2tga2$lu1$1@news.Stanford.EDU>
References: <4052352D.2D1C6CE9@stanford.edu>
NNTP-Posting-Host: elaine27.stanford.edu
X-Trace: news.Stanford.EDU 1079133314 22465 171.64.15.102 (12 Mar 2004 23:15:14 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:7018


>When I tried to submit my updated files for HW4, an error occurred:

I've tried to clear out some space.  Please try again, or email your TA
a tarball if you still get the error (last resort, please!)

.

Path: shelby.stanford.edu!not-for-mail
From: Adar Dembo <adar@stanford.edu>
Newsgroups: su.class.cs244a
Subject: default values for sr_api_init() ?
Date: Fri, 12 Mar 2004 16:29:27 -0800
Lines: 31
Distribution: su
Message-ID: <c2tkl7$qbh$1@news.Stanford.EDU>
NNTP-Posting-Host: adar.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1079137767 26993 128.12.72.21 (13 Mar 2004 00:29:27 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:7019

Hey,

	I understand which default values to pass to sr_api_init() in the case 
where the user hasn't specified them on the command line.

	But more often than not, sr_api_init() fails with certain parameters 
being default and others being passed in. Example:

elaine43:~/CS244a/PA4> ./ftpcopy_vns -t 116 -r rtable-vhost dat 4 
ftp.slac.stanford.edu test2
********************
Destination: 0.0.0.0
   Gateway : 192.168.128.90
   Mask : 0.0.0.0
   Interface : eth0
********************
Client pepe connecting to Server 171.67.71.19:12345
Requesting topology 116
Sending c_open (type=1 len=108)
vns server closed session.
Reason: reservehost failed
recv(..):sr_client.c::sr_read_from_server: Bad file number
Error: could not get hardware information from the server[TODO]: 
sr_vns_integ_destroy
can't initialise VNS subsystem

I've omitted -v vhost, but everything else is passed in. What is the 
default value for -v? vrouter? More appropriately, for which set of 
"default" values is sr_api_init() supposed to work?

-Adar
.

Path: shelby.stanford.edu!not-for-mail
From: Adar Dembo <adar@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: default values for sr_api_init() ?
Date: Fri, 12 Mar 2004 16:32:16 -0800
Lines: 68
Distribution: su
Message-ID: <c2tkqg$qbh$2@news.Stanford.EDU>
References: <c2tkl7$qbh$1@news.Stanford.EDU>
NNTP-Posting-Host: adar.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1079137936 26993 128.12.72.21 (13 Mar 2004 00:32:16 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207)
X-Accept-Language: en-us, en
In-Reply-To: <c2tkl7$qbh$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:7020

Here is another example:

elaine43:~/CS244a/PA4> ./ftpcopy_vns -t 116 -v vhost mp3 3 
192.168.128.89 test2
********************
Destination: 192.168.128.89
   Gateway : 0.0.0.0
   Mask : 255.255.255.255
   Interface : eth1
Destination: 171.67.71.116
   Gateway : 0.0.0.0
   Mask : 255.255.255.255
   Interface : eth2
Destination: 0.0.0.0
   Gateway : 172.24.74.17
   Mask : 0.0.0.0
   Interface : eth0
********************
Client pepe connecting to Server 171.67.71.19:12345
Requesting topology 116
Sending c_open (type=1 len=108)
Received Hardware Info with 6 entries
Interface: eth0
Speed: 0
Hardware Address: 70:00:00:74:00:06
Ethernet IP: 171.67.71.116
Subnet: 0.0.0.0
Mask: 0.0.0.0
Routing table not consistent with hardware

This is the command line given in the program specification, so is my 
program behavior incorrect? What am I missing here?

-Adar

Adar Dembo wrote:

> Hey,
> 
>     I understand which default values to pass to sr_api_init() in the 
> case where the user hasn't specified them on the command line.
> 
>     But more often than not, sr_api_init() fails with certain parameters 
> being default and others being passed in. Example:
> 
> elaine43:~/CS244a/PA4> ./ftpcopy_vns -t 116 -r rtable-vhost dat 4 
> ftp.slac.stanford.edu test2
> ********************
> Destination: 0.0.0.0
>   Gateway : 192.168.128.90
>   Mask : 0.0.0.0
>   Interface : eth0
> ********************
> Client pepe connecting to Server 171.67.71.19:12345
> Requesting topology 116
> Sending c_open (type=1 len=108)
> vns server closed session.
> Reason: reservehost failed
> recv(..):sr_client.c::sr_read_from_server: Bad file number
> Error: could not get hardware information from the server[TODO]: 
> sr_vns_integ_destroy
> can't initialise VNS subsystem
> 
> I've omitted -v vhost, but everything else is passed in. What is the 
> default value for -v? vrouter? More appropriately, for which set of 
> "default" values is sr_api_init() supposed to work?
> 
> -Adar
.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: default values for sr_api_init() ?
Date: Fri, 12 Mar 2004 16:51:10 -0800
Lines: 44
Distribution: su
Message-ID: <Pine.LNX.4.44.0403121649510.6283-100000@Xenon.Stanford.EDU>
References: <c2tkl7$qbh$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 1079139072 29340 171.64.66.201 (13 Mar 2004 00:51:12 GMT)
X-Complaints-To: news@news.stanford.edu
To: Adar Dembo <adar@stanford.edu>
In-Reply-To: <c2tkl7$qbh$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:7021


> Hey,

 hi
  
> 
> 	I understand which default values to pass to sr_api_init() in the case 
> where the user hasn't specified them on the command line.

 don't worry about it, we will pass in the correct parameters.

> 	But more often than not, sr_api_init() fails with certain parameters 
> being default and others being passed in. Example:

 correct .. the default topoid and hostname doesn't make much sense.  Thats
 OK.

 .m

> elaine43:~/CS244a/PA4> ./ftpcopy_vns -t 116 -r rtable-vhost dat 4 
> ftp.slac.stanford.edu test2
> ********************
> Destination: 0.0.0.0
>    Gateway : 192.168.128.90
>    Mask : 0.0.0.0
>    Interface : eth0
> ********************
> Client pepe connecting to Server 171.67.71.19:12345
> Requesting topology 116
> Sending c_open (type=1 len=108)
> vns server closed session.
> Reason: reservehost failed
> recv(..):sr_client.c::sr_read_from_server: Bad file number
> Error: could not get hardware information from the server[TODO]: 
> sr_vns_integ_destroy
> can't initialise VNS subsystem
> 
> I've omitted -v vhost, but everything else is passed in. What is the 
> default value for -v? vrouter? More appropriately, for which set of 
> "default" values is sr_api_init() supposed to work?
> 
> -Adar
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: default values for sr_api_init() ?
Date: Fri, 12 Mar 2004 16:52:01 -0800
Lines: 77
Distribution: su
Message-ID: <Pine.LNX.4.44.0403121651210.6283-100000@Xenon.Stanford.EDU>
References: <c2tkl7$qbh$1@news.Stanford.EDU> <c2tkqg$qbh$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 1079139123 29429 171.64.66.201 (13 Mar 2004 00:52:03 GMT)
X-Complaints-To: news@news.stanford.edu
To: Adar Dembo <adar@stanford.edu>
In-Reply-To: <c2tkqg$qbh$2@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:7022


 The default routing table is "rtable" which in this case probably has
 more routes than vhost has interfaces.  This isn't necessarily a problem
 nor a bug.

 .m

> Here is another example:
> 
> elaine43:~/CS244a/PA4> ./ftpcopy_vns -t 116 -v vhost mp3 3 
> 192.168.128.89 test2
> ********************
> Destination: 192.168.128.89
>    Gateway : 0.0.0.0
>    Mask : 255.255.255.255
>    Interface : eth1
> Destination: 171.67.71.116
>    Gateway : 0.0.0.0
>    Mask : 255.255.255.255
>    Interface : eth2
> Destination: 0.0.0.0
>    Gateway : 172.24.74.17
>    Mask : 0.0.0.0
>    Interface : eth0
> ********************
> Client pepe connecting to Server 171.67.71.19:12345
> Requesting topology 116
> Sending c_open (type=1 len=108)
> Received Hardware Info with 6 entries
> Interface: eth0
> Speed: 0
> Hardware Address: 70:00:00:74:00:06
> Ethernet IP: 171.67.71.116
> Subnet: 0.0.0.0
> Mask: 0.0.0.0
> Routing table not consistent with hardware
> 
> This is the command line given in the program specification, so is my 
> program behavior incorrect? What am I missing here?
> 
> -Adar
> 
> Adar Dembo wrote:
> 
> > Hey,
> > 
> >     I understand which default values to pass to sr_api_init() in the 
> > case where the user hasn't specified them on the command line.
> > 
> >     But more often than not, sr_api_init() fails with certain parameters 
> > being default and others being passed in. Example:
> > 
> > elaine43:~/CS244a/PA4> ./ftpcopy_vns -t 116 -r rtable-vhost dat 4 
> > ftp.slac.stanford.edu test2
> > ********************
> > Destination: 0.0.0.0
> >   Gateway : 192.168.128.90
> >   Mask : 0.0.0.0
> >   Interface : eth0
> > ********************
> > Client pepe connecting to Server 171.67.71.19:12345
> > Requesting topology 116
> > Sending c_open (type=1 len=108)
> > vns server closed session.
> > Reason: reservehost failed
> > recv(..):sr_client.c::sr_read_from_server: Bad file number
> > Error: could not get hardware information from the server[TODO]: 
> > sr_vns_integ_destroy
> > can't initialise VNS subsystem
> > 
> > I've omitted -v vhost, but everything else is passed in. What is the 
> > default value for -v? vrouter? More appropriately, for which set of 
> > "default" values is sr_api_init() supposed to work?
> > 
> > -Adar
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!pshankar
From: Shankar Ponnekanti <pshankar@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: PS4 solutions
Date: Sat, 13 Mar 2004 11:17:55 -0800
Lines: 5
Distribution: su
Message-ID: <Pine.LNX.4.44.0403131106440.1863-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 1079205476 21442 171.64.66.201 (13 Mar 2004 19:17:56 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:7023


Now posted on the class homepage.

Shankar

.

Path: shelby.stanford.edu!not-for-mail
From: "Tim Grow" <grow@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3 not available?
Date: Sat, 13 Mar 2004 13:17:25 -0800
Lines: 6
Distribution: su
Message-ID: <c2vtp5$ppc$1@news.Stanford.EDU>
NNTP-Posting-Host: grow.stanford.edu
X-Trace: news.Stanford.EDU 1079212645 26412 128.12.191.36 (13 Mar 2004 21:17: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:7024

Hi-

The requested URL /class/cs244a/homeworks/ps3/problem_set3_win04.pdf was not
found on this server.


.

Path: shelby.stanford.edu!not-for-mail
From: "Tim Grow" <grow@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: midterm solutions
Date: Sat, 13 Mar 2004 14:52:09 -0800
Lines: 20
Distribution: su
Message-ID: <c303b0$ov$1@news.Stanford.EDU>
References: <c26mg9$9ij$1@news.Stanford.EDU> <Pine.LNX.4.44.0403041100510.32379-100000@Xenon.Stanford.EDU>
NNTP-Posting-Host: grow.stanford.edu
X-Trace: news.Stanford.EDU 1079218336 799 128.12.191.36 (13 Mar 2004 22:52: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:7025

Did the solutions get posted? I don't seem them on the website or eeclass...
Maybe I'm looking at the wrong spot?

Tim

"Martin Casado" <casado@Xenon.Stanford.EDU> wrote in message
news:Pine.LNX.4.44.0403041100510.32379-100000@Xenon.Stanford.EDU...
>
>  Yup soon! :)
>
>   .m
>
> > just wondering if you guys were gonna post the midterm solutions.
thanks!
> >
> >
> >
>


.

Path: shelby.stanford.edu!not-for-mail
From: Susan Noreen Shepard <shepard8@elaine21.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3 not available?
Date: 13 Mar 2004 17:03:09 -0800
Organization: Stanford University, CA, USA
Lines: 11
Distribution: su
Message-ID: <snnbrn0me9e.fsf@elaine21.Stanford.EDU>
References: <c2vtp5$ppc$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine21.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1079226189 6173 171.64.15.86 (14 Mar 2004 01:03: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:7026

I don't know what happened to it, but I just re-added it.  You should be
able to follow the link now.

Susan

"Tim Grow" <grow@stanford.edu> writes:

> Hi-
> 
> The requested URL /class/cs244a/homeworks/ps3/problem_set3_win04.pdf was not
> found on this server.
.

Path: shelby.stanford.edu!elaine10.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Mid-Term Q6(a)
Date: Sun, 14 Mar 2004 10:22:51 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.GSO.4.44.0403141016320.4771-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 1079288573 21918 171.64.15.75 (14 Mar 2004 18:22:53 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:7027


In Friday's review session, the answer given for Q6(a) is something like
following:

A(K) = 240000 * floor(k/6) + 0		k mod 6 = 0
                           + 20,000     k mod 6 = 1
                           + 40,000     k mod 6 = 2
                           ....


I don't understand why when "k mod 6 = 1", there would be a frame of
20,000.  I thought the first frame is always an I-frame, which should have
100,000 bits.  So, should the following be true?

A(K0 = 240000 * floor(k/6) + 100,000  	k mod 6 = 1
                           + 120,000    k mod 6 = 2
                           + 140,000    k mod 6 = 3
                           + 200,000    k mod 6 = 4
                           + 220,000    k mod 6 = 5
If this is not true, could TA please explain why?

-Laura

.

Path: shelby.stanford.edu!elaine10.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS3 Q1(a) solution
Date: Sun, 14 Mar 2004 10:58:06 -0800
Lines: 9
Distribution: su
Message-ID: <Pine.GSO.4.44.0403141054250.4771-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 1079290689 23994 171.64.15.75 (14 Mar 2004 18:58:09 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:7028


From the solution, it says:

row = 11000bits 1000bits/10s = 1000bits/s

I really don't understand the math here.  TA, could you please explain?

-Laura

.

Path: shelby.stanford.edu!elaine10.Stanford.EDU!xxf5
From: Xiaohua Fang <xxf5@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Midterm Solution Q6(c)(iii), Q6(d)
Date: Sun, 14 Mar 2004 12:05:52 -0800
Lines: 14
Distribution: su
Message-ID: <Pine.GSO.4.44.0403141151520.5698-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 1079294758 26624 171.64.15.75 (14 Mar 2004 20:05:58 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:7029


Q6(c) (iii), the answer says the buffer has to accomadate the data for the
time duration of 0.25 + (Qmax - Qmin).
Why isn't it 0.25 + Qmax?  Why is it the delay that needed to accomadate
the Qmin got ignored?

Q6(d), the answer says 30second.  However, I thought the video clip is
only 10 seconds long.  Should it be answer be 7.5 seconds?  Basically, the
playback will run at 400Kb/s and the network will run at 100Kb/s.
All 10-second video will be all available by t = 10second.  We need
to make sure this 10 seconds video can be played by at 400Kb/s at
t=10second.  So, the playback can start at t=7.5seconds.  Is my
reasoninging correct?

.

Path: shelby.stanford.edu!not-for-mail
From: "Tim Grow" <grow@stanford.edu>
Newsgroups: su.class.cs244a
Subject: midterm solution
Date: Sun, 14 Mar 2004 13:17:55 -0800
Lines: 12
Distribution: su
Message-ID: <c32i62$sho$1@news.Stanford.EDU>
NNTP-Posting-Host: grow.stanford.edu
X-Trace: news.Stanford.EDU 1079299075 29240 128.12.191.36 (14 Mar 2004 21:17: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:7030

Dumb question -

Where can I find solutions to this year's midterm?  On March 3 Martin said
the midterm solutions would be posted soon, but I don't see the solutions on
http://www.stanford.edu/class/cs244a/timetable.html or eeclass.

Sorry if this has already been answered.

Thanks,
Tim


.

Path: shelby.stanford.edu!not-for-mail
From: "Tim Grow" <grow@stanford.edu>
Newsgroups: su.class.cs244a
Subject: 2003 final: Q9d
Date: Sun, 14 Mar 2004 13:22:53 -0800
Lines: 18
Distribution: su
Message-ID: <c32ifb$smp$1@news.Stanford.EDU>
NNTP-Posting-Host: grow.stanford.edu
X-Trace: news.Stanford.EDU 1079299371 29401 128.12.191.36 (14 Mar 2004 21:22: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:7031

Question Q9d on the 2003 final asks us to find N s.t.

PER = 1 - (1 - BER)^N.

The posted solution says you can find N via the following approximation:

1 - (1 - BER)^N ~= N * BER

If you use this approximation, you get N = 10^4.

I don't understand why you need the approximation.  If you solve for N using
PER = 1 - (1 - BER)^N, you get N ~= 10^10.  Why is this answer so different
from 10^4?

Thanks,
Tim


.

Path: shelby.stanford.edu!saga15.Stanford.EDU!echron
From: Edward Chron <echron@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: PS3 Q1(a) solution
Date: Sun, 14 Mar 2004 14:58:38 -0800
Lines: 19
Distribution: su
Message-ID: <Pine.GSO.4.44.0403141453380.3507-100000@saga15.Stanford.EDU>
References: <Pine.GSO.4.44.0403141054250.4771-100000@elaine10.Stanford.EDU>
NNTP-Posting-Host: saga15.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1079305120 4421 171.64.15.145 (14 Mar 2004 22:58:40 GMT)
X-Complaints-To: news@news.stanford.edu
In-Reply-To: <Pine.GSO.4.44.0403141054250.4771-100000@elaine10.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:7032

Well I'm no TA but it looks like a typeo to me. I think it should read:

11000bits - 1000bits / 10s = 1000bits/s

I mentioned this to the TAs when the solution came out but I guess they
didn't have time to make a correction.

>
> From the solution, it says:
>
> row = 11000bits 1000bits/10s = 1000bits/s
>
> I really don't understand the math here.  TA, could you please explain?
>
> -Laura
>
>


.

Path: shelby.stanford.edu!not-for-mail
From: "Tim Grow" <grow@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: 2003 final: Q9d
Date: Sun, 14 Mar 2004 15:15:58 -0800
Lines: 28
Distribution: su
Message-ID: <c32p3f$4u8$1@news.Stanford.EDU>
References: <c32ifb$smp$1@news.Stanford.EDU>
NNTP-Posting-Host: grow.stanford.edu
X-Trace: news.Stanford.EDU 1079306160 5064 128.12.191.36 (14 Mar 2004 23:16:00 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:7033

Oops - never mind.  Actually both approaches get N = 10^4

Sorry!

"Tim Grow" <grow@stanford.edu> wrote in message
news:c32ifb$smp$1@news.Stanford.EDU...
> Question Q9d on the 2003 final asks us to find N s.t.
>
> PER = 1 - (1 - BER)^N.
>
> The posted solution says you can find N via the following approximation:
>
> 1 - (1 - BER)^N ~= N * BER
>
> If you use this approximation, you get N = 10^4.
>
> I don't understand why you need the approximation.  If you solve for N
using
> PER = 1 - (1 - BER)^N, you get N ~= 10^10.  Why is this answer so
different
> from 10^4?
>
> Thanks,
> Tim
>
>


.

Path: shelby.stanford.edu!elaine9.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: midterm solution
Date: Mon, 15 Mar 2004 05:38:49 +0000 (UTC)
Lines: 8
Distribution: su
Message-ID: <c33fh9$ep3$1@news.Stanford.EDU>
References: <c32i62$sho$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine9.stanford.edu
X-Trace: news.Stanford.EDU 1079329129 15139 171.64.15.74 (15 Mar 2004 05:38:49 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:7034


>Where can I find solutions to this year's midterm?  On March 3 Martin said
>the midterm solutions would be posted soon, but I don't see the solutions on
>http://www.stanford.edu/class/cs244a/timetable.html or eeclass.

Sorry about this--
I've just posted the solutions.

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS3 Q1(a) solution
Date: Mon, 15 Mar 2004 09:45:43 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0403150945020.19665-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403141054250.4771-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 1079372744 18477 171.64.66.201 (15 Mar 2004 17:45:44 GMT)
X-Complaints-To: news@news.stanford.edu
To: Xiaohua Fang <xxf5@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403141054250.4771-100000@elaine10.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:7035


 LaTeX left out the '-' that should be (11000 - 1000)/10

 .m

> 
> From the solution, it says:
> 
> row = 11000bits 1000bits/10s = 1000bits/s
> 
> I really don't understand the math here.  TA, could you please explain?
> 
> -Laura
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Haripriya Rajagopal" <hpriya@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Bridges and Switches
Date: Mon, 15 Mar 2004 17:29:10 -0800
Lines: 24
Distribution: su
Message-ID: <c35l70$en0$1@news.Stanford.EDU>
NNTP-Posting-Host: rescomp-03-61723.stanford.edu
X-Trace: news.Stanford.EDU 1079400480 15072 128.12.189.163 (16 Mar 2004 01:28:00 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:7036

Hi,
In Ps-4  Q-5, we see that after the tree is built, port 3 closes its port
for forwarding to port 6.
But does it mean that 6 also stops forwarding the configuration messages to
port 3?
If I do assume the above, then I cannot understand how the spanning tree
explained in PD pg 188 would work as B3 would try to claim that it is root
even when no link is down.
But if 3 can still receive messages from 6, then
in the Q-5 in PS-4, when the link between 1-2 goes down, it is only 2 which
does not receive any configuration message for 10 seconds.Am I right in
thinking this?(3 will still be receiving messages from 6 and 4 from 7)
Also if this does happen, at time t=10,2 will send out a message claiming to
be root.At that point 3 will get 2 messages- one from 2 and one from 6.It
obviously chooses the one sent by 6.
at time t=15, then 3 (which already knows that 1 is root through 6) will
send a message to 2
that "1 is root".
This thinking differs though with the solution put up.
Please let me know if  the above is wrong.
Thanks,
Haripriya


.

Path: shelby.stanford.edu!elaine11.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Mid-Term Q6(a)
Date: Tue, 16 Mar 2004 06:09:31 +0000 (UTC)
Lines: 16
Distribution: su
Message-ID: <c365mr$1rp$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403141016320.4771-100000@elaine10.Stanford.EDU>
NNTP-Posting-Host: elaine11.stanford.edu
X-Trace: news.Stanford.EDU 1079417371 1913 171.64.15.76 (16 Mar 2004 06:09:31 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:7037



>A(K0 = 240000 * floor(k/6) + 100,000  	k mod 6 = 1
>                           + 120,000    k mod 6 = 2
>                           + 140,000    k mod 6 = 3
>                           + 200,000    k mod 6 = 4
>                           + 220,000    k mod 6 = 5

The I-frame went missing in the posted solns for some reason.  I've updated
them.

For the eqn above, the floor() assumes that k starts from 0, but then
RHS of the '+' assumes it starts from 1.  The 'k mod 6' should instead = 0,
1, 2, etc., and then you also need a 6th case for the final B-frame in each
group.

.

Path: shelby.stanford.edu!elaine11.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Midterm Solution Q6(c)(iii), Q6(d)
Date: Tue, 16 Mar 2004 06:15:20 +0000 (UTC)
Lines: 29
Distribution: su
Message-ID: <c3661o$26e$1@news.Stanford.EDU>
References: <Pine.GSO.4.44.0403141151520.5698-100000@elaine10.Stanford.EDU>
NNTP-Posting-Host: elaine11.stanford.edu
X-Trace: news.Stanford.EDU 1079417720 2254 171.64.15.76 (16 Mar 2004 06:15:20 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:7038



>Q6(c) (iii), the answer says the buffer has to accomadate the data for the
>time duration of 0.25 + (Qmax - Qmin).
>Why isn't it 0.25 + Qmax?  Why is it the delay that needed to accomadate
>the Qmin got ignored?

This only affects the end-to-end latency, it doesn't change how long you
have to buffer data to reduce jitter.  For example, if Qmin = Qmax in
the router, you'd have only a deterministic delay, and would see only
a (larger) constant latency that would be indistinguishable from usual
TRANSP/PROP--so you'd still only have to buffer for 0.25s before decoding.
(By "buffering," I mean, time from when the first bit of data arrives until
you can begin playback).

>Q6(d), the answer says 30second.  However, I thought the video clip is
>only 10 seconds long.  Should it be answer be 7.5 seconds?  Basically, the
>playback will run at 400Kb/s and the network will run at 100Kb/s.
>All 10-second video will be all available by t = 10second.  We need
>to make sure this 10 seconds video can be played by at 400Kb/s at
>t=10second.  So, the playback can start at t=7.5seconds.  Is my
>reasoninging correct?

The 10s video will take ~40.4s to download in its entirety (since it
takes 4x the data rate supported by the network).  You can only start
playing it 10s before it finishes downloading, i.e. ~30.4s into the
download.  Sketching A(t) from the network, and D(t) from the decoder
buffer, should make this clear.

.

Path: shelby.stanford.edu!not-for-mail
From: Ryan <ryan05@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Midterm Problem 7a
Date: Tue, 16 Mar 2004 00:36:11 -0800
Lines: 4
Distribution: su
Message-ID: <4056BC7B.748880B7@stanford.edu>
NNTP-Posting-Host: dnab4046e0.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1079426196 10672 171.64.70.224 (16 Mar 2004 08:36:36 GMT)
X-Complaints-To: news@news.stanford.edu
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: shelby.stanford.edu su.class.cs244a:7039

If there is a one directional link (for example between 2 and 3 can 3
still send RIP packets to inform two that it can reach router 6 (despite
the fact that the link only goes from 2 to 3)?  And if so, why is that?

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: bellman ford question
Date: Tue, 16 Mar 2004 14:56:14 -0800
Lines: 12
Distribution: su
Message-ID: <Pine.GSO.4.44.0403161453260.17715-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 1079477776 27623 171.64.15.100 (16 Mar 2004 22:56:16 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:7040


I've noticed in the solutions to bellman ford problems,
the entire NxN table is given and completely filled in.  But it
seems we can get away with simply one column of the table...

is it incorrect to just give the solution w/ one column corresponding
to the root node.  It seems writing the entire NxN table is a little
tedious and not necessary...is there any case where we benefit from
deriving the entire table versus just a single column?

--vishal

.

Path: shelby.stanford.edu!elaine25.Stanford.EDU!vishalp
From: Vishal Patel <vishalp@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Midterm problem 8d
Date: Tue, 16 Mar 2004 15:09:02 -0800
Lines: 18
Distribution: su
Message-ID: <Pine.GSO.4.44.0403161458290.17715-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 1079478546 28216 171.64.15.100 (16 Mar 2004 23:09:06 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:7041


solution says  W = B + C x PROP

I understand B is number of buffers in Q.  CxPROP, then is the amount
of data in the second link...But how about the amount of data in the first
link (w/ rate R)...  R>>C, so R x (some fraction of PROP) can be a
significant number...I mean, can't R be a really long link w/ a huge
datarate, that means that many bits can fit into the link...since R>>C,
how can we disregard this portion?

We found the RTT in the previous problem to be (B/C + PROP)

I would think W = RTT*send rate = R x (B/C + PROP)

What's wrong w/ my thinking?

-vishal

.

Path: shelby.stanford.edu!not-for-mail
From: Sumeet Shendrikar <sumeets@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ps4, q4b
Date: Tue, 16 Mar 2004 15:54:21 -0800
Lines: 9
Distribution: su
Message-ID: <c383ut$26o$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 1079481117 2264 128.12.197.156 (16 Mar 2004 23:51:57 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
Xref: shelby.stanford.edu su.class.cs244a:7042

quick (possibly stupid) question about problem set 4 question 4b.
The problem states that the incoming message is : "1101101"

why, then, does the circuit evaluate "1101101000" ?  It would seem that 
the circuit should operate on just the incoming message "1101101" which 
should already include the CRC code.

thanks,
sumeet
.

Path: shelby.stanford.edu!elaine3.Stanford.EDU!bergerj
From: Jonathan Berger <bergerj@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: PS4 Q5e
Date: Tue, 16 Mar 2004 17:56:28 -0800
Lines: 14
Sender: bergerj@elaine3.Stanford.EDU
Distribution: su
Message-ID: <Pine.GSO.4.44.0403161750510.9379-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 1079488590 9465 171.64.15.68 (17 Mar 2004 01:56:30 GMT)
X-Complaints-To: news@news.stanford.edu
Xref: shelby.stanford.edu su.class.cs244a:7043


The solution set says:
At time t+15: (4) sends "2 is root"

Wouldn't (4) have been receiving control messages from (7), and know that
"1 is root", and thus not send out the message "2 is root"?

The book says, "When a bridge receives a message from a bridge that is
closer to the root or equally far from the root but with a smaller id -
the bridge stops sending configuration messages over that port."

Neither of these conditions prevent (7) from continuing to send
configuration messages "1 is root" to (4).

.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Question about error detection capability of IP checksum
Date: Tue, 16 Mar 2004 19:22:05 -0800
Organization: CS Masters Program
Lines: 21
Distribution: su
Message-ID: <c38g92$dgj$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1079493732 13843 127.0.0.1 (17 Mar 2004 03:22: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:7044

In Handout 14, slide #6, it says "The IP and TCP checksum will catch any
burst error of 15 or fewer bits. In general, it will catch approximately 1
in 2^16 of all possible errors."

I don't understand this. Not only does not this make sense to me
mathematically, it also doesn't mesh with common sense: if this were true,
the checksum would be all but completely useless. It only catches one in
65,536 possible errors? Why would anyone ever use it?

It seems to me that assuming a totally random distribution of bit errors,
the IP checksum should catch all BUT approximately 1 in 2^16 errors. In
other words, it would catch (in the best case anyway) 65535 out of 65536
errors.

Am I wrong? If I am wrong, can someone explain to me the mathematics?

Thanks,

Greg


.

Path: shelby.stanford.edu!not-for-mail
From: "Oded Wurman" <owurman@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Question about DSSS
Date: Tue, 16 Mar 2004 20:17:47 -0800
Lines: 9
Distribution: su
Message-ID: <c38jg8$g5n$1@news.Stanford.EDU>
NNTP-Posting-Host: oded.stanford.edu
X-Trace: news.Stanford.EDU 1079497032 16567 128.12.61.97 (17 Mar 2004 04:17: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:7045

Am I understanding correctly that two access point using DSSS (with
different Chips) are running on the SAME frequency?
If they were running on different frequencies, is it correct that they
wouldn't interfere with each other either?

Thanks,
Oded


.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question about error detection capability of IP checksum
Date: Tue, 16 Mar 2004 21:17:02 -0800
Organization: CS Masters Program
Lines: 10
Distribution: su
Message-ID: <c38n0g$iti$1@news.Stanford.EDU>
References: <c38g92$dgj$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1079500624 19378 127.0.0.1 (17 Mar 2004 05:17: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:7046

Same question regarding the detection capabilities of CRC's:

 In Handout 14, slide #17, shouldn't it say "In general, an r-bit generator
can detect ALL BUT 1 in 2^r errors"?

Thanks,

Greg


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: bellman ford question
Date: Tue, 16 Mar 2004 21:52:34 -0800
Lines: 20
Distribution: su
Message-ID: <Pine.LNX.4.44.0403162151550.29021-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403161453260.17715-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 1079502756 21279 171.64.66.201 (17 Mar 2004 05:52:36 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403161453260.17715-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:7047



 We gave credit for solutions with a single column.

 .m

> 
> I've noticed in the solutions to bellman ford problems,
> the entire NxN table is given and completely filled in.  But it
> seems we can get away with simply one column of the table...
> 
> is it incorrect to just give the solution w/ one column corresponding
> to the root node.  It seems writing the entire NxN table is a little
> tedious and not necessary...is there any case where we benefit from
> deriving the entire table versus just a single column?
> 
> --vishal
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Midterm problem 8d
Date: Tue, 16 Mar 2004 21:53:59 -0800
Lines: 22
Distribution: su
Message-ID: <Pine.LNX.4.44.0403162152380.29021-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403161458290.17715-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 1079502841 21310 171.64.66.201 (17 Mar 2004 05:54:01 GMT)
X-Complaints-To: news@news.stanford.edu
To: Vishal Patel <vishalp@stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403161458290.17715-100000@elaine25.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:7048


> 
> solution says  W = B + C x PROP
> 
> I understand B is number of buffers in Q.  CxPROP, then is the amount
> of data in the second link...But how about the amount of data in the first
> link (w/ rate R)...  R>>C, so R x (some fraction of PROP) can be a
> significant number...I mean, can't R be a really long link w/ a huge
> datarate, that means that many bits can fit into the link...since R>>C,
> how can we disregard this portion?
> 
> We found the RTT in the previous problem to be (B/C + PROP)
> 
> I would think W = RTT*send rate = R x (B/C + PROP)
> 
> What's wrong w/ my thinking?

  The sender is throttled by the arrival of ACKs or a rate of
  C.

  .m

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: PS4 Q5e
Date: Tue, 16 Mar 2004 21:55:53 -0800
Lines: 23
Distribution: su
Message-ID: <Pine.LNX.4.44.0403162154270.29021-100000@Xenon.Stanford.EDU>
References: <Pine.GSO.4.44.0403161750510.9379-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 1079502955 21406 171.64.66.201 (17 Mar 2004 05:55:55 GMT)
X-Complaints-To: news@news.stanford.edu
To: Jonathan Berger <bergerj@cs.stanford.edu>
In-Reply-To: <Pine.GSO.4.44.0403161750510.9379-100000@elaine3.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:7049


 We've had various discussions regarding this and decided what
 the algorithm is somewhat ambiguous.
 Both answers where accepted.

 .m

> 
> The solution set says:
> At time t+15: (4) sends "2 is root"
> 
> Wouldn't (4) have been receiving control messages from (7), and know that
> "1 is root", and thus not send out the message "2 is root"?
> 
> The book says, "When a bridge receives a message from a bridge that is
> closer to the root or equally far from the root but with a smaller id -
> the bridge stops sending configuration messages over that port."
> 
> Neither of these conditions prevent (7) from continuing to send
> configuration messages "1 is root" to (4).
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: David Chan <dmchan@stanford.edu>
Newsgroups: su.class.cs244a
Subject: Midterm 2002 Questions (#4(b.iii) & #3(a))
Date: Tue, 16 Mar 2004 23:30:32 -0800
Lines: 23
Distribution: su
Message-ID: <c38uqp$pge$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 1079508633 26126 128.12.57.21 (17 Mar 2004 07:30:33 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207)
X-Accept-Language: en-us, en
Xref: shelby.stanford.edu su.class.cs244a:7050

I was reviewing the old midterms and I had a couple questions about 
these particular problems on the 2002 midterm:

In Problem #4 part b.iii, when the burstiness exceeds the expected bound 
on the arrival rate, why doesn't the maximum queue occupancy increase? 
I'm not really getting the leap of logic here.

In Problem #3 part a, the diagram shows that packets 9-12 are 
retransmitted because the acknowledgement for packet 9 was lost. Now, 
according to the rules set down in the very beginning of that problem, 
it seems like this is doing the right thing "each time a packet (or 
acknowledgement) is dropped, the window size is halved," but this 
doesn't seem to fit with my understanding of how TCP is supposed to work.

When host A received an acknowledgement triggered by packet 10 
(ostensibly ack=11), it should have acknowledged all sent packets 
numbered less than 11, including packet 9. Therefore, there should have 
been no retransmission since host A received acknowledgments for all 
packets < 11, < 12, < 13.  Is this right? Is there a better explanation 
for the diagram?

Thanks,
Dave
.

Path: shelby.stanford.edu!not-for-mail
From: "Greg Friedman" <gregory.friedman@cs.stanford.edu>
Newsgroups: su.class.cs244a
Subject: Re: Question about error detection capability of IP checksum
Date: Wed, 17 Mar 2004 09:27:42 -0800
Organization: CS Masters Program
Lines: 18
Distribution: su
Message-ID: <c3a1qj$o1i$1@news.Stanford.EDU>
References: <c38g92$dgj$1@news.Stanford.EDU> <c38n0g$iti$1@news.Stanford.EDU>
X-Trace: news.Stanford.EDU 1079544468 24626 127.0.0.1 (17 Mar 2004 17:27: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:7051

I just watched the first few minutes of the last lecture; I guess this
question was addressed then. Never mind.

"Greg Friedman" <gregory.friedman@cs.stanford.edu> wrote in message
news:c38n0g$iti$1@news.Stanford.EDU...
> Same question regarding the detection capabilities of CRC's:
>
>  In Handout 14, slide #17, shouldn't it say "In general, an r-bit
generator
> can detect ALL BUT 1 in 2^r errors"?
>
> Thanks,
>
> Greg
>
>


.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Midterm Problem 7a
Date: Wed, 17 Mar 2004 10:06:15 -0800
Lines: 11
Distribution: su
Message-ID: <Pine.LNX.4.44.0403171003020.26136-100000@Xenon.Stanford.EDU>
References: <4056BC7B.748880B7@stanford.edu>
NNTP-Posting-Host: xenon.stanford.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.Stanford.EDU 1079546777 27413 171.64.66.201 (17 Mar 2004 18:06:17 GMT)
X-Complaints-To: news@news.stanford.edu
To: Ryan <ryan05@stanford.edu>
In-Reply-To: <4056BC7B.748880B7@stanford.edu>
Xref: shelby.stanford.edu su.class.cs244a:7052


 Not directly but the information will propogate eventually.

  .m

> If there is a one directional link (for example between 2 and 3 can 3
> still send RIP packets to inform two that it can reach router 6 (despite
> the fact that the link only goes from 2 to 3)?  And if so, why is that?
> 
> 

.

Path: shelby.stanford.edu!Xenon.Stanford.EDU!casado
From: Martin Casado <casado@Xenon.Stanford.EDU>
Newsgroups: su.class.cs244a
Subject: Re: Question about DSSS
Date: Wed, 17 Mar 2004 10:07:12 -0800
Lines: 16
Distribution: su
Message-ID: <Pine.LNX.4.44.0403171006500.26136-100000@Xenon.Stanford.EDU>
References: <c38jg8$g5n$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 1079546833 27474 171.64.66.201 (17 Mar 2004 18:07:13 GMT)
X-Complaints-To: news@news.stanford.edu
To: Oded Wurman <owurman@stanford.edu>
In-Reply-To: <c38jg8$g5n$1@news.Stanford.EDU>
Xref: shelby.stanford.edu su.class.cs244a:7053


 I honestly don't know the answer to this ... anyone else?

  .m

> Am I understanding correctly that two access point using DSSS (with
> different Chips) are running on the SAME frequency?
> If they were running on different frequencies, is it correct that they
> wouldn't interfere with each other either?
> 
> Thanks,
> Oded
> 
> 
> 

.

Path: shelby.stanford.edu!not-for-mail
From: "Tim Grow" <grow@stanford.edu>
Newsgroups: su.class.cs244a
Subject: ATM on final?
Date: Thu, 18 Mar 2004 01:29:24 -0800
Lines: 9
Distribution: su
Message-ID: <c3bq5g$jb0$1@news.Stanford.EDU>
NNTP-Posting-Host: grow.stanford.edu
X-Trace: news.Stanford.EDU 1079602160 19808 128.12.191.36 (18 Mar 2004 09:29: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:7054

Will the final include questions on ATM?  Professor McKeown suggested that
ATM is not really part of the class, and we haven't seen any ATM problems on
homework or in section.

Sorry if this question has already been answered.

Tim


.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Midterm 2002 Questions (#4(b.iii) & #3(a))
Date: Thu, 18 Mar 2004 19:33:10 +0000 (UTC)
Lines: 30
Distribution: su
Message-ID: <c3cthm$mj3$1@news.Stanford.EDU>
References: <c38uqp$pge$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1079638390 23139 171.64.15.111 (18 Mar 2004 19:33:10 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:7055


>In Problem #4 part b.iii, when the burstiness exceeds the expected bound 
>on the arrival rate, why doesn't the maximum queue occupancy increase? 

The question asks about the queue occupancy of Q1, but flow f2 is the one
that misbehaves.  Flow 1 is still serviced at the same rate since the
router uses a WFQ scheduler.

>When host A received an acknowledgement triggered by packet 10 
>(ostensibly ack=11), it should have acknowledged all sent packets 
>numbered less than 11, including packet 9. Therefore, there should have 
>been no retransmission since host A received acknowledgments for all 
>packets < 11, < 12, < 13.  Is this right? Is there a better explanation 
>for the diagram?

The RTO is assumed to be equal to the RTT, so packet 9 would be
retransmitted at the beginning of window #7 once the ACK is dropped (since
the packet has timed out at that point).  As for the remaining
retransmission, there seem to be a couple of interpretations.

If you assume the protocol is a strict Go-Back N one, packets 10-12 would
be retransmitted as shown.  But if you don't assume this (IMO, this is more
plausible, and closer to how TCP would really work), the sender would
receive an ACK for 11 immediately between packets 9/10 in window #7 in the
solution figure, and in this case it would send packet 11 and 12 where
packet 10 is shown in window #7 (I'm assuming the window size has still
been halved from the timeout).  That would mean windows #8 and #9 would
send packets 13-15, and 16-19, respectively.  There may be other
interpretations too.

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: Question about DSSS
Date: Thu, 18 Mar 2004 19:39:29 +0000 (UTC)
Lines: 13
Distribution: su
Message-ID: <c3ctth$mpp$1@news.Stanford.EDU>
References: <c38jg8$g5n$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1079638769 23353 171.64.15.111 (18 Mar 2004 19:39:29 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:7056


>Am I understanding correctly that two access point using DSSS (with
>different Chips) are running on the SAME frequency?

Roughly speaking--keep in mind that one of the functions of DSSS is to
spread signal power over a frequency spectrum, which might be centered
around the same frequency for both access points.

>If they were running on different frequencies, is it correct that they
>wouldn't interfere with each other either?

Yes.

.

Path: shelby.stanford.edu!elaine36.Stanford.EDU!holliman
From: holliman@Stanford.EDU (Matthew Jonathan Holliman)
Newsgroups: su.class.cs244a
Subject: Re: ATM on final?
Date: Thu, 18 Mar 2004 19:41:50 +0000 (UTC)
Lines: 9
Distribution: su
Message-ID: <c3cu1u$mu0$1@news.Stanford.EDU>
References: <c3bq5g$jb0$1@news.Stanford.EDU>
NNTP-Posting-Host: elaine36.stanford.edu
X-Trace: news.Stanford.EDU 1079638910 23488 171.64.15.111 (18 Mar 2004 19:41:50 GMT)
X-Complaints-To: news@news.stanford.edu
X-Newsreader: NN version 6.5.4 (NOV)
Xref: shelby.stanford.edu su.class.cs244a:7057


>Will the final include questions on ATM?  Professor McKeown suggested that
>ATM is not really part of the class, and we haven't seen any ATM problems on
>homework or in section.

There doesn't seem to be much that could be asked unless it was in the
context of other material in the class.  The exam certainly wouldn't ask for
arcane details about things like that...

.