Comtrol eCos User Manual

Page 807

Advertising
background image

Synthetic Target Ethernet Driver

The protocol analyser is not intended to be a fully functional analyser with knowledge of many different TCP/IP
protocols, advanced search facilities, graphical traffic displays, and so on. Functionality like that is already provided
by other tools such as ethereal and tcpdump. Achieving similar levels of functionality would require a lot of work,
for very little gain. It is still useful to have some protocol analysis functionality available because the output will be
interleaved with other output, for example

printf

calls from the application. That may make it easier to understand

the sequence of events.

One problem with logging ethernet traffic is that it can involve very large amounts of data. If the application is
expected to run for a long time or is very I/O intensive then it is easy to end up with many megabytes. When
running in graphical mode all the logging data will be held in memory, even data that is not currently visible.
At some point the system will begin to run low on memory and performance will suffer. To avoid problems, the
ethernet script maintains a flag that controls whether or not packet logging is active. The default is to run with
logging disabled, but this can be changed in the target definition file:

synth_device ethernet {

...

logging 1

}

The ethernet script will add a toolbar button that allows this flag to be changed at run-time, allowing the user to
capture traffic for certain periods of time while the application continues running.

The target definition file can contain the following entries for the various packet logging filters:

synth_device ethernet {

...

filter ether

-hide 0 -background LightBlue -foreground "#000080"

filter arp

-hide 0 -background LightBlue -foreground "#000050"

filter ipv4

-hide 0 -background LightBlue -foreground "#000040"

filter ipv6

-hide 1 -background LightBlue -foreground "#000040"

filter icmpv4 -hide 0 -background LightBlue -foreground "#000070"

filter icmpv6 -hide 1 -background LightBlue -foreground "#000070"

filter udp

-hide 0 -background LightBlue -foreground "#000030"

filter tcp

-hide 0 -background LightBlue -foreground "#000020"

filter hexdata

-hide 1 -background LightBlue -foreground "#000080"

filter asciidata -hide 1 -background LightBlue -foreground "#000080"

}

All output will show the eCos network device, for example

eth0

, and the direction relative to the eCos application.

Some of the filters will show packet headers, for example

ether

gives details of the ethernet packet header and

tcp

gives information about TCP headers such as whether or not the SYN flag is set. The TCP and UDP filters will also
show source and destination addresses, using numerical addresses and if possible host names. However, host names
will only be shown if the host appears in

/etc/hosts

: doing full DNS lookups while the data is being captured

would add significantly to complexity and overhead. The

hexdata

and

asciidata

filters show the remainder of

the packets after the ethernet, IP and TCP or UDP headers have been stripped.

Some of the filters will provide raw dumps of some of the packet data. Showing up to 1500 bytes of data for each
packet would be expensive, and often the most interesting information is near the start of the packet. Therefore it
is possible to set a limit on the number of bytes that will be shown using the target definition file. The default limit
is 64 bytes.

synth_device ethernet {

...

703

Advertising