4 ms·
How are TCP connections established while using anycast ? I was reading https://serverfault.com/questions/279482/what-is-the-difference-between-unicast-anycast
by pulkitsh1234 8y ago
How are TCP connections established while using anycast ?
I was reading https://serverfault.com/questions/279482/what-is-the-difference-between-unicast-anycast-broadcast-and-multicast-traffic https://serverfault.com/questions/279482/what-is-the-differe... to understand what exactly is unicast, anycast, etc. It seems like TCP works with unicast.
With GeoDNS users requests will be resolved to single IP address with which they can establish a TCP connection.
How, will connection establishment (TCP specifically) work with anycast ? Where request (packets ?) can be routed to different machines ? Is there some other network protocol to use with anycast ?
I was going through: https://serverfault.com/questions/616412/how-does-anycast-work-with-tcp https://serverfault.com/questions/616412/how-does-anycast-wo... , not sure it is the 2018 way of doing these things.
Sorry for dumb questions, network newbie here.
- aaronblohowiak 8y agoRead more on anycast. Anycast lets different computers advertise the same IP address from multiple places. When your computer tries to talk to that IP address (over whatever protocol you chose) the network sends that traffic to the “closest” computer advertising that IP address. TCP builds a reliable stream on top of unreliable IP packets. Since which computer is “closest” rarely changes, your stream will keep being sent to the same server. When that server stops advertising the IP, then the data will get sent to a different server which will say “I don’t know what you are talking about, Reset your stream” and the tcp connection will close, basically.
- tgtweak 8y agoAnycast route election is done by the connecting router (typically the clients ISP), and it works over bgp like normal route advertising - it's transparent to your applications and they only get directed to one endpoint destination (typically the one with the lowest latency, congestion, or cost). Once the router gets a request from a client for a destination, it does the same thing it usually does and checks the possible routes and chooses the "best" based on the rules defined by the owner of the router. The difference here is that not all of those proposed routes make it to the same physical destination. There is some stickyness to make sure you're arriving at the same destination for the duration of that connection. Really it's like asking your favorite maps app where McDonalds is - it'll know to give you results close to you, since it knows there are many McDonalds. It would make sense for you to choose the closest, but it's not enforced by McDonalds. Similarly, if I do the same and we live in different cities, we'll get different results. The end result is that we both got to different physical places by specifying the same thing, and it's up to McDonalds to make sure the menu is the same :)