Subject: [ipfix] TCP/SCTP connection timers

From: Mark Fullmer <[email-masked]>
Date: Tue, 18 Nov 2003 21:27:44 -0500

When the exporter opens a TCP connection to a collector the collection
process may not be running.  In this case either an open timeout will
occur on the exporter (slow notification) or an ICMP port unreachable
will get passed up to the application to indicate a connection refused.
Other scenarios exist with packet filters or other network failures
which can prevent the exporter from opening a connection to the 
exporter.

So this is fairly easy to deal with, just retry.  Is there any defined
best practice for how to implement the retry state machine?  For example
should there be an exponential back-off bounded at some value?  Is
just retrying every 60 seconds okay?

mark 

--
Help        mailto:[email-masked] and say "help" in message body
Unsubscribe mailto:[email-masked] and say
"unsubscribe ipfix" in message body
Archive     http://ipfix.doit.wisc.edu/archive/

---

From: Peter Ludemann <[email-masked]>
Date: Tue, 18 Nov 2003 22:03:13 -0800 (PST)

The "usual" TCP implementations do their own backoff when
opening a connection until they time out. You can watch this
by installing a sniffer such as Ethereal (download from
http://www.ethereal.com )

If you have multiple receivers (for fail-over), then you
almost certainly want to override the default timeout (either
as a parameter or as a separate timer). Don't worry about
flipping back and forth between receivers while trying to
connect, because the amount of traffic will be minimal.

If you want to find out more about how TCP does things, I
suggest:

  Stevens&Wright "TCP/IP Illustrated Volume 2 (The
implementation)" [you might also want to look at the real
stuff in FreeBSD or Linux]
  
  Snader "Effective TCP/IP Programming: 44 tips to improve
your network programs"

  Other books by Stevens or Comer, according to your taste.

Have fun!  It's both simpler and more complicated than it
looks.

- peter

---

From: Mark Fullmer <[email-masked]>
Date: Wed, 19 Nov 2003 02:29:51 -0500

Yes, I know all that.

The question is how often to retry the connection from the application
(exporter) point of view.  The failure may be fast (ECONNREFUSED,
ENETUNREACH) or slow (ETIMEOUT).  You probably don't want to just
loop retrying the connection once a second if the collector process
isn't running.

There's lots of ways to do this (fixed timers, bounded exponential
backoff), I'm more interested if there's a best common practice that
we can use.  For example "The exporter MUST try to establish a 
connection
to the collector at least once every 300 seconds and MUST NOT try
more than once every 60 seconds."

mark