OnixS C++ CME Market Data Handler  4.8.0.10
API documentation
Pages/DetectingPacketGaps.md
Go to the documentation of this file.
1 \addtogroup packet-gap-detection
2 
3 \brief Explains details of how the Handler makes decision on gaps in
4 incoming data and which parameters affect Handler's behavior in the case.
5 
6 \section gap-detection-logic Detecting Packet Gaps
7 
8 Due to unreliable nature of multicast, the packets transmitted by
9 MDP may be received in the order different to the original. To differ
10 the case when the Handler received out-of-order packets from the case
11 when some of them were completely lost, the Handler uses two parameters
12 OnixS::CME::MDH::RealtimeFeedSettings::outOfOrderPacketMaxInterval and
13 OnixS::CME::MDH::RealtimeFeedSettings::lostPacketWaitTime.
14 
15 \note Noted parameters are a part of parameters for incremental feeds.
16 An instance of OnixS::CME::MDH::RealtimeFeedSettings class can be accessed
17 through the OnixS::CME::MDH::HandlerSettings::FeedSettings::incrementalFeeds
18 member of the OnixS::CME::MDH::HandlerSettings::FeedSettings class, which instance
19 in its turn is returned by the OnixS::CME::MDH::HandlerSettings::feeds member.
20 
21 When an out-of-order packet is received, the Handler makes a decision on data
22 loss if either missing data is not received for a predefined time interval,
23 or if new incoming packets have sequence numbers greater than a certain threshold.
24 
25 The OnixS::CME::MDH::RealtimeFeedSettings::outOfOrderPacketMaxInterval
26 parameter defines the size of the interval for incoming packets starting from
27 the last received. The packet is considered as out-of-order if its sequence
28 number fits into the following interval:
29 
30 *[seqNumberOfLastReceivedPacket,
31  seqNumberOfLastReceivedPacket+outOfOrderPacketsMaxInterval]*,
32 
33 where *seqNumberOfLastReceivedPacket* - a sequence number of the
34 last packet the Handler processed under normal conditions. In that
35 case, the Handler waits for other packets to fulfill the incoming
36 sequence. If a received packet has a sequence number greater than
37 *seqNumberOfLastReceivedPacket+outOfOrderPacketsMaxInterval*,
38 then the Handler decides on packets lost, and the gap is reported.
39 
40 If for a certain time interval the Handler receives missing data,
41 it resumes normal data processing. However, if no data is received
42 for the predefined time frame, the Handler considers missing data as
43 lost and raises a packet gap event.
44 The OnixS::CME::MDH::RealtimeFeedSettings::lostPacketWaitTime parameter
45 defines the size of time interval the Handler waits for missing data.