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 | @chapter Network Task Structure and Data Flow |
---|
12 | |
---|
13 | A schematic diagram of the tasks and message @b{mbuf} queues in a |
---|
14 | simple RTEMS networking application is shown in the following |
---|
15 | figure: |
---|
16 | |
---|
17 | @ifset use-ascii |
---|
18 | @example |
---|
19 | @group |
---|
20 | NO ASCII VERSION OF THE TASKING FIGURE IS AVAILABLE |
---|
21 | @end group |
---|
22 | @end example |
---|
23 | @end ifset |
---|
24 | |
---|
25 | @ifset use-tex |
---|
26 | @c for now use the ascii version |
---|
27 | @example |
---|
28 | @group |
---|
29 | @c why does this not work for pdf? |
---|
30 | @c @image{networkflow,5in,6in} |
---|
31 | NO TEX VERSION OF THE TASKING FIGURE IS AVAILABLE |
---|
32 | @end group |
---|
33 | @end example |
---|
34 | @end ifset |
---|
35 | |
---|
36 | @ifset use-html |
---|
37 | @html |
---|
38 | <IMG SRC="networkflow.png" ALIGN=CENTER |
---|
39 | ALT="Network Task Structure and Data Flow"> |
---|
40 | @end html |
---|
41 | @end ifset |
---|
42 | |
---|
43 | |
---|
44 | The transmit task for each network interface is normally blocked waiting |
---|
45 | for a packet to arrive in the transmit queue. Once a packet arrives, the |
---|
46 | transmit task may block waiting for an event from the transmit interrupt |
---|
47 | handler. The transmit interrupt handler sends an RTEMS event to the transmit |
---|
48 | task to indicate that transmit hardware resources have become available. |
---|
49 | |
---|
50 | The receive task for each network interface is normally blocked waiting |
---|
51 | for an event from the receive interrupt handler. When this event is received |
---|
52 | the receive task reads the packet and forwards it to the network stack |
---|
53 | for subsequent processing by the network task. |
---|
54 | |
---|
55 | The network task processes incoming packets and takes care of |
---|
56 | timed operations such as handling TCP timeouts and |
---|
57 | aging and removing routing table entries. |
---|
58 | |
---|
59 | The `Network code' contains routines which may run in the context of |
---|
60 | the user application tasks, the interface receive task or the network task. |
---|
61 | A network semaphore ensures that |
---|
62 | the data structures manipulated by the network code remain consistent. |
---|