Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reachability and IPv6

One of my project uses the Apple's Reachability class in order to be monitor the network state and be notified in case of changes.

After reading this article about supporting IPv6 I was wondering if were to be made to this class to make it work with IPv6.

I set up an IPv6 network following the same article and everything seems to work fine but maybe there is an issue with the setup.

Is the part of the Reachability class checking the Internet connection working with IPv6 as it is now or does it need some changes?

like image 691
Titouan de Bailleul Avatar asked Aug 11 '15 09:08

Titouan de Bailleul


People also ask

Is it better to enable IPv6?

Best answer: IPv6 can potentially add support for more devices, better security, and more efficient connections. While some older software may not work as expected, most of your network should work fine with IPv6 enabled.

How do you know if a website is IPv6 compatible?

IPv6 Compatibility Checker tool checks if a domain is using IPv6 on their network. This tool queries the domain's DNS records to check if the IPv6 DNS Records resolves correctly and returns some valid value or not. Just enter a domain name, and this tool instantly scans the IPv6 compatibility against a given domain.

What is IPv6 vs IPv4?

The main difference between IPv4 and IPv6 is the address size of IP addresses. The IPv4 is a 32-bit address, whereas IPv6 is a 128-bit hexadecimal address. IPv6 provides a large address space, and it contains a simple header as compared to IPv4.

Does IPv6 give faster speeds?

How do IPv4 and IPv6 compare when it comes to speed? The security blog Sucuri ran a series of tests in which they found that in direct connections, IPv4 and IPv6 delivered the same speed.


1 Answers

Short answer from Apple itself (https://developer.apple.com/videos/play/wwdc2015/719/ at ~10:30 - though I would recommend to watch the video in full - or at least look through at the key points here: http://www.internetsociety.org/deploy360/blog/2015/06/video-of-apple-wwdc-session-about-ipv6-and-ios-9-now-available-and-some-screenshots/):

Just Try The Connection.

A copy paste from https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-SW25 which reiterates this:

Connect Without Preflight

The Reachability APIs (see SCNetworkReachability Reference) are intended for diagnostic purposes after identifying a connectivity issue. Many apps incorrectly use these APIs to proactively check for an Internet connection by calling the SCNetworkReachabilityCreateWithAddress method and passing it an IPv4 address of 0.0.0.0, which indicates that there is a router on the network. However, the presence of a router doesn’t guarantee that an Internet connection exists. In general, avoid preflighting network reachability. Just try to make a connection and gracefully handle failures. If you must check for network availability, avoid calling the SCNetworkReachabilityCreateWithAddress method. Call the SCNetworkReachabilityCreateWithName method and pass it a hostname instead.

Some apps also pass the SCNetworkReachabilityCreateWithAddress method an IPv4 address of 169.254.0.0, a self-assigned link-local address, to check for an active Wi-Fi connection. To check for Wi-Fi or cellular connectivity, look for the network reachability flag kSCNetworkReachabilityFlagsIsWWAN instead.

like image 111
Andrew Y Avatar answered Oct 02 '22 05:10

Andrew Y