lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] SYN/ACK issue in TCP client/server implementation under


From: Ashish Anand
Subject: Re: [lwip-users] SYN/ACK issue in TCP client/server implementation under eCos with LwIP-TCP/IP stack on ARM Evaluator 7T board
Date: Mon, 5 Mar 2007 01:54:46 -0800 (PST)

Why would I be able to PING the board? I have not implemented any ICMP code
in my program (I'm assuming that I must write some code to make the board
ack ICMP packets). So, as of now, no, I can't PING my board, and all this
while I wasn't expecting to be able to either :-)

Correct me if I'm wrong!

Secondly, here's some good looking debug stuff:


tcp_output: snd_wnd 4096, cwnd 2048, wnd 2048, effwnd 0, seq 6509, ack 6509
tcp_output: snd_wnd 4096, cwnd 2048, wnd 2048, effwnd 0, seq 6509, ack 6509,
i 0tcp_output_segment: rtseq 6509
tcp_output_segment: 6509:6509
pbuf_header: old 0x0003a864 new 0x0003a850 (20)
ip_output_if: pp1
IP header:
+-------------------------------+
| 4 | 5 |  0x00 |        44     | (v, hl, tos, len)
+-------------------------------+
|        0      |010|       0   | (id, flags, offset)
+-------------------------------+
|  255  |    6  |    0xf873     | (ttl, proto, chksum)
+-------------------------------+
|  192  |  168  |    1  |    4  | (src)
+-------------------------------+
|  192  |  168  |    1  |    3  | (dest)
+-------------------------------+
netif->output()pbuf_alloc(length=0)
pbuf_alloc: allocated pbuf 0x0003bba0
pbuf_alloc(length=0) == 0x0003bba0
pppifOutput[0]: proto=0x0021

Here's the complete debug if you want detail. I first establish PPP using
lwip_init() which has those standard 4-5 function calls we're familiar with.
Then the board connects to the Linux box at port 80. I have used delays in
between my statements, coz' without them, nothing works...

ipcp: up
netif_set_ipaddr: netif address being changed
netif: IP address of interface  set to 192.168.1.4
netif: netmask of interface  set to 255.255.255.0
netif: GW address
 of interface  set to 192.168.1.3
netif: added interface pp IP addr 192.168.1.4 netmask 255.255.255.0 gw
192.168.3sifup: unit 0: linkStatusCB=10500 errCode=0
                                                                                
pppLinkStatusCallback: PPPERR_NONE
Board IP=192.168.1.4
Server IP=192.168.1.3
Netmask=255.255.255.0
dns1=0.0.0.0
dns2=0.0.0.0
netif: setting default interface pp
local  IP address 192.168.1.4
remote IP address 192.168.1.3


.......



pppMainWakeup: unit 0 sio_read len=1504 returned 0
pppMainWakeup: unit 0 sio_read len=1504 returned 0
pppMainWakeup: unit 0 sio_read len=1504 returned 0
pppMainWakeup: unit 0 sio_read len=1504 returned 0
pppMainWakeup: unit 0 sio_read len=1504 returned 0
pppMainWakeup: unit 0 sio_read len=1504 returned 0
pppMainWakeup: unit 0 sio_read len=1504 returned 0

.........



tcp_enqueue: queueing 6509:6510 (0x2)
tcp_enqueubuf len=44
ip_input: iphdr->dest 0x401a8c0 netif->ip_addr 0x401a8c0 (0x1a8c0, 0x1a8c0,
0x4)ip_input: iphdr->dest 0x401a8c0 netif->ip_addr 0x100007f (0xc0, 0x7f,
0x401a800)ip_input: packet not for us.
ip_forward: not bouncing packets back on incoming interface.
pbuf_free(0x0003bba0)
pbuf_free: deallocating 0x0003bba0
pppInProc[0]: got 67 bytes
pbuf_alloc(length=0)
pbuf_alloc: allocated pbuf 0x0003bba0
pbuf_alloc(length=0) == 0x0003bba0
pppInProc[0]: got 48 bytes
tcpip_thread: CALLBACK 0x0003bab0

 those were the mDNS packets, so dont bother about them either 


And finally when those SYN/ACKs get sent, I get that nice looking IP header
in the debug 







And here's some of the code:

static void simple_prog(CYG_ADDRESS data)
{
cyg_io_handle_t handle1;
cyg_io_lookup( "/dev/ser0", &handle1);
lwip_init();
cyg_thread_delay(50);
printf("\nConnected PPP\n");
cyg_thread_delay(100);
getchar();
cyg_thread_delay(50);
//                              TCP Client
printf("\n\nPress any key........\n\n");
cyg_thread_delay(50);
getchar();
printf("\n\nNow trying to connect to webserver...\n");
cyg_thread_delay(50);
struct netconn *conn, *newconn;
struct netbuf *inBuf;
int length, bindErr, connErr, writeErr;
struct ip_addr remoteIP;
u16_t port;
conn = netconn_new(NETCONN_TCP);
//conn->socket=1;
remoteIP.addr = htonl(( 192 << 24 ) | ( 168 << 16 ) | ( 1 << 8 ) | ( 3 << 0
)); 
cyg_thread_delay(50);
connErr=netconn_connect(conn, &remoteIP, 80);
printf("\nConnect: Error Code [%d]", connErr);
cyg_thread_delay(50);
printf("\nconnecting to linux box...");
netconn_write(conn, "GET\r\n", 7, NETCONN_NOCOPY);
//I know this is incorrect but I never reach this part anyway (see Ethereal
attachment) so ignore it for now
printf("\nSent GET");
cyg_thread_delay(50);
netconn_close(conn);
printf("\nConnection Closed");
cyg_thread_delay(50);
}





Kieran Mansley wrote:
> 
> On Sun, 2007-03-04 at 23:20 -0800, Ashish Anand wrote:
>> I have a PPP link between 192.168.1.3 (Linux) and 192.168.1.4 (ARM 7 ET
>> board
>> with eCos and LwIP)
>> 
>> Case 1: Board is a TCP server
>> 
>> Linux --> Board: SYN
>> Board --> Linux: no reply 
>> 
>> Case 2: Board is a TCP client
>> 
>> Board --> Linux: SYN
>> Linux --> Board: SYN, ACK
>> Board --> Linux: no reply, Linux retransmits initial SYN once only
>> 
> 
> Sounds like you've got some problem with your receive path.  Can you
> ping the board for example?  I suggest turning on some of the debugging
> statements in lwIP to try and trace what happens to the packets the
> board receives.  
> 
> Kieran
> 
> 
> 
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/SYN-ACK-issue-in-TCP-client-server-implementation-under-eCos-with-LwIP-TCP-IP-stack-on-ARM-Evaluator-7T-board-tf3346750.html#a9308571
Sent from the lwip-users mailing list archive at Nabble.com.





reply via email to

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