Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When connecting to an service provided using anycast, I am experiencing different behaviour depending on whether the request is made using TCP or UDP.

With TCP, the request is made to address A, and the subsequent response also comes from A.

With UDP however, while the request is made to A, the response comes from address B.

Is this correct behaviour, or should the UDP response come from the same address it's sent to?

share|improve this question
"Anycast" is more of a concept than one specific implementation. You need to provide a lot more details for us to help you. – cagenut May 3 '10 at 17:54
agreeing with cagenut. – dbasnett May 3 '10 at 19:01
up vote 2 down vote accepted

What you're seeing here may be more a factor of OS default source address selection semantics then an anycast issue specifically, although an anycasted setup will expose the problem more quickly.

On systems with multiple IPs (which is almost always the case for anycast uses), outgoing connections will originate from the machine's primary IP. Since TCP uses connections, there's a stronger association between the destination address of an incoming packet and the origin address of the reply; UDP doesn't have this as much.

For your UDP-based anycasted app, you will probably want to look on the server side for a setting to chose the interface to bind to, and possibly an additional setting for the address to use for outgoing connections.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.