[En-Nut-Discussion] Feedback

Mike Cornelius mikec at calldirect.com.au
Thu Sep 12 02:34:04 CEST 2002


Hi Harald and all,

Just a quick note to provide some feedback on some possible oddities I've
found.
FYI my primary IP connection is via PPP over UART1 through a GPRS phone
module so I tend to use the serial ports a bit harder than usual but also my
data rates are much slower than usual and latency much higher.

NutKPrintBinary[_P]()
Have a Critical section arount the entire send loop, this is means that
interrupts tend to get missed if you KPrint.
My modification is :-

int NutKPrintBinary(CONST char *data, int len)
{
    int rc = 0;


    while(len) {
	  NutEnterCritical();
        loop_until_bit_is_set(USR, 5);
        outp(*data, UDR);
	  NutExitCritical();
        data++;
        rc++;
        len--;
    }
    return rc;
}
Which lets interupts get in between characters, downside is that this means
KPrint's tend to get internmingled with any other UART0 output.

NutTcpStateEstablished()
Rejects packets with SYN set, on a slow link (such as GPRS) these can occur
if the remote end resends during the connect phase. In my case a silent
discard works better.

TCP Retransmissions
The lines :-

/*
 * Process retransmit timer.
 */
 if(sock->so_tx_nbq) {
     if(sock->so_state == TCPS_ESTABLISHED) {
         if((sock->so_retran_time++ & 3) == 0) {
             NutTcpStateRetranTimeout(sock);
         }
     }
     else if((sock->so_retran_time++ & 15) == 0) {
         NutTcpStateRetranTimeout(sock);
     }
  }

In THREAD(NutTcpSm, arg) function so that a retransmission occurs the first
time

if(NutEventWait(&tcp_in_rdy, 200))

Times out (200ms or less) since sock->so_retran_time == 0 on a new socket.
Is this by design ?
Or should this be :-

if((++(sock->so_retran_time) & ??) == 0) {

It probably works fine in an ethernet only environment but does not work
well over slow links (in fact my typical round trip time is more like
1500-3000ms and I need to change the 3 and the 15 too but that's my problem
:) )

I hope this is useful,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mike Cornelius                      Internet: mikec at calldirect.com.au
Call Direct Cellular Solutions      Phone:    +61 2 99-65-75-85
Level 1 8-22 West St North Sydney   FAX:      +61 2 99-65-75-90
NSW 2060 Australia                  URL:      http://www.calldirect.com.au
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





More information about the En-Nut-Discussion mailing list