CESNET / ipfixcol2

High-performance NetFlow v5/v9 and IPFIX collector (RFC7011)
Other
123 stars 36 forks source link

TCP input: replace waiting for whole IPFIX Messages with continous buffering of its parts #55

Closed Lukas955 closed 2 years ago

Lukas955 commented 2 years ago

The fixes situation when a connection with an exporter is unexpectly closed by the collector when a part of IPFIX message is sent over TCP but the rest is still on the way for long pariod of time. Previously the plugin waited up to half a second for the rest of the message. However, if no parts have been received, the connection was prematurely closed due to connection timeout.

Moreover, waiting for IPFIX Message parts (i.e. blocking) could caused performance degredation if multiple exporters were connected to the collector at the same time.

In this commit, input sockets of all expoters are always non-blocking and parts of IPFIX Messages are buffered until the whole IPFIX Message is received.