ipv6 - Why is addrinfo loop needed? -


suppose have pure ipv6 network. socket app uses getaddrinfo find host1 hostname, , gets 1 of host1's ip addresses first response. why should loop on returned addresses? isn't responsibilty of routers or host1's tcp/ip stack or local tcp/ip stack find alternate route host1, perhaps through different network interface on host1?

you think finding routes host known name basic functionality of computer network infrastructure rather socket app.

getaddrinfo() can give addresses name that's different host, can still access service if 1 host down.

but internet quite dumb, it's not intelligent network tried in old telecom networks. internet pushes functionality edges, , routers @ ip addresses in packet , sends out best pipe can. indeed take care of issues 1 path ip address broken, router send packet on alternative path.

but edge, socket application, responsible deciding ip address want send packets to, , whether figure out ip address send packets to, means of querying dns, ldap, statically configuring, config files or not, no concern of network.

you'd want loop around on getaddrinfo() results because resolving name can give different ip addresses, belonging different hosts around world provides same service, , can reached on ipv4 or ipv6.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -