Vous êtes sur la page 1sur 12

IrDA was established to develop standards for infrared system design.

In Part 1, we'll explore the required protocol layers of the IrDA specification. By Patrick Megowan, David Suvak, and Charles Knutson, Counterpoint Systems Foundry Infrared (IR) technology has long been used for the development of low-cost, short-range wireless data links. This technology has found its way into TV remote controls, PCs, personal digital assistants (PDAs), handheld data loggers, medical equipment, and printers. Until 1993, the IR industry was plagued by a lack of standardization. To counteract this problem, industry members worked together and formed the Infrared Data Association (IrDA). IrDA was established to develop protocols for IR point-to-point communications applications. Today, IrDA specifications define the communications protocol for many IR applications. In general, communications protocols are broken into layers. Each of these layers deals with a manageable set of responsibilities and supplies needed capabilities to the layers above and below. When these layers are placed on top of each other, they form a protocol stack. Similar to other communications protocols, the IrDA specification features a protocol stack made up of several layers (Figure 1).

Figure 1: The IrDA protocol stack consists of required and optional layers. In this figure, the optional layers are in shaded boxes while the required layers are in un-shaded boxes.

The IrDA protocol stack can be divided into two groups -- required and optional layers. The required layers of IrDA include a link access protocol (IrLAP), a link management protocol (IrLMP), and the Information Access Service (IAS). The optional protocol layers include the TinyTP transport protocol, an object exchange protocol (IrOBEX), a serial and parallel port emulation protocol (IrCOMM), and a local-area network access protocol (IrLAN). In the first part of this two-article set, we will focus on the required protocol layers of the IrDA specification. In part 2, we will cover the optional layers.

IrLAP The required link access protocol layer (IrLAP) corresponds to the OSI layer 2 data link protocol. This layer is based on high-level data link control (HDLC) and synchronous data control (SDLC) with extensions for some characteristics of IR communications. IrLAP provides reliable data transfer using retransmission, low-level flow control, and error detection. IrLAP allows IR systems to deal with data transfer at a low level. By handling data transfer at a low level, IrLAP frees the upper layers of an IrDA system from dealing with data transmission. As a result, the upper layers are assured that their data will be delivered (or at least that they will be informed if it was not). Several environmental factors influenced the development of the IrLAP layer. These factors include: 1. Point-to-point communication--Connections are one-to-one, such as camera to PC or data collector to printer. The range is typically 0 to 1 m, although extended range up to 10 m or more is under development. 2. Half-duplex operation--IR light, and therefore data, is sent in one direction at a time. In IR systems, however, the link changes directions frequently. Thus, IR systems can simulate full-duplex operation in cases where timing is not extremely sensitive. 3. A narrow IR cone--IR transmission is directional within a 15 deg. half angle in order to minimize interference with surrounding devices. 4. Hidden nodes--Other IR devices approaching an existing connection may not be immediately aware of the connection if they approach from behind the current transmitter. They must wait and see if the link turns around before stepping in. 5. Interference--IrLAP must overcome interference from fluorescent lights, other IR devices, sunlight, and moonbeams. 6. No collision detection -- IR systems are designed to not detect collisions. Therefore, the protocol layer software must handle cases where collisions cause lost data with methods such as random backoff. Roles Within a LAP Connection In the IrDA specifications, the LAP connection is set up as a master/slave relationship. The master is called the primary station and the slave is called the secondary station. The primary station sends command frames initiating connections and transfers. This station is responsible for organization and control of data flow and deals with unrecoverable data link errors. On the other hand, the secondary station only sends response frames. It only speaks when spoken to. In any connection, one device must play the primary role while the other device plays the secondary role. Once communication is started, the two sides take turns talking. The primary station leads off and the secondary station follows. Sides cannot talk for more than 500 ms at a time. They must allow the other side to talk, even if just to say it has nothing to send for the moment. This process continues until the communication is completed. During connection, the IrLAP operates in a normal response mode (NRM). In this mode, higher stack layers use normal command and response frames to exchange information. Once communication is completed, the IrLAP sends the IR system into a normal disconnect mode (NDM). NDM, known as a contention state, is the default state of disconnected devices. In this mode, a device must observe a set of media access rules. Of utmost importance, a device in NDM must check whether other transmissions are occurring (a condition known as media busy) before transmitting. To check for other transmissions, the IrDA device listens for activity. If activity is not detected for greater than 500 ms (the

maximum time for the link to turn around), the media is considered to be available for establishment of a connection. IrLAP Frame Format The basic IrLAP frame format is displayed in Figure 2:

Figure 2: The basic frame format of the IrLAP protocol layer.

Before sending, a frame is wrapped with framing information. Three different frame wrappers are used by IrLAP. These wrappers include: 1. Asynchronous (ASYNC) Framing: 9600 b/s to 115.2 kb/s 2. Synchronous (SYNC) HDLC Framing: 576 kb/s and 1.152 Mb/s 3. Synchronous 4 PPM Framing: 4 Mb/s Engineers should choose a frame wrapper based on the speed of connection employed in their system. Service Primitives IrLAP operations are described in the specification using service primitives. An engineer can think of the service primitive as a conceptual model of an API for an operation that IrLAP performs. Figure 3 illustrates an operation. In this figure, the operation starts with a service request and then travels across the link as a frame. The operation is then reported as an indication (frequently an up-call) on the receiving side. Finally, the receiver formulates a response that travels back as a frame to the original requester. This response provides the original requester with a confirmation that the operation has been received.

Figure 3: This figure illustrates an IrLAP operation.

A number of services are defined in the IrLAP specification. Not all services are necessary for all devices. In addition, the IrLAP specification (along with the IrDA Lite standard) describes the minimum service requirements for operation. The most important IrLAP services include: 1. Device Discovery -- These services explore the nearby IR space to see who is present and get some hint as to what they can do. 2. Connect -- These services choose a specific partner, negotiate the best possible communication parameters supported by both sides, and connect. 3. Send Data -- These services are used by higher layer protocols for almost all of their work. 4. Disconnect -- These services close down and return to the NDM state as well as prepare the IrDA system for a new connection IrLMP Link Management Protocol The required link management protocol (IrLMP) layer provides multiplexing, high-level discovery, address conflict resolution of the IrLAP discovery, and an Information Access Service (IAS). This protocol layer depends on the reliable connection and negotiated performance provided by the IrLAP layer.

In order to have multiple IrLMP links on a single IrLAP connection, there must be a high-level addressing scheme. The following terminology is used to describe this addressing: 1. Logical Service Access Point (LSAP): The point of access to a service or application within IrLMP. This access point is referenced with an LSAP selector (LSAP-SEL). 2. LSAP-SEL: A 1-byte number that corresponds to an LSAP. Engineers should think of the selector as the address of a service within the LMP multiplexor. This byte is broken into ranges for the IAS server, for legal connections, for connectionless service, and for future use. Given the limited number of LSAP-SEL values, services are not assigned fixed port addresses as in TCP/IP. Instead, services have fixed published names which are searchable using the IAS. Similar to IrLAP, the IrLMP layer defines services. These services include: 1. Device Discovery -- This service finds out information about other services in the IR space. 2. Connect -- This service establishes a connection between a pair of services at the LMP level. 3. Send Data -- This service sends data back and forth in the IR system. 4. Disconnect -- This service closes the LMP connection. But, this service does not necessarily close the LAP connection. It is important to note that this service set is identical to the set listed in the IrLAP section above. It is common for protocol stacks to propagate upward like this, with each layer adding its particular contribution. Information Access Service The IAS acts as the "yellow pages" for a device. All of the services/applications available for incoming connections must have entries in the IAS. These entries are used to determine the service address (LSAPSEL). These entries are also queried for additional information about services. A full IAS implementation consists of client and server components. The client is the component that makes inquiries about services on another device using the Information Access Protocol (IAP). The server is the component that knows how to respond to inquiries from an IAS client. The server uses an information base of objects supplied by the local services/applications. The IAS information base is a collection of objects that describe the services available for incoming connections. Objects consist of a class name and one or more attributes. These objects are quite similar to entries in the yellow pages of a phone book. The class name is equivalent to the business name in the phone book--it is the official published name of the service or application. IAS clients will inquire about a service using this name. The attributes contain information similar to phone number, address, and other characteristics of the business. The one essential attribute for every entry is the LSAP-SEL (or service address), which is required in order to make a LMP connection to the service. There are a number of IAS operations defined under the IrLMP standard. But, the most used and only required operation is called GetValueByClass. With this operation, the inquiring party gives the class name (for example, Printer) and the name of the attribute it wants (for example, the LSAP-SEL). The inquiring party then receives a response that consists of one or more answers (for example, the LSAP-SELs for any printing services in the responding party's information base) or an indication that the service or attribute does not exist.

Final Note This ends the first part of the overview of IrDA specifications. In part 2, we'll examine the optional layers of IrDA and the IrDA Lite specification.
Patrick Megowan, President, David Suvak, Chief Technical Officer, and Charles Knutson, Vice President of Research and Development, Counterpoint Systems Foundry, 800 NW Starker Avenue, Corvallis, OR 97330. Phone: 541-758-6123; Fax: 541-758-6120.

End of Part 1

The IrDA protocol stack is broken into required and optional layers. Part 2 of this two-article set focuses on the optional protocol layers. By Patrick Megowan, David Suvak, and Charles Knutson, Counterpoint Systems Foundry Infrared Data Association (IrDA) regulations are a guiding force behind the development of many shortrange, low-cost point-to-point infrared (IR) systems. Similar to other communication protocols, the IrDA standard is broken down into layers. In Part 1 of this series, we examined the required protocol layers of the IrDA specification. In this part, we will focus on IrDA's optional layers and the IrDA Lite specification. Under IrDA specifications, the optional protocol layers include the TinyTP transfer protocol, an object exchange protocol (IrOBEX), a serial and parallel emulation protocol (IrCOMM), and a local-area network (LAN) protocol (IrLAN). Even though the TinyTP transportation protocol (TTP) is an optional IrDA layer, it is so important that engineers should consider it a required layer (except in the case of current printing solutions). TTP provides two functions: 1. Flow control on a per-LMP-connection (per-channel) basis; 2. Segmentation and re-assembly (SAR). Per-channel flow control is currently the most important use of TTP. As discussed in Part 1, IrLAP offers flow control. But another flow control is still needed. To illustrate this need, suppose that a LAP connection is established and two LMP connections are made on top of the LAP connection using the LMP multiplexing capability. If one LMP connection turns the LAP flow control on, the flow of data on the LAP connection (which carries all the LMP connections) is completely cut in that direction. As a result, the second LMP connection side cannot get the data it wants until LAP flow control is turned off. This may seriously disrupt the work of the second LMP connection (especially if timers are involved). If flow control is applied on a per-LMP-connection basis using TTP (or other mechanisms), the first LMP connection can stop to digest information without negatively affecting the second LMP connection. TTP uses a credit-based flow control scheme. It works as follows:

1. At connection, some credit is extended by each side. One credit corresponds to permission to send one LMP packet. If you send a credit, you must be able to accept a maximum-sized packet. As an engineer can see, the number of provided credits depends entirely on how much buffer space an IR system has available. As long as the IR system has buffers, it can send anywhere from 1 to 127 credits. 2. Sending data causes credit to be used up (1 unit of credit per packet sent). 3. Periodically, the receiver issues more credit. Although this issuing policy is entirely at the receiver's discretion, it can make a big difference in the performance of the link. If the sender is constantly running out of credit and having to wait for more, throughput will suffer. 4. If a sender does not have credit, data movement cannot occur. 5. A credit-only packet can always be sent. This packet is not subject to flow control. Although the above description talks about the sender and receiver as if those roles are fixed, it is common for both sides of a LMP connection to send and receive. Thus, both sides will be issuing and using credit. Note that the credit byte normally travels as part of a LMP data packet, so LMP packets are not needed just for sending credit as long as there is data to send and credit to send with. Segmentation and Re-Assembly The TTP is also responsible for segmentation and re-assembly (SAR). Basically, TTP breaks large data into pieces (segmentation) and puts it back together on the other side (re-assembly). The entire piece of data being chopped up and re-constituted is called a service data unit (SDU). The maximum SDU size is negotiated when the TTP/LMP connection is first made. Tiny TP Service Primitives As with the IrLAP and IrLMP layers, TTP operations are characterized as service primitives: 1. Connect -- Negotiate maximum SDU size. 2. Disconnect 3. Data -- Reliable sequenced data. 4. Local Flow Control -- Stop data delivery. 5. Udata -- Unreliable, unsequenced (pass through to IrLMP). TTP service primitives focus on the core of the LMP primitives -- connect, send, and disconnect. The only difference is that TTP service primitives offer a course for low control. IrOBEX Object Exchange Protocol The optional object exchange protocol layer (IrOBEX) allows systems of all sizes and types to exchange a wide variety of data and commands in a resource-sensitive standardized fashion. This protocol layer takes an arbitrary data object (a file, for instance) and sends it to whomever the IR device is pointing. IrOBEX also provides tools that enable the object to be intelligently recognized and handled on the receive side.

The potential range of objects is wide, encompassing not only traditional files, but also pages, phone messages, digital images, electronic business cards, database records, handheld instrument results, and machinery diagnostics. The common thread is that the application doesn't need or want to get involved in managing connections or dealing with the communications process at all. The application simply wants to take an object and ship it to the other side with the least amount of hassle. IrOBEX was created to package an IrDA communications transaction as completely as possible in order to dramatically simplify the development of communications-enabled applications. It was further engineered to meet the following criteria: 1. Simple: Supports most-needed operations/applications. 2. Compact: Under 1K code on a small system. 3. Flexible: Supports data handling for both industry standard and custom types. 4. Extensible and Debug-able. 5. Works on IrDA, but is transport independent. The IrOBEX standard consists of a session model, an object model, guidelines for use and extension, as well as IAS entry for a default OBEX server and suggestions for its capabilities. The object model provides a flexible and extensible representation for objects and information describing the object. The guidelines for use and extension define new session operations and new object types. The session model offers the rules of conversation governing the exchange of objects. This model supports optional negotiation during connection and a set of operations such as Put and Get. The session model also allows IrDA systems to terminate the transfer of an object without closing the connection. IrCOMM When the IrDA standards were developed, there was a strong desire to allow existing PC applications that use serial and parallel ports to operate via IR without change. These applications, collectively known as legacy applications, include printing, file transfer applications, and modem communications. In the past, providing IR connectivity to legacy applications caused headaches for design engineers. IR communications differ significantly from serial and parallel communications. For instance, both serial and parallel cables have individual circuits over which signals can be sent independently and concurrently. By contrast, IR has a single beam of light. All information must fit into LMP or higher layer packets in a serial stream. The IrCOMM standard allows legacy applications to be used over IR with a minimum hassle. The key feature of IrCOMM is the definition of a so-called control channel to carry the non-data circuit information. IrCOMM is an optional IrDA protocol that applies only to certain applications. In general new applications are better served if they avoid IrCOMM and directly use other IrDA applications protocols such as IrOBEX, IrLAN, or TTP. New applications should avoid IrCOMM because it masks some of the useful features built into the lower protocols. After all, IrCOMM's job is to make IrDA look like serial and parallel media that do not offer handy features like automatic negotiation of best common parameters and a yellow pages of available services.

Since different applications use the non-data circuits of serial and parallel communications to varying degrees, four service types are defined in IrCOMM: 1. Three-Wire Raw (Parallel and Serial Emulation): Sends data only without the need for non-data circuit information and a control channel. Runs directly on IrLMP. 2. Three-Wire (Parallel and Serial Emulation): Minimal use of control channel. Uses TTP. 3. Nine-Wire (Serial emulation only): Uses a control channel for status of standard RS-232 non-data circuits. Uses TTP. 4. Centronics (Parallel emulation only): Uses control channel for status of Centronics non-data circuits. Uses TTP. Engineers should choose an IrCOMM service type based on the requirements of their individual IR system requirements. IrLAN The final optional protocol discussed is IrLAN. It is mentioned only briefly because it is not an approved standard at this time. In addition, IrLAN is not widely used in embedded systems throughout the world. IrLAN primarily serves as an extremely convenient connection between portable PCs and office LANs. It provides three levels of operation. This protocol layer enables a computer to attach to a LAN via an Access Point Device (sometime called an IR LAN Adapter). Secondly, it allows two computers to communicate as though they are attached to a LAN. In effect this functionality creates an instant LAN between a pair of machines, with access to the other machines' directories and other LAN capabilities. Finally, IrLAN lets a computer attach to a LAN through a second computer already attached. IrDA Lite Until now, we've discussed the layers that make up the IrDA protocol stack. This section briefly describes a specification that modifies the protocol layers already discussed without creating a new layer. The IrDA Lite specification describes a set of design and implementation strategies that together yield the smallest possible IrDA implementation. Naturally, the ultimate size of the stack will depend heavily on the hardware, the software tools available, and the experience and skills of the development team. But Counterpoint's experience suggests that IrDA Lite systems can achieve primaries under 10 kB code size and secondaries under 5 kB when running on common CISC processors in embedded systems. The IrDA Lite specification is composed of a number of strategies. A developer may choose to implement all of the strategies or only the ones appropriate for a particular device.

End of Part 2
Author's Note: Engineers can obtain standards documents and additional information about IrDA at http://www.irda.org.

RFID Radio frequency identification (RFID) is a general term that is used to describe a system that transmits the identity (in the form of a unique serial number) of an object wirelessly, using radio waves. RFID technologies are grouped under the more generic Automatic Identification(Auto ID) technologies. The barcode labels that triggered a revolution in identification systems long time ago, are inadequate in an increasing number of cases. They are cheap but the stumbling block is their low storage capacity and the fact that they cannot be reprogrammed. A feasible solution was putting the data on silicon chips. The ideal situation is contactless transfer of data between the data carrying device and its reader. The power required to operate the electronic data carrying device would also be transferred from the reader using contactless technology. These procedures give RFID its name. One grand commercial vision for RFID is to change the way demand-supply chain moves. In the current almost stone-age scenario, manufacturer produces goods based on forecasts and hopes all of them will be consumed before the shelf life gets them. Good, if the market is consistent. Horrible, if a sudden surge makes the supply fall short and hence everyone in the chain miss on profits. Disastrous, if demand dies suddenly and losses are passed along the chain. In a not so distant future, RFID enabled stores will monitor the consumption in real time. Shelf will signal the inventory when it needs more stuff and inventory will pull supplies from the manufacturer based on its level of stock. Simple concept, not-so-difficult implementation and revolutionary results in the pipeline. Thats RFID, in short.

Before RFID can be understood completely, it is essential to understand how Radio Frequency communication occurs. RF (Radio Frequency) communication occurs by the transference of data over electromagnetic waves. By generating a specific electromagnetic wave at the source, its effect can be noticed at the receiver far from the source, which then identifies it and thus the information. In an RFID system, the RFID tag which contains the tagged data of the object generates a signal containing the respective information which is read by the RFID reader, which then may pass this information to a processor for processing the obtained information for that particular application. Thus, an RFID System can be visualized as the sum of the following three components:

RFID tag or transponder RFID reader or transceiver Data processing subsystem

An RFID tag is composed of an antenna, a wireless transducer and an encapsulating material. These tags can be either active or passive. While the active tags have on-chip power, passive tags use the power induced by the magnetic field of the RFID reader. Thus passive tags are cheaper but with lower range (<10mts) and more sensitive to regulatory and environmental constraints, as compared to active tags. An RFID reader consists of an antenna, transceiver and decoder, which sends periodic signals to inquire about any tag in vicinity. On receiving any signal from a tag it passes on that information to the data processor. The data processing subsystem provides the means of processing and storing the data. RFID systems can also be differentiated based on the frequency range it uses. The common ranges are LowFrequency (LF: 125 - 134.2 kHz and 140 - 148.5 kHz), High-Frequency (HF: 13.56 MHz) and Ultra-HighFrequency (UHF: 868 MHz - 928 MHz). Low-frequency systems have short reading ranges and lower system costs. They are most commonly used in security access, asset tracking, and animal identification applications. High-frequency systems, offering long read ranges (greater than 90 feet) and high reading speeds, are used for such applications as railroad car tracking and automated toll collection. However, the higher performance of high-frequency RFID systems incurs higher system costs.

Standards are critical in RFID. Be it payment systems or tracking goods in open supply chains. A great deal of work has been going on to develop standards for different RFID fequencies and applications. RFID standards deal with the following:

Air Interface Protocol - The way tags and readers communicate Data Content - Organizing of data Conformance - Tests that products meet the standard Applications - How applications are used

The way the world has gone about developing the standards is a bit complex. There are two major and somewhat conflicting organizations into the business - ISO and Auto-ID Centre (now handled by EPC Global). Without going too much into the conflict, we'll review the standards proposed by both these organizations. Tags are required to be disposable (manufacturer may not get the tags back from the retailer to reuse it). Hence, the primary mission for any standard developer is to make the tags low cost. It should operate in UHF, as only UHF delivers read range needed for supply chain applications. And since the goods are needed to be tracked as they move across the globe, the standards must be open and globally accepted. There should also be an accompanying network architecture, which would enable anyone to look up information associated with a serial number stored on a tag. The network too needs to be based on open standards. EPC standards for tags are the class 0 and class 1 tags:

Class 1: a simple, passive, read-only backscatter tag with one-time, field-programmable non-volatile memory. Class 0: read-only tag that was programmed at the time the microchip was made

Class 1 and Class 0 have a couple of shortcomings, in addition to the fact that they are not interoperable. One issue is that they are incompatible with ISO standards. The new EPC standard ~V Gen2 is designed to be fast tracked with ISO standards but for some disagreements over the 8 bit Application Family Identifier (AFI). ISO has developed RFID standards for automatic identification and item management. This standard, known as the ISO 18000 series, covers the air interface protocol for systems likely to be used to track goods in the supply chain. They cover the major frequencies used in RFID systems around the world. The seven parts are: 1. 2. 3. 4. 5. 6. 7. 18000~V1: Generic parameters for air interfaces for globally accepted frequencies 18000~V2: Air interface for 135 KHz 18000~V3: Air interface for 13.56 MHz 18000~V4: Air interface for 2.45 GHz 18000~V5: Air interface for 5.8 GHz 18000~V6: Air interface for 860 MHz to 930 MHz 18000~V7: Air interface at 433.92 MHz

There are two main area of applications, defined broadly as proximity (short range) and vicinity (long range). Long range or vicinity applications can generally be described as track and trace applications, but the technology provides additional functionality and benefits for product authentication. RFID enables greater automation of data collection process. Most companies spend considerable effort in knowing whats in their warehouse. RFID will help them dig deeper and much more easily, tracking to the detail of even each unit, long after it has left the factory or warehouse. RFID allows all this data to be transferred securely. Companies use independent suppliers, data from each of them can be carried on tags and uploaded to the Company's central system. Imagine the control that the Company will have on a product's life cycle. The creation of sucesses and defeats can be better understood. There have been numerous instances when companies had to recall the entire product due to a fault in a minor component. Imagine the costs involved in recalling a whole car for a mistake in the AC system! RFIDs can make such recalls much more focussed. There would be better data about post production performance. A car could have individually tagged components. Data could be collected everywhere, accident sites, repair shops, even the garage.Even inside the factory, tags could enable faster and focussed fault tracing. The Just in Time(JIT) practice followed by many companies, where components are used when they are delivered and delivered just before being needed, can lead to out of stock situations. RFID will eliminate the problem.

The eventual aim of RFID in retail and manufacturing ~W eliminate the intermediary. A perfect supply chain would require no distribution center. Products would be delivered directly from the factory to the retail center. Some other areas where passive RFID has been applied in recent past are:

Person Identification Food Production Control Vehicle Parking Monitoring Toxic Waste Monitoring Valuable Objects Insurance Identification Asset Management Access Control

Short range or proximity applications are typically access control applications. Some main areas are:

Access control Mass transit ticketing

Vous aimerez peut-être aussi