Scheduling Support for Guaranteed Time Services in IEEE 802.15.4 Low Rate WPAN Seong-eun Yoo, Daeyoung Kim, Minh-Long Pham Information and Communications University
Yoonmee Doh, Eunchang Choi, Jae-doo Huh Electronics and Telecommunications Research Institute
{seyoo, kimd,
[email protected]}
{ydoh, ecchoi, jdhuh@ etri.re.kr}
Abstract We propose a real-time message scheduling algorithm which is applied to schedule periodic realtime messages in IEEE 802.15.4 for LR-WPAN(Low Rate Wireless Personal Area Network). The standard allows GTSs (Guaranteed Time Slots) in the optional use of a superframe structure in a beacon-enabled network to be used to exchange real-time messages. To utilize these features of the standard efficiently, a proper message scheduling algorithm is needed. The proposed off-line message scheduling algorithm which is based on a distance constrained scheduler generates the standard specific parameters including BO, SO, and GTS information to schedule the given message set. The algorithm is evaluated by simulation and the guaranteed time service using the schedule is implemented and evaluated on CC2420DB which is a prototyping platform including an IEEE 802.15.4 compliant transceiver of Chipcon AS.
1. Introduction In recent years, the desire to connect all electronic computing devices together has increased. Although they can be connected through wired lines, it is more convenient and effective to use wireless links when we consider the large number of pervasive devices in the environment. In the coming years, it is expected that the Wireless Sensor Network(WSN) will be used in applications in consumer electronics, PC peripherals, home automation, home security, personal healthcare, toys and games, industrial control and monitoring, asset and inventory tracking, and intelligent agriculture [2] [9]. Some applications, such as industrial control and monitoring, asset tracking, security, and personal
This work was supported in part by ETRI and ITRC program of the Korean Ministry of Information and Communication
health care, should have a timeliness property meaning the timeliness of each application is as important as its function. For example, if there is a patient whose temperature and pulse should be checked constantly, the timeliness property will be very important to maintain his or her health. One of the most well-known on-going standards used in a WSN field is ZigBee. Since ZigBee uses IEEE 802.15.4 LR-WPAN as its PHY layer and MAC sub-layer, the LR-WPAN is expected to be widely used in WSN in accordance with ZigBee standardization. The IEEE 802.15.4 std. defines the physical (PHY) layer and medium access control (MAC) sub layer specifications for low data rate (up to 250kbps@2450MHz) wireless connectivity. To exchange messages between LR-WPAN devices, a message scheduling algorithm is needed. In particular, we consider periodic real time messages. There are several message scheduling algorithms but since specific parameters in the standard must be considered in order to schedule a message set, it is difficult to use them directly in the LR-WPAN. Hence, this paper proposes a real-time message scheduling algorithm for the LR-WPAN. It generates the values of several standard specific parameters. We evaluate the algorithm by simulation and implement the guaranteed time service on a prototyping board, CC2420DB [8] which includes an IEEE 802.15.4 compliant transceiver of Chipcon AS’s, CC2420 [7]. The rest of this paper is organized as follows: Section 2 presents related work and then Section 3 summarizes some related parts of the IEEE 802.15.4 standard. In Section 4, we describe the system model and the problem statement. Section 5 presents the proposed scheduling algorithm and Section 6 evaluates the algorithm by simulation. The implementation results are stated in Section 7. Finally, the paper concludes with a summary of our work and a statement of future work in Section 8.
2. Related Work Gang Lu, et al. [6] published one of the first simulation-based performance evaluations of the new MAC in the IEEE 802.15.4, focusing on its beaconenabled mode for a star-topology network. Specifically, they compare the relative performance of CAP (Contention Access Period) and CFP (Contention Free Period) modes for a source under different background traffic. Guaranteed time slots can be assigned in the CFP to applications which require dedicated bandwidth or low latency regardless of the traffic load in the network. In the simulation, they compare the delay, energy consumption and throughput performance for a source using CSMA-CA and GTS under various background traffic. Clearly, with GTS, a device can get dedicated bandwidth, which achieves 100% delivery ratio and low latency regardless of the background traffic load in the network. As we expect, the guaranteed time service is useful to exchange the sensing data in sensor network, which usually need periodic and timely information transmissions. The pinwheel problem is a special real-time scheduling problem to schedule n periodic real-time processes in a single processor: it can be modeled mathematically as the following. (The Pinwheel Problem) Given a multiset of n positive integers A = {a1, a2, … , an}, find an infinite sequence(schedule) over the symbols {1, 2, …, n} such that there is at least one symbol “i” within any subsequence of ai consecutive symbols (slots) [4] [5]. To schedule an instance of the pinwheel problem, scheduler Sx was devised. Let A={a1, a2, …, an} be an instance of the pinwheel problem, where a1 ≤ a2 ≤ … ≤ an. In [4], it has been proved that if a pinwheel instance A with a total density ρ (A) ≤ 1 consists solely of multiples(i.e., ρ (A)∑ ni=1(1/ai) ≤ 1, ai | aj for all i < j, where x | y denotes x divides y), then A is schedulable. For example, {2, 4, 8, 8} is schedulable. Based on this result, Sx first transforms an arbitrary instance A = {a1, a2, …, an} to another instance B = {b1, b2, …, bn} which consists solely of multiples and bi ≤ ai for all i. Since bi ≤ ai for all i, the transformed multiset B is more restricted than the original pinwheel instance A. If we can find a pinwheel schedule for B, the schedule also satisfies the original constraint ai [3]. Also, since the instance B consists solely of multiples (i.e., if i < j then bi | bj), B can be feasibly scheduled if and only if ρ (B) ≤ 1. The operation used to transform an arbitrary pinwheel instance to one which consists solely of multiples is described as follows. Given an integer a,
find one bi for each ai that satisfies bi = a*2j ≤ ai < a*2j+1 = 2*bi, for some integer j ≥ 0, i.e., bi = a* 2floor(log(ai/a)) (note that the logarithm is to the base 2). This operation is called specializing A with respect to {a} in [5]. The PAN Coordinator defined by IEEE 802.15.4 is like a single processor and the other devices are similar to processes. The Sx scheduler is to be the basic scheme for scheduling periodic real-time messages in the star topology assumed in this paper. Since we need to consider the overheads added through each protocol layer, the ACK frame, and the IFS (Inter Frame Spacing) as well as the original message, a new scheduling algorithm is required.
3. Superframe structure in IEEE 802.15.4 Before formulating the problem, we overview the necessary parts of the standard first. Several MAC sublayer constants and PIB (PAN Information Base) attributes such as BO and SO are defined in [1]. The optional superframe structure, which is operated on the beacon enabled mode, is used to provide a guaranteed time message exchange. Beacon CAP
CFP
GTS2 1
2
3
4
5
6
7
8
GTS1
Inactive
9 10 11 12 13 14 15 16
SD = aBaseSuperframeDuration*2SO BI = aBaseSuperframeDuration*2BO 0 ≤ SO ≤ BO ≤ 14 Network Beacon
Transmitted by a network coordinator. Contains, superframe specification, notification of pending node messages, and etc.
Contention Access Period
Accessed by any node using CSMA-CA
Guaranteed Time Slots
Reserved for nodes requiring guaranteed bandwidth. Allocated in CFP up to 7 GTSs at the same time
Inactive
During the inactive portion, the coordinator shall not interact with its PAN and may enter a low power(sleep) mode
Figure 1 Superframe structure The Superframe (Figure 1) is bounded by network beacons sent from the coordinator, and is divided into 16 equally sized slots. The beacon frame is transmitted in the first slot of each superframe. For low-latency applications or applications requiring specific data bandwidth, the PAN coordinator may dedicate portions of the active superframe to them. These portions are called guaranteed timeslots (GTSs). The GTSs form the contention-free period (CFP), which always appears at the end of the active superframe starting at a slot boundary immediately following the contention access period (CAP), as shown in Figure 1. The PAN coordinator may allocate up to seven GTSs, and each one may occupy more than one slot period. However, a sufficient portion of the CAP shall remain for
contention-based access of other networked devices or new devices intending to join the network. All contention-based transactions shall be complete before the CFP begins. As well, each device transmitting in a GTS shall ensure that its transaction is complete before the time of the next GTS or the end of the CFP.
4. System Model and Problem Statement We assume that the network works in beaconenabled mode and in a star topology. So, the PAN coordinator participates in all of the packet transmissions. Since most sensed data are transmitted periodically, we consider only periodic real-time messages except for some MAC command messages. The message set M with N periodic real-time messages and its additional information I are given (Table 1). The i-th element of I, Ii = (Ai, Ri, ACKRi) identifies the message and gives further information, where Ai is the short address of the device address related to the i-th message, Ri is the direction of the message, and ACKRi is the flag for the acknowledgement request. When Ri is 1, the message is transmitted from the coordinator to the device with address Ai. Otherwise, the message is transmitted from the device with address Ai to the coordinator. The direction of a transmission is defined relative to the direction of the data frame transmission by the device. We define symbols per byte as SpB. SS designates the slot duration of a superframe and is calculated by SS = SD/aNumSuperframeSolts = 60 * 2SO (Figure 1). IFS is calculated by equation: ( MPDU ≤aMaxSIFSFrameSize) ?aMinSIFSPeriod : aMinLIFSPeriod . Some notations are listed in Table 1 and through this paper the italic fonts represent the standard specific constants (starting with a) or variables [1]. Table 1 Notations Notation SpB MPDU TS SS IFS
MTACK OF OP OVH PACT
Description Symbols per Byte,
[email protected], 8@915MHz, 8@868MHz MAC Protocol Data Unit Symbol duration,
[email protected], 200us@915MHz, 00us@868MHz Slot size(in symbols), SS = SD/aNumSuperframeSlots InterFrame Spacing. ((MPDU ≤ aMaxSIFSFrameSize) ? aMinSIFSPeriod : aMinLIFSPeriod) Max. Acknowledgement response time, (aTurnaroundTime + aUnitBackoffPeriod) symbols Overhead added through MAC-sublayer, variable according to address mode, etc. Overhead added through PHY-layer, 6 bytes Total overhead = MAC and PHY layer overhead(OFP ) + ACK and IFS overhead(OAI) Actual packet size(in symbol) including message
SFCAP M MF N Li L LSi LS LFi Pi PSi PS PH PF PHi PFi Ii I PA BPAYLOAD S SSO AllocatedSlot 4BNCAP APR Arg(SO) min(APR) ASETi
and overheads Final CAP slot. SFCAP = 16 – (number of allocated GTS slots) Message set, {M1, M2, M3, …, MN} = {(P1, L1), (P2, L2), (P3, L3), …, (PN, LN)} Mi is the i-th message in M Message set, {(PF1, LF1), (PF2, LF2), (PF3, LF3), …, (PFN, LFN)} Number of messages length(in byte) of i-th message set of lengths(in byte) of all messages, {L1, L2, L3, …, LN} length(in symbol) of i-th message set of lengths(in symbol) of all messages, {LS1, LS2, LS3, …, LSN} length(in slot) of i-th message period(in sec.) of i-th message period(in symbol) of i-th message set of periods(in symbol) of all messages, {PS1, PS2, PS3, …, PSN} set of harmonized periods(in symbol) of all messages set of harmonized periods(in slot) of all messages harmonized periods(in symbol) of i-th message harmonized periods(in slot) of i-th message Ii = (Ai, Ri, ACKRi) is the additional information for the i-th message, Mi. Additional information set to message set M, {I1, I2, I3, …, IN} = {(A1, R1, ACKR1), (A2, R2, ACKR2), (A3, R3, ACKR3), …. (AN, RN, ACKRN)}. Specifies max. number of short pending address and extended pending address Specifies the max. number of payload length set of schedulability test result the result of schedulability test when the superframe order is SO Allocate slots for beacon frame and CAP according to SO the inactive portion duration(in symbol) in a superframe Return the SO which minimizes ‘APR’ i-th element of a set ‘ASET’, ASET[i]
Generally, there are three kinds of messages: periodic real-time messages, aperiodic real-time messages, and best effort messages. As explained before, herein we focus on periodic real-time messages only. As such, the problem statement can be defined as: “finding proper standard specific parameters and beacon information to support periodic real-time messages in IEEE 802.15.4 std.” Thus, the inputs will be a message set M = {M0, M1, …, MN-1}, which includes period and length of each message, and the additional information set I for the message set M. In addition, PA specifying the maximum number of short and extended addresses, and the maximum beacon payload length, BPAYLOAD, will be inputs for calculating slots allocated to the beacon frame. The output of the proposed scheduling algorithm will be the beacon table
(Table 2), BT, which includes beacon order (BO, Figure 1), superframe order (SO, Figure 1), GTS descriptor for each GTS, and final CAP slot (SFCAP). Table 2 Beacon table notation Member BO SO NmM
mf [1:NmM]
Description
Beacon Order to be used in the minor frame Superframe Order to be used in the minor frame Number of minor frames in the major frame Available number of slots in each Availableslot minor frame FinalCAP Final CAP slot numGTS Number of allocated GTSs id Message id which uses startslot Start slot number for each GTS GTS Byte Size of MAC payload for each GTS [1:7] Number of allocated slots for each length GTS
5. Proposed Scheduling Algorithm In this section, we describe the proposed algorithm. Given a message set, the algorithm executes several steps, described in Figure 2, to get the final output beacon table. At the first step (Figure 2), AddOverheads procedure (Figure 3) calculates overheads (MAC/PHY/ACK/IFS) which are added via each layer according to the addressing modes and follow the message packets in the air. It then updates the given message set with considering the overheads and may be expressed in symbol unit. An example can be expressed as M = {(4000000, 6), (8000000, 11), (12000000, 16)} and the additional information set for the message set is I = {(0x1232, 0, 1), (0x1233, 0, 0), (0x1234, 1, 1)}. The example length set, L = {6, 11, 16} is changed to LS = {112, 96, 160}. By the operation of floor(Pi/TS), the period of each message is expressed in symbol unit. In the example, the period of the 1st message, P1 = 4000000 is changed to PS1 = floor(4000000/16) = 250000. Likewise, the example period set, P = {4000000, 8000000, 12000000} is changed to PS = {250000, 500000, 750000}. The number of slots allocated to the beacon frame and the minimum CAP are calculated. The minimum length of CAP is required to transmit the MAC command frames. At the second step (Figure 2), the pre-schedulability is checked and the BO is determined among all possible BOs. At the pre-schedulability check, it is checked whether the minimum period (the message set is sorted and M1) of the given message set is larger than that of a minor frame which the standard can support. If not, the given message can not be scheduled in the standard and the algorithm returns FAIL. When
the minimum period is equal to or larger than aBaseSuperframeDuration*20 and the minimum period is less than aBaseSuperframeDuration*215, the BO is determined by E satisfying: min( PSi ) / 2 < aBaseSuperframeDuration × 2 E ≤ min( PSi )
,where E is an integer in [0, 14]. GTSchedule(M, I, BT) //Initialize 1-1. AddOverheads(L, ACKR, LS); 1-2. PSi Å floor(Pi/TS), for all i; 1-3.CalAllocatedSlot(PA,BPAYLOAD,llocatedSlot4BNCAP); 2. //Check pre-schedulability and find the BO based on the minimum PS If (min(PSi) < aBaseSuperframeDuration*20){ /*Unschedulable with the IEEE 802.15.4: (aBaseSuperframeDuration*20) is the minimum possible minor frame size which can be supported by the standard*/ return FAIL; } Else If (min(PSi) < aBaseSuperframeDuration*215){ Set the BO to E satisfying the following: Min(PSi)/2 < aBaseSuperframeDuration*2E ≤ Min(PSi), where E is an integer in [0, 14] BO Å E; } Else BO Å 14; /upper bound 3. //Harmonize the periods of messages. Harmonize(PS, BO, PH); //for the periods of the message 4. //Change the units of periods the messages in slots, SD Å aBaseSuperframeDuration*2SO; // superframe duration SS Å SD/aNumSuperframeSlots; //slot size(or duration) Do the following steps for every i PFi Å floor(PHi/SS); LFi Å ceiling(LSi/SS); 5. //Check schedulability and try to allocate the slots to message set Schedulable(BO, SO, MF, L, S, BT); 6. //If the result of the schedulability check is FEASIBLE, return SUCCESS If(SSO == FEASIBLE){ BT.SO Å SO; BT.BO Å BO; return SUCCESS; } Else{ //Determine a SO for which the schedulability is check. If( SO == BO) {//at 1st duration, SO is 0. Always BO ≥ SO. If( BO == 0) //Done for all BO, SO return FAIL; //done all SO, but nothing makes the message set schedulable Else{//try to check schedulability check for another BO BO Å BO – 1; SO Å 0; goto the slot-based step(STEP 3); } //If( BO == 0) } // If( SO == BO) Else{ //SO < BO SO Å SO + 1; goto the slot-based step(STEP 4); } } 1.
Figure 2 Main procedure of the proposed algorithm If the minimum period is equal to or larger than aBaseSuperframeDuration*215, the BO is limited to 14, for this value is the maximum one which the standard supports. In the example, the minimum period is PS1 = 250000 symbols. Since
aBaseSuperframeDuration*28 = 960*28 = 245760, BO is 8. The third step(Figure 2) harmonizes(the same meaning as the specialization in the Sx scheduler [3], Figure 4) the periods of the given messages. At this step, we get the harmonized periods set PH = {BI*20, BI*21, BI*21} = {245760, 491520, 491520} of PS = {250000, 500000, 750000} with respect to {BI = 245760}, where the beacon interval, BI is BI = aBaseSuperframeDuration*2BO (Figure 1). Unlike in the Sx scheduler, this step specializes the message set with respect to BI. AddOverheads(L, ACKR, LS) //frame/packet overheads OADDRF Å 6; //star-based network, destination PAN ID, destination address, src addr. OF Å 2 + 1 + 2 + OADDRF; // Frame control, Sequnce number, FCS, /MAC-layer overhead //PHY-lyaer ovehread Op Å 6; OFP Å (OF + OP) * SpB; //MAC&PHY overhead in symbol 2. //calculate ACK & IFS overheads and add the total overheads Do the following sub-steps for all i OAR Å ((ACKRi == 1) ? (MTACK + (5 + OP) *SpB ) : 0); OI Å ((Li + OF) ≤ aMaxSIFSFrameSize) ? aMinSIFSPeriod : aMinLIFSPeriod OAI Å OAR + OI; OVH Å OFP + OAI; LSi Å Li *SpB + OVH; 1.
Figure 3 Procedure to add several overheads 1. 2.
Harmonize(PS, BO, PH) //Harmonize each periods BI = aBaseSuperframeDuration * 2BO; for i Å 1 to N { PHi Å BI*2E, where BI*2E ≤ PSi < BI*2(E+1) and E is an integer in [0, +∞]; }
Figure 4 Procedure to harmonize the periods At the fourth step, the unit of period of each message is transformed in slot. Thus, whenever SO is changed, the algorithm is restarted from this step to reflect the change of slot duration by the change of SO. In the example, the initial SO is 0 and the superframe duration, SD is aBaseSuperframeDuration*20 = 960*20 = 960 symbols and the slot size, SS = SD/aNumbSuperframeSlots = 960/16 = 60 symbols. For PH1 = 245760 symbols, PF1 is floor(PH1/SS) = floor(245760/60) = 4096 slots. Likewise, we can calculate the PF = {4096, 8912, 8912} for PH = {245760, 491520, 491520}. For LS1 = 112 symbols, LF1 is ceiling (LS1/SS) = ceil(112/60) = 2 slots. Likewise, we can get the LF = {2, 2, 3} for LS = {112, 96, 160}. At the fifth (Figure 2) step, the schedulability is checked. Schedulable (Figure 5) is responsible for checking the total utilization which includes the utilization of the beacon frame, a minimum CAP and inactive portion of the superframe, as well as the
utilization of the actual message set. To schedule the given message set, the total utilization should not be larger than 1. Although the total utilization is not larger than 1, there is another constraint to meet. The standard limits the maximum allowable number of GTSs in a superframe up to 7. To make sure that the constraint is satisfied, this procedure tries to allocate the slots to the message set. Only when all these constraints meet, the algorithm sets the schedulability result, SSO to FEASIBLE. Schedulable (PF, PH, LF, ACKR, AllocatedSlot4BNCAP, L, SOVH, BT) //Total utilization UT = UBCAP + ρ (MF) + UIP 1-1. //Utilization of beacon frame and CAP BO Å BT.BO; SO Å BT.SO; BI Å aBaseSuperframeDuration*2BO; SS Å aBaseSuperframeDuration*2SO/aNumSuperframeSlots; UBCAP Å AllocatedSlot4BNCAP[SO]/(BI/SS); 1-2. //Density or utilization of MF, ρ (MF)Å∑ Ni=1(LFi/PFi); 1-3. //Utilization of inactive portion, UIP UIP Å (2BO -2SO)/ 2BO; 1-4. //Total utilization(or duty cycle) UT = UBCAP + ρ (MF) + UIP; 2. If(UT ≤ 1) { If (AllocateSlots(SS, AllocatedSlot4BNCAP[SO], PF, PH, L, ACKR, SOVH, BT)!=SUCCESS) SSO Å SHORTGTSORSLOT; //Number of GTS in a superframe is limited up to 7 Else SSO Å FEASIBLE; } Else SSO Å EXCEEDUBOUND;//exceed utilization bound 1.
Figure 5 Procedure to check the schedulability The sixth step (Figure 2) checks the result of the schedulability, SSO. If the result is FEASIBLE, the algorithm finishes with a return value of SUCCESS. The algorithm is checking the schedulabilty from the smallest SO (i.e., the smallest duty cycle) and the algorithm finishes when it meets the first SO which makes the given message set schedulable. Of course, there would be a larger SO which makes the message set schedulable. As the SO is smaller, the duty cycle is smaller and the inactive portion of a superframe is larger and we may save more power by turning off the transceiver for a longer time. If the result is not FEASIBLE and SO is equal to BO and BO is not zero, then BO is decreased and SO is set to zero and the algorithm restarts from step 3. If the result is not FEASIBLE and SO is equal to BO and BO is zero, then all possible (BO, SO) combinations are checked but there is no feasible (BO, SO) combination and the algorithm finishes with FAIL. If the result is not FEASIBLE and SO is less than BO, the algorithm increases the SO and restarts from step 4.
6. Schedulability Analysis
7. Implementation
In this section, we present the simulation results for the proposed algorithm. We show the percentage of schedulable message sets, i.e. schedulability, in terms of message utilization for the given number of messages in message set.
The proposed algorithm is executed off-line and generates the schedule (i.e., beacon table). We implement the guaranteed time service using the output of the algorithm on Chipcon AS’s 4 CC2420DBs (the right most one for the PAN Coordinator, the others for network devices, Figure 7). Each board contains a CC2420, which is a single-chip IEEE 802.15.4 compliant RF transceiver. It is controlled by an Atmel Atmega 128L AVR microcontroller (128KB internal flash memory and 4KB internal SRAM) and includes 64KB external RAM, temperature sensor, potentiometer, and etc. [7].
N =3 N =6 N =7 N =8 N =10
1
0.6 0.4
S ched ulab ility
0.8
N =15 N =20 N =25 N =30 N =40 N =60 N =80 N =100 N =150
1 0.8 0.6 0.4
0.2 0
1.2
S ched ulab ility
1.2
0.2 U tiliza tio n 0.01 0.04 0.07 0.1 0.13 0.16 0.19 0.22 0.25 0.3
U tiliza tio n 0 Message Scheduling Algorithm
0.01 0.04 0.07 0.1 0.13 0.16 0.19 0.22 0.25 0.3
-Off-line, Message scheduler
Figure 6 Schedulability test Evaluation S/W
The simulations use random message sets generated according to the specified utilizations, 1%, 4%, 7%, 10%, 13%, 16%, 19%, 22%, 25%, and 30%. Each utilization includes utilizations of only original messages from the upper layer (higher than the MAC sublayer) without any overheads by IEEE 802.15.4 standard. The lengths of messages in a message set are uniformly distributed between minimum (1 byte) and maximum (aMaxMACFrameSize). The total utilization is randomly distributed to all messages in the message set and is used to compute periods of messages in the message set. Using the scheduling procedure in Figure 2, a randomly generated message set according to the number of messages and the specified utilization is checked to determine whether it is schedulable or not. We report the percentage of schedulable message sets among all sets in Figure 6. The figure shows the algorithm is capable of finding the schedule, beacon table. Although the simulations show almost 100% of schedulability in the utilization of 7%, the schedulability in the utilization (of original messages from the upper layer) larger than 13% is about 10%. This schedulability is due to the following constraints: 9 9 9 9 9
Overheads added by each layer, IFS, beacon frames Minimum required CAP region Messages are allocated in a slot boundary Harmonization is done with respect to one of 15 BI values Maximum Allocatable GTS number(7 GTSs) in a superframe
Standard C Libraries
Chipcon MAC
GT Service
Debug Console
Hardware Abstract Layer Hardware Definition Files
Figure 7 CC2420DB[7] and 4 CC2420DBs(1 PAN coordinator and 3 devices) Figure 7 shows the S/W blocks which are used to implement the guaranteed time service. Chipcon AS released their MAC S/W library version 0.7 which includes “Hardware Definition Files” and HAL block as well as IEEE 802.15.4 MAC S/W implementation but does not include the GTS related part. To implement the guaranteed time service, some modifications of the released MAC S/W are required. We add some routines to the beacon handler in this block so that the handler can process the GTS information part in the beacon frame. When the modified beacon handler in the PAN coordinator sends the beacon frame, it includes the GTS information in the beacon frame and registers some timed callback functions relevant to GTS TX/RX to its timed callback function list. Likewise, when a device receives the beacon frame from the PAN coordinator, the modified handler in the device parses the GTS information in the beacon and registers some timed callback functions relevant to GTS TX/RX to its time callback function list. The GT Service block is implemented in this paper to show that the guaranteed time service works well. The block defines several timed callback functions for GTS TX/RX. The Debug Console block is implemented to provide the console debugging service such as memory dump and edit. An Off-line Message Scheduling Algorithm block is implemented in the other platform to generate the schedule for the given messages set. The beacon table generated by the off-line scheduler is downloaded in the internal EEPROM of AVR on the
PAN coordinator. When the network starts, the PAN coordinator reads the beacon table in the internal EEPROM, generates the beacon frame and broadcasts the beacon to the network. Whenever each associated device receives the beacon, it parses the beacon information in the beacon frame. If there is any GTS owned by it, the device registers the timed callback function for the GTS. We use the IEEE 802.15.4 packet sniffer of Chipcon to measure the time stamp of a GTS packet. Table 3 shows the case where (BO, SO) = (8, 8) and the starting slots of GTS0, GTS1, GTS2, and GTS3 are 15, 14, 13, and 11 slots, respectively. The Calculated values are from the following equation according to the standard:
result of the guaranteed time communication system following the schedule generated by the proposed algorithm on an IEEE 802.15.4 compliant prototyping board of Chipcon AS’s, CC2420 DB. Measuring the time stamps of the GTS packets and comparing them with the calculated ones, we show that the system works well according to the schedule. Future work includes mathematical analysis, on-line scheduling and scheduling of aperiodic real-time messages, and the designing of scheduling algorithms with more consideration of power-awareness.
GTSStartTime = ( Slot Duration) × ( Start Slot Number ) × (Symbol Duration)
[1] “802.15.4-2003 IEEE Standard for Information Technology-Part 15.4: Wireless Medium Access Control (MAC) and Physical Layer (PHY) Specifications for LowRate Wireless Personal Area Networks (LR-WPANs)”, IEEE, Oct. 2003. [2] Jose A. Gutierrez, Edgar H. Callaway, Jr., and Raymond L. Barrett, Jr. Low-Rate Wireless Personal Area Networks: enabling wireless sensors with IEEE 802.15.4, IEEE Press 2004. [3] Ching-Chih Han, Kwei-Jay Lin, and Chao-Ju Hou, “Distance-Constrained scheduling and its application to realtime systems”, IEEE Trans. on Computers, vol. 45, NO. 7, Jul. 1996. [4] R. Holte, A. Mok, L. Rosier, I. Tulchinsky, and D. Varvel, “The Pinwheel: A Real-time Scheduling Problem”, Proc. 22nd Hawaii Int’l Conf. System Science, pp. 693~702, Jan. 1989. [5] M.Y. Chan and F. Chin, “Schedulers for Larger Classes of Pinwheel Instances”, Algorithmica, vol. 9, pp. 425~462, 1993. [6] Gang Lu, Bhaskar Krishnamachari, and Cauligi S. Raghavendra, “Performance Evaluation of the IEEE 802.15.4 MAC for Low-Rate Low-Power Wireless Networks”, EWCN2004. [7] “Chipcon AS SmartRF CC2420DBK Demonstration Board Kit User Manual (rev. 1.2)”, Chipcon AS, Jul 26, 2004. [8] “Chipcon AS SmartRF CC2420 Preliminary Datasheet (Rev.1.2)”, Chipcon AS, Jun. 9 2004. [9] http://www.zigbee.org
SO
= SS × startslot × TS = aBaseSlotDuration × 2 × startslot ×16u sec.
For example, the starting slot of GTS0 is 15 and the calculated starting time is aBaseSlotDuration*2SO*15*16 usec = 60*28*15*16 = 3686400 usec. The difference can almost be reduced by changing the number of timer ticks (320 usec/tick) after which the GTS timed callback function will start running. Table 4 shows a comparison of memory usages between original Chipcon MAC and the modified one for guaranteed time service. Table 3 (BO, SO) = (8, 8), GTS0 is in the last slot Calculat ed(A) us. Beacon 3932160 GTS0 3686400 GTS1 3440640 GTS2 3194880 GTS3 2703360
Measure Error(C= Error(C/A*100) d(B) us. B-A) us. % 3931801 -359 -0.00913 3686023 -377 -0.010227 3440295 -345 -0.010227 3194568 -312 -0.009766 2703084 -276 -0.01021
Table 4 Comparison of memory usages Section
Original chipcon Chipcon MAC with MAC Guaranteed Time Service
Text Data and bss Eeprom
24KB 2.1KB 0
40KB 2.6KB 93 B
8. Conclusion Guaranteed time service is required in WSN and a proper scheduling algorithm is indispensable to provide real-time message communication in the LRWPAN. This paper proposes a message scheduling algorithm, which is suitable for scheduling a given periodic real time message set in the LR-WPAN standard. We evaluate the performance of the algorithm from the viewpoint of schedulability by simulation. Finally, we present the implementation
9. References