Jumat, 01 Februari 2008

2.1 Hacks #13-19

There is much talk in the communications industry of providing "last mile" connectivity. Think of Bluetooth as providing connectivity for the last 10 feet. Bluetooth excels as a handy cable replacement technology, helping to eliminate the need for cumbersome wires that you might find on headsets, remote controls, PDAs, and other small devices. Bluetooth aims to end the days of needing to carry a three-foot piece of cable with obscure connectors on either end everywhere you go, just to interface to your laptop. You can use Bluetooth-enabled devices to talk to a laptop or a desktop, or even have them talk to each other to exchange data almost effortlessly. There are also a number of Bluetooth-enabled input devices on the market, such as mice and keyboards. While it does increase one's dependency on batteries, Bluetooth can go a long way toward cutting down on the rat's nest of cables that comes with personal computing. This chapter demonstrates some nifty directions people are taking with Bluetooth.

Also presented in this chapter are a couple of hacks about how to interface with mobile data networks [Hack #8]. These networks are particularly handy to use when Wi-Fi or other connectivity just isn't available. Devices that combine Bluetooth, mobile data networks, on-board storage, audio capability, and even video cameras are just coming to market. These advanced devices are just the beginning of the inevitable convergence of consumer products with general purpose computers and the Internet, creating an unprecedented level of connectivity for the average user. Here are some hacks that push this concept of hyperconnectivity quite far.

Hack 12 BSS Versus IBSS

BSS/Master/AP/Infrastructure/IBSS/Ad-Hoc/Peer-to-Peer: these all refer to 802.11b operating modes, but what does it all mean?

802.11b (see [Hack #3]) defines two possible (and mutually exclusive) radio modes that stations can use to intercommunicate. Those modes are BSS and IBSS.

BSS stands for Basic Service Set. In this operating mode, one station (the BSS master, usually a piece of hardware called an access point) acts as a gateway between the wireless and a wired (likely Ethernet) backbone. Before gaining access to the wired network, wireless clients (also called BSS clients) must first establish communications with an access point within range. Once the AP has authenticated the wireless client, it allows packets to flow between the client and the attached wired network, either routing traffic at Layer 3, or acting as a true Layer 2 bridge. A related term, Extended Service Set (ESS), refers to a physical subnet that contains more than one access point (AP). In this sort of arrangement, the APs can communicate with each other to allow authenticated clients to "roam" between them, handing off IP information as the clients move about. Note that (as of this writing) there are no APs that allow roaming across networks separated by a router.

IBSS (Independent Basic Service Set) is frequently referred to as Ad-Hoc or Peer-to-Peer mode. In this mode, no hardware AP is required. Any network node that is within range of any other can communicate if both nodes agree on a few basic parameters. If one of those peers also has a wired connection to another network, it can provide access to that network.

Note that an 802.11b radio must be set to work in either BSS or IBSS mode, but cannot work in both simultaneously. Also, BSS Masters (that is, APs) cannot speak to each other over the air without using WDS or some other tricky mechanism. Both BSS and IBSS support shared-key WEP encryption, for what it's worth (see [Hack #87] and the rest of Chapter 7).

Generally speaking, most 802.11b networks consist of one or more BSS Master devices (like a hardware access point, or a general purpose computer running the Host AP driver as seen in [Hack #57]) and several BSS clients (laptops, handhelds, etc.). Ad-Hoc networks, on the other hand, are handy for setting up a point-to-point connection between two fixed devices, or if a couple of laptops need to exchange files and there is no other wireless network present.

In the early days of 802.11b, many manufacturers implemented their own version of Ad-Hoc mode, sometimes referred to as Peer-to-Peer or Ad-Hoc Demo mode. Such devices could only communicate with each other and weren't compatible with true IBSS mode. Recent firmware updates have helped IBSS mode interoperability quite a bit, but not all cards can communicate with each other when speaking IBSS. Generally, any client device can talk to any access point regardless of the manufacturer, provided that both are certified to speak 802.11b.

Hack 11 HPNA and Powerline Ethernet

These nontraditional networking protocols can save you a ton of effort.

While not wireless networking protocols per se, both HPNA and Powerline Ethernet are finding their way into many people's network scheme. Like wireless, they both provide network functionality without requiring the installation of CAT5 cable. But rather than use wireless, they use other common media for their physical connection.

HPNA

HPNA stands for Home Phone Networking Alliance . It provides networking capabilities over existing CAT3 cable, and can share the same wire as a standard telephone line (even if you are using DSL on the same line). HPNA can reach about 1,000 feet over CAT3. The original HPNA 1.0 products can communicate at about 1.3 Mbps, while the newer HPNA 2.0 standard allows for speeds of up to 32 Mbps (although devices operating at 10 Mbps are more common). Some consumer grade routers, such as 2Wire HomePortal 100W, incorporate Ethernet, HPNA, and 802.11b in one unit.

Pros

  • Instant networking in any building with existing telephone wiring.

  • Very simple installation; just plug it in and you're done.

  • Fairly inexpensive.

Cons

  • HPNA isn't nearly as popular as Ethernet or Wireless, so it can sometimes be hard to find in retail stores.

  • HPNA 1.0 is much slower than wireless, but HPNA 2.0 approaches speeds of 802.11b.

  • Every HPNA device uses the telephone line as a shared medium, making it less efficient than a network switch as more devices are added.

Recommendation

HPNA can be ideal for adding access points to additional locations in a house or building that doesn't have CAT5 Ethernet laid to each room. Dedicated Ethernet is better for speed and reliability, but HPNA can make your job much easier. If you need to add additional access points to a building for greater coverage, or you want to shoot "through" a building by adding a device with external antennas on opposite walls, then HPNA can save a great deal of effort when tying it all together.

Powerline Ethernet

Powerline Ethernet uses AC power lines as a physical medium for network traffic. Powerline devices are about as simple as they come; simply plug in a CAT5 cable to one side of the device, plug the other end into any wall outlet, and you should be up and running. Some devices support encryption on the devices, but this is hardly ever necessary. Powerline Ethernet won't cross a power transformer, so your network signal usually stops at the end of your house wiring.

Siemens, Linksys, and NetGear all make popular Powerline adapters that should interoperate well with each other. They advertise speeds of up to 14 Mbps, but actual data rates of 5 or 6 Mbps are typical. As with HPNA, Powerline is a shared medium, much like a networking hub. More devices means more possible collisions and lower throughput.

Pros

  • Very simple installation, with virtually no configuration needed.

  • Data speeds comparable to 802.11b.

  • Ethernet bridges mean no configuration at all on the computer side.

Cons

  • Slightly expensive as of this writing (typically $100 per device, with at least two devices required).

Recommendation

Much like HPNA, Powerline Ethernet can be ideal in situations where CAT5 wiring just isn't practical. This can make installation much simpler whenever you have an AC outlet handy but can't quite get to a telephone line or CAT5 cable. There is no configuration needed in most cases, as the Powerline bridge acts just like a network hub to your Ethernet devices.

While CAT5 is usually preferred over line-sharing protocols such as HPNA and Powerline, these devices can save you a tremendous amount of installation time and effort. If you can cope with the slower data rates and slightly higher cost (compared to Ethernet), then these devices might be a perfect component for your wireless networking project.

Hack 10 802.1x: Port Security for Network Communications

Secure access to virtually any network port (wired or wireless) with 802.1x.

The 802.1x protocol is actually not a wireless protocol at all. It describes a method for port authentication that can be applied to nearly any network connection, whether wired or wireless.

Just when you thought you knew every IEEE spec relating to wireless, suddenly 802.1x appeared on the scene. The full title of 802.1x is "802.1x: Port Based Network Access Control." Interestingly enough, 802.1x wasn't originally designed for use in wireless networks; it is a generic solution to the problem of port security. Imagine a college campus with thousands of Ethernet jacks scattered throughout libraries, classrooms, and computer labs. At any time, someone could bring their laptop on campus, sit down at an unoccupied jack, plug in, and instantly gain unlimited access to the campus network. If network abuse by the general public were common, it might be desirable to enforce a policy of port access control that permitted only students and faculty to use the network.

This is where 802.1x fits in. Before any network access (to Layer 2 or above) is permitted, the client (the supplicant, in 802.1x parlance) must authenticate itself. When first connected, the supplicant can only exchange data with a component called the authenticator. This in turn checks credentials with a central data source (the Authentication Server), typically a RADIUS server or other existing user database. If all goes well, the authenticator notifies the supplicant that access is granted (along with some other optional data) and the client can go about its merry way. The various encryption methods employed are not defined in particular, but an extensible framework for encryption is provided—the Extensible Authentication Protocol , or EAP.

802.1x is widely regarded by the popular press as "the fix" for the problems of authentication in wireless networks. For example, the "other data" that is sent back to the supplicant could contain WEP keys that are dynamically assigned per session and are automatically renewed every so often, making most data collection attacks against WEP futile. Unfortunately, 802.1x has been found to be susceptible to certain session hijacking, denial of service, and man-in-the-middle attacks when used with wireless networks, making the use of 802.1x as the "ultimate" security tool a questionable proposition.

As of this writing, 802.1x drivers for Windows XP and 2000 are available, and many access points (notably Cisco and Proxim) support some flavor of 802.1x. There is also an open source 802.1x supplicant implementation project available at http://www.open1x.org/. It is possible to use the Host AP driver to provide authenticator services to a RADIUS server or other authentication server via the backend.

Unfortunately, the popular press tends to abbreviate 802.11a/b/g as 802.11x, which looks a lot like 802.1x—but don't be fooled. While it has an application in wireless networks, 802.1x actually has nothing to do with wireless networking. For a good discussion of 802.1x security methods and problems online, take a look at http://www.sans.org/rr/wireless/802.11.php.

Hack 9 FRS and GMRS: Super Walkie-Talkies

Use these high powered radios in places where mobile phones just don't cut it.

In the last couple of years, a number of manufacturers have come out with "high power" radios for general use, marketed as family or recreational communication devices and sold as impulse buy items at department stores. They claim a couple of miles range, operate on a chargeable battery pack or AA batteries, and most are surprisingly rugged and simple to use.

The two technologies behind these popular radios are FRS and GMRS. While sold in similar packaging and frequently sitting on shelves right next to each other, these two types of radios are quite different in capabilities and operating rules.

FRS

FRS stands for Family Radio Service , and was approved by the FCC for unlicensed use in 1996. It operates around 462 and 467 MHz, and is sometimes referred to as " UHF Citizens Band." It is not a Part 15 device like 802.11 radios, but is governed by FCC Part 95, Personal Radio Services. FRS radios share some channels with GMRS radios but are restricted to 500mW maximum power. Manufacturers typically claim two miles as the maximum range of FRS radios. FRS radios come with fixed antennas, and cannot be legally modified to accommodate antennas or amplifiers.

FRS channels 1 through 7 overlap with GMRS and can be used to communicate with GMRS radios. If you need to talk only to other FRS radios, use channels 8 through 14 to avoid possible interference with low band GMRS users. See Table 1-1 for the full list of FRS and GMRS frequencies.

GMRS

GMRS stands for General Mobile Radio Service, and is also known as "Class A Citizens Band." Its use is also covered by FCC Part 95, but requires a license to operate. As of this writing, a personal license costs $75 and can be obtained online at http://wireless.fcc.gov/uls/.

Handheld GMRS units can put out up to 5 Watts of power, although 4-Watt handhelds are more common. While fixed-base stations can use up to 15 Watts on most frequencies, they are restricted to 5 Watts when communicating on the FRS channels. Repeater stations are allowed and can transmit as high as 50 Watts. Both fixed-base stations and repeaters can only transmit on the lower "462" frequencies, while handhelds can operate on any GMRS frequency. Again, see Table 1-1 for the full list of FRS and GMRS frequencies. GMRS gear can include removable antennas, making it simple to use a handheld with a car mount or stationary antenna. Combined with the ability to use repeaters, GMRS can be used to communicate over considerable distances.

Table 1-1. FRS and GMRS frequencies

Lower frequency

Upper frequency

Purpose

462.550

467.550

GMRS "550"

462.5625

FRS channel 1, GMRS "5625"

462.575

467.575

GMRS "575"

462.5875

FRS channel 2, GMRS "5875"

462.600

467.600

GMRS "600"

462.6125

FRS channel 3, GMRS "6125"

462.625

467.625

GMRS "625"

462.6375

FRS channel 4, GMRS "6375"

462.650

467.650

GMRS "650"

462.6625

FRS channel 5, GMRS "6625"

462.675

467.675

GMRS "675"

462.6875

FRS channel 6, GMRS "6875"

462.700

467.700

GMRS "700"

462.7125

FRS channel 7, GMRS "7125"

462.725

467.725

GMRS "725"

467.5625

FRS channel 8

467.5875

FRS channel 9

467.6125

FRS channel 10

467.6375

FRS channel 11

467.6625

FRS channel 12

467.6875

FRS channel 13

467.7125

FRS channel 14

Typically, handheld GMRS units use lower frequencies to communicate with each other when possible, and transmit on the upper frequencies (while listening 5 MHz lower) to talk to a repeater. This allows anyone listening on the "462" side to hear traffic both from handhelds as well as from anyone using the repeater. Always use the lower frequencies and the lowest power settings whenever possible to help avoid unnecessary interference with other GMRS users. Use repeaters only when you can't otherwise establish communications.

Extending Range

While higher power radios can help extend your range a little, the best method for increasing your range is to increase your altitude. UHF radios can reach significantly further when the antenna is high in the air, even with limited power. This is one reason why the Part 95 rules limit "small control stations" to antennas no more than 20 feet higher than the structure to which they are mounted. To make the best use of your FRS or GMRS radio, find high ground when transmitting. In some cases, this can push your available range out many, many miles. If you are using a GMRS radio, attaching it to a tall antenna can significantly improve your effective range.

While these radios are half duplex and allow only limited data transmissions, they are handy in a number of situations. For example, when fine tuning a long distance point-to-point 802.11 link, you may find them far more useful than mobile phones. Any time you are working far away from a city, particularly on hills and mountains, FRS and GMRS radios can work considerably better than a phone. But don't get any bright ideas about connecting a radio to a telephone patch; this is prohibited on both FRS and GMRS.

This writing is by no means authoritative on the labyrinthine FCC rulebook, but should give you an idea of what each technology is good for. If in doubt, see the rules for yourself online at http://www.access.gpo.gov/nara/cfr/waisidx_00/47cfr95_00.html. If you are looking for more information about FRS and GMRS, there is also a wealth of information available from the Personal Radio Steering Group at http://www.provide.net/~prsg/rules.htm.

Hack 8 CDPD, 1xRTT, and GPRS: Cellular Data Networks

If you can't roll your own wireless, you might try one of these mobile phone carrier networks.

When it comes to data rates, most people are in agreement that faster is better. But current communications technology always involves a trade-off between speed, power, and range. 54 Mbps may be great if you can get it, but on a large scale, this can be difficult to maintain. The 802.11 protocols compensate for increased range by scaling back the data rate, but these devices simply aren't designed to serve hundreds of people scattered over many miles.

There are times when any data to the Internet is better than none at all, no matter how slow it might be. For example, you might need to log in to a remote machine or send a quick email while traveling, when Wi-Fi or even wired network access just isn't available. Or maybe you want to have an alternate communications channel into a wireless node in a remote place (say, on a mountaintop or deep in the woods) where telephone lines aren't even available. For these situations, you might consider exploiting the biggest advantage of the commercial mobile data networks: their ubiquity.

Mobile networks maybe be slow and relatively expensive, but you can't beat their coverage compared to current Wi-Fi networks. They can give you an IP address just about anywhere, but be warned that most mobile data services are not cheap. Most charge by the byte, and all charge for airtime while you are using it.

The type of data service you can use depends on the underlying wireless technology. Obviously, before choosing a technology, determine the coverage area of the mobile network in the place you intend to use it. The three leading mobile data services are described next, in decreasing order of availability in the U.S.

CDPD on TDMA

CDPD stands for Cellular Digital Packet Data. It works over the enormously popular Time Division Multiple Access (TDMA) mobile network, which is easily the most widely deployed mobile network in the U.S. CDPD "modems" typically use a serial port or PCMCIA slot and offer speeds of up to 19.2 Kbps (real world is typically closer to 9,600 bps).

It looks like TDMA operators are generally migrating to GSM, so it is probably unlikely that TDMA data services will ever be upgraded. In some areas, TDMA is being phased out altogether, making it difficult to obtain a CDPD account. But despite the relatively slow speed of CDPD, you can't beat its coverage. Virtually all of the populated regions of the U.S. are covered by TDMA.

1xRTT on CDMA

CDMA stands for Code Division Multiple Access: it is the second most popular mobile technology in the U.S. The original CDMA data services offered speeds of 9600 bps to 14.4 Kbps. A new upgrade called 1xRTT boasts speeds of up to 144 Kbps, but by many reports, real-world throughput is somewhere between 60 and 80 Kbps, occasionally bursting to 144 Kbps if you get lucky. If you think the 802.11 protocol names aren't confusing enough, you should really try following mobile phone technology. 1xRTT is also known in various circles as CDMA2000 Phase 1, or simply 95-C.

1xRTT is just the first phase of the CDMA2000 plan. A few communities are now trying the experimental 1xEV-DO technology, which can theoretically achieve 2 Mbps from fixed locations over CDMA. This technology hasn't yet been widely deployed. Also, we are told to expect 1xRTT Release A by the end of 2003. This is a software upgrade that promises 144 Kbps uploads and downloads of up to 300 Kbps.

GPRS on GSM

GPRS stands for General Packet Radio Service, and is the data service available on Global System for Mobile communications (GSM) networks. The original GSM data services offered only 9,600 bps throughput, but GPRS allows real-world speeds of 20 to 30 kbps. GPRS is a packet-based protocol, meaning that the GPRS radio transmits only when it actually has data to send. This can save on battery usage, and theoretically makes more efficient use of the network. A number of nifty gadgets such as the HipTop by Danger (http://www.danger.com/) use GPRS for connectivity.

Eventually, GPRS may be replaced by technologies like Enhanced Data for Global Evolution (EDGEyou have to ask yourself how they can use these acronyms with a straight face), which offers theoretical speeds of up to 384 Kbps over GSM. EDGE is still experimental, and hasn't yet been widely deployed. As of this writing, GSM coverage is increasing rapidly in the U.S. but still isn't as ubiquitous as CDMA or TDMA. Much of the rest of the world has a more thoroughly deployed GSM network.

If you find that you need simple wireless connectivity beyond what you can hope to provide with 802.11 technologies, commercial data networks are a viable alternative. They don't come cheap, but can be perfect for many low bandwidth applications.

Hack 7 900 MHz: Low Speed, Better Coverage

Ubiquity is sometimes more important than speed. If you absolutely need to make a link that isn't possible with 802.11, then this older gear might be for you.

In the days before 802.11, a number of FCC Part 15 wireless networking products were competing in the marketplace. For example, Aironet, Inc. (before it was bought by Cisco) produced the Arlan networking series. The Arlan APs and bridges use 10baseT Ethernet, operate at 900 MHz, and have a data rate of 215 Kbps or 860 Kbps. They also made a number of complementary PCMCIA radio cards (the 655-900, 690-900, and PC1000, for example). These devices put out up to a whopping 1 Watt at 900 MHz. NCR had the WaveLAN 900 MHz line that included an ISA and PCMCIA card that would push 2 Mbps at 250mW. While the data rate can't compare to modern wireless networking gear, the higher power and lower frequency of this equipment offers significant advantages.

As the frequency of a signal increases, the apparent range it can cover at the same power and gain decreases. For example, a 100mW signal at 5.8 GHz appears to travel less than half the distance of a 100mW signal at 2.4 GHz, which appears to travel less than half that of a 100mW signal at 900 MHz. There is no limit to how far a signal can actually go, but its ability to rise above the background noise and be detected at a usable level is bounded by its power, frequency, and antenna gain. So to put it simply, all other variables being equal, lower frequency signals travel further than higher frequency signals. You can make higher frequency signals appear to travel further, but to do so you need to increase the power, antenna gain, or both.

Another curious property of radio is that the requirement of having line of sight between the devices becomes more important at higher frequencies, but is less critical at lower frequencies. Higher frequencies don't fare so well when there are obstacles between the ends of the radio link (particularly in urban and indoor settings). This property, combined with the advantage of greater range, means that 900 MHz equipment can be used in a variety of situations where 802.11b/g or 802.11a don't fare as well. It can penetrate foliage, buildings, and other obstacles better than its 802.11 counterparts. Of course, the big trade-off is throughput.

Pros

  • Higher power and superior range.

  • Equipment doesn't compete with the increasingly crowded 2.4 GHz ISM band, but must still tolerate 900 MHz phones, video cameras, baby monitors, and other devices.

Cons

  • Low data throughput, from serial speeds of 9,600 bps up to 2 Mbps or so.

  • Very little vendor interoperability.

  • With the advent of 802.11 networking, 900 MHz gear has increasingly limited availability.

  • Equipment can be quite expensive compared to 802.11 gear.

Recommendation

A number of manufacturers offer serial or Ethernet to 900 MHz bridges. While Ethernet is generally preferable, the serial devices are perfectly capable of supporting a PPP connection between two sites. If you need to create a long distance point-to-point link (particularly where clean line of sight just isn't possible) and can cope with limited data rates, then this equipment might be right for your project. Expect the hardware to be difficult to locate and a bit more expensive than the typical consumer grade 802.11b equivalent.