Technetra

Archive for July, 2004

Wireless networking using NDIS Wrapper

Tuesday, July 27th, 2004

A few weeks ago, I decided to upgrade my existing 802.11b network with the latest 802.11g (54 Mbps) hardware. My network consists of two desktops, both using PCI (peripheral component interface) wireless adapters (WPM11), one notebook using a PCMCIA wireless adapter (WPC11), and a router/access point WRT11). All the wireless components are from Linksys because drivers from the Linux-WLAN project supported their chipsets in Linux. Both desktops and the notebook run Fedora Core 2 with a stock 2.6.5 kernel. Before upgrading to Fedora, I was running Red Hat Linux 9.0 with a 2.4.26 kernel on all three systems. Owing to a trouble-free experience with my current Linksys hardware, I decided to stick with them for my upgrade, too. I purchased two PCI adapters (WMP54Gv2), one PCMCIA adapter WPC54G), and an access point/router (WRT54G).

When 802.11b devices were initially released in the market, finding Linux support for them wasn’t easy. Chipset manufacturers were reluctant to share hardware specifications with the Linux community, fearing a loss of their “competitive advantage”. But, through the efforts of the chipset manufacturers and the Linux developer community, support for wireless networking devices in Linux has dramatically improved. Unfortunately, hardware vendors, like Linksys and Netgear, continue to provide device drivers for Windows only. The NDIS Wrapper project aims at bridging this gap by providing a kernel module to load Windows NDIS device drivers for unsupported hardware.

What is NDIS Wrapper?

NDIS Wrapper allows the Linux kernel to interact with a network device using the Microsoft NDIS driver for that device. NDIS Wrapper translates calls to the Windows NT kernel and hardware abstraction layer into native Linux calls. The project was started in November 2003 by the primary developers, Pontus Fuchs and Giridhar Pemmasani.

The Network Device Interface Specification (NDIS) was jointly developed by Microsoft and 3Com in the days of MSDOS to provide a device-driver programming interface allowing multiple network protocols to share the same network device. Before NDIS existed, hardware vendors provided proprietary drivers for their devices, creating interoperability issues for users.

Using NDIS Wrapper

Getting started with NDIS Wrapper is fairly straightforward. First, you have to install the unsupported network device in your Linux system. Next, download the NDIS Wrapper source package from the project’s homepage at ndiswrapper.sourceforge.net. If you are not using a custom kernel, you may be able to save time by using one of the precompiled NDIS Wrapper binary packages that are available for Red Hat and Debian (NDIS Wrapper is provided as part of Mandrakelinux 10). However, if you are using a custom kernel, you will need to have the source tree available for that kernel to compile NDIS Wrapper.

Once you have downloaded the source or binary NDIS Wrapper package, you will need to get the Windows driver for your network device. Generally, it comes on a CD with your hardware; otherwise you will need to download it from the vendor s website. Now that you have both NDIS Wrapper and the Windows drivers, we can get started with the installation. Just follow these steps:

Compile and install

Unpack the source package…

> tar xzvf ndiswrapper-0.8-rc2.tar.gz
> cd ndiswrapper-0.8-rc2

Login as “root”…

> make install

Verify installation of kernel module…

> ls -l /lib/modules/`uname -r`/misc/
-rw-r r  1 root root 1342995 Jun 1 17:52 ndiswrapper.ko

Verify the installation of user space utilities…

> whereis ndiswrapper loadndisdriver wlan_radio_averatec_5110hx
ndiswrapper: /usr/sbin/ndiswrapper
loadndisdriver: /sbin/loadndisdriver
wlan_radio_averatec_5110hx: /usr/sbin/wlan_radio_averatec_5110hx

Install Windows driver

Unpack the Windows driver package…

> unzip wmp54g_driver_utility_v1.3.zip

Install the driver…

> ndiswrapper -i BCMWL5.INF
Installing bcmwl5
(Note: This will also create the directory: /etc/ndiswrapper)

Verify the installation of the Windows driver…

> ndiswrapper -l
Installed ndis drivers:
bcmwl5    present

Enable the wireless network interface

Load the NDIS Wrapper kernel module…

> modprobe ndiswrapper

Verify device recognition by NDIS Wrapper…

> dmesg
ndiswrapper version 0.8-rc2 loaded ndiswrapper adding bcmwl5.sys
divert: allocating divert_blk for wlan0
wlan0: ndiswrapper ethernet device 00:0c:41:65:8f:f9   using driver bcmwl5.sys

Verify network configuration…

> iwconfig
lo     no wireless extensions.
eth0   no wireless extensions.
wlan0  IEEE 802.11g ESSID:""
       Mode:Managed Frequency:2.462GHz
       Access Point: FF:FF:FF:FF:FF:FF
       Bit Rate:54Mb/s Tx-Power:16 dBm
       RTS thr:2347 B Fragment thr:2346 B
       Encryption key:off
       Power Management:off
       Link Quality:100/100 Signal level:-10 dBm Noise level:-256 dBm
       Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
       Tx excessive retries:0 Invalid misc:122 Missed beacon:0

Set up automatic detection of the wireless device at system boot…

> ndiswrapper -m
Adding "alias wlan0 ndiswrapper" to /etc/modprobe.conf

Configure the wireless network interface in Fedora

Before you configure the network interface, you will need to know the service set identifier (SSID) and the mode (Ad-hoc, Managed) of your wireless network. If you don t have this information available, take a look at the configuration screens of your wireless access point.

Create the wlan0 configuration file using your favourite text editor…

> vi /etc/sysconfig/network-scripts/ifcfg-wlan0

Add the following lines to the file (lines in red will vary according to your configuration)…

# NDIS Wrapper Configuration: Linksys
WMP54GDEVICE=wlan0
ONBOOT=yes
BOOTPROTO=static
TYPE=Wireless
MODE=Managed
ESSID="marin"
CHANNEL=11
IPADDR=192.168.0.210
DOMAIN=private.dom
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
USERCTL=no
PEERDNS=no
IPV6INIT=RATE=Auto
HWADDR=00:0C:41:65:8F:F9

Save the file and use the “System Settings” -> “Network” control panel to activate the interface

Verify wireless connectivity

> iwconfig wlan0
wlan0  IEEE 802.11g ESSID:"marin"  Nickname: owl.private.dom
       Mode:Managed Frequency:2.462GHz
       Access Point: 00:0F:66:51:06:70
       Bit Rate=54Mb/s
       Encryption key:off
       Link Quality:0/100 Signal level:-47 dBm Noise level:-256 dBm
       Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
       Tx excessive retries:0 Invalid misc:0 Missed beacon:0

> ifconfig wlan0
wlan0  Link encap:Ethernet HWaddr 00:0C:41:65:8F:F9
       inet addr:192.168.0.210 Bcast:192.168.0.255 Mask:255.255.255.0
       inet6 addr: fe80::200:0c41:fe65:8ff9/64 Scope:Link
       UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
       RX packets:1558941 errors:0 dropped:0 overruns:0 frame:0
       TX packets:825302 errors:0 dropped:0 overruns:0 carrier:0
       collisions:0 txqueuelen:1000
       RX bytes:2305901954 (2199.0 Mb) TX bytes:143025599 (136.3 Mb)
       Interrupt:11 Memory:de000000-de00ffff

Try to ping www.google.com...

> ping -c 1 www.google.com
PING www.google.akadns.net (216.239.57.99) 56(84) bytes of data.
64 bytes from 216.239.57.99: icmp_seq=0 ttl=240 time=29.6 ms

--- www.google.akadns.net ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 29.622/29.622/29.622/0.000 ms, pipe 2

Finally, surf the Web…

Conclusion

As Linux gains popularity on the desktop, my hope is that hardware vendors will make a better effort to support their customers by releasing native device drivers. Meanwhile, we should thank the developers behind NDIS Wrapper for a job well done!

Piracy: Friend or Foe?

Saturday, July 17th, 2004

Despite last year’s promise of a government-assisted Linux tidal wave in Thailand, little has changed on this particular beach front of the Information Society. By some estimates, Linux still counts for an infinitesimal one-tenth of one percent of the Thai market, whereas various versions of Windows control 90 percent.

In response to Bangkok’s pressure, Microsoft dropped its prices 85 percent locally in Thailand. However, in spite of reduced pricing, the relative market for purchased copies of Windows appears to be ever shrinking. Comparatively fewer new systems are being shipped with legitimate copies of Windows. That is, piracy remains substantially undiminished. This is no victory at sea for Microsoft.

Instead of a Linux tsunami or, alternatively, a Microsoft triumph in Thailand, we see the flood of continued piracy. Free is free, after all. Ironically, while piracy strangles Redmond’s profiteering, it simultaneously makes Linux irrelevant for the average user. With piracy, the hottest and most familiar proprietary technologies are available at the same price point as the relatively unfamiliar and less popular open source alternatives.

Too often the ordinary user cannot perceive the benefits of using OSS instead of pirated equivalents. The business proposition of open source relies on the fair exchange of value inherent in a services model, which, in turn, can produce a more even distribution of wealth at a societal level. But this treasure may lie hidden in the dynamics of the macroeconomy, so the ordinary user is easily persuaded to use the pirate’s treasure.

Profiteering encourages Piracy

In Thailand and other developing economies, for now at least, the buccaneers command the high seas of the Information Society. Yet if Redmond’s Intellectual Property commandos can defeat the pirates, does the Information Society benefit or do the royal coffers simply grow even larger?

To counterbalance this perception of being a greedy giant, Microsoft has launched a global campaign to rehabilitate itself as a better corporate citizen of the Information Society. Microsoft has set up regional and national chief technology officers who can argue the local benefits of their tools and technologies. And it has begun to invest in local educational and employment projects.

All it asks in return is help in protecting its Intellectual Property, to reinforce and assist its commandos. Unfortunately, their IP bosses rarely question the right to accumulate wealth beyond their wildest needs, even as payment is extracted from the poorest of the poor on the south side of an invidious exchange rate. In a perverse balance of fair play, continued profiteering encourages continued piracy.

What to do?

The good news is that the components of OSS have dramatically matured in the last several years and have become more than adequate for almost all automation jobs, whether on the desktop, on backend servers or embedded in increasingly pervasive devices. This puts pressure on the proprietary vendors to justify their prices. And with true competition from OSS, revenue from legitimate licenses will inevitably weaken. This has already happened with old Unix. More than ever, proprietary vendors must strengthen their resolve to combat further erosion of value due to piracy. As Microsoft, Sun and others anticipate, piracy ultimately will be defeated by a subscription model of software deployment. It is at this tipping point of enforced subscriptions that the free and open source software floodgates will be guaranteed to open, when “free as in piracy” no longer works. The ordinary user may then discover the OSS treasure that has been there all along.

Aquarium Watch

Thursday, July 8th, 2004

An old-timer in the OSS aquarium, Hewlett Packard (HP), recently announced its support for MySQL and JBoss, claiming to be the first OEM to fully support OSS stacks. These OSS stacks are point solutions, such as ERP and CRM based on OSS components. The company plans to package Linux with MySQL as a database and JBoss as an application server on its hardware. HP executive vice president Ann Livermore said at the “Enterprise Outlook” conference in Redwood City in June, that Linux is her company’s highest growth area. HP also predicts a surge in Linux as the platform of choice for mission critical CRM applications and services. As an obvious beneficiary, MySQL welcomes HP’s lining up to support the enterprise market with open source vertical solutions such as the LAMP (Linux, Apache, MySQL and Perl/PHP/Python) stack.

Computer Associates (CA) also moved into deeper OSS waters. CA is offering a new CA Trusted Open Source License (CA-TOSL) based on the Common Public License, which provides legal protections such as ensuring trusted source code lineage as well as offering indemnification. CA will collaborate with the Plone foundation and the Zope project on content management frameworks offering products such as its Plone-based BrightStor document manager. CA has announced its intention to make its flagship database product, Ingres RDBMS, open source and will create an open source management technology stack using IJPL (Ingres, Java, Python, and Linux). CA has also contributed its Kernel Generalized Event Management (KGEM) instrumentation to the Linux development process. In another move, CA and JBoss will collaborate to build an OSS solution, which targets the high-performance relational storage and application server space. The JBoss Application Server and Ingres database will be used together to build Java applications that support transactional integrity, replication, caching and security.

Sun, not wanting to be left behind in the announcement flotilla, proclaimed in Shanghai its intentions yet again to open source Solaris. Sun also will use AMD Opteron-based systems and reorient itself as a subscription-based utility services company. Sun’s intent is to sell solutions with commoditized hardware and software to compete better against the 8000-pound killer whale - IBM.

New Schools of Fish

New schools of fish are forming. While Web services remain an important area of vertical solutions, new solution stacks, including CRM and ERP as well as content, document and event management systems, are maturing and will become important drivers of OSS adoption.

Meanwhile, the sharks are also circling. Companies whose hardware and software profits are being marginalized are looking for new channels of revenue from services. The hottest new channel, as reinforced by Sun’s announcements, is the concept of utility computing called variously N1 Grid (Sun), Adaptive Enterprise (HP), Agile Enterprise (EDS), and On-Demand Computing (IBM). Subscription-based utility computing is a net being cast to sweep up both proprietary as well as OSS applications, including the new OSS vertical solutions.

Whether or not the new OSS CRM, database, or development solutions can be provided as utility services remains to be seen. Complex software is really not so single dimensional as electricity or water. Plus many packages simply don’t fit a services model for example, why use an office suite such as OpenOffice as a service when it is convenient and free for use as a stand alone package. So, as the “net of utility subscription” is being cast, it’s still too early to tell how big the catch will be.

© 2000-2010 Technetra. All rights reserved. Contact | Terms of Use

WordPress