@c
|
@c
|
@c Written by Eric Norum
|
@c Written by Eric Norum
|
@c
|
@c
|
@c COPYRIGHT (c) 1988-2002.
|
@c COPYRIGHT (c) 1988-2002.
|
@c On-Line Applications Research Corporation (OAR).
|
@c On-Line Applications Research Corporation (OAR).
|
@c All rights reserved.
|
@c All rights reserved.
|
@c
|
@c
|
@c testing.t,v 1.8 2002/01/17 21:47:45 joel Exp
|
@c testing.t,v 1.8 2002/01/17 21:47:45 joel Exp
|
@c
|
@c
|
|
|
|
|
@chapter Testing the Driver
|
@chapter Testing the Driver
|
|
|
@section Preliminary Setup
|
@section Preliminary Setup
|
|
|
The network used to test the driver should include at least:
|
The network used to test the driver should include at least:
|
|
|
@itemize @bullet
|
@itemize @bullet
|
|
|
@item The hardware on which the driver is to run.
|
@item The hardware on which the driver is to run.
|
It makes testing much easier if you can run a debugger to control
|
It makes testing much easier if you can run a debugger to control
|
the operation of the target machine.
|
the operation of the target machine.
|
|
|
@item An Ethernet network analyzer or a workstation with an
|
@item An Ethernet network analyzer or a workstation with an
|
`Ethernet snoop' program such as @code{ethersnoop} or
|
`Ethernet snoop' program such as @code{ethersnoop} or
|
@code{tcpdump}.
|
@code{tcpdump}.
|
|
|
@item A workstation.
|
@item A workstation.
|
|
|
@end itemize
|
@end itemize
|
|
|
During early debug, you should consider putting the target, workstation,
|
During early debug, you should consider putting the target, workstation,
|
and snooper on a small network by themselves. This offers a few
|
and snooper on a small network by themselves. This offers a few
|
advantages:
|
advantages:
|
|
|
@itemize @bullet
|
@itemize @bullet
|
|
|
@item There is less traffic to look at on the snooper and for the target
|
@item There is less traffic to look at on the snooper and for the target
|
to process while bringing the driver up.
|
to process while bringing the driver up.
|
|
|
@item Any serious errors will impact only your small network not a building
|
@item Any serious errors will impact only your small network not a building
|
or campus network. You want to avoid causing any unnecessary problems.
|
or campus network. You want to avoid causing any unnecessary problems.
|
|
|
@item Test traffic is easier to repeatably generate.
|
@item Test traffic is easier to repeatably generate.
|
|
|
@item Performance measurements are not impacted by other systems on
|
@item Performance measurements are not impacted by other systems on
|
the network.
|
the network.
|
|
|
@end itemize
|
@end itemize
|
|
|
@section Debug Output
|
@section Debug Output
|
|
|
There are a number of sources of debug output that can be enabled
|
There are a number of sources of debug output that can be enabled
|
to aid in tracing the behavior of the network stack. The following
|
to aid in tracing the behavior of the network stack. The following
|
is a list of them:
|
is a list of them:
|
|
|
@itemize @bullet
|
@itemize @bullet
|
|
|
@item mbuf activity
|
@item mbuf activity
|
|
|
There are commented out calls to @code{printf} in the file
|
There are commented out calls to @code{printf} in the file
|
@code{sys/mbuf.h} in the network stack code. Uncommenting
|
@code{sys/mbuf.h} in the network stack code. Uncommenting
|
these lines results in output when mbuf's are allocated
|
these lines results in output when mbuf's are allocated
|
and freed. This is very useful for finding memory leaks.
|
and freed. This is very useful for finding memory leaks.
|
|
|
@item TX and RX queuing
|
@item TX and RX queuing
|
|
|
There are commented out calls to @code{printf} in the file
|
There are commented out calls to @code{printf} in the file
|
@code{net/if.h} in the network stack code. Uncommenting
|
@code{net/if.h} in the network stack code. Uncommenting
|
these lines results in output when packets are placed
|
these lines results in output when packets are placed
|
on or removed from one of the transmit or receive packet
|
on or removed from one of the transmit or receive packet
|
queues. These queues can be viewed as the boundary line
|
queues. These queues can be viewed as the boundary line
|
between a device driver and the network stack. If the
|
between a device driver and the network stack. If the
|
network stack is enqueuing packets to be transmitted that
|
network stack is enqueuing packets to be transmitted that
|
the device driver is not dequeuing, then that is indicative
|
the device driver is not dequeuing, then that is indicative
|
of a problem in the transmit side of the device driver.
|
of a problem in the transmit side of the device driver.
|
Conversely, if the device driver is enqueueing packets
|
Conversely, if the device driver is enqueueing packets
|
as it receives them (via a call to @code{ether_input}) and
|
as it receives them (via a call to @code{ether_input}) and
|
they are not being dequeued by the network stack,
|
they are not being dequeued by the network stack,
|
then there is a problem. This situation would likely indicate
|
then there is a problem. This situation would likely indicate
|
that the network server task is not running.
|
that the network server task is not running.
|
|
|
@item TCP state transitions
|
@item TCP state transitions
|
|
|
In the unlikely event that one would actually want to see
|
In the unlikely event that one would actually want to see
|
TCP state transitions, the @code{TCPDEBUG} macro can be defined
|
TCP state transitions, the @code{TCPDEBUG} macro can be defined
|
in the file @code{opt_tcpdebug.h}. This results in the routine
|
in the file @code{opt_tcpdebug.h}. This results in the routine
|
@code{tcp_trace()} being called by the network stack and
|
@code{tcp_trace()} being called by the network stack and
|
the state transitions logged into the @code{tcp_debug} data
|
the state transitions logged into the @code{tcp_debug} data
|
structure. If the variable @code{tcpconsdebug} in the file
|
structure. If the variable @code{tcpconsdebug} in the file
|
@code{netinet/tcp_debug.c} is set to 1, then the state transitions
|
@code{netinet/tcp_debug.c} is set to 1, then the state transitions
|
will also be printed to the console.
|
will also be printed to the console.
|
|
|
@end itemize
|
@end itemize
|
|
|
@section Driver basic operation
|
@section Driver basic operation
|
|
|
The network demonstration program @code{netdemo} may be used for these tests.
|
The network demonstration program @code{netdemo} may be used for these tests.
|
|
|
@itemize @bullet
|
@itemize @bullet
|
|
|
@item Edit @code{networkconfig.h} to reflect the values for your network.
|
@item Edit @code{networkconfig.h} to reflect the values for your network.
|
|
|
@item Start with @code{RTEMS_USE_BOOTP} not defined.
|
@item Start with @code{RTEMS_USE_BOOTP} not defined.
|
|
|
@item Edit @code{networkconfig.h} to configure the driver
|
@item Edit @code{networkconfig.h} to configure the driver
|
with an
|
with an
|
explicit Ethernet and Internet address and with reception of
|
explicit Ethernet and Internet address and with reception of
|
broadcast packets disabled:
|
broadcast packets disabled:
|
|
|
Verify that the program continues to run once the driver has been attached.
|
Verify that the program continues to run once the driver has been attached.
|
|
|
@item Issue a @samp{u} command to send UDP
|
@item Issue a @samp{u} command to send UDP
|
packets to the `discard' port.
|
packets to the `discard' port.
|
Verify that the packets appear on the network.
|
Verify that the packets appear on the network.
|
|
|
@item Issue a @samp{s} command to print the network and driver statistics.
|
@item Issue a @samp{s} command to print the network and driver statistics.
|
|
|
@item On a workstation, add a static route to the target system.
|
@item On a workstation, add a static route to the target system.
|
|
|
@item On that same workstation try to `ping' the target system.
|
@item On that same workstation try to `ping' the target system.
|
Verify that the ICMP echo request and reply packets appear on the net.
|
Verify that the ICMP echo request and reply packets appear on the net.
|
|
|
@item Remove the static route to the target system.
|
@item Remove the static route to the target system.
|
Modify @code{networkconfig.h} to attach the driver
|
Modify @code{networkconfig.h} to attach the driver
|
with reception of broadcast packets enabled.
|
with reception of broadcast packets enabled.
|
Try to `ping' the target system again.
|
Try to `ping' the target system again.
|
Verify that ARP request/reply and ICMP echo request/reply packets appear
|
Verify that ARP request/reply and ICMP echo request/reply packets appear
|
on the net.
|
on the net.
|
|
|
@item Issue a @samp{t} command to send TCP
|
@item Issue a @samp{t} command to send TCP
|
packets to the `discard' port.
|
packets to the `discard' port.
|
Verify that the packets appear on the network.
|
Verify that the packets appear on the network.
|
|
|
@item Issue a @samp{s} command to print the network and driver statistics.
|
@item Issue a @samp{s} command to print the network and driver statistics.
|
|
|
@item Verify that you can telnet to ports 24742
|
@item Verify that you can telnet to ports 24742
|
and 24743 on the target system from one or more
|
and 24743 on the target system from one or more
|
workstations on your network.
|
workstations on your network.
|
|
|
@end itemize
|
@end itemize
|
|
|
@section BOOTP/DHCP operation
|
@section BOOTP/DHCP operation
|
|
|
Set up a BOOTP/DHCP server on the network.
|
Set up a BOOTP/DHCP server on the network.
|
Set define @code{RTEMS USE_BOOT} in @code{networkconfig.h}.
|
Set define @code{RTEMS USE_BOOT} in @code{networkconfig.h}.
|
Run the @code{netdemo} test program.
|
Run the @code{netdemo} test program.
|
Verify that the target system configures itself from the BOOTP/DHCP server and
|
Verify that the target system configures itself from the BOOTP/DHCP server and
|
that all the above tests succeed.
|
that all the above tests succeed.
|
|
|
@section Stress Tests
|
@section Stress Tests
|
|
|
Once the driver passes the tests described in the previous section it should
|
Once the driver passes the tests described in the previous section it should
|
be subjected to conditions which exercise it more
|
be subjected to conditions which exercise it more
|
thoroughly and which test its error handling routines.
|
thoroughly and which test its error handling routines.
|
|
|
@subsection Giant packets
|
@subsection Giant packets
|
|
|
@itemize @bullet
|
@itemize @bullet
|
@item Recompile the driver with @code{MAXIMUM_FRAME_SIZE} set to
|
@item Recompile the driver with @code{MAXIMUM_FRAME_SIZE} set to
|
a smaller value, say 514.
|
a smaller value, say 514.
|
|
|
@item `Ping' the driver from another workstation and verify
|
@item `Ping' the driver from another workstation and verify
|
that frames larger than 514 bytes are correctly rejected.
|
that frames larger than 514 bytes are correctly rejected.
|
|
|
@item Recompile the driver with @code{MAXIMUM_FRAME_SIZE} restored to 1518.
|
@item Recompile the driver with @code{MAXIMUM_FRAME_SIZE} restored to 1518.
|
@end itemize
|
@end itemize
|
|
|
@subsection Resource Exhaustion
|
@subsection Resource Exhaustion
|
|
|
@itemize @bullet
|
@itemize @bullet
|
@item Edit @code{networkconfig.h}
|
@item Edit @code{networkconfig.h}
|
so that the driver is configured with just two receive and transmit descriptors.
|
so that the driver is configured with just two receive and transmit descriptors.
|
|
|
@item Compile and run the @code{netdemo} program.
|
@item Compile and run the @code{netdemo} program.
|
|
|
@item Verify that the program operates properly and that you can
|
@item Verify that the program operates properly and that you can
|
still telnet to both the ports.
|
still telnet to both the ports.
|
|
|
@item Display the driver statistics (Console `@code{s}' command or telnet
|
@item Display the driver statistics (Console `@code{s}' command or telnet
|
`control-G' character) and verify that:
|
`control-G' character) and verify that:
|
|
|
@enumerate
|
@enumerate
|
|
|
@item The number of transmit interrupts is non-zero.
|
@item The number of transmit interrupts is non-zero.
|
This indicates that all transmit descriptors have been in use at some time.
|
This indicates that all transmit descriptors have been in use at some time.
|
|
|
@item The number of missed packets is non-zero.
|
@item The number of missed packets is non-zero.
|
This indicates that all receive descriptors have been in use at some time.
|
This indicates that all receive descriptors have been in use at some time.
|
|
|
@end enumerate
|
@end enumerate
|
|
|
@end itemize
|
@end itemize
|
|
|
@subsection Cable Faults
|
@subsection Cable Faults
|
|
|
@itemize @bullet
|
@itemize @bullet
|
@item Run the @code{netdemo} program.
|
@item Run the @code{netdemo} program.
|
|
|
@item Issue a `@code{u}' console command to make the target machine transmit
|
@item Issue a `@code{u}' console command to make the target machine transmit
|
a bunch of UDP packets.
|
a bunch of UDP packets.
|
|
|
@item While the packets are being transmitted, disconnect and reconnect the
|
@item While the packets are being transmitted, disconnect and reconnect the
|
network cable.
|
network cable.
|
|
|
@item Display the network statistics and verify that the driver has
|
@item Display the network statistics and verify that the driver has
|
detected the loss of carrier.
|
detected the loss of carrier.
|
|
|
@item Verify that you can still telnet to both ports on the target machine.
|
@item Verify that you can still telnet to both ports on the target machine.
|
|
|
@end itemize
|
@end itemize
|
|
|
@subsection Throughput
|
@subsection Throughput
|
|
|
Run the @code{ttcp} network benchmark program.
|
Run the @code{ttcp} network benchmark program.
|
Transfer large amounts of data (100's of megabytes) to and from the target
|
Transfer large amounts of data (100's of megabytes) to and from the target
|
system.
|
system.
|
|
|
The procedure for testing throughput from a host to an RTEMS target
|
The procedure for testing throughput from a host to an RTEMS target
|
is as follows:
|
is as follows:
|
|
|
@enumerate
|
@enumerate
|
@item Download and start the ttcp program on the Target.
|
@item Download and start the ttcp program on the Target.
|
|
|
@item In response to the @code{ttcp} prompt, enter @code{-s -r}. The
|
@item In response to the @code{ttcp} prompt, enter @code{-s -r}. The
|
meaning of these flags is described in the @code{ttcp.1} manual page
|
meaning of these flags is described in the @code{ttcp.1} manual page
|
found in the @code{ttcp_orig} subdirectory.
|
found in the @code{ttcp_orig} subdirectory.
|
|
|
@item On the host run @code{ttcp -s -t <
|
@item On the host run @code{ttcp -s -t <
|
the Target here>>}
|
the Target here>>}
|
|
|
@end enumerate
|
@end enumerate
|
|
|
|
|
The procedure for testing throughput from an RTEMS target
|
The procedure for testing throughput from an RTEMS target
|
to a Host is as follows:
|
to a Host is as follows:
|
|
|
@enumerate
|
@enumerate
|
@item On the host run @code{ttcp -s -r}.
|
@item On the host run @code{ttcp -s -r}.
|
|
|
@item Download and start the ttcp program on the Target.
|
@item Download and start the ttcp program on the Target.
|
|
|
@item In response to the @code{ttcp} prompt, enter @code{-s -t <
|
@item In response to the @code{ttcp} prompt, enter @code{-s -t <
|
the hostname or IP address of the Target here>>}. You need to type the
|
the hostname or IP address of the Target here>>}. You need to type the
|
IP address of the host unless your Target is talking to your Domain Name
|
IP address of the host unless your Target is talking to your Domain Name
|
Server.
|
Server.
|
|
|
@end enumerate
|
@end enumerate
|
|
|
To change the number of buffers, the buffer size, etc. you just add the
|
To change the number of buffers, the buffer size, etc. you just add the
|
extra flags to the @code{-t} machine as specified in the @code{ttcp.1}
|
extra flags to the @code{-t} machine as specified in the @code{ttcp.1}
|
manual page found in the @code{ttcp_orig} subdirectory.
|
manual page found in the @code{ttcp_orig} subdirectory.
|
|
|
|
|
|
|
|
|
|
|
|
|