Scott Hanselman

iPhone tethering personal hotspot shows up a as a new network each time (plus the smart quote is silly)

March 17, 2012 Comment on this post [25] Posted in Musings
Sponsored By

I often use my iPhone as a Personal Hotspot. I'm not sure what's changed in iOS5 but one problem still exists and the other has gotten worse. First, the 802.11 wireless specification doesn't say anything about the character encoding of the SSID (Service Set Identifier - the think that names your access point). Most APs and Operating Systems assume that the string will be straight ASCII and code page 1252. However, Apple iOS devices default to yourname's iPhone where the quote ' is a smart quote like this ’, so Scott’s iPhone. Just as I mentioned in my post on "Why the #AskObama Tweet was Garbled on Screen: Know your UTF-8, Unicode, ASCII and ANSI Decoding Mr. President" even smart folks can mess this up. Since the iPhone is assuming that the encoding is UTF-8 while the rest of folks are assuming ASCII, we end up with "Scott’s iPhone."

Scott's iPhone is trying to use Smart Quotes, and failing

It's harmless, but it's irritating. I've filed a feature request with Windows (it's not a bug per se, but rather what appears to be an ambiguous spec that makes everyone look bad, IMHO).

If if bugs you too, you can Right Click on the network icon near your click and "open Network and Sharing Center" then click on the ICON that represents your network. That will get you this dialog (that you've likely never seen before because clicking on the icon isn't intuitive).

Set Network Properties Dialog

In that dialog you can change the name and the icon of the connection. Fancy.

image

If you really really want to fix it, then change the name of your phone to include a ' rather than a ’ by going to Settings | About | Name.

Changing a quote to a smart quote - before Changing a quote to a smart quote - after

However, since the iOS 5.1 update last month every time I tether my iPhone I get a new Wireless Network. I'm currently on Scott's iPhone 12 and it keeps going up. I'm not sure what changed in this update but it's clearly changed because everyone is seeing this behavior.

I like my things tidy, so I wanted to merge or delete all these superfluous networks. Remember that dialog above that we got to my clicking on the icon in Network and Sharing Center? Well, at the bottom it has another button that you've never seen before. I know I hadn't.

Merge or delete network locations

Click on Merge and you will be shocked to see the last six billion networks that you've connected to. You're very wirelessly promiscuous, aren't you?

Merge or Delete Network Locations List

From here you can select and merge together all your duplicate networks, as well as delete ones you don't want to have Windows remember.

Hope this helps! I hope that this is fixed in both iOS, the specification AND in Windows. Specification ambiguity hurts everyone.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
March 17, 2012 2:56
Scott,
I'm not seeing this new network issue. Same network name every time
Windows 7, iPhone 4, iOS 5.1
March 17, 2012 2:57
This sounds like a Public Service Announcement:

"Remember kids: Specification ambiguity hurts everyone." I think I may have to use this as my new motto.

In any case, thanks for the tip, Scott.

-David
March 17, 2012 3:01
A little pedantic :).
Another reason for me to stick to Android.
March 17, 2012 3:31
Get that dialog (Set Network Properties) is indeed not intuitive, I had been experiencing network error connections so often, I even thought it was a virus, but the problem was having multiple network locations related to the same domain, so I ended with corporate-domain, corporate-domain 2, corporate-domain 3, when you have this multiple locations sometimes browsers or OS (i don't know) try to use a connection in Not in use state and you cannot go to any site, however you have Skype, Messenger, etc., everything is fine except browsing, good luck trying to figure out what is going on until you find this "magic" dialog. The solution was leave just one network location.
March 17, 2012 4:18
I have the same problem, and I'm still on iOS 5.0.1

I get different network names depending on whether I'm tethering by Wi-Fi or USB.

I've currently got 6 Michael’s iPhone and 15 Network.

Screenshot: http://imgur.com/rI02I

I've even merged them a few times but they keep coming back. At this point I just resign myself to the fact that I click on Work after I connect. I don't know if this is a Windows issues or an iOS issue.

March 17, 2012 4:53
Very cool! I've been getting them with Andriod. Now I can get rid of that count. \o/
March 17, 2012 6:15
Works great on my Windows Phone (HD7 on TMobile).
March 17, 2012 20:44
Any particular reason you're connecting over wi-fi rather than bluetooth? Bluetooth doesn't exhibit these problems.
March 17, 2012 20:48
Are you still using Clear wireless?
March 17, 2012 23:58
Thank you so much! I was at 112 connections. I was praying for a fix at every ios or windows update (not knowing which one is wrong).
March 19, 2012 19:45
Next challenge: See if you can figure out how to tweak Network Location Awareness so it stops detecting it as a new network every time.
March 19, 2012 20:11
"even smart folks can mess this up." Well, we don't have any evidence of that. Also, he's about as responsible for that as he is for Bin Laden.
March 19, 2012 21:46
Weird behavior on the part of iOS but I've got to ask: what's with the "4G" indicator on the AT&T iPhone? I thought the 4s could only do 3G (HSDPA)...
March 19, 2012 23:24
The real background problem in my opinion is that a lot of great software components originate in a country (i.e. the US) that does not have to deal with "alternate" encodings and localization, such as date formats. So lots of developers are not sensible in this domain.

Here in germany, if you have to connect two different applications or even two simple software components, always test the umlauts äöüß and the dates and the numbers (1.000,00 instead of 1,000.00). It's interesting to count the many different representations they can have.

UTF-8/16 to the rescue. Alas, byte order mark (BOM). Nice little thing to wreck any ancient (no just kidding) software.

On the plus side: Time zones never were an issue. Guess why ;-)

Martin
March 19, 2012 23:34
I look forward to the day I am given explicit and complete specifications... hell, I look forward to a day when I can expect them with every project. ;p
March 20, 2012 0:43
CMike - That's HSPDA, but AT&T calls it 4G.
March 20, 2012 4:22
I am a Windows developer that owns Mac and develops in Parallels.

Having said that I can report the following:
I use the personal hotspot feature on my iPhone 4S and do not have the multiple network name issue with my Mac.
I have multiple iOS devices, all with their default device names (first name's device name) and all of the apostrophes are ASCII 39.

At the risk of derailing the conversation, I have to ask the following:
Have you ever renamed your device (office loves to add "smart quotes")? Perhaps that is the source of the smart quotes. Don't forget, the device name will survive through backups, so if you renamed the device that was replaced and restored the new device from a backup, that could be the source... I'm curious to know about the source of the smart quote. If you backup the device, 'restore' (Apple's reformat option) it from iTunes and set it up from scratch do you still get the smart quote?

Have you ever tried to connect another device to the wireless hotspot and noticed the multiple network name issue? Do you have an iPad? Have you tried to connect it to the wifi? Does it show the "Network N" matching your PC? If you connect a different Windows PC to the same hotspot at the same time, does it show the same "Network N"?

I'm not trying to start a Mac vs. Windows this better than that rant, I'm just trying to understand the underlying source of the issue.

Thanks for the great blog :-)
April 17, 2012 23:50
I have the multiple network references as above but it only happens when I connect via USB. WiFi hotspot recognizes my iPhone every time - no multiple networks. Any further suggestions how to remember a thethered network via USB? Is it possible I am assigned a different IP when using the 3G network that could be cause for new network ID or is there a separation/what is the difference between detecting the iPhone 'name' when USB vs WiFi?
TKO
May 12, 2012 11:41
Thank you very much for sharing, I would like to reproduced your article, so that more people would see it.
May 28, 2012 0:19
Someone please come up with a fix for the multiple Networks issue! It is so annoying to constantly have to go in there and merge / delete networks. Seems to happen on USB and WIFI everything I plug my phone into the computer with Personal Hotspot turned on. I'm on iOS 5.1.1, Windows 7.
July 17, 2012 8:14
Hi, I can give a little insight in to why this is happening.

I have been tethering my iPhone 4 to my Windows 7 PC for some time. When I used iOS 4.x, the network identification was consistent with the USB cable. That is - the first time I connected it, I renamed the connection to give it a meaningful name (not just "network"). I even changed the icon to be an iPhone. Windows correctly identified the phone as the same connection every subsequent time I plugged the phone in.

Something changed with iOS 5.0.1. I have not upgraded to 5.1.0 as I don't want to loose my jailbreak, so I don't know if the problem is fixed in iOS 5.1.x or not. Even if it is, I won't upgrade unless I can jailbreak.

The problem with iOS 5.0.1, as described in previous comments is that each time the phone is re-connected, Windows 7 fails to recognize the phone as the same network it was previously connected to. After a bit of digging, I know why this is happening, but I can't think of a way to fix it.

Windows 7 goes through a series of tests when it connects to a network to try and identify it. If the network is "managed", that is it's part of a windows domain, then there's one set of criteria involving the name of the domain. That isn't the case here, the iPhone tethered connection is considered an "unmanaged" network.

What it boils down to is that windows looks at the MAC address (the hardware address) of the network interface that's acting as the default gateway for the network. Every time it connects to an unmanaged network like this, it looks at the MAC address. If it's already seen that MAC address before, it believes it's the same network that it was previously connected to.

It turns out that each time you connect the iPhone to the PC, the MAC address of the default gateway is different. I think it's random within a certain set of parameters. This is why Windows 7 keeps thinking it's got a different network.

So you might think - great, I'll just keep remembering the networks and merging them together. Eventually, I'll have all the possible MAC addresses... The problem is that there are 16^6 possible MAC addresses that could be the MAC address of the default gateway of the tethered network. That's 16777216 possible combinations. If you connected to 1 network every 10 seconds and did nothing else, it would still take just over 5 years and 4 months to exhaust all possible combinations. Plus your windows registry would grow to be terabytes in size.....

Ok, so how do I know this. Here is a way you can confirm for yourself that what I'm claiming above is the case:

1. Tether your iPhone. Give the network a distinctive name - say "Test12345" or similar.
2. Open a command prompt on your windows 7 PC - so type "cmd" at the run prompt.
3. Type:

ipconfig /all

This will provide a LOT of information about your network connections. You are looking for the "Default Gateway" parameter. On my phone, the IP address of the default gateway is consistantly 172.20.10.1, my PC gets an IP address of 172.20.10.2 in most cases.

4. Now, still in the command prompt, type:

arp -a

This shows the contents of the Address Resolution Protocol cache (ARP cache). Many of the IP addresses that your PC has connected to will be listed here, including the default gateway address. Along with the IP addresses, the MAC addresses will be listed.

The MAC address will be a set of 6 pairs of hexadecimal numbers. So as an example:

ac-de-48-7d-bd-2f

Remember, it's the MAC address of the default gateway you care about, NOT the MAC address of your PC's network card or similar.

Make a note of the relevant MAC address.

5. Untether the phone. Wait a while (2 minutes ?). Tether it again. You should be prompted to identify the network. Give it a different name that's also distinctive (say Test23456).

6. Again, confirm what the default gateway IP address is (probably still the same as before, probably 172.20.10.1).

7. Type:

arp -a

Again, to see the MAC address. It will be different. Probably the first 6 pairs of values will be the same.

Record this MAC address too.

Every single time I tether my iPhone, the MAC address of the default gateway always looks like this:

ac-de-48-XX-XX-XX

So only the last 6 digits change. So there are 16^6 possible combinations.... hence my calculation earlier.


7. Now close the command prompt and launch the registry editor. (regedit.exe). Navigate to this key in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList

You will see two subkeys called "Signatures" and "Profiles".

First look in "Signatures", then in to "Unmanaged". Underneath you will see several (or many) further subkeys with very long numeric names. Look in each of these in turn, or search until you find the first MAC address you recorded earlier. Inside each of the numeric named folders, there will be a value named "DefaultGatewayMac". Against this will be the MAC address of the default gateway.

You should find an entry for both the MAC addresses you recorded earlier. It's because the MAC address of the default gateway changes that Windows thinks it's a new network every time.

I don't know for sure, but I'm willing to bet that in iOS4, the MAC address of the default gateway was a constant. It's probably something they changed to accommodate the improvements to the personal hotspot capabilities in iOS 5.x.

8. Now in each of the "profiles" that correspond to the MAC addresses, you will see a value called "ProfileGuid". Now look in the folder called "Profiles" that's on the same level as the registry as the "Signatures" folder. In the "Profiles" key, you will see subkeys corresponding to each ProfileGuid value. Look in the two subkeys that have names matching the ProfileGuid values from your two MAC addresses.

Note that inside those subkeys, you will see values called "ProfileName". Note that they have named like "Test12345" and "Test23456", the names you provided earlier.

So the net result is that the MAC address of the default gateway changes every time you connect, so Windows thinks it's a new network.


So great - what can we do to fix this ?

I don't know.

The only thing I can think of is a "brute force" approach to create every possible signature... so

ac-de-48-00-00-00
ac-de-48-00-00-01
ac-de-48-00-00-02
...
ac-de-48-FF-FF-FE
ac-de-48-FF-FF-FF

That would take HOURS to do even as a script and mean there would be 16,777,216 entries in the registry... so since each one is around 100 bytes of information, that would mean your regisry would grow by 1.6 GB in size or so.... that's just not realistic.

So far as I know, there is no way to put wildcards in the signatures section..... pity.....

The best fix would be for apple to fix the iPhone tethering so it has a consistent MAC address. However even if they do, it won't help me. I won't upgrade my iOS because I don't want to loose my jailbreak. My next phone will run Android... so I don't have to worry about jailbreaking...


If this can inspire anyone to think of a solution, please, please let me know.

Cheers.




August 18, 2012 0:22
Thanks S. Davey, that was very informative - you're clearly a smart guy. No doubt the relevant departments within Microsoft and Apple will blame each other for the issue for a year or so before someone bloody fixes the problem.

Regarding jailbreaking; I left the world of jailbreaking years ago - restrictions are a good thing, allowing apps to do less ensures less problems. I got sick of little problems popping up.

But the thing with jailbreaks is it's only a matter of time before they update the jailbreak to work with the latest version, so if that was your only excuse you needn't worry.
September 04, 2012 6:47
Hi
I wonder if you could take a minute to help me out by letting me know what to do to make my iphone 4 visible to my PC.

As part of my phone package I have internet tethering available to me but when I plug the phone into my PC via the USB cable it recognises the phone as a camera but nowhere can I find the option to connect to the internet. I have tried it on a friend’s laptop and it connects fine but on my PC (which has never been connected to an internet connection) the computer cannot find the phone at all. It is running a brand new install of windows xp professional and when I go to control panel - network connections etc, I see only LAN local area network and from what I can gather, I am sure this is where I should see the option to connect to the iphone to create the connection.

Hopefully you can help me with some advice please because I cannot find this specific problem anywhere despite extensive searching on the internet.

Heres hoping, and thank you in advance if you could take the time to point me in the right direction.

Mark
December 26, 2012 19:11
Thanks for this post. By changing the ' in my iphone's name I was able to get my printer to recognize my personal hotspot.
Gia
January 07, 2013 16:57
This is really helpful. You just solved two of my problems with my iPhone hotspot. Now I'm off to merge my bajillion duplicate Network names. Thank you!

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.