Monday, November 2, 2009

Chapter 7. Cut the Cord: Using Wireless Networking









Chapter 7. Cut the Cord: Using Wireless Networking







In This Chapter

  • Introducing wireless networking

  • Connecting to unencrypted wireless networks

  • Connecting to encrypted wireless networks

  • Using a Windows wireless network interface driver



How did people ever live without wireless networking? Before wireless fidelity networking — WiFi (pronounced WHY-fye), for short — we were tethered to our Ethernet cables — or worse, to telephone cords and dialup modems. In retrospect, it was like living without electricity or telephones — or for younger readers, without cellphones and text messaging.


Fortunately, the smart people from the IEEE (Institute of Electrical and Electronics Engineers) realized what wireless networking could achieve using radio frequency (RF) transmissions. The IEEE had previously designed the specifications used to create wired networking and decided to extend those protocols into the wireless realm. After the wireless protocols were designed, manufacturers used them to create the WiFi products we use today.


This chapter describes how to connect your Ubuntu computer — laptop or desktop — to an existing wireless network. I tell you how you can make three different types of connections using a Linux-compatible wireless network interface (also called a network device or a network interface adapter — NIC). You can do it without encryption and with either WEP (wired equivalent privacy) or WPA/WPA2 (WiFi Protected Access) encryption. I also tell you how you can adapt existing proprietary Windows wireless network interface drivers for use by Ubuntu when no Linux open source driver exists for your WiFi device.





Preparing for Wireless Networking


I assume that you connect to a pre-existing wireless network. Many businesses and organizations provide publicly accessible wireless networks on their premises.


You can also create a wireless network for yourself by purchasing an access point (AP) to connect to your private network. Many consumer-level APs cost less than $100 and are available in any electronics store. Follow the manufacturer's instructions to configure your own private wireless network.



Quick start: Getting connected fast


Before describing any details about what wireless networking is and how it works, I can help you get connected to one. The process is easy if Ubuntu provides a driver for your wireless network interface — in that case, you just connect to a wireless network. When it's connected, you can explore wireless networking at your leisure.


  1. Plug your wireless network interface into your computer if you're using an external PCMCIA or USB device.

    You must turn on some built-in wireless network interfaces; for instance, some laptop computers have a power switch for the device. In that case, turn on your computer's interface.

    PCMCIA is short for Personal Computer . . . take a breath . . . Memory Card International Association (although some sources define it as Peripheral Component MicroChannel Interconnect Architecture). USB is the acronym for universal serial bus.

  2. If necessary, boot your Ubuntu computer.

  3. Log in to your user account.

  4. From the GNOME menu bar, choose SystemAdministration Networking.

    If you haven't recently performed an administrative task, the Enter Your Password to Perform Administrative Tasks dialog opens.

  5. Type your password if prompted.

    The Network Settings dialog opens, showing all your network interfaces. Figure 7-1 shows a typical window with three network interfaces: a wireless interface, a wired (Ethernet) interface, and a modem.


    Figure 7-1: The Network Settings dialog showing the available network interfaces.




The Network Settings dialog is the front end to the Network Administration Tool utility, which is the default Ubuntu network configuration utility.


The dialog shows a wireless interface if Ubuntu has a compatible driver for the interface. In that case, locate the instructions in one of the following sections that describe how to connect to the type of wireless network you want to use. The following list describes the subsection, found in the "Connecting to Access Points" section, that you should go to depending on the type of wireless network you're connecting to:

  • Unencrypted APs: When connecting to a wireless network that does not use encryption.

  • WEP-encrypted APs: When connecting to a wireless network using the WEP encryption.

  • WPA-encrypted APs: When connecting to a wireless network using either WPA or WPA2 encryption.


If you don't see any wireless interfaces, this chapter shows how to obtain or configure a driver in the "Obtaining a wireless network interface" section.




Wireless networking basics


Wireless networks use common radio signals used to create wireless networks and generally have a range of between 50 and 100 meters (about 150 to 300 feet). The signal range can be reduced by

  • Weather

  • Physical barriers (such as doors, walls, and windows)


The radio frequencies used by wireless networks are regulated by the Federal Communications Commission (FCC) in the United States and equivalent governmental agencies in other countries. The FCC designates certain parts of the electromagnetic spectrum — from low-frequency radio waves to light, X-rays, and beyond — for various purposes. For instance, the FCC licenses AM and FM frequencies to radio stations, and likewise for television stations. However, the FCC designates some frequencies for nonlicensed use. Cellphones, portable phones, garage door openers, microwaves, wireless networks, and many other devices all use nonlicensed frequencies. Wireless network devices use the 2.4 GHz (gigahertz, or billion cycles per second) frequency.




Security standards


Three different levels of security are available if you use a wireless network: high, low, and none.



High-security options

If you transmit sensitive information or conduct business over a wireless network, you should use one of these high-security options. High-security options include the WPA and WPA2 encryption standards.



WPA2 encryption

WPA2 encryption provides the best wireless network protection. It's compatible with

  • Most 802.11g wireless network interfaces and APs

    Upgrading your wireless networking equipment to 802.11g usually is worth the expense.

  • Some 802.11b cards that can be upgraded by installing firmware updates




WPA encryption

WPA encryption is much more secure than WEP (the original WiFi encryption), but not as secure as WPA2.


If your wireless network interface or AP currently provides WPA, you can probably upgrade it to WPA2 (the highest security level). Check the device manufacturer's Web site for firmware upgrades that add WPA2 capability.


WPA is designed to work with

  • All 802-11g wireless network interfaces

  • All access points, except first-generation ones





VPN (virtual private network) encryption

VPNs (virtual private networks) can safely encrypt information transmitted over unencrypted wireless networks.


Appendix B shows how to create an encrypted VPN on an unencrypted wireless network using the open source security tool OpenSSH.





Low security

WEP encryption was the first encryption method used on wireless networks. It's a little better than nothing at all. It might prevent unauthorized users from easily seeing your information, but it might be beaten by a hacker armed with the right tools and plenty of Jolt Cola and cheezpuffs.


Don't trust WEP encryption if you need to keep hackers out. WEP can be cracked using common software tools.




No security

Without any encryption, anyone in relatively close proximity can easily capture (sniff) and read your WiFi-transmitted information.


You might not need security when using a public WiFi network to view a sports page or the news. But don't transmit sensitive information or conduct business without using either wireless encryption or an encrypted VPN.





Wireless standards


When you have a wireless network, you need to connect to it. Ubuntu supports many wireless network interfaces (also called wireless network adapters or WiFi network adapters).


Table 7-1 compares current and future wireless standards, but three standards are common for wireless network interfaces:

  • 802.11b networks are the slowest standard.

  • 802.11g networks are up to five times as fast as 802.11b.

  • 802.11inetworks are based on the 802.11g standard but use improved encryption, called WPA2.

    Most new wireless network interfaces work with both 802.11b and 802.11g networks.

  • 802.11a interfaces were considerably more expensive than 802.11b. 802.11a never achieved commercial success and is seldom used.

  • 802.11n will be the next generation of wireless networking. The 802.11n standard has been adopted in draft form but hasn't yet become official. At the time of publication, a few wireless network interface devices based on the draft form of 802.11n are on the market; these are called Pre-N. Few Linux drivers exist at this time.

    Table 7-1: Wireless Network Standards
    StandardIntroduction YearSpeed (Maximum)Range (Maximum)
    802.11a199954Mbs30 meters (100 feet)
    802.11b199911Mbs100 meters (330 feet)
    802.11g200354Mbs30 meters (100 feet)
    802.11i200454Mbs30 meters (110 feet)
    802.11n2007 (or later)540Mbs50 meters (165 feet)






Network scenarios


You'll find yourself in one of two situations when trying to connect your Ubuntu computer to a WiFi network:

  • Have at least one wireless network interface.

    You already own

    • A laptop with a built-in wireless network device

    and/or

    • A PCMCIA or USB device

    In that case, the section "Using an existing wireless network interface" shows what you need to do.

  • Need to purchase a wireless network interface.

    The section "Obtaining a wireless network interface" shows what you need to know when purchasing a device.




Using an existing wireless network interface

When you already have a wireless network interface, you need to discover whether the device works with Ubuntu. There are two ways that your device might work:

  • Ubuntu provides Linux drivers for many wireless devices.

  • Ubuntu provides a utility that allows you to use a Microsoft Windows device driver when no native Linux one exists.

    Linux device drivers allow the device to work with the Linux kernel. Technically, Linux device drivers are actually Linux kernel modules. Kernel modules dynamically plug into the running Linux kernel and provide the connection to the device.


Here's one way to check if a wireless network interface works with Ubuntu:

  1. Plug the PCMCIA or USB wireless network interface into your computer.

    If you're using a laptop with an embedded wireless network device, make sure it's turned on. Install a PCI wireless network interface on your desktop computer if using such a device.

  2. From the GNOME menu bar, choose SystemAdministrationNetworking.

    If you haven't recently performed an administrative task, the Enter Your Password to Perform Administrative Tasks dialog opens.

  3. Type your password if prompted.

    The Network Settings dialog opens, showing all of your network interfaces.

  4. Look for a wireless interface option.


If the Network Settings dialog shows a wireless network interface, wireless networking is supported, and you can start configuring the device. Proceed to one of the following sections that matches your wireless network's capabilities:

  • "Unencrypted AP": Use only unencrypted wireless networks if no other option exists. Public APs often provide unencrypted service.

    Be careful when using unencrypted public networks. You should assume that all your communications are being monitored. Try to use a virtual private network (VPN) if at all possible to encrypt your network traffic. (Appendix B shows how to use OpenSSH to create your own VPN.) Your computer is more vulnerable to attack when using such networks because it's easier for hackers to use the network to exploit any vulnerabilities in your computer.

  • "WEP-encrypted AP": WEP encryption is better than no encryption but can be broken with a moderate amount of effort. If possible, you should upgrade to WPA2, or at least WPA, rather than continue to use WEP.

  • "WPA-encrypted AP": WPA offers adequate encryption, which falls between WEP and WPA2. You should definitely use WPA in place of WEP, but use WPA2 if your equipment supports that protocol.

  • "WPA2-encrypted AP": WPA2 offers the best wireless network encryption. You can sleep well at night if you use properly configured WPA2.




Displaying your network information




You can use the lshw utility to view your Ubuntu computer's network interfaces. Type the command lshw -C network and you see all information about your interfaces. For instance, the following listing shows my computer's interfaces:



  *-network:0
description: Wireless interface
product: BCM4306 802.11b/g Wireless LAN Controller
vendor: Broadcom Corporation
physical id: 9
bus info: pci@00:09.0
logical name: wlan0
version: 02
serial: 00:90:4b:48:4a:25
width: 32 bits
clock: 33MHz
capabilities: bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=ndiswrapper driverversion=1.22 firmware=Broadcom,03/19/2003, 3.10.53.0 ip=192.168.2.101 link=yes multicast=yes wireless=IEEE 802.11b
resources: iomemory:d0004000-d0005fff irq:10
*-network:1
description: Ethernet interface
product: DP83815 (MacPhyter) Ethernet Controller
vendor: National Semiconductor Corporation
physical id: 12
bus info: pci@00:12.0
logical name: eth0
version: 00
serial: 00:0d:9d:82:22:3c
size: 10MB/s
capacity: 100MB/s
width: 32 bits
clock: 33MHz
capabilities: bus_master cap_list ethernet physical tp mii fibre 10bt 10bt-fd 100bt 100bt-fd autonegociation
configuration: autonegociation=on broadcast=yes driver=natsemi driverversion=1.07+LK1.0.17 duplex=half link=no multicast=yes port=twisted pair speed=10MB/s
resources: ioport:8c00-8cff iomemory:d000a000-d000afff irq:11




This output shows detailed information about your network interfaces. Note that if lshw shows the wireless network interface to be disabled, you haven't loaded the necessary driver. In that case, you might be able to use a Windows driver to run the device. The "Using a Windows Device Driver" section later in this chapter describes how to use a Windows device driver to enable the wireless device under Ubuntu.







Obtaining a wireless network interface

If you need to purchase or borrow a wireless network interface, there are nearly 200 commercially available devices to choose from. Ubuntu provides a convenient and detailed table at https://help.ubuntu.com/community/WifiDocs/WirelessCardsSupported. This table provides information about the manufacturer and model plus whether and how well each device works with Ubuntu Linux. You can use this information to find a Linux-capable, wireless network interface before purchasing one.


Some manufacturers place a Linux sticker on their products. Look for the decal before purchasing a wireless device.











No comments:

Post a Comment