How can I investigate low level network issues in iPhone?

I am building a WebRTC based app that enables peer-to-peer voice calls between two users. The app works flawlessly when the device is connected to WI-FI, but I am encountering low level TCP related network issues when one of the devices is connected to the internet with 4G.

This happens when two devices are exchanging WebRTC candidate informations.
Once the problem occurs, the device produces errors like below every few seconds.


2021-02-22 10:31:52.952548-0800 App[9718:624872] [tcp] nw_proto_tcp_route_init [C3:2] no mtu received

2021-02-22 10:31:52.953908-0800 App[9718:624872] Connection 3: encountered error(1:53)

2021-02-22 10:31:56.371279-0800 App[9718:625253] [tcp] nw_proto_tcp_route_init [C3:2] no mtu received

2021-02-22 10:31:58.067480-0800 App[9718:625253] [tcp] nw_proto_tcp_route_init [C3:2] no mtu received

2021-02-22 10:32:01.330340-0800 App[9718:625340] [tcp] nw_proto_tcp_route_init [C3:2] no mtu received


The thing is that once the device encounters the above error, the device isn't able to receive PushKit notification (or so any kinds of 'push' from the server, including WebSocket push), while the device can still initiate HTTP calls. It is as if the device's some part of the network connection goes into a "stall" or "locked-in" state where it starts operating abnormally.

This problem resets as soon as I change the internet connection back to WI-FI, but comes back when I switch back to 4G/LTE.

The above error statement seems to be low-level network error statements, and I have no idea what I can do to diagnose the problem. Are there tools in macOS that I can use to analyze what is going on under the hood in an iOS device?

Of course, I want to avoid publishing my app if it works only with a WI-FI connection, and not with 4G/5G, so this is a blocker for me.

I have submitted feedback to Apple using Feedback Assistance, but I have not received a response from any one of my previous submissions, so I am a bit hopeless here and decided to ask to dev community.
Answered by Systems Engineer in 663428022

Are there tools in macOS that I can use to analyze what is going on under the hood in an iOS device?

One method to investigate this would be to take a sysdiagnose and look at your routing table when this issue takes place. One of the files to look at is the logarchive file. This is a very tedious task, so just be prepared if you go this route. You will need to install these debug profiles on the iOS device before you recreate the issue and take the sysdiagnose:
  • Network Diagnostics for iOS

  • CFNetwork for iOS

  • Background Networking for iOS

  • APNS (Apple Push Notification Service) for iOS

Another method of investigation would be to look at a packet trace and take a look at what is happening on the wire when you are receiving these errors.

Lastly, regarding:

2021-02-22 10:31:52.953908-0800 App[9718:624872] Connection 3: encountered error(1:53)
2021-02-22 10:31:56.371279-0800 App[9718:625253] [tcp] nw_proto_tcp_route_init [C3:2] no
mtu received

2021-02-22 10:31:58.067480-0800 App[9718:625253] [tcp] nw_proto_tcp_route_init [C3:2] no
mtu received

These errors mean that when a TCP connection is being setup either your network path is not fully determined yet, or there was no MTU that was able to be determined about the path being used to setup the TCP connection. I suspect that it's the latter and the MTU size is not able to be determined.


Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
Accepted Answer

Are there tools in macOS that I can use to analyze what is going on under the hood in an iOS device?

One method to investigate this would be to take a sysdiagnose and look at your routing table when this issue takes place. One of the files to look at is the logarchive file. This is a very tedious task, so just be prepared if you go this route. You will need to install these debug profiles on the iOS device before you recreate the issue and take the sysdiagnose:
  • Network Diagnostics for iOS

  • CFNetwork for iOS

  • Background Networking for iOS

  • APNS (Apple Push Notification Service) for iOS

Another method of investigation would be to look at a packet trace and take a look at what is happening on the wire when you are receiving these errors.

Lastly, regarding:

2021-02-22 10:31:52.953908-0800 App[9718:624872] Connection 3: encountered error(1:53)
2021-02-22 10:31:56.371279-0800 App[9718:625253] [tcp] nw_proto_tcp_route_init [C3:2] no
mtu received

2021-02-22 10:31:58.067480-0800 App[9718:625253] [tcp] nw_proto_tcp_route_init [C3:2] no
mtu received

These errors mean that when a TCP connection is being setup either your network path is not fully determined yet, or there was no MTU that was able to be determined about the path being used to setup the TCP connection. I suspect that it's the latter and the MTU size is not able to be determined.


Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
How can I investigate low level network issues in iPhone?
 
 
Q