lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Need help with missing-ack


From: John Taylor
Subject: [lwip-users] Need help with missing-ack
Date: Tue, 3 Feb 2004 18:06:45 -0500

I am trying port lwIP to H8s platform using XMK as the RTOS.  I am
running into problem with lwIP 'skipping' an ack.  The skipped ack
effectively stalls the connection.

First disclaimer: I know very little about TCP/IP! So the problem may be
something trivial. 

My setup:
----------
I am using lwIP v0.7 that I downloaded from:
http://www.esrac.ele.tue.nl/~leon/lwip/

My "test application" consists of the 4 unix project apps, tcpecho,
udpecho, shell, and httpd.

I have setup lwIP so that it runs in a single thread - including the
low-level Ethernet driver.  The applications tcpecho, udpecho, and shell
all run in individual threads for a total of 4 threads.

I have ported the "sys arch" layer to the XMK RTOS.  Now the XMK RTOS is
made up of two layer: 1) the scheduler (XMK) 2) And an application
programming layer (APL).  The APL layer is independent of the underlying
scheduler.  Why the explanation? Well I have actually ported lwIP's "sys
arch" layer to the APL portion of XMK.  In turn, there is a POSIX/LINUX
implementation of the scheduler interfaces for APL.  So I am able to use
the lwIP's UNIX TAP/TUN interface to verify my implementation of the
"sys arch" layer.  And when running lwIP/APL on Linux, everything works
just fine. 

I have two target boards: 
- EDOSK2674 which has a Hitachi H8s2674 MCU and SMSC91C96 LAN
controller. 
- ESP-HBDB01 which has a Hitachi H8s2329 MCU and SMSC91C96 LAN
controller.

I am using Hitachi's HEW2 compiler for the H8 targets.


My problem
----------
When running on my Hitachi target boards, the 'shell' application stalls
because it skips an ACK number when transferring data.  What I do is
telnet to the target board from my Linux box and issue the 'stat'
command when the shell prompt comes up.  Almost always the stat command
never finishes printing (it does complete sometimes, but I have not be
able to issue the stat command three times in a row without it hanging).
For other network traffic such as HTTP, PING, TCP, UDP and evening using
the 'manual' connection commands in the shell appear to work fine
(though I have not put them under stress).

I have included below the output of my telnet client and snippet from
tcpdump output of the network traffic when the skipped-ack occurs.  In
the print out below, you can see where the lwIP target skipped over 'ack
592'.  I can not figure out why my port works under Linux but not on my
target boards - unless it is has something to due with the performance
differences between the PC and the H8 boards.  The print out of the
statistics does take a relatively long time (>1sec) when using the H8
target boards as opposed to 'instantaneous' on when running under
Linux/TAPDEV.


More pieces to the puzzle
--------------------------
- The same test application works fine when running lwIP on my Linux
box.  Now there are three major differences between the PC and my target
boards:
1) The H8 is a big endian processor
2) The H8 requires all 16/32bit accesses to occur on even address
boundaries (and to help matters, it does not throw a 'bus fault', it
just silently fails with indeterminate results for the odd byte(s)). 
3) The Linux box is P6 @ 1.6GHz, where the H8 target boards 16bit MCUs
running at 33Mhz and 20Mhz.

- I tried turning on all of the LWIP_DEBUG stuff, but that did not work.
First I got compiler warnings about "not optimizing" certain lwiP
functions. Then at run time, every time I tried to telnet to port 23 or
port 7, my lwIP target refuses the connection (this make me lose faith
about the compiler, but 9 times out of 10 when I try to blame the
compiler, its my software not the compiler).

TIA
-john

 

Capture of Telnet session (Linux telnet client)
===================================================================
lwIP simple interactive shell.
(c) Copyright 2001, Swedish Institute of Computer Science.
Written by Adam Dunkels.
For help, try the "help" command.
> stat
Link level * transmitted 0
             retransmitted 0
           * received 0
             forwarded 0
           * dropped 0
           * checksum errors 0
           * length errors 0
           * memory errors 0
             routing errors 0
             protocol errors 0
             option errors 0
           * misc errors 0
             cache hits 0
IP_FRAG    * transmitted 0
             retransmitted
           * received


TCPDUMP LOG (The host 192.168.1.104 is running LWIP)
========================================================================
====
17:13:42.596063 0:bd:3b:33:5:71 0:b0:d0:7:96:35 ip 81:
192.168.1.104.telnet > jake.local.33944: P [tcp sum ok] 541:568(27) ack
34 win 8096 (DF) (ttl 255, id 45, len 67)
0x0000   4500 0043 002d 4000 ff06 f76c c0a8 0168        address@hidden
0x0010   c0a8 0162 0017 8498 0000 1b8b 6d89 1c5b        ...b........m..[
0x0020   5018 1fa0 5319 0000 2020 2020 2020 2020        P...S...........
0x0030   2020 2020 2072 6574 7261 6e73 6d69 7474        .....retransmitt
0x0040   6564 20                                        ed.
17:13:42.597167 0:b0:d0:7:96:35 0:bd:3b:33:5:71 ip 54: jake.local.33944
> 192.168.1.104.telnet: . [tcp sum ok] 34:34(0) ack 568 win 5840 (DF)
[tos 0x10]  (ttl 64, id 19490, len 40)
0x0000   4510 0028 4c22 4000 4006 6a83 c0a8 0162        E..(L"@address@hidden
0x0010   c0a8 0168 8498 0017 6d89 1c5b 0000 1ba6        ...h....m..[....
0x0020   5010 16d0 eaaf 0000                            P.......
17:13:42.604779 0:bd:3b:33:5:71 0:b0:d0:7:96:35 ip 78:
192.168.1.104.telnet > jake.local.33944: P [tcp sum ok] 568:592(24) ack
34 win 8096 (DF) (ttl 255, id 46, len 64)
0x0000   4500 0040 002e 4000 ff06 f76e c0a8 0168        address@hidden@....n...h
0x0010   c0a8 0162 0017 8498 0000 1ba6 6d89 1c5b        ...b........m..[
0x0020   5018 1fa0 5b26 0000 000a 2020 2020 2020        P...[&..........
0x0030   2020 2020 202a 2072 6563 6569 7665 6420        .....*.received.
17:13:42.604857 0:b0:d0:7:96:35 0:bd:3b:33:5:71 ip 54: jake.local.33944
> 192.168.1.104.telnet: . [tcp sum ok] 34:34(0) ack 592 win 5840 (DF)
[tos 0x10]  (ttl 64, id 19491, len 40)
0x0000   4510 0028 4c23 4000 4006 6a82 c0a8 0162        
E..(address@hidden@.j....b
0x0010   c0a8 0168 8498 0017 6d89 1c5b 0000 1bbe        ...h....m..[....
0x0020   5010 16d0 ea97 0000                            P.......
17:13:43.733462 0:bd:3b:33:5:71 0:b0:d0:7:96:35 ip 80:
192.168.1.104.telnet > jake.local.33944: P [tcp sum ok] 593:619(26) ack
34 win 8096 (DF) (ttl 255, id 49, len 66)
0x0000   4500 0042 0031 4000 ff06 f769 c0a8 0168        address@hidden
0x0010   c0a8 0162 0017 8498 0000 1bbf 6d89 1c5b        ...b........m..[
0x0020   5018 1fa0 08db 0000 0a20 2020 2020 2020        P...............
0x0030   2020 2020 2a20 666f 7277 6172 6465 6420        ....*.forwarded.
0x0040   010a                                           ..
17:13:43.733500 0:b0:d0:7:96:35 0:bd:3b:33:5:71 ip 54: jake.local.33944
> 192.168.1.104.telnet: . [tcp sum ok] 34:34(0) ack 592 win 5840 (DF)
[tos 0x10]  (ttl 64, id 19492, len 40)
0x0000   4510 0028 4c24 4000 4006 6a81 c0a8 0162        
E..(address@hidden@.j....b
0x0010   c0a8 0168 8498 0017 6d89 1c5b 0000 1bbe        ...h....m..[....
0x0020   5010 16d0 ea97 0000                            P.......
17:13:46.749478 0:bd:3b:33:5:71 0:b0:d0:7:96:35 ip 80:
192.168.1.104.telnet > jake.local.33944: P [tcp sum ok] 593:619(26) ack
34 win 8096 (DF) (ttl 255, id 51, len 66)
0x0000   4500 0042 0033 4000 ff06 f767 c0a8 0168        address@hidden
0x0010   c0a8 0162 0017 8498 0000 1bbf 6d89 1c5b        ...b........m..[
0x0020   5018 1fa0 08db 0000 0a20 2020 2020 2020        P...............
0x0030   2020 2020 2a20 666f 7277 6172 6465 6420        ....*.forwarded.
0x0040   010a                                           ..


John T. Taylor
Shift-Right Technologies, LLC.
433 Comanche Trl
Lawrenceville, GA 30044
Tel: 678-344-3115
Fax: 770-736-9276
email: address@hidden
url: www.shift-right.com






reply via email to

[Prev in Thread] Current Thread [Next in Thread]