public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Re:  Networking in a ROM build
@ 2001-08-23  9:03 Fano Ramparany
  2001-08-23  9:07 ` [ECOS] " Trenton D. Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Fano Ramparany @ 2001-08-23  9:03 UTC (permalink / raw)
  To: Trenton D. Adams; +Cc: eCos Disuss

Trenton,
This is exactly the problem we are currently facing and trying to solve
(see some recent threads). A socket configuration that might
solve your problem is to increase the socket timeout value:

#include <timer.h>
#define SOCK_TIMEOUT 50
...
int sd,len,rc;
sd = socket(AF_INET, SOCK_STREAM, 0);
struct timeval tv;
...
tv.tv_sec = SOCK_TIMEOUT;
tv.tv_usec = 0;
setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));

This partially solved our problem, however, by sniffing the network
traffic (using tcpdump)
We have observed some strange behaviour on the ROM version of our
application, which seems to buffer the first packets and at some stage
sends them alltogether over the network.

I've also added some delay between the ethernet driver initialization
and the ip stack initialization, but this didn't solve the problem.

I'll now try to add some tracing (CYGDBG_USE_ASSERT) to go further.

Fano

> When using a ROM version, the following thing happens:
> The transmit and status signal threads connect to my windows machine
> just fine.  After they are connected, my windows machine attempts to
> connect back to the embedded system's CommandThread socket.  The
> connection attempt times out.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ECOS] RE:  Networking in a ROM build
  2001-08-23  9:03 [ECOS] Re: Networking in a ROM build Fano Ramparany
@ 2001-08-23  9:07 ` Trenton D. Adams
  2001-08-23 10:26 ` [ECOS] " Trenton D. Adams
  2001-08-23 14:46 ` Trenton D. Adams
  2 siblings, 0 replies; 6+ messages in thread
From: Trenton D. Adams @ 2001-08-23  9:07 UTC (permalink / raw)
  To: Fano.Ramparany; +Cc: 'eCos Disuss'

Thanks for that.  Unfortunately, I don't have a Linux machine near by to
do any packet dumping.

FYI: http://freshmeat.net/projects/tcpdumpfilter/
The utility there should make your life a little easier with tcpdump.

-----Original Message-----
From: ramparfa@theone.dnsalias.com [ mailto:ramparfa@theone.dnsalias.com ]
On Behalf Of Fano Ramparany
Sent: Thursday, August 23, 2001 10:01 AM
To: Trenton D. Adams
Cc: eCos Disuss
Subject: Re: Networking in a ROM build


Trenton,
This is exactly the problem we are currently facing and trying to solve
(see some recent threads). A socket configuration that might
solve your problem is to increase the socket timeout value:

#include <timer.h>
#define SOCK_TIMEOUT 50
...
int sd,len,rc;
sd = socket(AF_INET, SOCK_STREAM, 0);
struct timeval tv;
...
tv.tv_sec = SOCK_TIMEOUT;
tv.tv_usec = 0;
setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));

This partially solved our problem, however, by sniffing the network
traffic (using tcpdump)
We have observed some strange behaviour on the ROM version of our
application, which seems to buffer the first packets and at some stage
sends them alltogether over the network.

I've also added some delay between the ethernet driver initialization
and the ip stack initialization, but this didn't solve the problem.

I'll now try to add some tracing (CYGDBG_USE_ASSERT) to go further.

Fano

> When using a ROM version, the following thing happens:
> The transmit and status signal threads connect to my windows machine
> just fine.  After they are connected, my windows machine attempts to
> connect back to the embedded system's CommandThread socket.  The
> connection attempt times out.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [ECOS] Re:   Networking in a ROM build
  2001-08-23  9:03 [ECOS] Re: Networking in a ROM build Fano Ramparany
  2001-08-23  9:07 ` [ECOS] " Trenton D. Adams
@ 2001-08-23 10:26 ` Trenton D. Adams
  2001-08-24  8:02   ` Fano Ramparany
  2001-08-23 14:46 ` Trenton D. Adams
  2 siblings, 1 reply; 6+ messages in thread
From: Trenton D. Adams @ 2001-08-23 10:26 UTC (permalink / raw)
  To: Fano.Ramparany; +Cc: 'eCos Disuss'

I noticed you are talking about receive timeout.  My problem is a
connect timeout from the windows machine to the embedded system.  Is
there something I'm missing that would tell me that the two are related?

-----Original Message-----
From: ecos-discuss-owner@sources.redhat.com
[ mailto:ecos-discuss-owner@sources.redhat.com ] On Behalf Of Fano
Ramparany
Sent: Thursday, August 23, 2001 10:01 AM
To: Trenton D. Adams
Cc: eCos Disuss
Subject: [ECOS] Re: Networking in a ROM build


Trenton,
This is exactly the problem we are currently facing and trying to solve
(see some recent threads). A socket configuration that might
solve your problem is to increase the socket timeout value:

#include <timer.h>
#define SOCK_TIMEOUT 50
...
int sd,len,rc;
sd = socket(AF_INET, SOCK_STREAM, 0);
struct timeval tv;
...
tv.tv_sec = SOCK_TIMEOUT;
tv.tv_usec = 0;
setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));

This partially solved our problem, however, by sniffing the network
traffic (using tcpdump)
We have observed some strange behaviour on the ROM version of our
application, which seems to buffer the first packets and at some stage
sends them alltogether over the network.

I've also added some delay between the ethernet driver initialization
and the ip stack initialization, but this didn't solve the problem.

I'll now try to add some tracing (CYGDBG_USE_ASSERT) to go further.

Fano

> When using a ROM version, the following thing happens:
> The transmit and status signal threads connect to my windows machine
> just fine.  After they are connected, my windows machine attempts to
> connect back to the embedded system's CommandThread socket.  The
> connection attempt times out.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [ECOS] Re:   Networking in a ROM build
  2001-08-23  9:03 [ECOS] Re: Networking in a ROM build Fano Ramparany
  2001-08-23  9:07 ` [ECOS] " Trenton D. Adams
  2001-08-23 10:26 ` [ECOS] " Trenton D. Adams
@ 2001-08-23 14:46 ` Trenton D. Adams
  2001-08-31 10:01   ` Fano Ramparany
  2 siblings, 1 reply; 6+ messages in thread
From: Trenton D. Adams @ 2001-08-23 14:46 UTC (permalink / raw)
  To: Fano.Ramparany; +Cc: 'eCos Disuss'

Does your code hang up on the accept () call?  Mine does.  I call
accept, and the windows machine never gets to it.  It's almost as if the
bind didn't even work originally.

Anyone know if there's a way of using something like "netstat" in eCos?
I would like to be able to use CYG_TRACEX () to output the socket
connection information of the entire system.

-----Original Message-----
From: ecos-discuss-owner@sources.redhat.com
[ mailto:ecos-discuss-owner@sources.redhat.com ] On Behalf Of Fano
Ramparany
Sent: Thursday, August 23, 2001 10:01 AM
To: Trenton D. Adams
Cc: eCos Disuss
Subject: [ECOS] Re: Networking in a ROM build


Trenton,
This is exactly the problem we are currently facing and trying to solve
(see some recent threads). A socket configuration that might
solve your problem is to increase the socket timeout value:

#include <timer.h>
#define SOCK_TIMEOUT 50
...
int sd,len,rc;
sd = socket(AF_INET, SOCK_STREAM, 0);
struct timeval tv;
...
tv.tv_sec = SOCK_TIMEOUT;
tv.tv_usec = 0;
setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));

This partially solved our problem, however, by sniffing the network
traffic (using tcpdump)
We have observed some strange behaviour on the ROM version of our
application, which seems to buffer the first packets and at some stage
sends them alltogether over the network.

I've also added some delay between the ethernet driver initialization
and the ip stack initialization, but this didn't solve the problem.

I'll now try to add some tracing (CYGDBG_USE_ASSERT) to go further.

Fano

> When using a ROM version, the following thing happens:
> The transmit and status signal threads connect to my windows machine
> just fine.  After they are connected, my windows machine attempts to
> connect back to the embedded system's CommandThread socket.  The
> connection attempt times out.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Re:  Networking in a ROM build
  2001-08-23 10:26 ` [ECOS] " Trenton D. Adams
@ 2001-08-24  8:02   ` Fano Ramparany
  0 siblings, 0 replies; 6+ messages in thread
From: Fano Ramparany @ 2001-08-24  8:02 UTC (permalink / raw)
  To: Trenton D. Adams; +Cc: eCos Disuss

"Trenton D. Adams" wrote:

> I noticed you are talking about receive timeout.  My problem is a
> connect timeout from the windows machine to the embedded system.  Is
> there something I'm missing that would tell me that the two are related?

You are right, our problem is also that the call to connect returns a
negative code.
I don't know the detail of the implementation of a socket, but my guess is
that
to connect a socket, some packets with a request for connection are sent
throught
the ethernet interface, which expect a some reply from the host to be
connected to,
thus, maybe you could to do the same for a send timeout. (SO_SNDTIMEO)

Fano

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Re:  Networking in a ROM build
  2001-08-23 14:46 ` Trenton D. Adams
@ 2001-08-31 10:01   ` Fano Ramparany
  0 siblings, 0 replies; 6+ messages in thread
From: Fano Ramparany @ 2001-08-31 10:01 UTC (permalink / raw)
  To: Trenton D. Adams; +Cc: 'eCos Disuss'

After some investigations and tracing the ROM version of my networking
application, I've found that the call to connect is stuck, waiting for ever
on
a blocking semaphore at line 349 within a function cyg_tsleep in file
synch.c.
The function calls stack  is then:
connect
  bsd_connect
    tsleep
      cyg_tsleep
the call to tsleep is done in bsd_connect under the following condition
which
holds in the ROM version:
while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) {
        error = tsleep((caddr_t)&so->so_timeo, PSOCK | PCATCH,
                       netcon, 0);
in the RAM version the condition fails, that partly explains why the
behaviour
differ in the RAM and ROM version.
Has any one further hints. In particular, is there a way for checking that
the ethernet driver has properly initialized?

Fano

"Trenton D. Adams" wrote:

> Does your code hang up on the accept () call?  Mine does.  I call
> accept, and the windows machine never gets to it.  It's almost as if the
> bind didn't even work originally.
>
> Anyone know if there's a way of using something like "netstat" in eCos?
> I would like to be able to use CYG_TRACEX () to output the socket
> connection information of the entire system.
>
> -----Original Message-----
> From: ecos-discuss-owner@sources.redhat.com
> [ mailto:ecos-discuss-owner@sources.redhat.com ] On Behalf Of Fano
> Ramparany
> Sent: Thursday, August 23, 2001 10:01 AM
> To: Trenton D. Adams
> Cc: eCos Disuss
> Subject: [ECOS] Re: Networking in a ROM build
>
> Trenton,
> This is exactly the problem we are currently facing and trying to solve
> (see some recent threads). A socket configuration that might
> solve your problem is to increase the socket timeout value:
>
> This partially solved our problem, however, by sniffing the network
> traffic (using tcpdump)
> We have observed some strange behaviour on the ROM version of our
> application, which seems to buffer the first packets and at some stage
> sends them alltogether over the network.
>
> I've also added some delay between the ethernet driver initialization
> and the ip stack initialization, but this didn't solve the problem.
>
> I'll now try to add some tracing (CYGDBG_USE_ASSERT) to go further.
>
> Fano
>
> > When using a ROM version, the following thing happens:
> > The transmit and status signal threads connect to my windows machine
> > just fine.  After they are connected, my windows machine attempts to
> > connect back to the embedded system's CommandThread socket.  The
> > connection attempt times out.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-08-31 10:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-23  9:03 [ECOS] Re: Networking in a ROM build Fano Ramparany
2001-08-23  9:07 ` [ECOS] " Trenton D. Adams
2001-08-23 10:26 ` [ECOS] " Trenton D. Adams
2001-08-24  8:02   ` Fano Ramparany
2001-08-23 14:46 ` Trenton D. Adams
2001-08-31 10:01   ` Fano Ramparany

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).