Dropped Network Connections

I have a MacBook Air M1 running Ventura 13.2.1. A long time ago I disabled sleep mode with this command:


sudo pmset -a disablesleep 1


This has worked great as I never want my laptop to go to sleep when I close the lid or lock the screen. I keep multiple ssh and Claris FileMaker connections open all day. I have fiber from AT&T and good wi-fi coverage through my home with a wireless extender although my laptop does not move from room to room very much at all.


A few months ago I started having problems with my wi-fi network going out. I was able to track it down to the AT&T router. When the wi-fi was available again, the uptime on the router had been reset. I made some configuration changes (mostly disabling the firewall and IPv6 support) and now my router has an uptime of over 25 days. The wireless extender also has a web interface and the uptime there is over 35 days.


The problem I'm having is at random times some or all of my ssh and / or FileMaker connections will drop. The first thing I do is check the modem to make sure it did not reboot and that has not been the case. So far I have not been able to detect a pattern as to when the connections drop or why. There are times when only some of the ssh connections will drop even though they are all going to the same network cloud host.


Is there a low-level log on in MacOS I can view / enable to debug the cause of these dropped connections? My best guess at this point is that my router is still the issue but by disabling some extra services, it's not doing a full reboot when it fails. Maybe it's running low on memory and dropping some persistent connections. Once recently when everything dropped I was able to attempt a ping to google.com and got no response for a minute or two. Because the failures are so intermittent, I can't actually confirm that it's not isolated to my laptop. No other devices on my network are attempting to maintain this constant connections.

MacBook Air Apple Silicon

Posted on Feb 27, 2023 9:36 PM

Reply
Question marked as Top-ranking reply

Posted on Feb 28, 2023 9:10 AM

WiFi is so much fun, because everything is NOT under your control.


First I would see if you can use Ethernet (at least as an experiment). This would isolate the issue to WiFi and not some other networking issue.


WiFi interference can come from

  • poorly shielded USB3 devices. This can be the device, the cable (especially if a USB2 cable is used instead of a USB3 cable), and even the connector, which could be a Thunderbolt connector because USB3 signals are passed through Thunderbolt (there have been reported cases of bad Thunderbolt connectors).
  • Weak signals because the distance between the WiFi access point and the Mac is far enough or has enough WiFi blocking objects in the middle (metal, water, reenforced concrete, metal studs in the walls,water heaters, refridgerator, etc...), that any interference will disrupt the connection.
  • A Microwave oven is near the WiFi access point or the Mac, or in the middle. Microwaves operate in the 2.4GHz frequencies. 2.4GHz was given over to WiFi because water blocks the signal, and long distance communications always runs into humidity, rain, snow, etc... that messes up 2.4GHz
  • Cordless phones using the 2.4GHz signals (could be you, or your neighbors)
  • Cordless baby monitors using the 2.4GHz signals (could be you or your neighbors).
  • WiFi access points from your neighbors competing for the same channels. Option-Click -> menu bar WiFi icon -> Open Wireless Diagnostic -> Window (menu) -> Scan. This will display all the WiFi access points your Mac can see (grow the window to see all the columns). You can see the RSSI (signal strength) and Noise for all the access points as seen by your Mac. A low negative value is a STRONG signal (-30 would be VERY STRONG), and a high negative value would be a weak signal (-70 or -80 is very weak). What you want to see is that your RSSI is strong, and your Noise is weak. And then looking at your neighbor's RSSI and Noise, you want weak RSSI and still want weak Noise. If you find a strong RSSI on a neighbor's access point, check their channel and your channels. The 2.4GHz frequences should have 5 channels of sepearation as 2.4GHz overlaps the 2 above and the 2 below, so you want to be 5 away from anyone else if you can, or at least sharing a channel with someone that has a very weak RSSI. The 5GHz channels when usng 20MHz do not overlap. When using 40MHz 2 channels are being use, 40MHz would be 4 channels, etc... Again, either 5GHz channel to yourself, or a shared channel where the neighbor has a very weak RSSI. NOTE: Noise can be from other WiFi access points, cordless phone/baby monitors, USB3 devices, Microwaves, etc... Noise is interfererence with your RSSI signal.



Option-Click -> menu bar WiFi icon -> Open Wireless Diagnostic -> Window (menu) -> Performance, will show you a real-time graph of your WiFi signal. Moving around the house with this display up can show you storng or weak WiFi areas of your home.


Similar questions

7 replies
Question marked as Top-ranking reply

Feb 28, 2023 9:10 AM in response to hyphenistic

WiFi is so much fun, because everything is NOT under your control.


First I would see if you can use Ethernet (at least as an experiment). This would isolate the issue to WiFi and not some other networking issue.


WiFi interference can come from

  • poorly shielded USB3 devices. This can be the device, the cable (especially if a USB2 cable is used instead of a USB3 cable), and even the connector, which could be a Thunderbolt connector because USB3 signals are passed through Thunderbolt (there have been reported cases of bad Thunderbolt connectors).
  • Weak signals because the distance between the WiFi access point and the Mac is far enough or has enough WiFi blocking objects in the middle (metal, water, reenforced concrete, metal studs in the walls,water heaters, refridgerator, etc...), that any interference will disrupt the connection.
  • A Microwave oven is near the WiFi access point or the Mac, or in the middle. Microwaves operate in the 2.4GHz frequencies. 2.4GHz was given over to WiFi because water blocks the signal, and long distance communications always runs into humidity, rain, snow, etc... that messes up 2.4GHz
  • Cordless phones using the 2.4GHz signals (could be you, or your neighbors)
  • Cordless baby monitors using the 2.4GHz signals (could be you or your neighbors).
  • WiFi access points from your neighbors competing for the same channels. Option-Click -> menu bar WiFi icon -> Open Wireless Diagnostic -> Window (menu) -> Scan. This will display all the WiFi access points your Mac can see (grow the window to see all the columns). You can see the RSSI (signal strength) and Noise for all the access points as seen by your Mac. A low negative value is a STRONG signal (-30 would be VERY STRONG), and a high negative value would be a weak signal (-70 or -80 is very weak). What you want to see is that your RSSI is strong, and your Noise is weak. And then looking at your neighbor's RSSI and Noise, you want weak RSSI and still want weak Noise. If you find a strong RSSI on a neighbor's access point, check their channel and your channels. The 2.4GHz frequences should have 5 channels of sepearation as 2.4GHz overlaps the 2 above and the 2 below, so you want to be 5 away from anyone else if you can, or at least sharing a channel with someone that has a very weak RSSI. The 5GHz channels when usng 20MHz do not overlap. When using 40MHz 2 channels are being use, 40MHz would be 4 channels, etc... Again, either 5GHz channel to yourself, or a shared channel where the neighbor has a very weak RSSI. NOTE: Noise can be from other WiFi access points, cordless phone/baby monitors, USB3 devices, Microwaves, etc... Noise is interfererence with your RSSI signal.



Option-Click -> menu bar WiFi icon -> Open Wireless Diagnostic -> Window (menu) -> Performance, will show you a real-time graph of your WiFi signal. Moving around the house with this display up can show you storng or weak WiFi areas of your home.


Feb 28, 2023 9:10 AM in response to hyphenistic

I have some suggestions with respect to your ssh connections. It is not a cure, but it might be useful.


In your $HOME/.ssh/config file add the following:

Host *
    ServerAliveInterval 300
    ServerAliveCountMax 2

This will help keep ssh connections from A) being seen as idle, which can cause some 3rd party monitoring software to decide to kill the connections, and B) allow ssh to survive short network interruptions.


Feel free to drop the 300 seconds to something lower, but I would not really go below 60 seconds. Adjust the ServerAliveCountMax count accordingly. But huge values can make it difficult to get control of a Terminal window if the other side has gone away, and you need to do something in that window. If you do hit this, then <return> ~ . (return key, tilda key, period key) is the ssh kill connection sequence.


The 2nd thing I'm going to suggest is that you run tmux (or GNU screen) on your remote system. These utilities keep remote sessions alive when the network connection is broken, and you can make a new connection and re-attach to the still running sessions and pick up where you left off.


I have been living in ssh connections for the past 18 years at work. I use a Mac, but I develop software on Unix/Linux systems. At one time I used GNU screen to protect my remote sessions. I have switched to using the newer more flexible tmux. These remote utilities protect me from network interruptions (company forces the VPN connections to disconnect very 24 hours), or I have a power failure that takes out the network, or I need to reboot my Mac, etc... None of these things bother the remote GNU screen or tmux connections.


There are a lot of good tmux YouTube.com presentations.


These are rather good using 'GNU screen' YouTube videos:


Again, the .ssh/config settings and the tmux/GNU screen suggestions are not cures, but they can help improve working with ssh in a network environment where "Stuff Happens" 😁

Feb 28, 2023 11:11 AM in response to hyphenistic

hyphenistic wrote:

Ethernet is not an option. I've been pure wi-fi for years now. I'm also using WiFi6 over 5 Ghz so I don't think there's an interference issue. I've not been able to find the real-time graph yet. All I can get so far is a wizard that will create a report or capture live performance for a report. No graph though. I'll keep looking.

Wireless Diagnostics -> Window (menu) -> Performance.

You have to click on the "Window" menu and select "Performance"



And looking at the Wireless Diagnostics -> Window (menu) -> Scan, can tell you about "Noise" (aka interference) on each channel. 5GHz can still have interference from neighbor's WiFi access points, unless you live miles from anyone else.

Feb 28, 2023 9:51 AM in response to BobHarris

I already had my ServerAliveInterval set to 60 because very early on I ran into that issue. I only switched from Windows to Mac last summer. But I have decades of Linux experience. I'm also no stranger to screen and use it when I'm doing critical operations. I never made the switch to tmux. If it was only my SSH connections getting dropped I would really focus on that setup but FileMaker is getting dropped as well. It's also very picky about consistent connections.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Dropped Network Connections

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.