source: rtems/doc/networking/testing.t @ 381fc99

4.104.114.84.95
Last change on this file since 381fc99 was 381fc99, checked in by Joel Sherrill <joel.sherrill@…>, on 02/09/99 at 20:30:34

Added information on debug modes that can be enabled in the network stack.

  • Property mode set to 100644
File size: 6.5 KB
Line 
1@c
2@c  Written by Eric Norum
3@c
4@c  COPYRIGHT (c) 1988-1998.
5@c  On-Line Applications Research Corporation (OAR).
6@c  All rights reserved.
7@c
8@c  $Id$
9@c
10
11
12@chapter Testing the Driver
13
14@section Preliminary Setup
15
16The network used to test the driver should include at least:
17
18@itemize @bullet
19
20@item The hardware on which the driver is to run.
21It makes testing much easier if you can run a debugger to control
22the operation of the target machine.
23
24@item An Ethernet network analyzer or a workstation with an
25`Ethernet snoop' program such as @code{ethersnoop} or
26@code{tcpdump}.
27
28@item A workstation.
29
30@end itemize
31
32During early debug, you should consider putting the target, workstation,
33and snooper on a small network by themselves.  This offers a few
34advantages:
35
36@itemize @bullet
37
38@item There is less traffic to look at on the snooper and for the target
39to process while bringing the driver up.
40
41@item Any serious errors will impact only your small network not a building
42or campus network.  You want to avoid causing any unnecessary problems.
43
44@item Test traffic is easier to repeatably generate.
45
46@item Performance measurements are not impacted by other systems on
47the network.
48
49@end itemize
50
51@section Debug Output
52
53There are a number of sources of debug output that can be enabled
54to aid in tracing the behavior of the network stack.  The following
55is a list of them:
56
57@itemize @bullet
58
59@item mbuf activity
60
61There are commented out calls to @code{printf} in the file
62@code{sys/mbuf.h} in the network stack code.  Uncommenting
63these lines results in output when mbuf's are allocated
64and freed.  This is very useful for findind memory leaks.
65
66@item TX and RX queuing
67
68There are commented out calls to @code{printf} in the file
69@code{net/if.h} in the network stack code.  Uncommenting
70these lines results in output when packets are placed
71on or removed from one of the transmit or receive packet
72queues.  These queues can be viewed as the boundary line
73between a device driver and the network stack.  If the
74network stack is enqueuing packets to be transmitted that
75the device driver is not dequeuing, then that is indicative
76of a problem in the transmit side of the device driver.
77Conversely, if the device driver is enqueueing packets
78as it receives them (via a call to @code{ether_input}) and
79they are not being dequeued by the network stack,
80then there is a problem.  This situation would likely indicate
81that the network server task is not running.
82
83@item TCP state transitions
84
85In the unlikely event that one would actually want to see
86TCP state transitions, the @code{TCPDEBUG} macro can be defined
87in the file @code{opt_tcpdebug.h}.  This results in the routine
88@code{tcp_trace()} being called by the network stack and
89the state transitions logged into the @code{tcp_debug} data
90structure.  If the variable @code{tcpconsdebug} in the file
91@code{netinet/tcp_debug.c} is set to 1, then the state transitions
92will also be printed to the console.
93
94@end itemize
95
96@section Driver basic operation
97
98The network demonstration program @code{netdemo} may be used for these tests.
99
100@itemize @bullet
101
102@item Edit @code{networkconfig.h} to reflect the values for your network.
103
104@item Start with @code{RTEMS_USE_BOOTP} not defined.
105
106@item Edit @code{networkconfig.h} to configure the driver
107with an
108explicit Ethernet and Internet address and with reception of
109broadcast packets disabled:
110
111Verify that the program continues to run once the driver has been attached.
112
113@item Issue a @samp{u} command to send UDP
114packets to the `discard' port.
115Verify that the packets appear on the network.
116
117@item Issue a @samp{s} command to print the network and driver statistics.
118
119@item On a workstation, add a static route to the target system.
120
121@item On that same workstation try to `ping' the target system.
122Verify that the ICMP echo request and reply packets appear on the net.
123
124@item Remove the static route to the target system.
125Modify @code{networkconfig.h} to attach the driver
126with reception of broadcast packets enabled.
127Try to `ping' the target system again.
128Verify that ARP request/reply and ICMP echo request/reply packets appear
129on the net.
130
131@item Issue a @samp{t} command to send TCP
132packets to the `discard' port.
133Verify that the packets appear on the network.
134
135@item Issue a @samp{s} command to print the network and driver statistics.
136
137@item Verify that you can telnet to ports 24742
138and 24743 on the target system from one or more
139workstations on your network.
140
141@end itemize
142
143@section BOOTP/DHCP operation
144
145Set up a BOOTP/DHCP server on the network.
146Set define @code{RTEMS USE_BOOT} in @code{networkconfig.h}.
147Run the @code{netdemo} test program.
148Verify that the target system configures itself from the BOOTP/DHCP server and
149that all the above tests succeed.
150
151@section Stress Tests
152
153Once the driver passes the tests described in the previous section it should
154be subjected to conditions which exercise it more
155thoroughly and which test its error handling routines.
156
157@subsection Giant packets
158
159@itemize @bullet
160@item Recompile the driver with @code{MAXIMUM_FRAME_SIZE} set to
161a smaller value, say 514.
162
163@item `Ping' the driver from another workstation and verify
164that frames larger than 514 bytes are correctly rejected.
165
166@item Recompile the driver with @code{MAXIMUM_FRAME_SIZE} restored  to 1518.
167@end itemize
168
169@subsection Resource Exhaustion
170
171@itemize @bullet
172@item Edit  @code{networkconfig.h}
173so that the driver is configured with just two receive and transmit descriptors.
174
175@item Compile and run the @code{netdemo} program.
176
177@item Verify that the program operates properly and that you can
178still telnet to both the ports.
179
180@item Display the driver statistics (Console `@code{s}' command or telnet
181`control-G' character) and verify that:
182
183@enumerate
184
185@item The number of transmit interrupts is non-zero.
186This indicates that all transmit descriptors have been in use at some time.
187
188@item The number of missed packets is non-zero.
189This indicates that all receive descriptors have been in use at some time.
190
191@end enumerate
192
193@end itemize
194
195@subsection Cable Faults
196
197@itemize @bullet
198@item Run the @code{netdemo} program.
199
200@item Issue a `@code{u}' console command to make the target machine transmit
201a bunch of UDP packets.
202
203@item While the packets are being transmitted, disconnect and reconnect the
204network cable.
205
206@item Display the network statistics and verify that the driver has
207detected the loss of carrier.
208
209@item Verify that you can still telnet to both ports on the target machine.
210
211@end itemize
212
213@subsection Throughput
214
215Run the @code{ttcp} network benchmark program.
216Transfer large amounts of data (100's of megabytes) to and from the target
217system.
218
219
220
Note: See TracBrowser for help on using the repository browser.