MultiPath TCP in iOS - ios

How can I implement Multipath TCP in iOS.
I hope as per the MultiPath Apple documentation we do not need to enable MPTCP in iPhone.
Is there any Multipath TCP samples for iOS

You should not need to enable MPTCP on the phone. MPTCP is already in use by iOS applications, e.g., Siri.
What the document you linked to is referring to is enabling MPTCP on your network. MPTCP uses TCP option 30. Many firewalls will not pass unknown TCP options. In order for your iOS app to use MPTCP, tcp option 30 needs to make it unmolested through the network to your server.
Further, your server must support MPTCP for the phone to negotiate an MPTCP connection.
This paper on a socket API for MPTCP has a code sample for using MPTCP on iOS and provides links to opensource code released by Apple that contain examples of using the API.

Multipath TCP is now open for any app in iOS11 beta. See http://www.tessares.net/highlights-from-advances-in-networking-part-1/ for a summary of the announcements at WWDC17. Apple does not expose the socket API mentioned in the previous post.

Related

routing the network over ipv4 instead of ipv6 in iOS

I am using the 3rd party library which only support ipv4.
Whenever there is ipv6 network in my iOs device 3rd party fail.Is there any way I can force or convert or create ipv4 network and do routineg of the application in ipv4 instead of ipv6.
I found the below link but don't know how to implement it or does apple will approve that. https://developer.apple.com/documentation/networkextension/neipv4route
Any help on this please
I think you’ve answered your own question. The library your using only supports ipv4. So either you need to find a library that supports ipv6 or write your own since you can’t control what the network is broadcasting.
Apple has a write up on this here : supporting ipv6

Objective-C - itune app store rejected my app after review, main reason is IPv4 needs to be IPv6?

I have WebRTC framework for my iOS app.
But Apple iTune app store review team, rejected my app (even though it was working in my local hardware's, cost me 6 months of work). After waiting so long, they rejected, because its IPv4, has to be IPv6?
I cant simply change the whole WebRTC Framework that i have used in my app.
My target clients are only IPv4 (not IPv6, i am not even interested to use IPv6), is there no way to solve it? I am using this framework: https://cocoapods.org/pods/libjingle_peerconnection
Any advise/suggestion, has anyone tried the libjingle_peerconnection library to make compatible for IPv6?
EDIT: at 3.56AM
You need to add more details in your question to get an appropriate and correct answer.
My reason for putting an answer is not to answer your question as we need further information. My goal to answer is to make everyone aware how IPv6 functionality can be enabled when developing an Webrtc app.
Server side
Generally speaking primarily there are two main backend components the Webrtc clients connect to:
Signaling server : This is used to carry signaling information such as your sdp between Webrtc endpoints. Can be implemented using web sockets or http or other mechanisms
Stun and a relay/turn server: for obvious Udp hole punching through NAT traversal and if p2p not possible, to act as a relay between endpoints.
For IPv6 both of these servers should support IPv6 connections to it.
Client side
When apple tests IPv6, it must be disabling IPv4 network interface so that the iOS networking stack is forced to use IPv6. Hence you need to enable Webrtc stack to use IPv6 interface. This can be done by adding the constraint googIPv6 : true in the createpeerconnection constraints.
Other than this if you are using any other app servers in your code, you will have to make sure they accept v6 connections.

Implementing VPN with L2TP protocol in iOS app

In iOS settings, there are options to create a VPN configuration using IPSec, IKEv2, and L2TP. Using the NetworkExtension framework from Apple there's an option to create VPN using IPSec and IKEv2 protocols only. They do work but problem is that I need to create a connection via L2TP since that's only supported by the company's firewall.
There's a question iOS app with custom VPN connect from 2014 and it's answered with:
If you want to connect programmatically in ios 8 you can use only IPSec or IKEv2 protocols. L2TP and PPTP protocols are private for apple. It is not possible to use L2TP and PPTP APIs in your applications. Only Apple is currently using these APIs.
Is there any way to create a L2TP VPN connection from an iOS application (Swift)?
The Personal VPN feature that allows using built-in protocols doesn't support unencrypted protocols, presumably for security reasons:
Personal VPN only supports recommended VPN protocols; it doesn’t support legacy VPN protocols, like PPTP and L2TP.
However, that's not the only way to implement a VPN app. You can also create a Packet Tunnel Provider to tunnel layer 3 packets yourself, or an App Proxy Provider for TCP and UDP connections. A packet tunnel provider would allow using your own L2TP implementation.
This might be solving the wrong problem, though. If this is for a specific company, why not use MDM instead of a custom app? MDM does support L2TP.
It is not possible to create a L2TP VPN connection from an iOS application. Only Apple is currently using the L2TP and PPTP APIs.
Is it possible that the company this is for has some sort of internal framework or package you can use for their VPN authentication within your app?
You can make use of every proxy app available on Android playstore. Basically youre iOS device will make use of the hostpot from android phone.
Remember youre android phone must be connected to L2TP VPN.
Every proxy will put all the connection of VPN shared to iOS device.
iOS device in settings we need to add ip and port. You will now be connected to VPN on iOS.
You can try hosting an l2tp server on your mac and connect another device remotely to the server using the settings->network->vpn->l2tp and provide the settings. I haven't tried it personally. On the iPhone General->VPN Management->L2tp can be used.

Bulletproof HTTP Monitor for iOS

I'm using Charles Proxy and Wireshark to monitor http(s) traffic from various iOS apps I'm using on my iPhone. These apps require me to set the HTTP Proxy under the iOS Wifi settings (let's call these the Proxy Settings).
My business needs to see ALL URL's that are being called from my phone. From all apps. All URL's, not some of them.
Now Charles and Wireshark both work fine and I can see a ton of traffic coming from my phone.
However, I can't help but wonder whether I might be missing some HTTP calls. Maybe calls that don't use the Cocoa Core Foundation libraries as the basis for their networking.
For instance, I could write my own HTTP library out of TCP/IP and these would bypass the Proxy Settings.
So my question is: what is the likelihood that some apps are using custom-rolled HTTP libraries and side-stepping my Proxy Settings. Or worse, they're using raw TCP/IP to communicate with a server. I know it's possible, but do any APIs work this way? Does anyone do it?
I found the answer: Use mitmproxy in transparent mode. proxy is not used. harder to setup because it needs work on the router, but it reliably captures every packet on port 80 and 443 regardless of proxy settings.
Assuming that you are able to keep your device tethered, then you may be able to use the pcap service to monitor all traffic. According to the following paper (2014) the pcap service is running on every iOS device:
"Identifying back doors, attack points, and surveillance mechanisms in iOS devices"
You should be able to connect to it via usbmuxd. I'm not sure whether there is a pre-rolled client for the pcap service. There is a list of services supported by libimobiledevice here. Pcap is not on that list.
Alternatively, you can use wireshark to capture all traffic on your wifi network.

MPTCP implementation..?

After iOS7 launched, Multipath TCP allows for a connected device, such as an iPhone or iPad, to transmit data over multiple pathways simultaneously.Can any body explain how it can be implemented programitically or is it required to do anything programatically or does iOS take care everything u dont need to woorry about that?
iOS take care about everything. Classic TCP header is extended with MPTCP bits, which should be ignored by middleboxes between iOS and Siri servers. These bits tell both sides, all available IP address they can use and then MPTCP create connection between them.
MultiPath TCP is at this moment used only with Siri.
There exist Linux implementation of MPTCP you may be interested in.
Multipath TCP configuration is available for developers since iOS 11 .
Developers using high level communication classes such as NSURLSession , Can now choose between 3 different MPTCP modes , each suitable for different communication use case .
Just set the multipathServiceType property in NSURLSessionConfiguration to a mode other than none.
Read about it :
https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/improving_network_reliability_using_multipath_tcp

Resources