# HG changeset patch # User jlarmour # Date 1050094869 0 # Node ID c77314a3f0fd169a1302762c772f90725e727002 # Parent aa074daf1f12e29de0381d49e275f44bc40405c8 * tests/linux_echo.c: Renamed to.... * tests/host_echo.c: this new file. Change comment to indicate this. * tests/make.linux: Renamed to.... * tests/make.host: this new file. Change comment to indicate this. Also linux_echo -> host_echo, and add clean target. * doc/tcpip.sgml: Reflect above. diff --git a/packages/net/common/current/ChangeLog b/packages/net/common/current/ChangeLog --- a/packages/net/common/current/ChangeLog +++ b/packages/net/common/current/ChangeLog @@ -1,3 +1,14 @@ +2003-04-11 Jonathan Larmour + + * tests/linux_echo.c: Renamed to.... + * tests/host_echo.c: this new file. Change comment to indicate this. + + * tests/make.linux: Renamed to.... + * tests/make.host: this new file. Change comment to indicate this. + Also linux_echo -> host_echo, and add clean target. + + * doc/tcpip.sgml: Reflect above. + 2003-04-11 Michael Checky * tests/nc_test_framework.h: deleted '#include '. diff --git a/packages/net/common/current/doc/tcpip.sgml b/packages/net/common/current/doc/tcpip.sgml --- a/packages/net/common/current/doc/tcpip.sgml +++ b/packages/net/common/current/doc/tcpip.sgml @@ -246,26 +246,26 @@ purpose networks unless protected by a s tcp_echo is one part of the standard performance test we use. The other parts are host programs tcp_source and tcp_sink. - To make these (under LINUX) cd to the tests source directory in -the eCos repository and type “make -f make.linux” - + To make these (under your HOST system) cd to the tests source directory in +the eCos repository and type “make -f make.host” - this should build tcp_source and tcp_sink. -The LINUX program “tcp_source” sends +The host program “tcp_source” sends data to the target. On the target, “tcp_echo” sends it onwards to “tcp_sink” running -on LINUX. So the target must receive and send on all the data that tcp_source sends +on your host. So the target must receive and send on all the data that tcp_source sends it; the time taken for this is measured and the data rate is calculated. To invoke the test, first start tcp_echo on the target board and wait for it to become quiescent - it will report work to calibrate a CPU load which can be used to simulate real operating conditions for the stack. -Then on your LINUX machine, in one terminal window, invoke tcp_sink giving +Then on your host machine, in one terminal window, invoke tcp_sink giving it the IP address (or hostname) of one interface of the target board. For example “tcp_sink 10.130.39.66”. tcp_echo on the target will print something like “SINK connection from 10.130.39.13:1143” when tcp_sink is correctly invoked. -Next, in another LINUX terminal window, invoke tcp_source, +Next, in another host terminal window, invoke tcp_source, giving it the IP address (or hostname) of an interface of the target board, and optionally a background load to apply to the target while the test runs. For example, “tcp_source @@ -279,15 +279,15 @@ tcp_source is correctly invoked. You can connect tcp_sink to one target interface and tcp_source to another, or both to the same interface. Similarly, you can run tcp_sink and tcp_source on -the same LINUX machine or different ones. TCP/IP and ARP +the same host machine or different ones. TCP/IP and ARP look after them finding one another, as intended. nc_test_master - network characterization master nc_test_slave - network characterization slave These tests talk to each other to measure network performance. -They can each run on either a test target or a LINUX host computer +They can each run on either a test target or a host computer given some customization to your local environment. As provided, nc_test_slave must run on the test target, and nc_test_master must -be run on a LINUX host, and be given the test target's +be run on a host computer, and be given the test target's IP address or hostname. The tests print network performance for various packet sizes over UDP and TCP, versus various additional CPU loads on the target. diff --git a/packages/net/common/current/tests/host_echo.c b/packages/net/common/current/tests/host_echo.c new file mode 100644 --- /dev/null +++ b/packages/net/common/current/tests/host_echo.c @@ -0,0 +1,281 @@ +//========================================================================== +// +// tests/host_echo.c +// +// Simple TCP throughput test - echo component FOR *HOST* +// * CAUTION: host, i.e. non eCos, only * +// +//========================================================================== +//####BSDCOPYRIGHTBEGIN#### +// +// ------------------------------------------- +// +// Portions of this software may have been derived from OpenBSD or other sources, +// and are covered by the appropriate copyright disclaimers included herein. +// +// ------------------------------------------- +// +//####BSDCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas +// Date: 2000-01-10 +// Purpose: +// Description: This is the middle part of a three part test. The idea is +// to test the throughput of box in a configuration like this: +// +// +------+ port +----+ port +----+ +// |SOURCE|=========>|ECHO|============>|SINK| +// +------+ 9990 +----+ 9991 +----+ +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#undef _KERNEL +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#define true 1 +#define false 1 + +#define TNR_ON() +#define TNR_OFF() + +#define diag_printf printf + +void +pexit(char *s) +{ + perror(s); + exit(1); +} + + +#define SOURCE_PORT 9990 +#define SINK_PORT 9991 + +#define MAX_BUF 8192 +static unsigned char data_buf[MAX_BUF]; + +struct test_params { + long nbufs; + long bufsize; + long load; +}; + +struct test_status { + long ok; +}; + +int max( int a, int b ) { return (a>b)?a:b; } +int min( int a, int b ) { return (a|ECHO|============>|SINK| -// +------+ 9990 +----+ 9991 +----+ -// -// -//####DESCRIPTIONEND#### -// -//========================================================================== - -#undef _KERNEL -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#define true 1 -#define false 1 - -#define TNR_ON() -#define TNR_OFF() - -#define diag_printf printf - -void -pexit(char *s) -{ - perror(s); - exit(1); -} - - -#define SOURCE_PORT 9990 -#define SINK_PORT 9991 - -#define MAX_BUF 8192 -static unsigned char data_buf[MAX_BUF]; - -struct test_params { - long nbufs; - long bufsize; - long load; -}; - -struct test_status { - long ok; -}; - -int max( int a, int b ) { return (a>b)?a:b; } -int min( int a, int b ) { return (a