Improved Network Wizard (and rc.network)

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#61 Post by Dougal »

BarryK wrote:In my case, I was in Perth at a relative's place, then I came home, but the same profile worked at home. The wireless networks are open at both places.
What do you mean by "the same profile worked"? You mean the same MAC address existed in both cases?
I already mentioned in this thread that I could easily add the SSID, too, but figured people might change it sometimes on their router.

In any case, the way it currently works is that if it wasn't able to connect to any network that has a profile, it will try each of the (non-profiled) open networks available.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#62 Post by BarryK »

Correct me if I'm wrong, but isn't the MAC address simply the hardware address of the network interface device.

In my case, I'm using the same wireless hardware, so of course the address will be the same whereever I take my laptop.

A side note, I'm using a D-Link DWA-110 USB wireless unit with my laptop, as I could never get the internal wireless hardware to work.

Therefore, the problem as I asked in my previous question, still remains. The MAC address is a constant whereever I take my laptop, but I need to connect to different wireless networks.

Actually, do you need to use the MAC address at all in the profile name -- why not a random number? or the date? The MAC address, can be inside the profile file.

The thing is, I need to create a profile for each of the places I go to, so the profile file must have a different name for each. I imagine a lot of people would have the same situation as me.
[url]https://bkhome.org/news/[/url]

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#63 Post by Dougal »

BarryK wrote:Correct me if I'm wrong, but isn't the MAC address simply the hardware address of the network interface device.
As far as I understand it, the MAC address is the HW address of the network you connect to, i.e. the router. Thus (as I explained in the parent post) I used it as a unique identifier of the network (since, as I explained in another post, I've seen cases where the SSID is "default" and such).

If you run a wireless scan somewhere where there are a few networks, you see that each has its own address.

I may be wrong, of course, but I asked an no-one bothered to correct me.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#64 Post by BarryK »

Dougal,
No, the MAC address is the hardware address of the actual network card/hardware on your PC, not the external thing that you connect to.

That's what I always understood, so I was puzzled about the choice of MAC address for the profile files in the new Wizard.

I can prove it right now. If I run ifconfig, and look at the wlan1 information, it shows eactly the same MAC address as when I was at my relative's place:

wlan1 Link encap:Ethernet HWaddr 00:1C:F0:0A:53:F8

They refer to it as the HW (hardware) address, which is a far less confusing name than "MAC".

Perhaps name the profile as a combination:
<mac address>_<date>.profile.
...although, it would be nice to have a more meaningful name...
er, why not just ask the user for a simple name to uniquely identify the connection, like, in my case:
perenjori_internet.profile
relative_1_internet.profile
[url]https://bkhome.org/news/[/url]

nic2109
Posts: 405
Joined: Mon 01 Jan 2007, 20:24
Location: Hayslope, near Middlemarch, Midlands, England

#65 Post by nic2109 »

Barry's correct.

Every Ethernet device has its own unique "hard wired" MAC address. The Router associates the MAC address to the I/P address either via DHCP or manual assigments. The Router will of course have its own MAC address but that's irrelevant.
[color=darkblue][b][size=150]Nick[/size][/b][/color]

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#66 Post by jcoder24 »

Barry is right about the mac address. However, it should be possible to use the mac address of the gateway that you are connected to.

When the wireless connection is complete it most likely would have a default gateway for the assigned interface. You would need to determine the ip of the gateway and then use that to get the mac address for it. To determine the mac you need the arp binary, which is small ~40k, and would be nice to have in the default puppy ;).

You can use something like this:

Code: Select all

INTERFACE="wlan0"
GW_IP=` route -n | grep ^0.0.0.0.*$INTERFACE$ | gawk '{ print $2 }'`
GW_MAC=` arp | grep  $GW_IP | gawk '{ print $3 }'`
Of course you would need to use the appropriate code for INTERFACE=""

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#67 Post by Dougal »

BarryK wrote:I can prove it right now. If I run ifconfig, and look at the wlan1 information, it shows eactly the same MAC address as when I was at my relative's place:

wlan1 Link encap:Ethernet HWaddr 00:1C:F0:0A:53:F8

They refer to it as the HW (hardware) address, which is a far less confusing name than "MAC".
That it the HW address of your NIC, which I use to identify it, for configuring the different interfaces (in the network/interfaces and wireless/interfaces dirs).
What is referred to as the MAC address in the wizard (PROFILE_AP_MAC) is what I use for the profile name and is obviously the MAC address of the Access Point, aka the HW address of your router's interface (so that if you set up your computer as a router, your HW address will be that AP_MAC) -- at least that's they way I understand it.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#68 Post by BarryK »

Dougal,
No, the MAC address that you are using for the profile names is that of the network card, not the access point.

I just checked. I reran the Wizard. Here at home I have a different router, my "profile name" is "belkin45g", in Perth it was "WLAN", these are how the networks have identified themselves when scanned.

Anyway, the point is, the .conf files are named with the MAC address of the card, not the access point.

Question for the experts: isn't it possible that the MAC address of the access point could change, in cases where you are connecting via some kind of wireless network provided by the ISP? They might have a sophisticated router system where you might connect to a different MAC address each time. Just a thought.

Oh yes, your comment that the MAC address will be that of the access point if your computer is setup as the router is correct, but that is not how most people connect. I have an external router/modem and in my case the MAC address that you are using for the .conf file names is not that of the router/modem, it is that of the USB D-Link wireless thingy that is plugged into my laptop.
[url]https://bkhome.org/news/[/url]

PaulBx1
Posts: 2312
Joined: Sat 17 Jun 2006, 03:11
Location: Wyoming, USA

#69 Post by PaulBx1 »

Starts to sound like the files ought to be identified by the ESSID, not the MAC address.

ESSID is after all an identifier. It should be usable as such. It is not our problem if a certain user has an ESSID of "linksys" both at work and at home; it's up to him to configure his router to have a usable, unique (for him) identifier (and very few company admins are going to leave a default ESSID on a router anyway).

Of course, there is still the support issue here. We will run into users who do have the same ESSID on two different APs and who won't know why one of their internet connections don't work. How is the network wizard to tell him to set him straight? Should we just have some text that says so? Should we have a text box warning if two profiles are created with the same ESSID?

On reflection, I can see the appeal of the MAC address; it requires nothing like the configuration of a router, which is beyond some users. But there has to be a way to get the address of the AP. What's the deal here, is this simply not available, or does it need a working connection to be established first (chicken or egg problem)? I guess the network scan does not provide it?

There is also a possible fallback for the sort of people who use default values in their routers. These people could switch networks the same way I do it in 2.16: going into the network wizard and simply telling it which profile to use.

Which makes me wonder. Why after all do the different files need to be named with MAC address or ESSID? Why not just let the user supply the name, just like in earlier versions of the network wizard, and the boot code simply compares the values found in the scan with every file's contents in that directory? It can't take that long to scan through a few short text files. That way, a naive user really could have a profile that worked for two different APs. Buy two linksys routers, plug 'em in, and bang, they both work, without configuration. Why is this a bad thing? Outside of being dumb, because not using encryption?

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#70 Post by jcoder24 »

BarryK wrote:isn't it possible that the MAC address of the access point could change, in cases where you are connecting via some kind of wireless network provided by the ISP? They might have a sophisticated router system where you might connect to a different MAC address each time. Just a thought.
If it's the same access point then it should have the same MAC. However, it is possible for a particular network/isp/ESSID to have have multiple access points (and hence multiple MACs). It would prob be best to use a compound id something like MAC-ESSID-ISP.

It would work something like this

Code: Select all

Check for MAC
If found 
	retrieve associated details
	use associated details
else
	check for ESSID

	# here we assume that duplicate ESSIDs exists
	if found
		repeat
			retrieve ESSID assoicated details
			try ESSID assoicated details
		until (all essids exhausted ) or (success using details)
	else
		get details from users
		associate details with ESSID
	fi
fi

User avatar
dogone
Posts: 202
Joined: Tue 22 Apr 2008, 02:53
Location: Arizona, USA

MAC address vs ESSID vs both

#71 Post by dogone »

Time to throw in my 2 (your currency)'s worth.

As to "what is a MAC address", Wiikipedia has an excellent, if somewhat technical explanation: http://en.wikipedia.org/wiki/MAC_address.

The current convention is to identify wireless networks by ESSID only. This generally works well but depends upon the owner/operator assigning a unique (to his area only) ESSID and broadcasting the ESSID (the default, but optional). Any number of networks can employ the same ESSID however, at the same location or at many. Bottom line - the ESSID does not positively identify a network.

Unlike the ESSID, a MAC address is unique in the world. It identifies one and only one piece of network equipment. Replace your AP and systems configured to seek out that MAC address will fail to find your network.

Employing MAC addresses to identify a network is also problematic where several pieces of hardware serve one wireless network. Say you are at the north end of you airport and find an airport wireless AP. You save the profile "airport" based on the AP's MAC address. You now walk to the south end of this big airport and attempt to re-establish the connection. You laptop fails to find the "airport" connection simply because the AP identified by that MAC is out of range. The several closer airport APs are ignored.

Many wireless scanning utilities, including Pwireless, address this problem by displaying both the ESSID and the MAC address. The careful user can then correctly identify any wireless network, no matter the network's ESSID or the equipment it employs (MAC).

The best solution in Puppy's case may be to track networks by both ESSID and MAC and to, for security purposes, inform the user when these no longer match those on file. Thus, if Barry swaps out his faulty AP or changes it's ESSID, we still stand some chance of finding his network. We also stand a good chance of detecting a pirate AP (Ubuntu spies) using Barry's ESSID.
Last edited by dogone on Fri 01 Aug 2008, 14:58, edited 1 time in total.

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#72 Post by Dougal »

BarryK wrote:Anyway, the point is, the .conf files are named with the MAC address of the card, not the access point.
If that is, indeed, the case, then it's a mistake. But I'm quite positive it is the PROFILE_AP_MAC that is used for profiles, while the HWADDRESS (i.e. MAC of your device) is only used for the interface configurations.
I'll go over the script and report later.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
erikson
Posts: 735
Joined: Wed 27 Feb 2008, 09:22
Location: Ghent, Belgium
Contact:

#73 Post by erikson »

Re MAC addresses:

To the best of my understanding, ifconfig returns the MAC address of your PC's interface, while iwlist returns the MAC address(es) of the wireless access point(s). For my network at home:

Code: Select all

1# ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 00:0E:35:C1:EA:D7  
          inet addr:192.168.1.65  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3872 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2063 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:18731879 (17.8 MiB)  TX bytes:1256325 (1.1 MiB)
          Interrupt:11 Base address:0x4000 Memory:e0204000-e0204fff 

1# iwlist eth1 scan
eth1      Scan completed :
          Cell 01 - Address: 00:12:17:E5:0A:B2
                    ESSID:"linksys"
                    Protocol:IEEE 802.11bg
                    Mode:Master
                    Channel:11
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s; 22 Mb/s; 24 Mb/s
                              36 Mb/s; 48 Mb/s; 54 Mb/s
                    Quality=59/100  Signal level=-65 dBm  
                    Extra: Last beacon: 240ms ago

1# 
You can also see that I'm just one of those guys who never bothered to change the default ESSID.
[size=84][i]If it ain't broke, don't fix it.[/i] --- erikson
hp/compaq nx9030 (1.6GHz/480MB/37.2GB), ADSL, Linksys wireless router
[url]http://www.desonville.net/[/url]
Puppy page: [url]http://www.desonville.net/en/joere.puppy.htm[/url][/size]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#74 Post by BarryK »

The idea of using a unique custom name that you yourself create, seems nice, but I am reminded of a situation awhile back. I was helping someone on a Windows XP system to get their external USB wireless unit working, and if I recall rightly it came up with a window asking the user to type in a name for the profile -- and that is one place where he was confused -- what should he type in there? That's what he asked me. It could be any name he desired, but that was not explained by the Windows setup program.

The wireless setup program in that case, came on a CD and was not the built-in Windows wireless setup.

So, if we can eliminate that step, that's one less thing to cause any possible confusion. Unless the custom name is explained very clearly.
[url]https://bkhome.org/news/[/url]

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#75 Post by Aitch »

FWIW - I'm with erikson

that's what I use

in windoze from run/cmd

ipconfig /all

is the same as ifconfig in linux

useful iwlist info may help clear up confusion [can use in win & lin]

http://www.newlinuxuser.com/howto-use-iwlist/

Aitch
Edit:
I trust you've seen urban's autoconnect, dougal et al?

http://www.murga-linux.com/puppy/viewto ... e457c352b9

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

IPW2100 support working again in puppy405

#76 Post by Béèm »

Just to say I am happy that my IPW2100 hw is detected, the driver loaded, recognized as eth0 (as before) and that configuration sticks between boots.

This was broke in puppy403
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

PaulBx1
Posts: 2312
Joined: Sat 17 Jun 2006, 03:11
Location: Wyoming, USA

#77 Post by PaulBx1 »

I was logging in to this forum, and this ad showed up at the bottom of the login page:
"7 Days To Puppy Training
Train Your Puppy In Just 7 Days... Stop Inside Peeing & Pooping Today."

:)

Yesterday I tried 4.1a5 on a friend's Dell laptop. He had a Broadcomm 4311 wireless, but this was not even detected in the network wizard. If I loaded the 43xx driver it still was not seen.

I tried my Puppy 2.16.1 CD, and it did detect this device, and loaded the broadcomm 43xx driver too. However I never did get it to connect properly.

Anyway, on his box, it's a step backward.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#78 Post by tempestuous »

The bcm43xx module is deprecated in k2.6.25.
You should use b43 or b43legacy.

This is more a kernel issue than a Network Wizard issue.

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#79 Post by Dougal »

Ok, I had a look at the code and also walked around the street, creating
profiles for various open networks... everything seems ok -- the profiles
are named after the AP MAC, as they should be.

I have updated the attachment to the original post, having made some changes:
- I moved the config directories from /etc into /etc/network-wizard
- I added a "sleep 1" and a rescan, when the wireless scan at boot time
finds no networks.
- The startup code had a little bug with the name of profiles for open
networks: it expected "open", when it is actually "Open" (the only effect
of this is that the profiled networks lost their priority over non-profiled
ones).
- I added recognizing "Mode:Master" in the scan output (so the info in the
scan window has "Master" in the first field, rather than nothing). I assume
it is ok... all the networks I've seen were "master".
- Improved debug output.

I've also checked the code for autoconnecting after boot and it
works fine -- message dialogs and all (I also redirect the output to a
file, /tmp/network-connect.log, so people can see what it did).
I'm attaching here the update to the desktop "Connect" icon, so it gives
the option of auto-(dis)connecting when right-clicking on it.

There's something I think I forgot to mention before: in net-setup.sh, the
BLACKLIST_FILE parameter should be changed to refer to the actual file
used by Puppy for blacklisting modules (my init scripts use a different one).

There's one more little thing I did:
With the newer wireless drivers (rt73usb in my case), the output of the
wireless scan shows encryption info for WPA, if an AP uses it.
For example WPA:

Code: Select all

                    IE: WPA Version 1
                        Group Cipher : WEP-40
                        Pairwise Ciphers (1) : WEP-40
                        Authentication Suites (1) : PSK
and WPA2:

Code: Select all

                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (1) : TKIP
                        Authentication Suites (1) : PSK
I've modified the scan window so that instead of "Encryption:on", it
actually tells you what kind of encryption is used.

One thing I wasn't sure about, though: with WPA, it mentions using WEP-40,
while the wizard actually says it uses WPA/TKIP... is this ok?


And one last thing: should I add the signal level to the scan window
tooltips, as well as the quality? At the moment is says something like
"Strength:47/100", but I could trivially change it to display the entire
line of info from the scan:

Code: Select all

Quality=47/100  Signal level=-78 dB
Attachments
connect-update.tar.gz
(722 Bytes) Downloaded 453 times
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

hayagix
Posts: 131
Joined: Sat 07 Jun 2008, 15:41

#80 Post by hayagix »

Good timing. I've been having a bit of trouble with my rt2500usb wireless setup recently.
I hooked up my spare dongle rt73usb and tried it with Dingo 4.0 earlier and it failed to connect wpa.

I installed new wizard and it connected beautifully. Thankyou.

The only flaw I noticed is that it specified wep when it scanned for networks.

Post Reply