![]() | ![]() |
Products |
Sniffer
The clear separation of decoding and processing of messages from the process of gathering the data from the network is of major importance within the design of the IIOP Tracer. The reason is that there is a direct relationship of the data sniffing rate and the load of the Sniffer process. A new packet can only be read after the previous packet has been processed completely. If any more packets are transmitted during the processing period, the Sniffer will not notice them. Therefore, solutions must be found that keep the processing time as low as possible. The decoding process itself cannot be optimized for all possible scenarios in a way that guarantees a sufficient recognition rate. Separation into SendThread and SniffThread The application of multithreading won't solve the problem described above completely and would further increase the overhead because of the thread synchronization needed. Therefore it appears reasonable to delegate the tasks to different processes. The functionality of the Sniffer can thus be reduced to the forwarding of the data. Since this communication is less expensive than the decoding and processing, we achieve a higher data rate by decoupling in that way. The processing speed is further increased by separating the collection of data from the communication within the Sniffer process itself. For this, two threads are created. One of them reads data from the network into a buffered memory segment. This ensures the fastest possible reception of subsequent network packets. A second thread reads from the memory segment and forwards the data to the decoder. Other responsibilities of the so-called SendThread are checking for completeness of the packets received and, in the case of fragmentation, reassembly of the packets before they are passed on to the TraceServer.
Image Preview: Sniffer Architecture Communication with the TraceServer Implementing the communication between the SendThread of the Sniffer and the Decoder using sockets has several advantages. First, the Sniffer can run on a host separated from the other components, thus helping reduce the load on the Sniffer node. This decision further allows the placement of several Sniffers at different locations in the network, which is of major importance for a distributed environment. The implementation of appropriate algorithms that combine the data streams to encrease the data rate further will be done in a later release. The Packet Sniffer must not be blocked by a congested queue caused by the TraceServer. IIt was therefore decided to discard the current message when there is no more storage space available. The socket connection is configured in a way that prevents a blocking of the communication thread of the Sniffer in the case of a filled queue. The Packet Sniffer maintains an internal log registering processed and discarded packets in order to signal the loss of data. Bottlenecks of the system can thus be easily identified. The time stamp of a message is set by the SniffThread immediately after having read the data. |