Ynt: [uCsimm] Connecting to Internet via ucsimm

From: Erdem Gunes (egunes@adamarge.com.tr)
Date: Fri Jun 15 2001 - 08:41:01 EDT


I will soon build a web site and publish my works.

I think that ucsimm can not process all the serial packets while Ipfadm and
pppd working;
so many TCP retransmissions occurs, that make the connection too slow!

I wrote a program to test serial port of ucsimm:

I mounted a nfs share from my Suse Linux.
I wrote a program, in ucsimm that writes all incoming serial data to a log
file, in this nfs disk.
I sent a long text file from minicom.

In 1200...19200bps, ucsimm perfectly log the incoming data,(without any
RTS-CTS)
But after 38400 to 115200bps, I see that there are a lot of bytes lost!!!

Does writing a single byte to an nfs file spend so much mips??

Here is my test code:

#include <fcntl.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <termios.h>
#include <string.h>

#define BAUDRATE B115200

int main(int argc, char *argv[])
{
int fd,file ;
int i,j,count,delay=0;
char a,buf[50];
int baudrate,b;

struct termios old_device, new_device;

b= atoi(argv[1]); // Baudrate is a command line parameter...
switch(b){
    case 1:
         baudrate = B9600;
  break;
    case 2:
         baudrate = B19200;
  break;
    case 3:
         baudrate = B38400;
  break;
    case 4:
         baudrate = B57600;
  break;
    case 5:
         baudrate = B115200;
  break;
  default:
         baudrate = B9600;
  break;
};

if((fd = open ("/dev/ttyS0",O_RDWR))==-1)
 { printf("cannot open the device!");
   exit(0);
  }
if((file = open("log",O_RDWR))==-1) // This is the log file in NFS mount
{ printf("cannot create file!!");
    exit(0);
}

tcgetattr(fd,&old_device);
tcgetattr(fd,&new_device);
    new_device.c_cflag &= ~(CSIZE | CSTOPB | PARENB | CLOCAL);
    new_device.c_cflag |= CS8 | CREAD | HUPCL;

    new_device.c_iflag = IGNBRK | IGNPAR;
    new_device.c_oflag = 0;
    new_device.c_lflag = 0;
    new_device.c_cc[VMIN] = 1;
    new_device.c_cc[VTIME] = 0;

   new_device.c_cflag &= ~CRTSCTS;
   cfsetospeed (&new_device, baudrate);
   cfsetispeed (&new_device, baudrate);

tcsetattr(fd,TCSANOW,&new_device);
tcflush(fd,TCIFLUSH);

i=0;

while(i<65280){ //130560 //63270
  do
  {
  count=read(fd,buf,50);
  if(count>0){
   write(file,buf,count);
   printf("%d\n",i);
   i = i +count;
   if(i>=65280) break;
   };
   }while(count>0);
 };

tcsetattr(fd,TCSANOW,&old_device);
close(fd);
close(file);
return 0;
}

-----Özgün İleti-----
Kimden: David Beckemeyer <david@bdt.com>
Kime: ucsimm@uclinux.org <ucsimm@uclinux.org>
Tarih: 14 Haziran 2001 Perşembe 22:24
Konu: Re: [uCsimm] Connecting to Internet via ucsimm

>
>I'm not so sure I'd be that quick to toss it to 'MIPS' yet.
>
>If you are really seeing something as poor as 9600, then it
>seems like it's something else. I'm using a uCsimm as a
>Ethernet proxyarp gateway with a Tivo connecetd via hardwire
>serial cable, and it can give at least 38K-56K performance:
>
> http://www.bdt.com/david/tivo/
>
>You'll probably never get much better than raw 56K, but unless
>ipfadm and IP Masquerading adds that much overhead, you should
>be able to achieve much better than 9600 even on the little
>16Mhz Dragonball.
>
>Neat work on the porting. Can you make your changes public
>for us?
>
>
>On Wed, Jun 13, 2001 at 08:29:51AM +0300, Erdem Gunes wrote:
>>
>> Hello!
>>
>> I tried to use ucsimm as an internet gateway:
>>
>> I compiled PPPD full version (including chap, pap...), it works.
>> I compiled diald for dial on demand; it works.
>> I configured ipfadm for IP Masquerading; it wrks.
>>
>> Every thing is working; ucsimm can connect to my service provider with a
56K dial-up modem.
>>
>> I set My computer's gateway to ucsimm.
>>
>> When I make a web request from Netscape, diald works and modem dials...
>>
>> And I could connect to Web!!
>>
>> BUT PROBLEM: I works very very slowly, like I connect with a 9600bps
modem.
>> I am sure that it is not a problem of RTS-CTS handshaking; because there
is a few data flow to modem (web requests) as I look to TX led
>> and to much data flow from modem (RX).
>>
>> I think ucsimm cannot process all of incoming serial packets.
>>
>> WHAT DO YOU THINK ABOUT THIS?? Is it a SERIAL DRIVER bug?? Or 68EZ328
MIPS LACK??
>>
>>
>> THANKS!!!
>>
>>
>> Erdem Gunes
>>
>>
>This message resent by the ucsimm@uclinux.com list server
http://www.uClinux.com/
>

This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:43 EST